ソースを参照

fix:生产汇报单,生产入库单

hmc 7 ヶ月 前
コミット
319df090a8

+ 11 - 0
zkqy-fujian-amichi/src/main/java/com/zkqy/amichi/jd/domain/MaterialRetentionLogVo.java

@@ -14,8 +14,13 @@ public class MaterialRetentionLogVo extends BaseEntity {
     @Excel(name = "产品编码")
     @JSONField(name = "FMaterialID.FNumber")
     private String productCode;
+    /**MES工序*/
+    private String  mesprocess;
+
+
 
     @Excel(name = "工序")
+    @JSONField(name = "FProcessID.FName")
     private  String  process;
 
     public String getProcess() {
@@ -203,7 +208,13 @@ public class MaterialRetentionLogVo extends BaseEntity {
     public String getProductCode() {
         return productCode;
     }
+    public String getMesprocess() {
+        return mesprocess;
+    }
 
+    public void setMesprocess(String mesprocess) {
+        this.mesprocess = mesprocess;
+    }
     public void setProductCode(String productCode) {
         this.productCode = productCode;
     }

+ 7 - 0
zkqy-fujian-amichi/src/main/java/com/zkqy/amichi/mapper/RingScanInformationMapper.java

@@ -131,4 +131,11 @@ public interface RingScanInformationMapper
      * @return
      */
     List<Map> handHeldJournal(RingScanInformation ringScanInformation);
+
+    /**
+     * 重复扫描排除那些订单号为空的重复扫描
+     * @param prodOrderScanning
+     * @return
+     */
+    List<RingScanInformation> selectRingScanInformationListisNotNull(RingScanInformation prodOrderScanning);
 }

+ 1 - 1
zkqy-fujian-amichi/src/main/java/com/zkqy/amichi/scheduling/ScheduledBean.java

@@ -72,7 +72,7 @@ public class ScheduledBean {
      * 流转卡序列号信息
      * 焊接单数据信息
      */
-//    @Scheduled(cron = "0 0/4 * * * ?", zone = "Asia/Shanghai")
+    @Scheduled(cron = "0 0 0/1 * * ?", zone = "Asia/Shanghai")
     public void printLog1(){
         Boolean aTrue = stringRedisTemplate.opsForValue().setIfAbsent("fjqy:ptd:pulled", "true");
         if (aTrue) {

+ 116 - 56
zkqy-fujian-amichi/src/main/java/com/zkqy/amichi/service/impl/StationInformationServiceImpl.java

@@ -327,7 +327,7 @@ public class StationInformationServiceImpl implements IStationInformationService
             RingScanInformation prodOrderScanning=new RingScanInformation();
             prodOrderScanning.setContentInformation(s1);
             prodOrderScanning.setProcessName(ringScanInformation.getProcessName());
-            List<RingScanInformation> ringScanInformations = ringScanInformationMapper.selectRingScanInformationList(prodOrderScanning);
+            List<RingScanInformation> ringScanInformations = ringScanInformationMapper.selectRingScanInformationListisNotNull(prodOrderScanning);
             if(ringScanInformations.size()>0){
                 ringScanInformation.setExecutionMark("2");//成功
                 ringScanInformation.setExecutionMessage("重复扫描");
@@ -339,7 +339,6 @@ public class StationInformationServiceImpl implements IStationInformationService
                 return stationInformations.get(0).getStationName()+"-"+stationInformations.get(0).getPersonnelName()+"-"+"重复扫描"+"-"
                         +scanStatistics.getdOrder()+"-"+scanStatistics.getdCount()+"-"+scanStatistics.getDsCount()+"-"+scanStatistics.getDfCount();
             }
-
             //查询生产订单日志里有没有这个生产订单有就不添加了
             RingScanInformationFirst ringScanInformationFirst=new RingScanInformationFirst();
             ringScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
@@ -371,7 +370,7 @@ public class StationInformationServiceImpl implements IStationInformationService
                     String materialId = planTaskDetails2.getMaterialId();
                     if(materialId.startsWith("1")){//
                         ringScanInformationFirst1.setPackingOrInspection("1");//1开头的 试机,包装,包装检验, 入库
-                    }else if(materialId.startsWith("201")) {
+                    }else if(materialId.startsWith("2")) {
                         ringScanInformationFirst1.setPackingOrInspection("2");//2试机,入库
                     }
                 }
@@ -392,7 +391,7 @@ public class StationInformationServiceImpl implements IStationInformationService
                 if(planTaskDetails1.size()>0){
                     PlanTaskDetails planTaskDetails2 = planTaskDetails1.get(0);
                     String materialId = planTaskDetails2.getMaterialId();
-                    if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("包装检验")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
+                    if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("成品检验")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
                         RingScanInformation ringScanInformation1=new RingScanInformation();
                         ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
                         ringScanInformation1.setProcessName(ringScanInformation.getProcessName());//工序
@@ -405,7 +404,7 @@ public class StationInformationServiceImpl implements IStationInformationService
 //                            this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName());//生产订单号,工序名
                              this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
                         }
-                    }else if(materialId.startsWith("201")&&ringScanInformation.getProcessName().equals("试机")) {
+                    }else if(materialId.startsWith("2")&&ringScanInformation.getProcessName().equals("试机检验")) {
                         //有关于这个产品的扫描信息就不更新数量了
                         RingScanInformation ringScanInformation1=new RingScanInformation();
                         ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
@@ -415,9 +414,8 @@ public class StationInformationServiceImpl implements IStationInformationService
                             RingScanInformationFirst newRingScanInformationFirst = getRingScanInformationFirst(ringScanInformationFirstNumber.getInspectionQuantity(), ringScanInformation,"2");
                             ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
                             //生产汇报
-//                            this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber());
-                            this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
-
+//                         this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber());
+                           this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
                         }
                     }
                     else if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("入库")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
@@ -433,7 +431,7 @@ public class StationInformationServiceImpl implements IStationInformationService
 //                            this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName());//生产订单号,工序名
                             this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"1");
                         }
