guoyujia 1 жил өмнө
parent
commit
746998a428

+ 3 - 3
src/main/java/cn/ezhizao/project/business/controller/BizReturnReceiptController.java

@@ -94,12 +94,12 @@ public class BizReturnReceiptController extends BaseController
             String previous = redisCache.hasKey(codeType) ? redisCache.getCacheObject(codeType) :"";
             //若不存在,则直接存入
             if (previous.isEmpty()) {
-                previous = ("HX" + formattedDate + "000001");
+                previous = ("SHD" + formattedDate + "000001");
             } else {
                 codeValue=previous;
-                int lastFourDigits = Integer.parseInt(codeValue.substring(3, 8));
+                int lastFourDigits = Integer.parseInt(codeValue.substring(5, 10));
                 lastFourDigits += 1; // 加1
-                codeValue = codeValue.substring(0, 3) + String.format("%03d", lastFourDigits);
+                codeValue = codeValue.substring(0, 5) + String.format("%05d", lastFourDigits);
                 previous=codeValue;
             }
             //存到redis中