From e8a4f89378426692ee0648acb99c94adfad84711 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Tue, 11 Feb 2025 12:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93#1094=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Aapi=E5=AF=BC=E5=85=A5=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=9D=BF=E7=BC=96=E5=8F=B7=E7=B4=AF=E5=8A=A0?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrderNoGenerateRuleServiceImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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(); } }