Просмотр исходного кода

Merge branch 'master' of https://git.steerinfo.com/luobang/DIL-DAZHOU-WMS2

luobang 2 лет назад
Родитель
Сommit
77b2a651e0

+ 16 - 2
src/main/java/com/steerinfo/dil/controller/WmsInboundScanResultController.java

@@ -1,8 +1,10 @@
 package com.steerinfo.dil.controller;
 
 import com.github.pagehelper.PageHelper;
+import com.steerinfo.dil.feign.BmsTruckFeign;
 import com.steerinfo.dil.feign.ColumnDataFeign;
 import com.steerinfo.dil.feign.OmsFeign;
+import com.steerinfo.dil.feign.TmstruckFeign;
 import com.steerinfo.dil.mapper.WmspInboundResultMapper;
 import com.steerinfo.dil.model.*;
 import com.steerinfo.dil.service.impl.RmsMaterialServiceImpl;
@@ -61,6 +63,11 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
     @Autowired
     OmsFeign omsFeign;
 
+    @Autowired
+    BmsTruckFeign bmsTruckFeign;
+
+    @Autowired
+    TmstruckFeign tmstruckFeign;
 
     /**
      * 1.新增扫描吊牌实绩!!!此时入库实绩未生成
@@ -80,6 +87,11 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
         Integer orderType=DataChange.dataToBigDecimal(order.get("orderType")).intValue();
         BigDecimal orderId=DataChange.dataToBigDecimal(order.get("orderId"));
         if(orderType!=null && orderType == 25){
+            //校验是否有装货实绩,若没有则不允许入库
+            Integer count=wmsInboundScanResultService.isExistLoad((String)map.get("resultMaterial"));
+            if(count==null|| count<=0){
+                return failed(null);
+            }
             //根据运输订单号查询出库扫码实绩
             List<Map<String,Object>> inboundOld= wmsInboundScanResultService.findInboundScanResult((String)map.get("resultMaterial"));
             //批量新增扫码实绩
@@ -88,14 +100,16 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
             }
             else{
                 System.out.println("物资暂未出库,请先出库再入库!");
-                return null;
+                return failed(null);
             }
             //返回新建的扫码实绩数据
             List<Map<String,Object>> mapList= wmsInboundScanResultService.noIssueScanResultList(map.get("userName").toString());
+            //新增卸货实绩
+            tmstruckFeign.updateUnloadResult(order);
             //关闭运输订单
             omsFeign.closeSteelOrderType4(DataChange.dataToBigDecimal(orderId));
             //生成计费详单
-
+            bmsTruckFeign.addInwardDetailsOrder(order);
             return  success(mapList);
         }
         int isExist= wmsInboundScanResultService.isExist(map.get("userName").toString(),map.get("resultMaterial").toString().substring(0,map.get("resultMaterial").toString().length()-1));

+ 5 - 0
src/main/java/com/steerinfo/dil/feign/BmsTruckFeign.java

@@ -1,7 +1,9 @@
 package com.steerinfo.dil.feign;
 
+import com.steerinfo.framework.controller.RESTfulResult;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.Map;
 
@@ -15,4 +17,7 @@ public interface BmsTruckFeign {
 
     @PostMapping("api/v1/bmstruck/bmstruckdetailsorder/addInwardDetailsOrder")
     int addDetailsOrder(Map<String,Object> map);
+
+    @PostMapping("api/v1/bmstruck/bmstruckdetailsorder/addInwardDetailsOrder")
+    RESTfulResult addInwardDetailsOrder(@RequestBody(required = false) Map<String,Object> map);
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/feign/OmsFeign.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.feign;
 
 
+import com.steerinfo.framework.controller.RESTfulResult;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/WmspInboundScanResultMapper.java

@@ -143,4 +143,7 @@ public interface WmspInboundScanResultMapper extends IBaseMapper<WmspInboundScan
 
     //根据运输订单号查询出库扫码实绩
     List<Map<String, Object>> findInboundScanResult(String orderNumber);
+
+    //查询装货实绩数量
+    Integer isExistLoad(String orderNumber);
 }

+ 4 - 2
src/main/java/com/steerinfo/dil/service/IWmsInboundScanResultService.java

@@ -134,15 +134,17 @@ public interface IWmsInboundScanResultService {
     int isExistInboundScanResult(String substring);
 
     //根据运输订单号取得订单类型
-    Map<String, Object> getOrderTypeByNum(String orderNum);
+    Map<String, Object> getOrderTypeByNum(String orderNumber);
 
     //根据入库实绩id查询运输订单id和类型
     Map<String, Object> getOrderTypeByInboundId(String resultId);
 
     //根据运输订单号查询出库扫码实绩
-    List<Map<String, Object>> findInboundScanResult(String orderNum);
+    List<Map<String, Object>> findInboundScanResult(String orderNumber);
 
     //通过查询结果批量地创建创建扫描实绩
     int createInboundScanResultByFind(List<Map<String,Object>> list,Map<String,Object> map) throws Exception;
 
+    //查询运输订单是否已经装货
+    Integer isExistLoad(String orderNumber);
 }

+ 5 - 1
src/main/java/com/steerinfo/dil/service/impl/WmsInboundScanResultServiceImpl.java

@@ -329,7 +329,6 @@ public class WmsInboundScanResultServiceImpl implements IWmsInboundScanResultSer
             WmspInboundScanResult wmspInboundScanResult=new WmspInboundScanResult();
             //设置自增主键
             wmspInboundScanResult.setId(wmspInboundScanResultMapper.getCount());
-            System.out.println("resultId"+wmspInboundScanResult.getResultId());
             //获取班次次序的吊牌信息
             String resultMaterial=temp.get("resultMaterial").toString();
             String[] result = resultMaterial.split("-");
@@ -466,4 +465,9 @@ public class WmsInboundScanResultServiceImpl implements IWmsInboundScanResultSer
     public List<Map<String, Object>> findInboundScanResult(String orderNumber) {
         return wmspInboundScanResultMapper.findInboundScanResult(orderNumber);
     }
+
+    @Override
+    public Integer isExistLoad(String orderNumber) {
+        return wmspInboundScanResultMapper.isExistLoad(orderNumber);
+    }
 }

+ 14 - 1
src/main/resources/com/steerinfo/dil/mapper/WmspInboundScanResultMapper.xml

@@ -1092,7 +1092,10 @@ where wisr.result_id = #{stackResultId}
         where wisr.result_material=#{resultMaterial} and (wgm.DELETED is null or wgm.DELETED='0')
     </select>
     <select id="getOrderTypeByNum" resultType="java.util.Map">
-        select ORDER_TYPE "orderType",ORDER_ID "orderId" from OMSTRUCK_ORDER
+        select ORDER_TYPE "orderType",
+               ORDER_ID "orderId",
+               ORDER_NUMBER "orderNumber"
+               from OMSTRUCK_ORDER
         where ORDER_NUMBER=SUBSTR(#{orderNumber}, 0, 21)
     </select>
     <select id="findInboundScanResult" resultType="java.util.Map">
@@ -1122,6 +1125,16 @@ where wisr.result_id = #{stackResultId}
                            ON WIR.INBOUND_ID=WISR.INBOUND_RESULT_ID
         WHERE WISR.RESULT_ID=#{resultId}
     </select>
+    <select id="isExistLoad" resultType="java.lang.Integer">
+        --查询装货实绩
+        select COUNT(DISTINCT TLR.RESULT_ID)
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                           ON OO.ORDER_ID=TTR.ORDER_ID
+                 LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
+                           ON TTR.RESULT_TOTAL_ID=TLR.RESULT_TOTAL_ID
+        WHERE OO.ORDER_TYPE=25 AND ORDER_NUMBER=SUBSTR(#{orderNumber}, 0, 21) AND TLR.RESULT_ID IS NOT NULL
+    </select>
 
 
 </mapper>