luobang 2 年之前
父節點
當前提交
faaf4a1168

+ 405 - 404
src/main/java/com/steerinfo/dil/controller/WmsInboundResultController.java

@@ -254,76 +254,76 @@ public class WmsInboundResultController extends BaseRESTfulController {
     }
     }
 
 
 
 
-    /**
-     * 新增入库实绩
-     *
-     * @param
-     * @return
-     */
-    @ApiOperation("新增入库实绩")
-    @PostMapping("/insertInboundResult4")
-    @Transactional
-    public  RESTfulResult addInvoice2(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
-
-        //遗留 查询批次、以及状态
-        int batch=0;
-        //需要判断是否已经提交过了 通过resultId判断物质是否已经下发过了跳出、多次下发的结果
-        int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
-        if(resultStatus==1){
-            return success("请勿重复下发");
-        }
-        //、创建批次
-        WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
-        //判断物质是否是线材
-
-
-        //将下面的订单都录入这个批次里面
-        for (int i=0;i<mapList.size();i++){
-            BigDecimal count = wmsInboundScanResultService.selectMaterialTypeByMaterialId(new BigDecimal(mapList.get(0).get("materialId").toString()));
-            if (count!=null){
-                Map<String,Object> item=mapList.get(i);
-                // BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
-                BigDecimal houseGrid = null;
-                if (personnelWorkshopid.compareTo(new BigDecimal(1))==0){
-                    houseGrid = new BigDecimal("12335");
-                }else if (personnelWorkshopid.compareTo(new BigDecimal(2))==0){
-                    houseGrid = new BigDecimal("24472");
-                }
-                //创建一个入库作业实绩
-                WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
-                //改变扫码实绩里面的状态
-                int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
-                //创建实时库存
-                wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
-                //改为扫一次添加得代码
-                //当都完成的时候就要去改变这一批的状态改为下发状态
-                if(mapList.size()==i+1){
-                    int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
-                }
-            }else {
-                //如果是线材直接结束
-                //将下面的订单都录入这个批次里面
-                Map<String, Object> item = mapList.get(i);
-                //获得高线库
-                HashMap<String, Object> map3 = new HashMap<>();
-                map3.put("warehouseId",3);
-                BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
-                //创建一个入库作业实绩
-                WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
-                //改变扫码实绩里面的状态
-                int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
-                //创建实时库存
-                wmspGridMaterialService.initInsertWmspGridMaterial(item, houseGrid);
-                //当都完成的时候就要去改变这一批的状态改为下发状态
-                if(mapList.size()==i+1){
-                    int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
-                }
-            }
-        //改为扫一次添加得代码
-        int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
-        }
-        return success("下发成功");
-    }
+    ///**
+    // * 新增入库实绩
+    // *
+    // * @param
+    // * @return
+    // */
+    //@ApiOperation("新增入库实绩")
+    //@PostMapping("/insertInboundResult4")
+    //@Transactional
+    //public  RESTfulResult addInvoice2(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
+    //
+    //    //遗留 查询批次、以及状态
+    //    int batch=0;
+    //    //需要判断是否已经提交过了 通过resultId判断物质是否已经下发过了跳出、多次下发的结果
+    //    int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
+    //    if(resultStatus==1){
+    //        return success("请勿重复下发");
+    //    }
+    //    //、创建批次
+    //    WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
+    //    //判断物质是否是线材
+    //
+    //
+    //    //将下面的订单都录入这个批次里面
+    //    for (int i=0;i<mapList.size();i++){
+    //        BigDecimal count = wmsInboundScanResultService.selectMaterialTypeByMaterialId(new BigDecimal(mapList.get(0).get("materialId").toString()));
+    //        if (count!=null){
+    //            Map<String,Object> item=mapList.get(i);
+    //            // BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
+    //            BigDecimal houseGrid = null;
+    //            if (personnelWorkshopid.compareTo(new BigDecimal(1))==0){
+    //                houseGrid = new BigDecimal("12335");
+    //            }else if (personnelWorkshopid.compareTo(new BigDecimal(2))==0){
+    //                houseGrid = new BigDecimal("24472");
+    //            }
+    //            //创建一个入库作业实绩
+    //            WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
+    //            //改变扫码实绩里面的状态
+    //            int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
+    //            //创建实时库存
+    //            wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
+    //            //改为扫一次添加得代码
+    //            //当都完成的时候就要去改变这一批的状态改为下发状态
+    //            if(mapList.size()==i+1){
+    //                int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
+    //            }
+    //        }else {
+    //            //如果是线材直接结束
+    //            //将下面的订单都录入这个批次里面
+    //            Map<String, Object> item = mapList.get(i);
+    //            //获得高线库
+    //            HashMap<String, Object> map3 = new HashMap<>();
+    //            map3.put("warehouseId",3);
+    //            BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
+    //            //创建一个入库作业实绩
+    //            WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
+    //            //改变扫码实绩里面的状态
+    //            int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
+    //            //创建实时库存
+    //            wmspGridMaterialService.initInsertWmspGridMaterial(item, houseGrid);
+    //            //当都完成的时候就要去改变这一批的状态改为下发状态
+    //            if(mapList.size()==i+1){
+    //                int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
+    //            }
+    //        }
+    //    //改为扫一次添加得代码
+    //    int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
+    //    }
+    //    return success("下发成功");
+    //}
     /**
     /**
      * 新增入库实绩
      * 新增入库实绩
      *
      *
@@ -333,7 +333,11 @@ public class WmsInboundResultController extends BaseRESTfulController {
     @ApiOperation("新增入库实绩")
     @ApiOperation("新增入库实绩")
     @PostMapping("/insertInboundResult")
     @PostMapping("/insertInboundResult")
     @Transactional
     @Transactional
-    public  RESTfulResult addInvoice(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
+    public  RESTfulResult addInvoice(@RequestParam("userName") String userName,
+                                     @RequestParam("groupId") BigDecimal groupId,
+                                     @RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid,
+                                     @RequestBody(required = false) List<Map<String, Object>> mapList,
+                                     @RequestParam("remark") String remark) {
 
 
             //遗留 查询批次、以及状态
             //遗留 查询批次、以及状态
             int batch=0;
             int batch=0;
@@ -342,6 +346,9 @@ public class WmsInboundResultController extends BaseRESTfulController {
             if(resultStatus==1){
             if(resultStatus==1){
                 return success("请勿重复下发");
                 return success("请勿重复下发");
             }
             }
+            if(remark == null || "null".equals(remark)){
+                remark = "";
+            }
             //、创建批次
             //、创建批次
             WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
             WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
             //判断物质是否是线材
             //判断物质是否是线材
@@ -349,10 +356,7 @@ public class WmsInboundResultController extends BaseRESTfulController {
             if (count!=null){
             if (count!=null){
                 //将下面的订单都录入这个批次里面
                 //将下面的订单都录入这个批次里面
                 for (int i=0;i<mapList.size();i++){
                 for (int i=0;i<mapList.size();i++){
-
                     Map<String,Object> item=mapList.get(i);
                     Map<String,Object> item=mapList.get(i);
-
-
                    // BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
                    // BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
                     BigDecimal houseGrid = null;
                     BigDecimal houseGrid = null;
                     if (wmspInboundDistribute.getPersonnelWorkshopid().compareTo(new BigDecimal(1))==0){
                     if (wmspInboundDistribute.getPersonnelWorkshopid().compareTo(new BigDecimal(1))==0){
@@ -363,115 +367,8 @@ public class WmsInboundResultController extends BaseRESTfulController {
                         return null;
                         return null;
                     }
                     }
 
 
-                            //创建一个入库作业实绩
-                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
-                    //改变扫码实绩里面的状态
-                    int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
-                    //创建实时库存
-                    wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
-                    //改为扫一次添加得代码
-                    //当都完成的时候就要去改变这一批的状态改为下发状态
-                    if(mapList.size()==i+1){
-                        int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
-                    }
-
-                }
-                //改为扫一次添加得代码
-                int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
-            }else {
-                //如果是线材直接结束
-                //将下面的订单都录入这个批次里面
-                for (int i=0;i<mapList.size();i++) {
-                    Map<String, Object> item = mapList.get(i);
-                    //获得高线库
-                    HashMap<String, Object> map3 = new HashMap<>();
-                    map3.put("warehouseId",3);
-                    BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
                     //创建一个入库作业实绩
                     //创建一个入库作业实绩
-                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
-                    //改变扫码实绩里面的状态
-                    int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
-                    //创建实时库存
-                    wmspGridMaterialService.initInsertWmspGridMaterial(item, houseGrid);
-                    //当都完成的时候就要去改变这一批的状态改为下发状态
-                    if(mapList.size()==i+1){
-                        int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
-                    }
-
-                }
-                int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
-                // wmspSendReceiveService.addInBoundSendReceive();
-            }
-            return success("下发成功");
-
-
-    }
-    /**
-     * 新增入库实绩
-     *
-     * @param
-     * @return
-     */
-    @ApiOperation("新增入库实绩")
-    @PostMapping("/insertInboundResult3")
-    @Transactional
-    public  RESTfulResult addInvoice3(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
-        //查询当前组最新得一条入库实绩、判断是否是自己创建得、状态是否是带下发状态
-        Map<String,Object> conditionMap=wmsInboundResultServiceImpl.selectInboundResultByGroupId(groupId);
-        //如果最新的一条是自己的并且
-        //遗留 查询批次、以及状态
-        int batch=0;
-        //此条件成了说明他提交之后、另外一个还没提交交
-         if ((conditionMap!=null&&conditionMap.get("userName").toString().equals(userName)&&conditionMap.get("resultStatus").toString().equals("1"))){
-            return success("等待提交");
-        }
-
-        //此条件成了说明第二个人开始提交了
-        if (conditionMap!=null&&!conditionMap.get("userName").toString().equals(userName)&&conditionMap.get("resultStatus").toString().equals("1")){
-            //将下面的订单都录入这个批次里面
-            for (int i=0;i<mapList.size();i++){
-                Map<String,Object> item=mapList.get(i);
-                //获得同一批的第i个的网格  解释:目前还没有设计出来网格的结构 没有做默认为 第一库、第一月台、第一垛位、第一行、第一列 \推送信息给行车工、让他们抢单代码备注了
-                BigDecimal houseGrid = wmsInboundResultServiceImpl.getGrid(conditionMap.get("distributeId").toString(), i+1);
-                //如果差不多、说明上一个人少扫了一次
-                if (houseGrid==null){
-                    houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
-                    //创建实时库存
-                    wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
-                }
-                //创建一个入库作业实绩
-                WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(0,i+1,personnelWorkshopid,groupId,userName,new BigDecimal(conditionMap.get("distributeId").toString()),houseGrid,item);
-                //改变扫码实绩里面的状态
-                int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
-                //当都完成的时候就要去改变这一批的状态改为下发状态
-                if(mapList.size()==i+1){
-                    int status2= wmsInboundResultServiceImpl.updateInboundStatus(new BigDecimal(conditionMap.get("distributeId").toString()));
-                }
-            }
-               int status3= wmspInboundDistributeService.updateDistributeStatus(conditionMap.get("distributeId").toString());
-
-                return success("下发成功");
-        //第n批第一次提交
-        }else{
-            //需要判断是否已经提交过了 通过resultId判断物质是否已经下发过了跳出、多次下发的结果
-            int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
-           if(resultStatus==1){
-               return success("请勿重复下发");
-           }
-            //、创建批次
-            WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
-            //判断物质是否是线材
-            BigDecimal count = wmsInboundScanResultService.selectMaterialTypeByMaterialId(new BigDecimal(mapList.get(0).get("materialId").toString()));
-            if (count!=null){
-                //将下面的订单都录入这个批次里面
-                for (int i=0;i<mapList.size();i++){
-
-                    Map<String,Object> item=mapList.get(i);
-
-                    //获得一个默认的网格  解释:目前还没有设计出来网格的结构 没有做默认为 第一库、第一月台、第一垛位、第一行、第一列 \推送信息给行车工、让他们抢单代码备注了
-                    BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
-                    //创建一个入库作业实绩
-                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(0,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
+                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item,remark);
                     //改变扫码实绩里面的状态
                     //改变扫码实绩里面的状态
                     int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
                     int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
                     //创建实时库存
                     //创建实时库存
@@ -481,7 +378,6 @@ public class WmsInboundResultController extends BaseRESTfulController {
                     if(mapList.size()==i+1){
                     if(mapList.size()==i+1){
                         int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
                         int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
                     }
                     }
-
                 }
                 }
                 //改为扫一次添加得代码
                 //改为扫一次添加得代码
                 int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
                 int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
@@ -495,7 +391,7 @@ public class WmsInboundResultController extends BaseRESTfulController {
                     map3.put("warehouseId",3);
                     map3.put("warehouseId",3);
                     BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
                     BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
                     //创建一个入库作业实绩
                     //创建一个入库作业实绩
-                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
+                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item,remark);
                     //改变扫码实绩里面的状态
                     //改变扫码实绩里面的状态
                     int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
                     int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
                     //创建实时库存
                     //创建实时库存
@@ -505,231 +401,336 @@ public class WmsInboundResultController extends BaseRESTfulController {
                         int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
                         int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
                     }
                     }
 
 
-                    //获取物资大类id
-//                    BigDecimal materialSteelId = DataChange.dataToBigDecimal(item.get("materialId"));
-//                    BigDecimal materialId = wmspSendReceiveService.getMaterialId(materialSteelId);
-//                    Map<String,Object> map4 = new HashMap<>();
-//                    map4.put("materialId",materialId);
-//                    map4.put("warehouseId",3);
-//                    wmspSendReceiveService.addInBoundSendReceive(map4);
-//                    wmspSendReceiveService.addThisdayInventorySendReceive(map4);
                 }
                 }
                 int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
                 int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
