Browse Source

跨年编号获取调整

user5 1 year ago
parent
commit
2213fc45c0

+ 6 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/serialNumTpl/service/SerialnumTplService.java

@@ -111,6 +111,9 @@ public class SerialnumTplService {
                 throw new Exception("生成编号失败,请稍后重试");
             }
             String num = String.valueOf(numTpl.getSerialNum() + 1);
+            if(!year.equals(numTpl.getYearBuilt())){
+                num = "1";
+            }
             StringBuffer sb = new StringBuffer();
             for (int x = 0; x < (numTpl.getSerialNumLen() - num.length()); x++) {
                 sb.append("0");
@@ -265,6 +268,9 @@ public class SerialnumTplService {
                 throw new Exception("生成编号失败,请稍后重试");
             }
             String num = String.valueOf(numTpl.getSerialNum() + 1);
+            if(!year.equals(numTpl.getYearBuilt())){
+                num = "1";
+            }
             StringBuffer sb = new StringBuffer();
 //            for (int x = 0; x < (numTpl.getSerialNumLen() - num.length()); x++) {
 //                sb.append("0");