-                    }else if(materialId.startsWith("201")&&ringScanInformation.getProcessName().equals("入库")) {
+                    }else if(materialId.startsWith("2")&&ringScanInformation.getProcessName().equals("入库")) {
                         //有关于这个产品的扫描信息就不更新数量了
                         RingScanInformation ringScanInformation1=new RingScanInformation();
                         ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
@@ -443,7 +441,7 @@ public class StationInformationServiceImpl implements IStationInformationService
                             RingScanInformationFirst newRingScanInformationFirst = getRingScanInformationFirst(ringScanInformationFirstNumber.getRks(), ringScanInformation,"3");
                             ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
                             //生产逻辑
-                            this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"1");//生产订单号,工序名
+                            this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"2");//生产订单号,工序名
                         }
                     }
                 }
@@ -491,39 +489,69 @@ public class StationInformationServiceImpl implements IStationInformationService
                     ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
                     ringScanInformation1.setProcessName("焊接D");
                     String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation1);
-                    ringScanInformation.setOverNumber(s);
+                    int i = Integer.parseInt(s);
+                    int ss=i+1;
+                    ringScanInformation.setOverNumber(String.valueOf(ss));
                 }else if(contentInformation.contains("Z")){
                     RingScanInformation ringScanInformation1=new RingScanInformation();
                     ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
                     ringScanInformation1.setProcessName("焊接Z");
                     String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation1);
-                    ringScanInformation.setOverNumber(s);
+                    int i = Integer.parseInt(s);
+                    int ss=i+1;
+                    ringScanInformation.setOverNumber(String.valueOf(ss));
                 }
             }else {
                 String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation);
-                ringScanInformation.setOverNumber(s);
+                int i = Integer.parseInt(s);
+                int ss=i+1;
+                ringScanInformation.setOverNumber(String.valueOf(ss));
             }
             //插入扫描日志信息
             ringScanInformation.setExecutionMark("1");
             ringScanInformation.setExecutionMessage("扫描成功");
+            if(ringScanInformation.getProcessName().equals("白坯检验")){
+                RingScanInformation ringScanInformation1=new RingScanInformation();
+                BeanUtils.copyProperties(ringScanInformation,ringScanInformation1);
+                ringScanInformation1.setProcessName("浸漆");
+                ringScanInformation1.setProcess("32");
+                ringScanInformation1.setStationId("0");
+                ringScanInformation1.setStationName("浸漆");
+                int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation1);
+            }
+            if(ringScanInformation.getProcessName().equals("成品检验")){
+                RingScanInformation ringScanInformation1=new RingScanInformation();
+                BeanUtils.copyProperties(ringScanInformation,ringScanInformation1);
+                ringScanInformation1.setProcessName("包装");
+                ringScanInformation1.setProcess("26");
+                ringScanInformation1.setStationId("0");
+                ringScanInformation1.setStationName("包装工位");
+                int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation1);
+            }
             int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation);
 
-            //扣料操作
+//            //扣料操作
             String s = this.sweepingMaterial(ringScanInformation.getOrderNumber(), ringScanInformation.getProductionOrderNumber(), //订单号   生产订单号
                         ringScanInformation.getProcessName(), ringScanInformation.getNativeNumbering());//工序     流转卡信息
 
             //查询当前工位信息