-               // wmspSendReceiveService.addInBoundSendReceive();
+                // wmspSendReceiveService.addInBoundSendReceive();
             }
             }
             return success("下发成功");
             return success("下发成功");
-        }
-
-    }
-    /**
-     * 新增入库实绩
-     *
-     * @param
-     * @return
-     */
-    @ApiOperation("新增入库实绩")
-    @PostMapping("/insertInboundResult2")
-    @Transactional
-    public RESTfulResult addInvoice( @RequestBody(required = false) List<Map<String, Object>> mapList) {
-
-
-        //获取前方传来的仓库ID进行入库
-        BigDecimal warehouseId = new BigDecimal((Integer)mapList.get(0).get("personnelWorkshopid"));
-
-        String inboundValue = null;
-        BigDecimal ST = null;
-        if(warehouseId.intValue() == 3){
-             inboundValue = wmsInboundResultServiceImpl.selectWarehouseName(new BigDecimal(3));
-        }
-        //!!!默认该仓库的所有行车工都能看到
-        //!!!待添加,查询该仓库所有在班的行车工
-        String personnelJobNumber = "000417";
-        if(warehouseId.intValue() != 3){
-            //查询入库垛位信息
-            Map<String,Object> stackingMap = rmsStackingService.getStackingToUpdate(mapList.size(),warehouseId,personnelJobNumber);
-            //获取入库垛位ID
-            ST = (BigDecimal) stackingMap.get("stackingId");
-            inboundValue = stackingMap.get("stackingNo").toString();
-        }
-        for (Map<String,Object> map:mapList
-             ) {
-            WmspInboundResult wmspInboundResult = new WmspInboundResult();
-            wmspInboundResult.setInboundId(new BigDecimal(wmsInboundResultServiceImpl.count() + 1));
-            /*
-            设置入库类型为生产入库
-             */
-            wmspInboundResult.setInboundType(new BigDecimal(0));
-            /*
-            设置入库单编号
-             */
-            String number=Liushuih.generateNextNumber("WRKD-", "yyyyMMdd-", 8, 12);
-            wmspInboundResult.setInboundNumber(number);
-             /*
-            设置逻辑删除字段
-             */
-            wmspInboundResult.setResultDeleted(new BigDecimal(0));
-            /*
-            设置常规字段
-            */
-            wmspInboundResult.setInsertUsername("admin");
-            wmspInboundResult.setInsertTime(new Date());
-            wmspInboundResult.setUpdateUsername("admin");
-            wmspInboundResult.setUpdateTime(new Date());
-            wmspInboundResult.setInsertUpdateRemark("无");
-            /*
-            设置入库日期
-             */
-            wmspInboundResult.setInboundTime(new Date());
-              /*
-            设置入库单状态为已下发
-             */
-            wmspInboundResult.setResultStatus(new BigDecimal(1));
-            
-            /*
-            设置入库状态,当异常值为0时,入库状态设为未完成;当异常值为1时,入库状态设为完成
-             */
-            Integer K = 1;
-            if(warehouseId.intValue() != 3){
-                System.out.println(map.containsKey("abnormalis"));
-                System.out.println(map.get("abnormalis"));
-                 K =  (map.containsKey("abnormalis")&&map.get("abnormalis").toString().isEmpty())?Integer.valueOf(map.get("abnormalis").toString()):0;
-            }
-            if (K==0){
-                wmspInboundResult.setResultStatus(new BigDecimal(0));
-                wmspInboundResult.setInboundIscomplete(new BigDecimal(0));
-            }
-            else{
-                wmspInboundResult.setResultStatus(new BigDecimal(1));
-                wmspInboundResult.setInboundIscomplete(new BigDecimal(1));
-            }
-            Integer MN = null ;
-            Integer CC = null ;
-            Integer CX = null ;
-            if(warehouseId.intValue() != 3){
-                //根据垛位ID查询物资数,确定层次层序,即网格ID
-                HashMap<String, Object> map1 = new HashMap<>();
-                map1.put("stackingId",ST);
-                //获取物资数
-                 MN=rmsStackingService.selectMaterialNumber(map1);
-                //计算层次号
-                 CC=(MN)/24+1;
-                //计算层序号
-                 CX=(MN)%24+1;
-                //更新垛位表
-               rmsStackingService.updateStack(ST);
-            }
-            //根据仓库id、垛位ID,层次号,层序号查找仓储网格
-            HashMap<String, Object> map3 = new HashMap<>();
-            map3.put("warehouseId",warehouseId);
-            map3.put("stackingID",ST);
-            map3.put("gradationNumber",CC);
-            map3.put("sequenceNumber",CX);
-            BigDecimal gridId=rmsPwarehouseGridService.getGridId(map3);
-            //设置入库实绩里面的网格ID
-            wmspInboundResult.setGridId(gridId);
-            /*
-            插入一条网格物资中间表
-             */
-            WmspGridMaterial wmspGridMaterial = new WmspGridMaterial();
-            //设置主键ID
-            wmspGridMaterial.setGmId(wmspGridMaterialMapper.getCount());
-            wmspGridMaterial.setGridId(gridId);
-            wmspGridMaterial.setGmNumber(new BigDecimal(1));
-            wmspGridMaterial.setStandardDataId(new BigDecimal(1));
-            //设置网格物资表里面的物资ID
-            BigDecimal materialId= DataChange.dataToBigDecimal(map.get("materialId"));
-            wmspInboundResult.setMaterialId(materialId);
-            wmspGridMaterial.setMaterialId(materialId);
-            //设置逻辑删除字段
-            wmspGridMaterial.setDeleted(new BigDecimal(0));
-            //设置常规字段
-            wmspGridMaterial.setInsertUsername("admin");
-            wmspGridMaterial.setInsertTime(new Date());
-            wmspGridMaterial.setUpdateUsername("admin");
-            wmspGridMaterial.setUpdateTime(new Date());
-            wmspGridMaterial.setInsertUpdateRemark("无");
-            wmspGridMaterial.setStatus(new BigDecimal(2));
-            wmspGridMaterialService.insertWmspGridMaterial(wmspGridMaterial);
-            /*
-            新增入库实绩主表
-             */
-            wmsInboundResultServiceImpl.insertWmsInboundResult(wmspInboundResult);
-            /*
-            新增天车司机接收实绩
-             */
-            WmspInboundDrivingResult wmspInboundDrivingResult = new WmspInboundDrivingResult();
-            wmspInboundDrivingResult.setDrivingId(new BigDecimal(wmsInboundDrivingResultServiceImpl.count()+1));
-            wmspInboundDrivingResult.setDriverId(new BigDecimal(9));
-            wmspInboundDrivingResult.setDrivingReceiveTime(new Date());
-            wmspInboundDrivingResult.setInboundResultId(wmspInboundResult.getInboundId());
-            wmspInboundDrivingResult.setInsertUsername("admin");
-            wmspInboundDrivingResult.setInsertTime(new Date());
-            wmspInboundDrivingResult.setUpdateUsername("admin");
-            wmspInboundDrivingResult.setResultDeleted(new BigDecimal(1));
-            wmsInboundDrivingResultServiceImpl.insertWmspInboundDrivingResult(wmspInboundDrivingResult);
-            /*
-            新增选择垛位实绩
-             */
-            WmspInboundStackResult wmspInboundStackResult = new WmspInboundStackResult();
-            wmspInboundStackResult.setResultId(new BigDecimal(wmsInboundStackResultServiceImpl.count()+1));
-            wmspInboundStackResult.setInboundResultId(wmspInboundResult.getInboundId());
-            wmspInboundStackResult.setStackingId(ST);
-            wmspInboundStackResult.setResultDeleted(new BigDecimal(1));
-            //设置常规字段
-            wmspInboundStackResult.setInsertUsername("admin");
-            wmspInboundStackResult.setInsertTime(new Date());
-            wmspInboundStackResult.setUpdateUsername("admin");
-            wmspInboundStackResult.setUpdateTime(new Date());
-            wmspInboundStackResult.setInsertUpdateRemark("无");
-            wmspInboundStackResult.setStackingStatus(new BigDecimal(0));
-            wmsInboundStackResultServiceImpl.insertWmsInboundStackResult(wmspInboundStackResult);
-            System.out.println(map.get("LOADA"));
-            System.out.println(map.get("LOADB"));
-            //判断物资是否为线材
-            BigDecimal count = wmsInboundScanResultServiceImpl.selectMaterialTypeByMaterialId(materialId);
-
-            BigDecimal resultId= new BigDecimal((Integer)map.get("resultId")) ;
-//            BigDecimal RESULTBID= new BigDecimal((Integer)map.get("RESULTBID")) ;
-            BigDecimal InbounId=wmspInboundResult.getInboundId();
-            if(count!=null){
-                /*
-            编辑扫描实绩-根据前台返回的扫描实绩ID修改扫描实绩
-            */
-                HashMap<String, Object> map5 = new HashMap<>();
-                Map<String,Object> otherLoadMap = new HashMap<>();
-                otherLoadMap.put("personnelWorkshopid",map.get("personnelWorkshopid"));
-                otherLoadMap.put("personnelShifts",map.get("personnelShifts"));
-                otherLoadMap.put("personnelTeam",map.get("personnelTeam"));
-                otherLoadMap.put("resultId",resultId);
-                //获取同一班次班组车间扫描次数扫描实绩
-                List<Map<String,Object>> otherResultIds = wmsInboundScanResultServiceImpl.getOntherLoadId(otherLoadMap);
-                //根据物资id查询是否该物资为线材
-                //设置另一个扫描实绩id为空
-                BigDecimal otherResultId = null;
-                //遍历查询出的同一班次班组车间扫描次数所有扫描实绩
-                for (Map<String,Object> otherMap : otherResultIds) {
-                    //判断,查询出来的扫描实绩id是否于点击下发的扫描实绩的id相同
-                    //如果不同,将获取到的扫描实绩主键id赋予otherResultId
-                    if (((BigDecimal) otherMap.get("resultId")).intValue() != resultId.intValue()) {
-                        otherResultId = (BigDecimal) otherMap.get("resultId");
-                    }
-                }
-                //更新扫描实绩
-                map5.put("resultId",resultId);
-                map5.put("InbounId",InbounId);
-                wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map5);
-                map5.remove("resultId");
-                map5.put("resultId",otherResultId);
-                wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map5);
-            }
-            //更新扫描实绩状态
-            Map<String,Object> map7=new HashMap<>();
-            map7.put("resultId",resultId);
-            map7.put("InbounId",InbounId);
-            wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map7);
-        }
-        return success(inboundValue);
     }
     }
