diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplatenorule/OrderNoGenerateRuleServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplatenorule/OrderNoGenerateRuleServiceImpl.java index 620bd8ff9..f0fb76625 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplatenorule/OrderNoGenerateRuleServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplatenorule/OrderNoGenerateRuleServiceImpl.java @@ -166,15 +166,17 @@ public class OrderNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule private int resetByYear(int curr, CustomPlateNoSeqDTO orgCustomPlateNoSeqRespDTO, CustomPlateNoRuleVO plateNoRule) { // 上一次的年 Integer lastYear = orgCustomPlateNoSeqRespDTO.getLastYear(); + // 初始值 + Integer initValue = plateNoRule.getInitValue(); String nowYearFormat = plateNoRule.getNow().format(YEAR_FORMATTER); if (ObjectUtil.notEqual(String.valueOf(lastYear), nowYearFormat)) { int nowDayNum = Integer.parseInt(nowYearFormat); // 跨年,把上一次的年设成当前年,后续不再跨年 orgCustomPlateNoSeqRespDTO.setLastYear(nowDayNum); // 复位 - return nowDayNum; + return initValue; } - return curr; + return curr + plateNoRule.getIncrementStep(); } /** @@ -188,15 +190,17 @@ public class OrderNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule private int resetByMonth(int curr, CustomPlateNoSeqDTO orgCustomPlateNoSeqRespDTO, CustomPlateNoRuleVO plateNoRule) { // 上一次的月 Integer lastMonth = orgCustomPlateNoSeqRespDTO.getLastMonth(); + // 初始值 + Integer initValue = plateNoRule.getInitValue(); String nowMonthFormat = plateNoRule.getNow().format(MONTH_FORMATTER); if (ObjectUtil.notEqual(String.valueOf(lastMonth), nowMonthFormat)) { int nowDayNum = Integer.parseInt(nowMonthFormat); // 跨月,把上一次的月设成当前月,后续不再跨月 orgCustomPlateNoSeqRespDTO.setLastMonth(nowDayNum); // 复位 - return nowDayNum; + return initValue; } - return curr; + return curr + plateNoRule.getIncrementStep(); } /** @@ -210,14 +214,16 @@ public class OrderNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule private int resetByDay(int curr, CustomPlateNoSeqDTO orgCustomPlateNoSeqRespDTO, CustomPlateNoRuleVO plateNoRule) { // 上一次的天 Integer lastDay = orgCustomPlateNoSeqRespDTO.getLastDay(); + // 初始值 + Integer initValue = plateNoRule.getInitValue(); String nowDayFormat = plateNoRule.getNow().format(DAY_FORMATTER); if (ObjectUtil.notEqual(String.valueOf(lastDay), nowDayFormat)) { int nowDayNum = Integer.parseInt(nowDayFormat); // 跨月,把上一次的月设成当前月,后续不再跨月 orgCustomPlateNoSeqRespDTO.setLastDay(nowDayNum); // 复位 - return nowDayNum; + return initValue; } - return curr; + return curr + plateNoRule.getIncrementStep(); } }