-            RingScanInformation ringScanInformation1=new RingScanInformation();
-            ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
-            ringScanInformation1.setProcessName(ringScanInformation.getProcessName());
-            if(ringScanInformation.getProcessName().equals("焊接")) {
-                if (ringScanInformation.getContentInformation().contains("D")) {
-                    ringScanInformation1.setProcessName("焊接D");
-                } else {
-                    ringScanInformation1.setProcessName("焊接Z");
+            ScanStatistics scanStatistics = null;
+            try {
+                RingScanInformation ringScanInformation1=new RingScanInformation();
+                ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
+                ringScanInformation1.setProcessName(ringScanInformation.getProcessName());
+                if(ringScanInformation.getProcessName().equals("焊接")) {
+                    if (ringScanInformation.getContentInformation().contains("D")) {
+                        ringScanInformation1.setProcessName("焊接D");
+                    } else {
+                        ringScanInformation1.setProcessName("焊接Z");
+                    }
                 }
+                scanStatistics = ringScanInformationMapper.selectScanStatistics(ringScanInformation1);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
             }
-            ScanStatistics scanStatistics = ringScanInformationMapper.selectScanStatistics(ringScanInformation1);
+            //记录扫迈欧
             return ringScanInformation.getStationName()+"-"+ringScanInformation.getPersonnelName()+"-"+"扫描成功"+"-"+
                     scanStatistics.getdOrder()+"-"+scanStatistics.getdCount()+"-"+scanStatistics.getDsCount()+"-"+scanStatistics.getDfCount();
         }
@@ -540,6 +568,9 @@ public class StationInformationServiceImpl implements IStationInformationService
      */
     @Override
     public  String   sweepingMaterial(String orderNumber,String productNumber,String gxm,String lxkNumber){
+       if(gxm.equals("入库")){
+           return "入库不扣料";
+       }
        ProcedureList procedureList=new ProcedureList();
        procedureList.setProcedurName(gxm);
        List<ProcedureList> procedureLists = procedureListMapper.selectProcedureListList(procedureList);
@@ -654,7 +685,7 @@ public class StationInformationServiceImpl implements IStationInformationService
            String queryString ="{\n" +
                    "    \"FormId\": \"PRD_MO\",\n" +
                    "    \"FieldKeys\": \"FBillNo\",\n" +
-                   "    \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSerialNo\",\"Compare\":\"67\",\"Value\":\""+productNumber+"\",\"Right\":\"\",\"Logic\":0}],\n" +
+                   "    \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSerialNo\",\"Compare\":\"67\",\"Value\":\""+lxkNumber+"\",\"Right\":\"\",\"Logic\":0}],\n" +
                    "    \"OrderString\": \"\",\n" +
                    "    \"TopRowCount\": 0,\n" +
                    "    \"StartRow\": 0,\n" +
@@ -682,8 +713,8 @@ public class StationInformationServiceImpl implements IStationInformationService
                        //根据生产订单号查询生产用料清单
                        String productionMaterialsListQuery="{\n" +
                                "    \"FormId\": \"PRD_PPBOM\",\n" +
-                               "    \"FieldKeys\": \"FMaterialID.FNumber,FMaterialName,FMaterialModel,FMaterialModel2,FDescription,FMaterialID2.FNumber,FMaterialName1,FMaterialModel1,FUnitID2.FName,FMustQty,FMEMO1,FNumerator,FMaterialType\",\n" +
-                               "    \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"17\",\"Value\":\""+documentNumber+"\",\"Right\":\"\",\"Logic\":0},{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"17\",\"Value\":\""+gxm+"\",\"Right\":\"\",\"Logic\":0}],\n" +
+                               "    \"FieldKeys\": \"FMaterialID.FNumber,FMaterialName,FMaterialModel,FMaterialModel2,FDescription,FMaterialID2.FNumber,FMaterialName1,FMaterialModel1,FUnitID2.FName,FMustQty,FMEMO1,FNumerator,FMaterialType,FProcessID.FName\",\n" +
+                               "    \"FilterString\": [],\n" +
                                "    \"OrderString\": \"\",\n" +
                                "    \"TopRowCount\": 0,\n" +
                                "    \"StartRow\": 0,\n" +
@@ -698,9 +729,13 @@ public class StationInformationServiceImpl implements IStationInformationService
                        List<Map> mapList = JSON.parseArray(filterString, Map.class);
                        //循环条件
                        procedureListErps.forEach(map1 -> {
+                           String ddh="{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"67\",\"Value\":\"11\",\"Right\":\"\",\"Logic\":0}";
                            String mapTj="{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"67\",\"Value\":\"111\",\"Right\":\"\",\"Logic\":1}";
                            Map mapObj = JSONObject.parseObject(mapTj, Map.class);
+                           Map ddhObj = JSONObject.parseObject(ddh, Map.class);
+                           ddhObj.put("Value", productNumber);
                            mapObj.put("Value", map1.getProcedurName());
+                           mapList.add(ddhObj);
                            mapList.add(mapObj);
                        });
                        map2.put("FilterString", mapList);//从新绑定条件
@@ -715,7 +750,7 @@ public class StationInformationServiceImpl implements IStationInformationService
                            item.setCkNumber("CK005");
                            item.setDeliveryWarehouse("车间仓");
                            item.setFlowSequenceNumber(lxkNumber);//流转序列号
-                           item.setProcess(gxm); //工序
+                           item.setMesprocess(gxm); //工序
                            item.setOrderNumber(orderNumber); //订单
                            item.setProductionOrderNumber(productNumber); //生产订单
                            return item;
@@ -793,6 +828,9 @@ public class StationInformationServiceImpl implements IStationInformationService
                       List<PlanTaskDetails> planTaskDetails1 = planTaskDetailsMapper.selectPlanTaskDetailsList(planTaskDetails);
                       //入库 typ 1 入成品 type 入利库
                       erpWareHouSing(planTaskDetails1.get(0),type);
+                      //加更正生产订单状态
+                      planTaskDetails.setStatus("2");//生产完成
+                      int i2 = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
                       return "入库成功";
                   }
               }
@@ -810,20 +848,20 @@ public class StationInformationServiceImpl implements IStationInformationService
                   planTaskDetails.setDemandDocument(productionOrderNumber);
                   //查询即将入库的产品信息
                   List<PlanTaskDetails> planTaskDetails1 = planTaskDetailsMapper.selectPlanTaskDetailsList(planTaskDetails);