+//    /**
+//     * 新增入库实绩
+//     *
+//     * @param
+//     * @return
+//     */
+//    @ApiOperation("新增入库实绩")
+//    @PostMapping("/insertInboundResult3")
+//    @Transactional
+//    public  RESTfulResult addInvoice3(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
+//        //查询当前组最新得一条入库实绩、判断是否是自己创建得、状态是否是带下发状态
+//        Map<String,Object> conditionMap=wmsInboundResultServiceImpl.selectInboundResultByGroupId(groupId);
+//        //如果最新的一条是自己的并且
+//        //遗留 查询批次、以及状态
+//        int batch=0;
+//        //此条件成了说明他提交之后、另外一个还没提交交
+//         if ((conditionMap!=null&&conditionMap.get("userName").toString().equals(userName)&&conditionMap.get("resultStatus").toString().equals("1"))){
+//            return success("等待提交");
+//        }
+//
+//        //此条件成了说明第二个人开始提交了
+//        if (conditionMap!=null&&!conditionMap.get("userName").toString().equals(userName)&&conditionMap.get("resultStatus").toString().equals("1")){
+//            //将下面的订单都录入这个批次里面
+//            for (int i=0;i<mapList.size();i++){
+//                Map<String,Object> item=mapList.get(i);
+//                //获得同一批的第i个的网格  解释:目前还没有设计出来网格的结构 没有做默认为 第一库、第一月台、第一垛位、第一行、第一列 \推送信息给行车工、让他们抢单代码备注了
+//                BigDecimal houseGrid = wmsInboundResultServiceImpl.getGrid(conditionMap.get("distributeId").toString(), i+1);
+//                //如果差不多、说明上一个人少扫了一次
+//                if (houseGrid==null){
+//                    houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
+//                    //创建实时库存
+//                    wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
+//                }
+//                //创建一个入库作业实绩
+//                WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(0,i+1,personnelWorkshopid,groupId,userName,new BigDecimal(conditionMap.get("distributeId").toString()),houseGrid,item);
+//                //改变扫码实绩里面的状态
+//                int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
+//                //当都完成的时候就要去改变这一批的状态改为下发状态
+//                if(mapList.size()==i+1){
+//                    int status2= wmsInboundResultServiceImpl.updateInboundStatus(new BigDecimal(conditionMap.get("distributeId").toString()));
+//                }
+//            }
+//               int status3= wmspInboundDistributeService.updateDistributeStatus(conditionMap.get("distributeId").toString());
+//
+//                return success("下发成功");
+//        //第n批第一次提交
+//        }else{
+//            //需要判断是否已经提交过了 通过resultId判断物质是否已经下发过了跳出、多次下发的结果
+//            int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
+//           if(resultStatus==1){
+//               return success("请勿重复下发");
+//           }
+//            //、创建批次
+//            WmspInboundDistribute  wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
+//            //判断物质是否是线材
+//            BigDecimal count = wmsInboundScanResultService.selectMaterialTypeByMaterialId(new BigDecimal(mapList.get(0).get("materialId").toString()));
+//            if (count!=null){
+//                //将下面的订单都录入这个批次里面
+//                for (int i=0;i<mapList.size();i++){
+//
+//                    Map<String,Object> item=mapList.get(i);
+//
+//                    //获得一个默认的网格  解释:目前还没有设计出来网格的结构 没有做默认为 第一库、第一月台、第一垛位、第一行、第一列 \推送信息给行车工、让他们抢单代码备注了
+//                    BigDecimal houseGrid = rmsPwarehouseGridService.selectGrid(mapList.size()-(i+1), personnelWorkshopid,new BigDecimal(item.get("materialId").toString()));
+//                    //创建一个入库作业实绩
+//                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(0,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
+//                    //改变扫码实绩里面的状态
+//                    int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
+//                    //创建实时库存
+//                    wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
+//                    //改为扫一次添加得代码
+//                    //当都完成的时候就要去改变这一批的状态改为下发状态
+//                    if(mapList.size()==i+1){
+//                        int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
+//                    }
+//
+//                }
+//                //改为扫一次添加得代码
+//                int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
+//            }else {
+//                //如果是线材直接结束
+//                //将下面的订单都录入这个批次里面
+//                for (int i=0;i<mapList.size();i++) {
+//                    Map<String, Object> item = mapList.get(i);
+//                    //获得高线库
+//                    HashMap<String, Object> map3 = new HashMap<>();
+//                    map3.put("warehouseId",3);
+//                    BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
+//                    //创建一个入库作业实绩
+//                    WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
+//                    //改变扫码实绩里面的状态
+//                    int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
+//                    //创建实时库存
+//                    wmspGridMaterialService.initInsertWmspGridMaterial(item, houseGrid);
+//                    //当都完成的时候就要去改变这一批的状态改为下发状态
+//                    if(mapList.size()==i+1){
+//                        int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
+//                    }
+//
+//                    //获取物资大类id
+////                    BigDecimal materialSteelId = DataChange.dataToBigDecimal(item.get("materialId"));
+////                    BigDecimal materialId = wmspSendReceiveService.getMaterialId(materialSteelId);
+////                    Map<String,Object> map4 = new HashMap<>();
+////                    map4.put("materialId",materialId);
+////                    map4.put("warehouseId",3);
+////                    wmspSendReceiveService.addInBoundSendReceive(map4);
+////                    wmspSendReceiveService.addThisdayInventorySendReceive(map4);
+//                }
+//                int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
+//               // wmspSendReceiveService.addInBoundSendReceive();
+//            }
+//            return success("下发成功");
+//        }
+//
+//    }
+//    /**
+//     * 新增入库实绩
+//     *
+//     * @param
+//     * @return
+//     */
+//    @ApiOperation("新增入库实绩")
+//    @PostMapping("/insertInboundResult2")
+//    @Transactional
+//    public RESTfulResult addInvoice( @RequestBody(required = false) List<Map<String, Object>> mapList) {
+//
+//
+//        //获取前方传来的仓库ID进行入库
+//        BigDecimal warehouseId = new BigDecimal((Integer)mapList.get(0).get("personnelWorkshopid"));
+//
+//        String inboundValue = null;
+//        BigDecimal ST = null;
+//        if(warehouseId.intValue() == 3){
+//             inboundValue = wmsInboundResultServiceImpl.selectWarehouseName(new BigDecimal(3));
+//        }
+//        //!!!默认该仓库的所有行车工都能看到
+//        //!!!待添加,查询该仓库所有在班的行车工
+//        String personnelJobNumber = "000417";
+//        if(warehouseId.intValue() != 3){
+//            //查询入库垛位信息
+//            Map<String,Object> stackingMap = rmsStackingService.getStackingToUpdate(mapList.size(),warehouseId,personnelJobNumber);
+//            //获取入库垛位ID
+//            ST = (BigDecimal) stackingMap.get("stackingId");
+//            inboundValue = stackingMap.get("stackingNo").toString();
+//        }
+//        for (Map<String,Object> map:mapList
+//             ) {
+//            WmspInboundResult wmspInboundResult = new WmspInboundResult();
+//            wmspInboundResult.setInboundId(new BigDecimal(wmsInboundResultServiceImpl.count() + 1));
+//            /*
+//            设置入库类型为生产入库
+//             */
+//            wmspInboundResult.setInboundType(new BigDecimal(0));
+//            /*
+//            设置入库单编号
+//             */
+//            String number=Liushuih.generateNextNumber("WRKD-", "yyyyMMdd-", 8, 12);
+//            wmspInboundResult.setInboundNumber(number);
+//             /*
+//            设置逻辑删除字段
+//             */
+//            wmspInboundResult.setResultDeleted(new BigDecimal(0));
+//            /*
+//            设置常规字段
+//            */
+//            wmspInboundResult.setInsertUsername("admin");
+//            wmspInboundResult.setInsertTime(new Date());
+//            wmspInboundResult.setUpdateUsername("admin");
+//            wmspInboundResult.setUpdateTime(new Date());
+//            wmspInboundResult.setInsertUpdateRemark("无");
+//            /*
+//            设置入库日期
+//             */
+//            wmspInboundResult.setInboundTime(new Date());
+//              /*
+//            设置入库单状态为已下发
+//             */
+//            wmspInboundResult.setResultStatus(new BigDecimal(1));
+//
+//            /*
+//            设置入库状态,当异常值为0时,入库状态设为未完成;当异常值为1时,入库状态设为完成
+//             */
+//            Integer K = 1;
+//            if(warehouseId.intValue() != 3){
+//                System.out.println(map.containsKey("abnormalis"));
+//                System.out.println(map.get("abnormalis"));
+//                 K =  (map.containsKey("abnormalis")&&map.get("abnormalis").toString().isEmpty())?Integer.valueOf(map.get("abnormalis").toString()):0;
+//            }
+//            if (K==0){
+//                wmspInboundResult.setResultStatus(new BigDecimal(0));
+//                wmspInboundResult.setInboundIscomplete(new BigDecimal(0));
+//            }
+//            else{
+//                wmspInboundResult.setResultStatus(new BigDecimal(1));
+//                wmspInboundResult.setInboundIscomplete(new BigDecimal(1));
+//            }
+//            Integer MN = null ;
+//            Integer CC = null ;
+//            Integer CX = null ;
+//            if(warehouseId.intValue() != 3){
+//                //根据垛位ID查询物资数,确定层次层序,即网格ID
+//                HashMap<String, Object> map1 = new HashMap<>();
+//                map1.put("stackingId",ST);
+//                //获取物资数
+//                 MN=rmsStackingService.selectMaterialNumber(map1);
+//                //计算层次号
+//                 CC=(MN)/24+1;
+//                //计算层序号
+//                 CX=(MN)%24+1;
+//                //更新垛位表
+//               rmsStackingService.updateStack(ST);
+//            }
+//            //根据仓库id、垛位ID,层次号,层序号查找仓储网格
+//            HashMap<String, Object> map3 = new HashMap<>();
+//            map3.put("warehouseId",warehouseId);
+//            map3.put("stackingID",ST);
+//            map3.put("gradationNumber",CC);
+//            map3.put("sequenceNumber",CX);
+//            BigDecimal gridId=rmsPwarehouseGridService.getGridId(map3);
+//            //设置入库实绩里面的网格ID
+//            wmspInboundResult.setGridId(gridId);
+//            /*
+//            插入一条网格物资中间表
+//             */
+//            WmspGridMaterial wmspGridMaterial = new WmspGridMaterial();
+//            //设置主键ID
+//            wmspGridMaterial.setGmId(wmspGridMaterialMapper.getCount());
+//            wmspGridMaterial.setGridId(gridId);
+//            wmspGridMaterial.setGmNumber(new BigDecimal(1));
+//            wmspGridMaterial.setStandardDataId(new BigDecimal(1));
+//            //设置网格物资表里面的物资ID
+//            BigDecimal materialId= DataChange.dataToBigDecimal(map.get("materialId"));
+//            wmspInboundResult.setMaterialId(materialId);
+//            wmspGridMaterial.setMaterialId(materialId);
+//            //设置逻辑删除字段
+//            wmspGridMaterial.setDeleted(new BigDecimal(0));
+//            //设置常规字段
+//            wmspGridMaterial.setInsertUsername("admin");
+//            wmspGridMaterial.setInsertTime(new Date());
+//            wmspGridMaterial.setUpdateUsername("admin");
+//            wmspGridMaterial.setUpdateTime(new Date());
+//            wmspGridMaterial.setInsertUpdateRemark("无");
+//            wmspGridMaterial.setStatus(new BigDecimal(2));
+//            wmspGridMaterialService.insertWmspGridMaterial(wmspGridMaterial);
+//            /*
+//            新增入库实绩主表
+//             */
+//            wmsInboundResultServiceImpl.insertWmsInboundResult(wmspInboundResult);
+//            /*
+//            新增天车司机接收实绩
+//             */
+//            WmspInboundDrivingResult wmspInboundDrivingResult = new WmspInboundDrivingResult();
+//            wmspInboundDrivingResult.setDrivingId(new BigDecimal(wmsInboundDrivingResultServiceImpl.count()+1));
+//            wmspInboundDrivingResult.setDriverId(new BigDecimal(9));
+//            wmspInboundDrivingResult.setDrivingReceiveTime(new Date());
+//            wmspInboundDrivingResult.setInboundResultId(wmspInboundResult.getInboundId());
+//            wmspInboundDrivingResult.setInsertUsername("admin");
+//            wmspInboundDrivingResult.setInsertTime(new Date());
+//            wmspInboundDrivingResult.setUpdateUsername("admin");
+//            wmspInboundDrivingResult.setResultDeleted(new BigDecimal(1));
+//            wmsInboundDrivingResultServiceImpl.insertWmspInboundDrivingResult(wmspInboundDrivingResult);
+//            /*
+//            新增选择垛位实绩
+//             */
+//            WmspInboundStackResult wmspInboundStackResult = new WmspInboundStackResult();
+//            wmspInboundStackResult.setResultId(new BigDecimal(wmsInboundStackResultServiceImpl.count()+1));
+//            wmspInboundStackResult.setInboundResultId(wmspInboundResult.getInboundId());
+//            wmspInboundStackResult.setStackingId(ST);
+//            wmspInboundStackResult.setResultDeleted(new BigDecimal(1));
+//            //设置常规字段
+//            wmspInboundStackResult.setInsertUsername("admin");
+//            wmspInboundStackResult.setInsertTime(new Date());
+//            wmspInboundStackResult.setUpdateUsername("admin");
+//            wmspInboundStackResult.setUpdateTime(new Date());
+//            wmspInboundStackResult.setInsertUpdateRemark("无");
+//            wmspInboundStackResult.setStackingStatus(new BigDecimal(0));
+//            wmsInboundStackResultServiceImpl.insertWmsInboundStackResult(wmspInboundStackResult);
+//            System.out.println(map.get("LOADA"));
+//            System.out.println(map.get("LOADB"));
+//            //判断物资是否为线材
+//            BigDecimal count = wmsInboundScanResultServiceImpl.selectMaterialTypeByMaterialId(materialId);
+//
+//            BigDecimal resultId= new BigDecimal((Integer)map.get("resultId")) ;
+////            BigDecimal RESULTBID= new BigDecimal((Integer)map.get("RESULTBID")) ;
+//            BigDecimal InbounId=wmspInboundResult.getInboundId();
+//            if(count!=null){
+//                /*
+//            编辑扫描实绩-根据前台返回的扫描实绩ID修改扫描实绩
+//            */
+//                HashMap<String, Object> map5 = new HashMap<>();
+//                Map<String,Object> otherLoadMap = new HashMap<>();
+//                otherLoadMap.put("personnelWorkshopid",map.get("personnelWorkshopid"));
+//                otherLoadMap.put("personnelShifts",map.get("personnelShifts"));
+//                otherLoadMap.put("personnelTeam",map.get("personnelTeam"));
+//                otherLoadMap.put("resultId",resultId);
+//                //获取同一班次班组车间扫描次数扫描实绩
+//                List<Map<String,Object>> otherResultIds = wmsInboundScanResultServiceImpl.getOntherLoadId(otherLoadMap);
+//                //根据物资id查询是否该物资为线材
+//                //设置另一个扫描实绩id为空
+//                BigDecimal otherResultId = null;
+//                //遍历查询出的同一班次班组车间扫描次数所有扫描实绩
+//                for (Map<String,Object> otherMap : otherResultIds) {
+//                    //判断,查询出来的扫描实绩id是否于点击下发的扫描实绩的id相同
+//                    //如果不同,将获取到的扫描实绩主键id赋予otherResultId
+//                    if (((BigDecimal) otherMap.get("resultId")).intValue() != resultId.intValue()) {
+//                        otherResultId = (BigDecimal) otherMap.get("resultId");
+//                    }
+//                }
+//                //更新扫描实绩
+//                map5.put("resultId",resultId);
+//                map5.put("InbounId",InbounId);
+//                wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map5);
+//                map5.remove("resultId");
+//                map5.put("resultId",otherResultId);
+//                wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map5);
+//            }
+//            //更新扫描实绩状态
+//            Map<String,Object> map7=new HashMap<>();
+//            map7.put("resultId",resultId);
+//            map7.put("InbounId",InbounId);
+//            wmsInboundScanResultServiceImpl.updateWmsInboundScanById(map7);
+//        }
+//        return success(inboundValue);
+//    }
 
 
     //根据入库实绩id查找扫描实绩
     //根据入库实绩id查找扫描实绩
     @PostMapping("/selectScanResultByIboundResultId")
     @PostMapping("/selectScanResultByIboundResultId")

