wwh 1 рік тому
батько
коміт
d0db5d39ec

+ 25 - 22
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java

@@ -196,7 +196,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
     }
 
     @Override
-    public Result commitClean(HttpServletRequest httpServletRequest,String farmId, String id, String date, String result
+    public Result commitClean(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result
             , MultipartFile img1, MultipartFile img2, MultipartFile img3) throws ParseException, IOException {
 
         String s1 = "";
@@ -223,7 +223,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             }
             s3 = "," + uploadImage.uploadImg(img3);
         }
-        String s = s1 + s2 + s3 ;
+        String s = s1 + s2 + s3;
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
         if (StringUtils.isBlank(date)) {
@@ -347,7 +347,6 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 }
 
 
-
                 if (baseLocation.getId() == 4) {
                     QueryWrapper<BillPcr> queryWrapper1 = new QueryWrapper<>();
                     queryWrapper1.eq("farm_id", farmId).eq("process_id", baseProcess.getId()).eq("test_location_id", 4);
@@ -380,14 +379,14 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             split1[3] = "2";
                             split1[4] = "1";
                             baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + "," + split1[4] + status.substring(9));
-                        }else {
+                        } else {
                             String status = baseProcess.getAllLocationStatus();
                             String[] split1 = status.split(",");
                             split1[0] = "2";
                             split1[1] = "2";
                             split1[2] = "2";
                             split1[3] = "1";
-                            baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3]  + status.substring(7));
+                            baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + status.substring(7));
                         }
 
                     } else {
@@ -409,7 +408,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         isolate.setIsolateLocationId(baseLocation.getNextId());
                         isolateMapper.insert(isolate);
 
-                        if (exist.getExist()==0) {
+                        if (exist.getExist() == 0) {
                             String status = baseProcess.getAllLocationStatus();
                             String[] split1 = status.split(",");
                             split1[0] = "2";
@@ -418,14 +417,14 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             split1[3] = "2";
                             split1[4] = "2";
                             baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + "," + split1[4] + "," + "1");
-                        }else {
+                        } else {
                             String status = baseProcess.getAllLocationStatus();
                             String[] split1 = status.split(",");
                             split1[0] = "2";
                             split1[1] = "2";
                             split1[2] = "2";
                             split1[3] = "2";
-                            baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3]  + "," + "1");
+                            baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + "," + "1");
                         }
 
 
@@ -468,13 +467,17 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 if (baseProcess.getDestId() == 2) {
                     baseProcess.setAllLocationStatus("2,3,0");
                 }
-                if (baseProcess.getDestId() == 3) {
-                    baseProcess.setAllLocationStatus("2,2,3");
-                }
-                if (baseProcess.getDestId() == 4) {
-                    baseProcess.setAllLocationStatus("2,2,2,3");
+                if (baseProcess.getDestId() >= 3 && baseLocation.getId() == 3) {
+                    String status = baseProcess.getAllLocationStatus();
+                    String[] split1 = status.split(",");
+                    split1[0] = "2";
+                    split1[1] = "2";
+                    split1[2] = "2";
+                    split1[3] = "3";
+                    baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + status.substring(7));
                 }
 
+
                 if (baseLocation.getId() == 1 && baseProcess.getDestId() > 2) {
                     String status = baseProcess.getAllLocationStatus();
                     String[] split1 = status.split(",");
@@ -484,7 +487,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     split1[3] = "0";
                     baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + status.substring(7));
                 }
-                if (baseLocation.getId() == 3 || baseLocation.getId() == 4) {
+                if (baseLocation.getId() == 4 && exist.getExist() == 0) {
                     String status = baseProcess.getAllLocationStatus();
                     String[] split1 = status.split(",");
                     split1[0] = "2";
@@ -494,7 +497,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     split1[4] = "3";
                     baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + "," + split1[2] + "," + split1[3] + "," + split1[4] + status.substring(9));
                 }
-                if (exist.getExist() == 1 && baseProcess.getDestId() > 2) {
+                if (exist.getExist() == 1 && baseProcess.getDestId() > 2 && baseLocation.getId() == 4) {
                     String status = baseProcess.getAllLocationStatus();
                     String[] split1 = status.split(",");
                     split1[0] = "2";
@@ -968,7 +971,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     if (billClean.getTestLocationId() == 6) {
                         split[0] = "2";
                         split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                     }
                     if (billClean.getTestLocationId() == 7) {
                         split[0] = "2";
@@ -979,12 +982,12 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     if (billClean.getTestLocationId() == 9) {
                         split[0] = "2";
                         split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                     }
                     if (billClean.getTestLocationId() == 10) {
                         split[0] = "2";
                         split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                     }
                     if (billClean.getTestLocationId() == 11) {
                         baseProcess.setAllLocationStatus("2,3");
@@ -993,7 +996,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     processMapper.updateById(baseProcess);
                 }
                 return new Result(10000, "修改成功!", true);
-            }  else {
+            } else {
                 //当前是目的地
                 if ("1".equals(result)) {
                     billClean.setBillStatus(1);
@@ -1016,7 +1019,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 if (billClean.getTestLocationId() == 6) {
                     split[0] = "2";
                     split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                 }
                 if (billClean.getTestLocationId() == 7) {
                     split[0] = "2";
@@ -1027,12 +1030,12 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 if (billClean.getTestLocationId() == 9) {
                     split[0] = "2";
                     split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                 }
                 if (billClean.getTestLocationId() == 10) {
                     split[0] = "2";
                     split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1]  + status1.substring(3));
+                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
                 }
                 if (billClean.getTestLocationId() == 11) {
                     baseProcess.setAllLocationStatus("2,3");