-                  //加更正生产订单状态
-                  planTaskDetails.setStatus("2");//生产完成
+//                  //加更正生产订单状态
+//                  planTaskDetails.setStatus("2");//生产完成
                   //检查包装或者试机数量
                   if(packingOrInspection.equals("1")){//检查包装检验  --如果够了-下推生产汇报单
                       //看包装跟当前生产订单总数量是否相等
                       if(ringScanInformationFirst.getPackingQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
-                          int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
+//                          int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
                           //工序汇报
                           erpProcessReport(planTaskDetails1.get(0));
                       }
                   }else if(packingOrInspection.equals("2")){ //试机数量--下推生产汇报单
                       //看包装跟当前生产订单总数量是否相等
                       if(ringScanInformationFirst.getInspectionQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
-                          int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
+//                          int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
                           //生产汇报
                           erpProcessReport(planTaskDetails1.get(0));
                       }
@@ -989,7 +1027,7 @@ public class StationInformationServiceImpl implements IStationInformationService
      * @param planTaskDetails1
      * type 入那个库
      */
-    private  void erpWareHouSing(PlanTaskDetails planTaskDetails1,String type){
+    private  String erpWareHouSing(PlanTaskDetails planTaskDetails1,String type){
         //生产汇报
         ObjectMapper objectMapper = new ObjectMapper();
         //生产用料清单结果
@@ -998,7 +1036,7 @@ public class StationInformationServiceImpl implements IStationInformationService
             //查询生产汇报工序的基本信息
             String nr="{\n" +
                     "    \"FormId\": \"PRD_MORPT\",\n" +
-                    "    \"FieldKeys\": \"fbillno,fid,FSrcBillNo,FEntity_FEntryId\",\n" +
+                    "    \"FieldKeys\": \"fbillno,fid,FSrcBillNo,FEntity_FEntryId,FDate,FUnitID.FNumber\",\n" +
                     "    \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSrcBillNo\",\"Compare\":\"17\",\"Value\":\""+planTaskDetails1.getDemandDocument()+"\",\"Right\":\"\",\"Logic\":0}],\n" +
                     "    \"OrderString\": \"\",\n" +
                     "    \"TopRowCount\": 0,\n" +
@@ -1013,40 +1051,53 @@ public class StationInformationServiceImpl implements IStationInformationService
             String fbillno = map2.get("fbillno").toString();
             String fid = map2.get("fid").toString();
             String FEntityFEntryId = map2.get("FEntity.FEntryId").toString();
-
+            String FDate = map2.get("FDate").toString();
+            String FSrcBillNo = map2.get("FSrcBillNo").toString();
+            String FUnitIDFNumber = map2.get("FUnitID.FNumber").toString();
             //生成入库单
-            Map<String, String> jsonData2 = objectMapper.readValue(storage.getInputStream(), Map.class);
+            Map<String, Object> jsonData2 = objectMapper.readValue(storage.getInputStream(), LinkedHashMap.class);
             //得到Model
-            String model2 = jsonData2.get("Model");
-            Map map6 = JSONObject.parseObject(model2, Map.class);
+            String model2 = objectMapper.writeValueAsString(jsonData2.get("Model"));
+            LinkedHashMap map6 = JSONObject.parseObject(model2, LinkedHashMap.class);
             map6.put("FDate",DateUtils.toLocalDateTimeStr(LocalDateTime.now()));
-            String fEntity1 = map6.get("FEntity").toString();
-            List<Map> mapList = JSONArray.parseArray(fEntity1, Map.class);
-            Map map7 = mapList.get(0);
-            map7.put("FMoId",fid);
-            map7.put("FMoEntryId",FEntityFEntryId);
-            map7.put("FMOMAINENTRYID",FEntityFEntryId);
+            String fEntity1 = objectMapper.writeValueAsString(map6.get("FEntity"));
+            List<LinkedHashMap> mapList = JSONArray.parseArray(fEntity1, LinkedHashMap.class);
+            LinkedHashMap map7 = mapList.get(0);
+            map7.put("F_PONP_HBRQ",FDate);
+
             map7.put("FSrcEntryId",FEntityFEntryId);
-            map7.put("FSrcInterId",FEntityFEntryId);
-            map7.put("FSrcBillNo",planTaskDetails1.getDemandDocument());
+            map7.put("FSrcInterId",fid);
+            map7.put("FSrcBillNo",fbillno);
             map7.put("FMoBillNo",planTaskDetails1.getDemandDocument());
-
+            map7.put("FMoId",planTaskDetails1.getFid());
+            map7.put("FMoEntryId",planTaskDetails1.getFtreeEntityFentryid());
+            map7.put("FMOMAINENTRYID",planTaskDetails1.getFtreeEntityFentryid());
+            HashMap<String, String> fStockId = new HashMap<>();
+            if(type.equals("1")){
+                fStockId.put("FNumber","CK007");
+            }else {
+                fStockId.put("FNumber","CK006");
+            }
+            map7.put("FStockId",fStockId);
             HashMap<String, String> fNumber = new HashMap<>();
             fNumber.put("FNumber",planTaskDetails1.getMaterialId());
             map7.put("FMaterialId",fNumber);
 
             HashMap<String, String> fUnitIDfNumber = new HashMap<>();
-            fUnitIDfNumber.put("FNumber",planTaskDetails1.getFunitidfNumber());
+            fUnitIDfNumber.put("FNumber",FUnitIDFNumber);
             map7.put("FUnitID",fUnitIDfNumber);
 
-
             HashMap<String, String> fBaseUnitIdFNumber = new HashMap<>();
-            fBaseUnitIdFNumber.put("FNumber",planTaskDetails1.getFunitidfNumber());
+            fBaseUnitIdFNumber.put("FNumber",FUnitIDFNumber);
             map7.put("FBaseUnitId",fBaseUnitIdFNumber);
 
+
+
             map7.put("FMustQty",planTaskDetails1.getQuantity());
             map7.put("FRealQty",planTaskDetails1.getQuantity());
 
+
+
             List<Map> fEntityLinkList=new ArrayList<>();
             String FenJson="{\n" +
                     "\"FEntity_Link_FRuleId\": \"PRD_MO2INSTOCK\",\n" +
@@ -1059,13 +1110,20 @@ public class StationInformationServiceImpl implements IStationInformationService
             map8.put("FEntity_Link_FSId",FEntityFEntryId);
             fEntityLinkList.add(map8);
             map7.put("FEntity_Link",fEntityLinkList);
-            String rkdcrateJosn = api.executeBillQueryJson(JSONObject.toJSONString(map7));
+            List<LinkedHashMap> map7List = new ArrayList<>();
+            map7List.add(map7);
+            map6.put("FEntity",map7List);
+
+            jsonData2.put("Model",map6);
+
+            String rkdcrateJosn = api.save("PRD_INSTOCK",JSONObject.toJSONString(jsonData2));
 
             documentExecutionJudgment(objectMapper, rkdcrateJosn,"生成入库单创建","入库单创建失败");
 
             //解析入库单创建结果
             Map rkdCrateJsonResultString = objectMapper.readValue(rkdcrateJosn, Map.class);
-            String rkdCrateResultJson = rkdCrateJsonResultString.get("Result").toString();
+//            String rkdCrateResultJson = rkdCrateJsonResultString.get("Result").toString();
+            String rkdCrateResultJson = objectMapper.writeValueAsString(rkdCrateJsonResultString.get("Result"));
             Map<String,String>  rkdResultMap= objectMapper.readValue(rkdCrateResultJson, Map.class);
             String rkdNumber = rkdResultMap.get("Number");//编号
 
@@ -1080,8 +1138,8 @@ public class StationInformationServiceImpl implements IStationInformationService
             Map<String, Object> jsonData3 = objectMapper.readValue(rkdtj, Map.class);
             List<String> list5 =new ArrayList<>();
             list5.add(rkdNumber);
-            jsonData3.put("Number",list5);
-            String tkdtjR = api.executeBillQueryJson(JSONObject.toJSONString(jsonData3));
+            jsonData3.put("Numbers",list5);
+            String tkdtjR = api.submit("PRD_INSTOCK",JSONObject.toJSONString(jsonData3));
             documentExecutionJudgment(objectMapper, tkdtjR,"入库单提交成功","入库单提交失败");
 
             //审核
@@ -1097,11 +1155,12 @@ public class StationInformationServiceImpl implements IStationInformationService
             Map<String, Object> jsonData4 = objectMapper.readValue(rkdsh, Map.class);
             jsonData4.put("Number",list5);
 
-            String rkdshR = api.executeBillQueryJson(JSONObject.toJSONString(jsonData3));
+            String rkdshR = api.audit("PRD_INSTOCK",JSONObject.toJSONString(jsonData3));
             documentExecutionJudgment(objectMapper, rkdshR,"入库单审核成功","入库单审核失败");
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
+        return "入库成功";
     }
 
     /**
@@ -1122,9 +1181,10 @@ public class StationInformationServiceImpl implements IStationInformationService
         Map map11 = objectMapper.readValue(responseStatus3, Map.class);
         String isSuccess3 = map11.get("IsSuccess").toString();
         if(isSuccess3.equals("true")){
-            return msg2;
-        }else {
             return msg1;
+        }else {
+            System.out.println(msg2);
+            throw new RuntimeException(msg2);
         }
 
     }

+ 3 - 0
zkqy-fujian-amichi/src/main/resources/mapper/MaterialRetentionLogMapper.xml

@@ -82,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateById != null "> and update_by_id = #{updateById}</if>
             <if test="productCode != null "> and product_code = #{productCode}</if>
             <if test="productName != null "> and product_name = #{productName}</if>
+            <if test="process!=null">and process=#{process}</if>
             <if test="productModel != null "> and product_model = #{productModel}</if>
             <if test="productSpecification != null "> and product_specification = #{productSpecification}</if>
             <if test="orderNumber!=null">and order_number = #{orderNumber}</if>
@@ -294,6 +295,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="item.process!=null">process,</if>
                 <if test="item.orderNumber!=null">order_number,</if>
                 <if test="item.productionOrderNumber!=null">production_order_number,</if>
+                <if test="item.mesprocess!=null">mesprocess</if>
             </trim>
             VALUES
             <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -334,6 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="item.process!=null">#{item.process},</if>
                 <if test="item.orderNumber!=null">#{item.orderNumber},</if>
                 <if test="item.productionOrderNumber!=null">#{item.productionOrderNumber},</if>
+                <if test="item.mesprocess!=null">#{item.mesprocess},</if>
             </trim>
         </foreach>
     </insert>

+ 2 - 1
zkqy-fujian-amichi/src/main/resources/mapper/RingScanInformationFirstMapper.xml

@@ -16,11 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="totalQuantity"    column="total_quantity"    />
         <result property="packingOrInspection"    column="packing_or_inspection"    />
         <result property="productionOrderTotalQuantity"    column="production_order_total_quantity"    />
+        <result property="rks"    column="rks"    />
     </resultMap>
 
     <sql id="selectRingScanInformationFirstVo">
         select id, order_number, production_order_number, status,start_time,end_time,packing_quantity,inspection_quantity,total_quantity,
-            packing_or_inspection,production_order_total_quantity
+            packing_or_inspection,production_order_total_quantity,rks
         from fjqydb.ring_scan_information_first
     </sql>
 

+ 31 - 43
zkqy-fujian-amichi/src/main/resources/mapper/RingScanInformationMapper.xml

@@ -155,13 +155,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceNumber != null  and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
             <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
             <if test="scanningTime != null "> and scanning_time = #{scanningTime}</if>
-            <if test="personnelName != null "> and personnel_name = #{personnelName}</if>
-            <if test="process != null "> and process = #{process}</if>
-            <if test="contentInformation != null  and contentInformation != ''"> and content_information = #{contentInformation}</if>
-            <if test="nativeNumbering != null  and nativeNumbering != ''"> and native_numbering = #{nativeNumbering}</if>
+            <if test="personnelName != null "> and personnel_name like concat('%', #{personnelName}, '%') </if>
+            <if test="process != null "> and process like concat('%', #{process}, '%')</if>
+            <if test="contentInformation != null  and contentInformation != ''"> and content_information like concat('%', #{contentInformation}, '%')</if>
+            <if test="nativeNumbering != null  and nativeNumbering != ''"> and native_numbering like concat('%', #{nativeNumbering}, '%')</if>
             <if test="executionMark!=null and executionMark!=''">and execution_mark = #{executionMark}</if>
-            <if test="productionOrderNumber!=null and productionOrderNumber!=''">and rsi.production_order_number = #{productionOrderNumber}</if>
-            <if test="orderNumber!=null and orderNumber!=''">and rsi.order_number = #{orderNumber}</if>
+            <if test="productionOrderNumber!=null and productionOrderNumber!=''">and rsi.production_order_number like concat('%', #{productionOrderNumber}, '%')</if>
+            <if test="orderNumber!=null and orderNumber!=''">and rsi.order_number like concat('%', #{orderNumber}, '%')</if>
             <if test="scanningTimes!=null and scanningTimes[0] != null and scanningTimes[0] != ''">
                 <![CDATA[ and scanning_time >= #{scanningTimes[0]}]]>
             </if>
@@ -236,39 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectRingScanInformationLog2" resultType="com.zkqy.amichi.domain.vo.RingScanInformationLogVo">
---         SELECT
---         sub.count,
---         sub.process_name,
---         sub.native_numbering,
---         sub.order_number,
---         sub.scanning_time,
---         sub.production_order_number,
---         sub.sort,
---         rsif.`status`,
---         rsif.start_time,
---         rsif.end_time,
---         rsif.total_quantity,
---         rsif.production_order_total_quantity
---         FROM
---         (
---             SELECT
---             rsi.process_name,
---             rsi.native_numbering,
---             rsi.order_number,
---             COUNT( rsi.process_name ) `AS count`,
---             rsi.production_order_number,
---             MAX( rsi.scanning_time ) AS scanning_time,
---             pl.sort
---             FROM
---             fjqydb.ring_scan_information AS rsi
---             LEFT JOIN fjqydb.procedure_list AS pl ON pl.procedur_name = rsi.process_name
---             where
---             rsi.execution_mark='1'
---             GROUP BY
---             rsi.production_order_number,
---             rsi.process_name
---         ) AS sub
---         LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON (sub.production_order_number = rsif.production_order_number)
+
         SELECT
         count(sub.count) as `count`,
         sub.process_name,
@@ -355,10 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectRingScanInformationListLike" resultType="java.lang.String" parameterType="com.zkqy.amichi.domain.RingScanInformation">
         SELECT
-            CASE
-            WHEN COUNT(1) = 0 THEN 1
-            ELSE COUNT(1)
-            END AS count_result
+         COUNT(1)
         FROM
             fjqydb.ring_scan_information
         <where>
@@ -395,6 +360,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             rsi.personnel_name,
             rsi.station_name
     </select>
+    <select id="selectRingScanInformationListisNotNull"
+            resultType="com.zkqy.amichi.domain.RingScanInformation">
+        <include refid="selectRingScanInformationVo"/>
+        <where>
+            <if test="deviceNumber != null  and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
+            <if test="processName != null  and processName != ''"> and process_name = #{processName}</if>
+            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
+            <if test="contentInformation != null  and contentInformation != ''"> and content_information = #{contentInformation}</if>
+            <if test="nativeNumbering != null  and nativeNumbering != ''"> and native_numbering = #{nativeNumbering}</if>
+            <if test="productionOrderNumber != null  and productionOrderNumber != ''"> and production_order_number = #{productionOrderNumber}</if>
+            <if test="executionMark!=null and executionMark!=''">and execution_mark = #{executionMark}</if>
+            <if test="productionOrderNumber!=null and productionOrderNumber!=''">and production_order_number = #{productionOrderNumber}</if>
+            <if test="orderNumber!=null and orderNumber!=''">and order_number = #{orderNumber}</if>
+            <if test="scanningTimes!=null and scanningTimes[0] != null and scanningTimes[0] != ''">
+                <![CDATA[ and scanning_time >= #{scanningTimes[0]}]]>
+            </if>
+            <if test="scanningTimes!=null and scanningTimes[1] != null and scanningTimes[0] != ''">
+                <![CDATA[ and scanning_time <= #{scanningTimes[0]}]]>
+            </if>
+             and order_number is not null
+        </where>
+        order by  scanning_time,process_name
+    </select>
 
 
     <insert id="insertRingScanInformation" parameterType="com.zkqy.amichi.domain.RingScanInformation" useGeneratedKeys="true" keyProperty="id">

+ 56 - 35
zkqy-fujian-amichi/src/main/resources/storage.json

@@ -9,7 +9,7 @@
   "NumberSearch": "true",
   "IsAutoAdjustField": "false",
   "InterationFlags": "",
-  "IgnoreInterationFlag": "true",
+  "IgnoreInterationFlag": "",
   "IsControlPrecision": "false",
   "ValidateRepeatJson": "false",
   "Model": {
@@ -17,7 +17,7 @@
     "FBillType": {
       "FNUMBER": "SCRKD01_SYS"
     },
-    "FDate": "2024-12-07 00:00:00",
+    "FDate": "2024-12-14 00:00:00",
     "FOwnerTypeId0": "BD_OwnerOrg",
     "FOwnerId0": {
       "FNumber": "100"
@@ -30,53 +30,74 @@
     "F_PONP_PrintTimes": 0,
     "FEntity": [
       {
-        "FInStockType": "1",
-        "FIsNew": "false",
-        "FProductType": "1",
-        "FMoId": "166810",
-        "FMoEntryId": "168691",
-        "FMOMAINENTRYID": "168691",
-        "FMoEntrySeq": "1",
-        "FSrcEntryId": "168691",
-        "FSrcBillType": "PRD_MORPT",
-        "FSrcInterId": "168691",
-        "FSrcBillNo": "MO046723",
-        "FSrcEntrySeq": "1",
-        "FMaterialId":{
-          "FNumber": "1010040010147"
+        "F_PONP_HBRQ": "2024-12-14 00:00:00",
+        "FSrcEntryId": 102067,
+        "FIsNew": false,
+        "FMaterialId": {
+          "FNumber": "1010010010005"
         },
+        "FCheckProduct": false,
+        "FProductType": "1",
+        "FInStockType": "1",
         "FUnitID": {
-          "FNumber": "UOM001"
+          "FNumber": "Pcs"
         },
+        "FMustQty": 1.0,
+        "FRealQty": 1.0,
+        "FCostRate": 100.0000000000,
         "FBaseUnitId": {
-          "FNumber": "UOM001"
+          "FNumber": "Pcs"
         },
+        "FBaseMustQty": 1.0,
+        "FBaseRealQty": 1.0,
         "FOwnerTypeId": "BD_OwnerOrg",
-        "FOWNERID": {
+        "FOwnerId": {
           "FNumber": "100"
         },
-        "FSTOCKID": {
-          "FNumber": "CK007"
+        "FStockId": {
+          "FNumber": "CK006"
+        },
+        "FISBACKFLUSH": true,
+        "FWorkShopId1": {
+          "FNumber": "BM000003"
+        },
+        "FMoBillNo": "MO046746",
+        "FMoId": 166833,
+        "FMoEntryId": 168714,
+        "FMoEntrySeq": 1,
+        "FStockUnitId": {
+          "FNumber": "UOM001"
         },
-        "FMoBillNo": "MO046723",
-        "FSTOCKSTATUSID": {
+        "FStockRealQty": 1.0,
+        "FSecRealQty": 0.0,
+        "FSrcBillType": "PRD_MORPT",
+        "FSrcInterId": 101306,
+        "FSrcBillNo": "SCHB00001092",
+        "FBasePrdRealQty": 1.0,
+        "FIsFinished": false,
+        "FStockStatusId": {
           "FNumber": "KCZT01_SYS"
         },
-        "FKEEPERTYPEID": "BD_KeeperOrg",
-        "FKEEPERID": {
+        "FSrcEntrySeq": 1,
+        "FMOMAINENTRYID": 168714,
+        "FKeeperTypeId": "BD_KeeperOrg",
+        "FKeeperId": {
           "FNumber": "100"
         },
-        "FMustQty": 1,
-        "FRealQty":1,
-        "FCheckProduct": false,
-        "FEntity_Link": [{
-          "FEntity_Link_FRuleId": "PRD_MO2INSTOCK",
-          "FEntity_Link_FSTableName": "T_PRD_MORPTENTRY",
-          "FEntity_Link_FSBillId": "168691",
-          "FEntity_Link_FSId": "168691"
-        }]
+        "FSelReStkQty": 0.0,
+        "FBaseSelReStkQty": 0.0,
+        "FIsOverLegalOrg": false,
+        "FSerialSubEntity": [
+          {
+            "FSerialNo": "240116007",
+            "FSerialId": {
+              "FNumber": "240116007"
+            },
+            "FQty": 1.0,
+            "FBaseSNQty": 1.0000000000
+          }
+        ]
       }
     ]
-
   }
 }

+ 1 - 1
zkqy-ui/src/views/amichi/dialogCompments/customizedVersion/components/TaskItem.vue

@@ -10,7 +10,7 @@
     <div style="width: 100%">
       <div class="task-title">
         <span class="mr5">工序名称:</span>
-        <span class="mr5">{{itemData.sort}}.{{itemData.processName}}</span>
+        <span class="mr5">{{itemData.processName}}</span>
       </div>
       <div class="completedQuantity">
         <span class="mr5">任务数量:</span>

+ 1 - 1
zkqy-ui/src/views/amichi/dialogCompments/customizedVersion/components/taskList.vue

@@ -154,7 +154,7 @@ export default {
       /* // justify-content: space-around;\ */
       .card-item {
         margin-right: 15px;
-        flex: 0 0 20%; /* 每个子项占据 20% 的空间,总共五个子项 */
+        flex: 0 0 19.3%; /* 每个子项占据 20% 的空间,总共五个子项 */
         &:last-child {
           margin-right: 0;
         }

+ 4 - 4
zkqy-ui/src/views/amichi/ringScanInformation/index.vue

@@ -47,9 +47,9 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="订单号" prop="orderumber">
+      <el-form-item label="订单号" prop="orderNumber">
         <el-input
-          v-model="queryParams.orderumber"
+          v-model="queryParams.orderNumber"
           placeholder="请输入订单号"
           clearable
           @keyup.enter.native="handleQuery"
@@ -102,8 +102,8 @@
 <!--        </template>-->
       </el-table-column>
 <!--      <el-table-column label="实际序列号" align="center" prop="nativeNumbering" />-->
-      <el-table-column label="订单号" align="center" prop="orderNumber" />
-      <el-table-column label="生产订单号" align="center" prop="demandDocument" />
+      <el-table-column label="生产订单号" align="center" prop="orderNumber" />
+      <el-table-column label="订单号" align="center" prop="demandDocument" />
       <el-table-column label="物料编码" align="center" prop="materialCode" />
       <el-table-column label="物料名称" align="center" prop="materialName" />
       <el-table-column label="型号" align="center" prop="model" />

+ 8 - 8
zkqy-ui/src/views/amichi/stationInformation/indexCopyV4.vue

@@ -97,14 +97,14 @@
 
     <el-table v-loading="loading" :data="stationInformationList" @selection-change="handleSelectionChange" style="margin-top: 20px">
       <el-table-column type="selection" width="55" align="center" />
-<!--      <el-table-column label="工序"  align="center" prop="processId">-->
-<!--        <template  v-slot="scope">-->
-<!--           <span v-for="option in processList" :key="option.value" v-if="option.value == scope.row.processId" class="custom-label">-->
-<!--                   {{ option.label }}-->
-<!--           </span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-            <el-table-column label="工序"  align="center" prop="processName"/>
+      <el-table-column label="工序"  align="center" prop="processId">
+        <template  v-slot="scope">
+           <span v-for="option in processList" :key="option.value" v-if="option.value == scope.row.processId" class="custom-label">
+                   {{ option.label }}
+           </span>
+        </template>
+      </el-table-column>
+<!--            <el-table-column label="工序"  align="center" prop="processName"/>-->
       <el-table-column label="工位名称" align="center" prop="stationName" />
       <el-table-column label="人员姓名" align="center" prop="personnelName"/>
       <el-table-column label="设备mac" align="center"  prop="deviceNumber" />

+ 1 - 1
zkqy-ui/src/views/login.vue

@@ -310,7 +310,7 @@ export default {
                uri: "?client_id=hmc&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.1.249:8066/oauth/callback",
                // uri:"?client_id=mestools&scope=basic&response_type=code&state=AB1357&redirect_uri=http://62.234.61.92:8055/oauth/callback",
                // uri:"?client_id=mestools&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.128.171:8066/oauth/callback",
-              //  uri:"?client_id=mestools&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.2.135:8066/oauth/callback",
+               // uri:"?client_id=mestools&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.2.135:8066/oauth/callback",
              //uri:"?client_id=hmc&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.110.85:8066/oauth/callback",
              //uri:"?client_id=hmc&scope=basic&response_type=code&state=AB1357&redirect_uri=http://192.168.110.83:8066/oauth/callback",
             // uri:"?client_id=hmc&scope=basic&response_type=code&state=AB1357&redirect_uri=http://172.20.10.5:8066/oauth/callback",