+ 1 - 0
src/main/java/com/steerinfo/dil/controller/WmsInboundScanResultController.java

@@ -68,6 +68,7 @@ public class WmsInboundScanResultController extends BaseRESTfulController {
         //这里需要的参数包括 扫码人账号 userId、二维码信息 resultMaterial
         //这里需要的参数包括 扫码人账号 userId、二维码信息 resultMaterial
         //首先判断二维码是否已经被扫过了
         //首先判断二维码是否已经被扫过了
         //判断条件是查询扫描实绩判断是否已经存在改唯一标识码并且扫码人是否是自己
         //判断条件是查询扫描实绩判断是否已经存在改唯一标识码并且扫码人是否是自己
+        System.out.println(map.get("resultMaterial"));
         int isExist= wmsInboundScanResultService.isExist(map.get("userName").toString(),map.get("resultMaterial").toString().substring(0,map.get("resultMaterial").toString().length()-1));
         int isExist= wmsInboundScanResultService.isExist(map.get("userName").toString(),map.get("resultMaterial").toString().substring(0,map.get("resultMaterial").toString().length()-1));
         //通过用户ID查询、当前扫描没有下发的物质、最终展示的集合
         //通过用户ID查询、当前扫描没有下发的物质、最终展示的集合
         List<Map<String,Object>>mapList= wmsInboundScanResultService.noIssueScanResultList(map.get("userName").toString());
         List<Map<String,Object>>mapList= wmsInboundScanResultService.noIssueScanResultList(map.get("userName").toString());

+ 11 - 8
src/main/java/com/steerinfo/dil/controller/WmspOutboundResultController.java

@@ -27,10 +27,7 @@ import org.springframework.web.bind.annotation.*;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * WmspOutboundResult RESTful接口:
  * WmspOutboundResult RESTful接口:
@@ -64,6 +61,9 @@ public class WmspOutboundResultController extends BaseRESTfulController {
     @Autowired
     @Autowired
     private  ESFeign esFeign;
     private  ESFeign esFeign;
 
 
+    @Autowired
+    private WmsInboundResultController wmsInboundResultController;
+
     private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     private SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     private SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 
@@ -192,7 +192,6 @@ public class WmspOutboundResultController extends BaseRESTfulController {
         //物资唯一编码
         //物资唯一编码
         String materialOnlyCode=subResultMaterial.split("-")[7];
         String materialOnlyCode=subResultMaterial.split("-")[7];
 
 
-
         //判断物质是否已经被扫描
         //判断物质是否已经被扫描
         int isScan = wmspOutboundResultService.ExistScanResult(subResultMaterial);
         int isScan = wmspOutboundResultService.ExistScanResult(subResultMaterial);
         //根据物资id查询相对应的入库实绩ID,并将其赋值给相对应的入库扫描实绩表,判断是否入库
         //根据物资id查询相对应的入库实绩ID,并将其赋值给相对应的入库扫描实绩表,判断是否入库
@@ -201,10 +200,16 @@ public class WmspOutboundResultController extends BaseRESTfulController {
             //Map<String, Object> inboundScanResultByResultMaterial = wmsInboundScanResultService.createInboundScanResultByResultMaterial(1, map.get("personnelJobNumber").toString(), map.get("resultMaterial").toString());
             //Map<String, Object> inboundScanResultByResultMaterial = wmsInboundScanResultService.createInboundScanResultByResultMaterial(1, map.get("personnelJobNumber").toString(), map.get("resultMaterial").toString());
            // if (inboundScanResultByResultMaterial==null){
            // if (inboundScanResultByResultMaterial==null){
                 //没有入库
                 //没有入库
-                return failed(-2);
+            wmsInboundScanResultService.createInboundScanResultByResultMaterial(new Integer(1),map.get("personnelJobNumber").toString(),map.get("resultMaterial").toString());
+            List<Map<String,Object>> mapList = null;
+            mapList= wmsInboundScanResultService.noIssueScanResultList(map.get("personnelJobNumber").toString());
+            //传用户名,批次默认为2,仓库id,扫描数据
+            String remark =  map.get("personnelJobNumber") + "出库扫码时入库";
+            wmsInboundResultController.addInvoice(map.get("personnelJobNumber").toString(),new BigDecimal(2),DataChange.dataToBigDecimal(map.get("personnelWorkshopid")),mapList,remark);
            // }
            // }
 
 
         }
         }
+        list = wmspInboundScanResultMapper.getInboundResultIdByMaterial(subResultMaterial);
         //判断物资是否是需要出库的物资类型,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         //判断物资是否是需要出库的物资类型,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         //判断物资是否是需要出库的物资,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         //判断物资是否是需要出库的物资,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         Map<String,Object> materialMap = wmspOutboundResultMaterialService.isOutboundResultMaterial(materialOnlyCode,resultId);
         Map<String,Object> materialMap = wmspOutboundResultMaterialService.isOutboundResultMaterial(materialOnlyCode,resultId);
@@ -225,10 +230,8 @@ public class WmspOutboundResultController extends BaseRESTfulController {
             //默认以获取到的第一个值作为入库实绩Id
             //默认以获取到的第一个值作为入库实绩Id
             Map<String, Object> map1 = list.get(0);
             Map<String, Object> map1 = list.get(0);
             int status= wmspOutboundResultService.createOutboundScanResult(subResultMaterial,personnelId,resultId,(BigDecimal)map1.get("inboundResultId"),new BigDecimal(materialMap.get("resultMaterialId").toString()));
             int status= wmspOutboundResultService.createOutboundScanResult(subResultMaterial,personnelId,resultId,(BigDecimal)map1.get("inboundResultId"),new BigDecimal(materialMap.get("resultMaterialId").toString()));
-
             return success(status);
             return success(status);
         }else {
         }else {
-
             if (list.size()==0){
             if (list.size()==0){
                 //没有入库
                 //没有入库
                 return failed(-2);
                 return failed(-2);

+ 1 - 1
src/main/java/com/steerinfo/dil/service/IWmsInboundResultService.java

@@ -60,7 +60,7 @@ public interface IWmsInboundResultService {
 
 
     String selectWarehouseName(BigDecimal bigDecimal);
     String selectWarehouseName(BigDecimal bigDecimal);
 
 
-    WmspInboundResult initAndWmspInboundResult(Integer complete, Integer resultNumber,BigDecimal personnelWorkshopid,BigDecimal inboundGroupId,String userName, BigDecimal distributeId, BigDecimal gridId, Map<String, Object> item);
+    WmspInboundResult initAndWmspInboundResult(Integer complete, Integer resultNumber,BigDecimal personnelWorkshopid,BigDecimal inboundGroupId,String userName, BigDecimal distributeId, BigDecimal gridId, Map<String, Object> item,String remark);
 
 
     Map<String,Object> selectInboundResultByGroupId(BigDecimal groupId);
     Map<String,Object> selectInboundResultByGroupId(BigDecimal groupId);
 
 

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

@@ -143,7 +143,7 @@ public class WmsInboundResultServiceImpl implements IWmsInboundResultService {
     }
     }
 
 
     @Override
     @Override
-    public WmspInboundResult initAndWmspInboundResult(Integer complete, Integer resultNumber,BigDecimal personnelWorkshopid,BigDecimal inboundGroupId,String userName, BigDecimal distributeId, BigDecimal gridId, Map<String, Object> item) {
+    public WmspInboundResult initAndWmspInboundResult(Integer complete, Integer resultNumber,BigDecimal personnelWorkshopid,BigDecimal inboundGroupId,String userName, BigDecimal distributeId, BigDecimal gridId, Map<String, Object> item,String remark) {
         WmspInboundResult wmspInboundResult=new WmspInboundResult();
         WmspInboundResult wmspInboundResult=new WmspInboundResult();
         //1、给实绩属性赋值
         //1、给实绩属性赋值
         int orderNumber = count();
         int orderNumber = count();
@@ -178,6 +178,10 @@ public class WmsInboundResultServiceImpl implements IWmsInboundResultService {
         wmspInboundResult.setInsertUsername(userName);
         wmspInboundResult.setInsertUsername(userName);
         //记录创建时间
         //记录创建时间
         wmspInboundResult.setInsertTime(new Date());
         wmspInboundResult.setInsertTime(new Date());
+
+        if(remark != null&&!"null".equals(remark) && !"".equals(remark)){
+            wmspInboundResult.setInsertUpdateRemark(remark);
+        }
         //创建序号
         //创建序号
         wmspInboundResult.setResultNumber(new BigDecimal(resultNumber));
         wmspInboundResult.setResultNumber(new BigDecimal(resultNumber));
         //插入
         //插入

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

@@ -10,7 +10,7 @@ spring:
 #feign设置
 #feign设置
 openfeign:
 openfeign:
   ColumnDataFeign:
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
   Im:
   Im:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
     url: ${IMFEIGN_URL:172.16.33.166:8055}
   TmsTruckFeign:
   TmsTruckFeign:

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -32,7 +32,7 @@ cache:
 redis:
 redis:
   host: 10.10.50.28
   host: 10.10.50.28
   port: 6379
   port: 6379
-  pwd: 123456
+  pwd: adhykdj
   project:
   project:
     prefix: sysmanage
     prefix: sysmanage
   pool:
   pool: