ezhizao_zx 5 月之前
父节点
当前提交
9a8b390c34

+ 4 - 4
src/main/java/cn/ezhizao/project/business/product/controller/BizProcessInspecionController.java

@@ -913,7 +913,7 @@ public class BizProcessInspecionController extends BaseController {
         if (previous.isEmpty() || !previous.startsWith(beginCode)) {
             previous = (beginCode + "000001");
         } else {
-            codeValue = previous;
+            codeValue =  previous.startsWith(beginCode) ? previous : beginCode + "000000";
             int lastFourDigits = Integer.parseInt(codeValue.substring(7, 13));
             lastFourDigits += 1; // 加1
             codeValue = codeValue.substring(0, 7) + String.format("%06d", lastFourDigits);
@@ -1104,7 +1104,7 @@ public class BizProcessInspecionController extends BaseController {
                 previous = (beginCode + "000001");
             }
         } else {
-            codeValue = previous;
+            codeValue = previous.startsWith(beginCode) ? previous : beginCode + "000000";
             int lastFourDigits = Integer.parseInt(codeValue.substring(7, 13));
             lastFourDigits ++; // 加1
             codeValue = codeValue.substring(0, 7) + String.format("%06d", lastFourDigits);
@@ -3870,7 +3870,7 @@ public class BizProcessInspecionController extends BaseController {
                     previous = (beginCode + "000001");
                 }
             } else {
-                codeValue = previous;
+                codeValue = previous.startsWith(beginCode) ? previous : beginCode + "000000";
                 int lastFourDigits = Integer.parseInt(codeValue.substring(7, 13));
                 lastFourDigits ++; // 加1
                 codeValue = codeValue.substring(0, 7) + String.format("%06d", lastFourDigits);
@@ -4177,7 +4177,7 @@ public class BizProcessInspecionController extends BaseController {
                 previous = (beginCode + "000001");
             }
         } else {
-            codeValue = previous;
+            codeValue = previous.startsWith(beginCode) ? previous : beginCode + "000000";
             int lastFourDigits = Integer.parseInt(codeValue.substring(7, 13));
             lastFourDigits ++; // 加1
             codeValue = codeValue.substring(0, 7) + String.format("%06d", lastFourDigits);