1
0
xwh 4 лет назад
Родитель
Сommit
e29b6f1338

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsTransportInfoDetailServiceImpl.java

@@ -5,6 +5,7 @@ import com.kmall.admin.dto.GoodsTransportInfoDetailExcelDto;
 import com.kmall.admin.entity.GoodsTransportInfoDetailEntity;
 import com.kmall.admin.service.GoodsTransportInfoDetailService;
 import com.kmall.common.utils.Query;
+import com.kmall.common.utils.RRException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -75,6 +76,11 @@ public class GoodsTransportInfoDetailServiceImpl implements GoodsTransportInfoDe
     public void saveExcelDtoList(List<GoodsTransportInfoDetailExcelDto> goodsTransportInfoDetailExcelDtoList) {
         goodsTransportInfoDetailExcelDtoList.forEach(goodsTransportInfoDetailExcelDto -> {
             GoodsTransportInfoDetailEntity goodsTransportInfoDetailEntity = new GoodsTransportInfoDetailEntity();
+            if (goodsTransportInfoDetailExcelDto.getWayStatus()==null ||
+                    (Integer.parseInt(goodsTransportInfoDetailExcelDto.getWayStatus())!=0
+                            && Integer.parseInt(goodsTransportInfoDetailExcelDto.getWayStatus()) != 1)){
+                throw new RRException("是否在途必填,且只能填0或1");
+            }
             goodsTransportInfoDetailEntity.setWayStatus(Integer.parseInt(goodsTransportInfoDetailExcelDto.getWayStatus()));
             goodsTransportInfoDetailEntity.setSku(goodsTransportInfoDetailExcelDto.getSku());
             goodsTransportInfoDetailEntity.setSupplierId(Integer.parseInt(goodsTransportInfoDetailExcelDto.getSupplierId()));