liyg 2 rokov pred
rodič
commit
882f787d74

+ 0 - 8
src/main/java/com/steerinfo/dil/controller/WmsInboundResultController.java

@@ -411,14 +411,6 @@ public class WmsInboundResultController extends BaseRESTfulController {
                 int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
                 // wmspSendReceiveService.addInBoundSendReceive();
             }
-            //如果是倒库
-            Map<String,Object> inboundScanDetail=wmsInboundScanResultService.getOrderTypeByInboundId(mapList.get(0).get("resultId").toString());
-            if(DataChange.dataToBigDecimal(inboundScanDetail.get("orderType")).intValue()==25){
-                //关闭运输订单
-                omsFeign.closeSteelOrderType4(DataChange.dataToBigDecimal(inboundScanDetail.get("orderId")));
-                //生成计费详单
-
-            }
             return success("下发成功");
     }
 //    /**

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

@@ -2,6 +2,7 @@ package com.steerinfo.dil.controller;
 
 import com.github.pagehelper.PageHelper;
 import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.feign.OmsFeign;
 import com.steerinfo.dil.mapper.WmspInboundResultMapper;
 import com.steerinfo.dil.model.*;
 import com.steerinfo.dil.service.impl.RmsMaterialServiceImpl;
@@ -10,12 +11,14 @@ import com.steerinfo.dil.service.impl.WmsInboundResultServiceImpl;
 import com.steerinfo.dil.service.impl.WmsInboundScanResultServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.annotation.Order;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -55,6 +58,9 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
     @Autowired
     ColumnDataFeign columnDataFeign;
 
+    @Autowired
+    OmsFeign omsFeign;
+
 
     /**
      * 1.新增扫描吊牌实绩!!!此时入库实绩未生成
@@ -70,9 +76,11 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
         //判断条件是查询扫描实绩判断是否已经存在改唯一标识码并且扫码人是否是自己
         System.out.println(map.get("resultMaterial"));
         //订单类型为倒库,直接扫码所有并返回数据
-        Integer orderType=wmsInboundScanResultService.getOrderTypeByNum((String)map.get("resultMaterial"));
+        Map<String,Object> order=wmsInboundScanResultService.getOrderTypeByNum((String)map.get("resultMaterial"));
+        Integer orderType=DataChange.dataToBigDecimal(order.get("orderType")).intValue();
+        BigDecimal orderId=DataChange.dataToBigDecimal(order.get("orderId"));
         if(orderType!=null && orderType == 25){
-            //根据出库数据查询入库扫码实绩
+            //根据运输订单号查询出库扫码实绩
             List<Map<String,Object>> inboundOld= wmsInboundScanResultService.findInboundScanResult((String)map.get("resultMaterial"));
             //批量新增扫码实绩
             if(inboundOld!=null || inboundOld.size()>0 || inboundOld.get(0)!=null){
@@ -84,6 +92,10 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
             }
             //返回新建的扫码实绩数据
             List<Map<String,Object>> mapList= wmsInboundScanResultService.noIssueScanResultList(map.get("userName").toString());
+            //关闭运输订单
+            omsFeign.closeSteelOrderType4(DataChange.dataToBigDecimal(orderId));
+            //生成计费详单
+
             return  success(mapList);
         }
         int isExist= wmsInboundScanResultService.isExist(map.get("userName").toString(),map.get("resultMaterial").toString().substring(0,map.get("resultMaterial").toString().length()-1));

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

@@ -135,12 +135,12 @@ public interface WmspInboundScanResultMapper extends IBaseMapper<WmspInboundScan
     int isExistInboundScanResult(String resultMaterial);
     int isExistInboundTwo(String resultMaterial);
 
-    //根据运输订单号取得订单类型
-    Integer getOrderTypeByNum(String orderNumber);
+    //根据运输订单号取得订单类型和订单id
+    Map<String, Object> getOrderTypeByNum(String orderNumber);
 
     //根据入库实绩id查询运输订单id和类型
     Map<String, Object> getOrderTypeByInboundId(String resultId);
 
-    //根据运输订单号查询入库扫描实绩
+    //根据运输订单号查询出库扫码实绩
     List<Map<String, Object>> findInboundScanResult(String orderNumber);
 }

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

@@ -134,12 +134,12 @@ public interface IWmsInboundScanResultService {
     int isExistInboundScanResult(String substring);
 
     //根据运输订单号取得订单类型
-    Integer getOrderTypeByNum(String orderNum);
+    Map<String, Object> getOrderTypeByNum(String orderNum);
 
     //根据入库实绩id查询运输订单id和类型
     Map<String, Object> getOrderTypeByInboundId(String resultId);
 
-    //根据运输订单号查询入库扫描实绩
+    //根据运输订单号查询出库扫码实绩
     List<Map<String, Object>> findInboundScanResult(String orderNum);
 
     //通过查询结果批量地创建创建扫描实绩

+ 16 - 10
src/main/java/com/steerinfo/dil/service/impl/WmsInboundScanResultServiceImpl.java

@@ -320,26 +320,33 @@ public class WmsInboundScanResultServiceImpl implements IWmsInboundScanResultSer
     public int createInboundScanResultByFind(List<Map<String, Object>> list, Map<String, Object> map) throws Exception {
         List<WmspInboundScanResult> results=new ArrayList<>();
         String userName=map.get("userName").toString();
+        int i=0;
         for(Map<String,Object> temp:list){
-            if(temp==null || temp.get("shiftOrder")==null || temp.get("resultMaterial")==null){
+            if(temp==null || temp.get("resultMaterial")==null){
                 throw new Exception("查询结果存在空值,终止新增扫码实绩,并回滚");
             }
             //创建入库扫描实绩、并且给对象赋值
             WmspInboundScanResult wmspInboundScanResult=new WmspInboundScanResult();
             //设置自增主键
-            wmspInboundScanResult.setId(count());
+            wmspInboundScanResult.setId(wmspInboundScanResultMapper.getCount());
+            System.out.println("resultId"+wmspInboundScanResult.getResultId());
             //获取班次次序的吊牌信息
-            wmspInboundScanResult.setShiftOrder(temp.get("shiftOrder").toString());
+            String resultMaterial=temp.get("resultMaterial").toString();
+            String[] result = resultMaterial.split("-");
+            if(result.length == 10){
+                String shiftOrder = result[9];
+                wmspInboundScanResult.setShiftOrder(shiftOrder);
+            }
             //分组
             //根据用户名和分组状态查询到分组信息
             BigDecimal groupId= wmspInboundGroupService.getGroupIdByUserName(userName);
             wmspInboundScanResult.setInboundGroupId(groupId);
             //吊钢工扫描吊牌结果
-            wmspInboundScanResult.setResultMaterial(temp.get("resultMaterial").toString());
+            wmspInboundScanResult.setResultMaterial(resultMaterial);
             //扫描吊牌信息
             wmspInboundScanResult.setResultLoadTime(new Date());
             //新增钢材物资ID
-            Map<String,Object> materialSteel = rmsMaterialSteelService.insertRmsMaterialSteel2((String)temp.get("resultMaterial"));
+            Map<String,Object> materialSteel = rmsMaterialSteelService.insertRmsMaterialSteel2(resultMaterial);
             wmspInboundScanResult.setMaterialId(new BigDecimal(materialSteel.get("materialSteelId").toString()));
             //创建用户
             //insertUsername
@@ -356,11 +363,10 @@ public class WmsInboundScanResultServiceImpl implements IWmsInboundScanResultSer
             wmspInboundScanResult.setInsertUsername(userName);
             //创建时间
             wmspInboundScanResult.setInsertTime(new Date());
-            //插入列表
-            results.add(wmspInboundScanResult);
+            //插入
+            i+=wmspInboundScanResultMapper.insertSelective(wmspInboundScanResult);
         }
-        //批量插入
-        return wmspInboundScanResultMapper.batchInsert(results);
+        return i;
     }
 
     @Override
@@ -447,7 +453,7 @@ public class WmsInboundScanResultServiceImpl implements IWmsInboundScanResultSer
     }
 
     @Override
-    public Integer getOrderTypeByNum(String orderNumber) {
+    public Map<String, Object> getOrderTypeByNum(String orderNumber) {
         return wmspInboundScanResultMapper.getOrderTypeByNum(orderNumber);
     }
 

+ 5 - 9
src/main/resources/com/steerinfo/dil/mapper/WmspInboundScanResultMapper.xml

@@ -1091,24 +1091,20 @@ where wisr.result_id = #{stackResultId}
         on rms.MATERIAL_STEEL_ID=wgm.MATERIAL_ID
         where wisr.result_material=#{resultMaterial} and (wgm.DELETED is null or wgm.DELETED='0')
     </select>
-    <select id="getOrderTypeByNum" resultType="java.lang.Integer">
-        select ORDER_TYPE from OMSTRUCK_ORDER
+    <select id="getOrderTypeByNum" resultType="java.util.Map">
+        select ORDER_TYPE "orderType",ORDER_ID "orderId" from OMSTRUCK_ORDER
         where ORDER_NUMBER=SUBSTR(#{orderNumber}, 0, 21)
     </select>
     <select id="findInboundScanResult" resultType="java.util.Map">
-        --倒库根据出库实绩查询入库扫码数据
+        --根据运输订单号查询出库扫码实绩
         select
-               WISR.RESULT_MATERIAL "resultMaterial",
-               WISR.SHIFT_ORDER "shiftOrder"
+            WOSR.RESULT_MATERIAL "resultMaterial",
+            WOSR.OUTBOUND_MATERIAL_NUMBER "number"
         from OMSTRUCK_ORDER OO
                  left join WMSP_OUTBOUND_RESULT WOR
                            on OO.ORDER_ID=WOR.BILL_LADING_ID
                  LEFT JOIN WMSP_OUTBOUND_SCAN_RESULT WOSR
                            ON WOR.RESULT_ID=WOSR.OUTBOUND_RESULT_ID
-                 LEFT JOIN WMSP_INBOUND_RESULT WIR
-                           ON WIR.INBOUND_ID=WOSR.INBOUND_RESULT_ID
-                 LEFT JOIN WMSP_INBOUND_SCAN_RESULT WISR
-                           ON WIR.INBOUND_ID=WISR.INBOUND_RESULT_ID
         WHERE OO.ORDER_NUMBER=SUBSTR(#{orderNumber}, 0, 21)
     </select>
     <select id="getOrderTypeByInboundId" resultType="java.util.Map">