瀏覽代碼

修改发货通知调用入库

zx 2 年之前
父節點
當前提交
38c19170ec

+ 10 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsshipDeliveryNoticeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.feign.WmshboundFeign;
 import com.steerinfo.dil.mapper.AmsshipCargoTransferResultMapper;
 import com.steerinfo.dil.mapper.DilBatchMapper;
 import com.steerinfo.dil.model.AmsshipCargoTransferResult;
@@ -48,6 +49,8 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
     private DilBatchServiceImpl dilBatchService;
     @Autowired
     private DilBatchMapper dilBatchMapper;
+    @Autowired
+    private WmshboundFeign wmshboundFeign;
 
 
 
@@ -138,6 +141,7 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         amsshipDeliveryNotice.setIsNeedPortFee((String) map.get("isNeedPortFee"));
         amsshipDeliveryNotice.setIsNeedPortCharge((String) map.get("isNeedPortDisCharge"));
         amsshipDeliveryNotice.setCargoImageUrl((String) map.get("cargoPictureUrl"));
+       BigDecimal portId= DataChange.dataToBigDecimal(map.get("portId"));
         //生成批次
         //根据portId查找portName
         String portName = dilBatchMapper.getPortName(DataChange.dataToBigDecimal(map.get("portId")));
@@ -152,6 +156,12 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         Map<String, Object> map1 = dilBatchService.insertBatchId(map);
         BigDecimal batchIdInfacotryId =DataChange.dataToBigDecimal(map1.get("batchIdInfacotryId"));
         amsshipDeliveryNotice.setBatchId(batchIdInfacotryId);
+        //调用港口入库
+        Map<String,Object> mapValue = new HashMap<>();
+        mapValue.put("batchId",map1.get("batchIds"));
+        mapValue.put("portId",portId);
+        mapValue.put("resultMaterialNumber",DataChange.dataToBigDecimal(map.get("resultNumberOfLoans")));
+        wmshboundFeign.addWarehousingResult(mapValue);
         i += amsshipDeliveryNoticeMapper.insertSelective(amsshipDeliveryNotice);
         return i ;
     }

+ 3 - 1
src/main/java/com/steerinfo/dil/service/impl/DilBatchServiceImpl.java

@@ -73,6 +73,7 @@ public class DilBatchServiceImpl  implements IDilBatchService {
         String foreignShipName = (String) map.get("foreignShipName");
         BigDecimal materialId = DataChange.dataToBigDecimal(map.get("materialId"));
         String userId = (String) map.get("userId");
+        BigDecimal batchId1=null;
         BigDecimal batchIds =DataChange.dataToBigDecimal(map.get("batchIds"));
         DilBatchInfacotry dilBatchInfacotry=new DilBatchInfacotry();
         //首先根据外轮船名和批次查找批次主表id是否存在
@@ -81,7 +82,7 @@ public class DilBatchServiceImpl  implements IDilBatchService {
             dilBatchInfacotry.setBatchId(batchIds);
         }else {
             DilBatch dilBatch = new DilBatch();
-            BigDecimal batchId1 = dilBatchMapper.selectBatchId();
+             batchId1 = dilBatchMapper.selectBatchId();
             dilBatch.setBatchId(batchId1);
             dilBatch.setResultForeignShipName(foreignShipName);
             dilBatch.setMaterialId(materialId);
@@ -100,6 +101,7 @@ public class DilBatchServiceImpl  implements IDilBatchService {
         dilBatchInfacotry.setInsertUsername(userId);
         dilBatchInfacotry.setInsertTime(new Date());
         map.put("batchIdInfacotryId",batchIdInfacotryId);
+        map.put("batchId",batchId1);
         int j= dilBatchInfacotryMapper.insertSelective(dilBatchInfacotry);
         if (j==0){
             System.out.println("新增批次中间表失败!!!");

+ 1 - 1
src/main/resources/application-dev.yml

@@ -16,7 +16,7 @@ openfeign:
   WmshboundFeign:
     url: ${WMSHBOUNDFEIGN_URL:172.16.33.166:8070}
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
 
 server:
   port: 8003