瀏覽代碼

接触洗消点个数限制

wwh 1 年之前
父節點
當前提交
d19d2c78ba

+ 22 - 12
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java

@@ -173,13 +173,17 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
-                if (allLocationId.length() > 9) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2");
-                } else {
-                    baseProcess.setAllLocationStatus("2,2,2");
+                String[] strings = allLocationId.split(",");
+                String ss2 = "";
+                for (int i = 0; i < strings.length; i++) {
+                    strings[i].replaceAll(strings[i], "2");
+                    if (i == strings.length - 1) {
+                        ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                    } else {
+                        ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                    }
                 }
+                baseProcess.setAllLocationStatus(ss2);
             } else {
                 String[] strings = allLocationId.split(",");
                 Integer index = 0;
@@ -282,15 +286,21 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                     inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
-                if (allLocationId.length() > 9) {
-                    if (index == 1) {
-                        baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+
+                Integer locationId = cleanBefore.getTestLocationId();
+                int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                String[] split1 = substring.split(",");
+                String sb2 = "";
+                for (int i = 0; i < split1.length; i++) {
+                    if (i == split1.length - 1) {
+                        sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                     } else {
-                        baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                        sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                     }
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,1,0");
                 }
+                sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                baseProcess.setAllLocationStatus(sb2);
             }
         } else if (nextId == 1) {
             //新增采样

+ 43 - 24
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java

@@ -912,13 +912,17 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 if (nextId == 0) {
                     if (splits.length == 1) {
                         baseProcess.setProcessType(1);
-                        if (allLocationId.length() > 9) {
-                            baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                        } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                            baseProcess.setAllLocationStatus("2,2,2,2,2");
-                        } else {
-                            baseProcess.setAllLocationStatus("2,2,2");
+                        String[] strings = allLocationId.split(",");
+                        String ss2 = "";
+                        for (int i = 0; i < strings.length; i++) {
+                            strings[i].replaceAll(strings[i], "2");
+                            if (i == strings.length - 1) {
+                                ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                            } else {
+                                ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                            }
                         }
+                        baseProcess.setAllLocationStatus(ss2);
                     }  else {
                         String[] strings = allLocationId.split(",");
                         Integer index = 0;
@@ -1021,15 +1025,20 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             inventoryMapper.insert(before);
                         }
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
-                        if (allLocationId.length() > 9) {
-                            if (index == 1) {
-                                baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                        Integer locationId = billClean.getTestLocationId();
+                        int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                        String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                        String[] split1 = substring.split(",");
+                        String sb2 = "";
+                        for (int i = 0; i < split1.length; i++) {
+                            if (i == split1.length - 1) {
+                                sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                             } else {
-                                baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                                sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                             }
-                        } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                            baseProcess.setAllLocationStatus("2,2,2,1,0");
                         }
+                        sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                        baseProcess.setAllLocationStatus(sb2);
                     }
                 } else if (nextId == 1) {
                     //新增采样
@@ -1204,13 +1213,17 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     if (nextId == 0) {
                         if (splits.length == 1) {
                             baseProcess.setProcessType(1);
-                            if (allLocationId.length() > 9) {
-                                baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                            } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                                baseProcess.setAllLocationStatus("2,2,2,2,2");
-                            } else {
-                                baseProcess.setAllLocationStatus("2,2,2");
+                            String[] strings = allLocationId.split(",");
+                            String ss2 = "";
+                            for (int i = 0; i < strings.length; i++) {
+                                strings[i].replaceAll(strings[i], "2");
+                                if (i == strings.length - 1) {
+                                    ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                                } else {
+                                    ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                                }
                             }
+                            baseProcess.setAllLocationStatus(ss2);
                         }  else {
                             String[] strings = allLocationId.split(",");
                             Integer index = 0;
@@ -1313,15 +1326,21 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                 inventoryMapper.insert(before);
                             }
                             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
-                            if (allLocationId.length() > 9) {
-                                if (index == 1) {
-                                    baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+
+                            Integer locationId = billClean.getTestLocationId();
+                            int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                            String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                            String[] split1 = substring.split(",");
+                            String sb2 = "";
+                            for (int i = 0; i < split1.length; i++) {
+                                if (i == split1.length - 1) {
+                                    sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                                 } else {
-                                    baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                                    sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                                 }
-                            } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                                baseProcess.setAllLocationStatus("2,2,2,1,0");
                             }
+                            sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                            baseProcess.setAllLocationStatus(sb2);
                         }
                     } else if (nextId == 1) {
                         //新增采样

+ 21 - 12
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -126,13 +126,17 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
-                if (allLocationId.length() > 9) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2");
-                } else {
-                    baseProcess.setAllLocationStatus("2,2,2");
+                String[] strings = allLocationId.split(",");
+                String ss2 = "";
+                for (int i = 0; i < strings.length; i++) {
+                    strings[i].replaceAll(strings[i], "2");
+                    if (i == strings.length - 1) {
+                        ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                    } else {
+                        ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                    }
                 }
+                baseProcess.setAllLocationStatus(ss2);
             } else {
                 String[] strings = allLocationId.split(",");
                 Integer index = 0;
@@ -236,15 +240,20 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
                     inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
-                if (allLocationId.length() > 9) {
-                    if (index == 1) {
-                        baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                Integer locationId = goodsInventory.getTestLocationId();
+                int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                String[] split1 = substring.split(",");
+                String sb2 = "";
+                for (int i = 0; i < split1.length; i++) {
+                    if (i == split1.length - 1) {
+                        sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                     } else {
-                        baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                        sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                     }
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,1,0");
                 }
+                sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                baseProcess.setAllLocationStatus(sb2);
             }
         } else if (nextId == 1) {
             //新增采样

+ 21 - 12
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -1589,13 +1589,17 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         if (nextId == 0) {
             if (splits.length == 1) {
                 baseProcess.setProcessType(1);
-                if (allLocationId.length() > 9) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2");
-                } else {
-                    baseProcess.setAllLocationStatus("2,2,2");
+                String[] strings = allLocationId.split(",");
+                String ss2 = "";
+                for (int i = 0; i < strings.length; i++) {
+                    strings[i].replaceAll(strings[i], "2");
+                    if (i == strings.length - 1) {
+                        ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                    } else {
+                        ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                    }
                 }
+                baseProcess.setAllLocationStatus(ss2);
             }  else {
                 String[] strings = allLocationId.split(",");
                 Integer index = 0;
@@ -1698,15 +1702,20 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                     inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
-                if (allLocationId.length() > 9) {
-                    if (index == 1) {
-                        baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                Integer locationId = billIsolate.getIsolateLocationId();
+                int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                String[] split1 = substring.split(",");
+                String sb2 = "";
+                for (int i = 0; i < split1.length; i++) {
+                    if (i == split1.length - 1) {
+                        sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                     } else {
-                        baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                        sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                     }
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,1,0");
                 }
+                sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                baseProcess.setAllLocationStatus(sb2);
             }
         } else if (nextId == 1) {
             //新增采样

+ 21 - 12
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillSamplingServiceImpl.java

@@ -175,13 +175,17 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
-                if (allLocationId.length() > 9) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2");
-                } else {
-                    baseProcess.setAllLocationStatus("2,2,2");
+                String[] strings = allLocationId.split(",");
+                String ss2 = "";
+                for (int i = 0; i < strings.length; i++) {
+                    strings[i].replaceAll(strings[i], "2");
+                    if (i == strings.length - 1) {
+                        ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                    } else {
+                        ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                    }
                 }
+                baseProcess.setAllLocationStatus(ss2);
             } else {
                 String[] strings = allLocationId.split(",");
                 Integer index = 0;
@@ -284,15 +288,20 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                     inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
-                if (allLocationId.length() > 9) {
-                    if (index == 1) {
-                        baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                Integer locationId = sampling.getTestLocationId();
+                int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                String[] split1 = substring.split(",");
+                String sb2 = "";
+                for (int i = 0; i < split1.length; i++) {
+                    if (i == split1.length - 1) {
+                        sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                     } else {
-                        baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                        sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                     }
-                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                    baseProcess.setAllLocationStatus("2,2,2,1,0");
                 }
+                sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                baseProcess.setAllLocationStatus(sb2);
             }
         } else if (nextId == 1) {
             //新增采样

+ 21 - 12
huimv-receive/src/main/java/com/huimv/receive/timer/SafeTimer.java

@@ -88,13 +88,17 @@ public class SafeTimer {
                 if (nextId == 0) {
                     if (StringUtils.isBlank(splits[1])) {
                         baseProcess.setProcessType(1);
-                        if (allLocationId.length() > 9) {
-                            baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
-                        } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                            baseProcess.setAllLocationStatus("2,2,2,2,2");
-                        } else {
-                            baseProcess.setAllLocationStatus("2,2,2");
+                        String[] strings = allLocationId.split(",");
+                        String ss2 = "";
+                        for (int i = 0; i < strings.length; i++) {
+                            strings[i].replaceAll(strings[i], "2");
+                            if (i == strings.length - 1) {
+                                ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                            } else {
+                                ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                            }
                         }
+                        baseProcess.setAllLocationStatus(ss2);
                     } else {
                         String[] strings = allLocationId.split(",");
                         Integer index = 0;
@@ -197,15 +201,20 @@ public class SafeTimer {
                             inventoryService.save(before);
                         }
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
-                        if (allLocationId.length() > 9) {
-                            if (index == 1) {
-                                baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                        Integer locationId = billIsolate.getIsolateLocationId();
+                        int indexOf = allLocationId.indexOf(locationId);//当前位置在所有流程位置中的下标
+                        String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                        String[] split1 = substring.split(",");
+                        String sb2 = "";
+                        for (int i = 0; i < split1.length; i++) {
+                            if (i == split1.length - 1) {
+                                sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
                             } else {
-                                baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                                sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
                             }
-                        } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
-                            baseProcess.setAllLocationStatus("2,2,2,1,0");
                         }
+                        sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                        baseProcess.setAllLocationStatus(sb2);
                     }
                 } else if (nextId == 1) {
                     //新增采样