diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/CustomPlateNoGenerateServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/CustomPlateNoGenerateServiceImpl.java index 2c9dd981e..f40529648 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/CustomPlateNoGenerateServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/CustomPlateNoGenerateServiceImpl.java @@ -123,10 +123,10 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe // 遍历规则列表 for (CustomPlateNoRuleVO plateNoRule : orgCustomPlateNoRuleVOList) { if (ObjectUtil.equal(CustomPlateNoRuleCodeEnum.CUSTOM.getRuleCode(), plateNoRule.getRuleCode())) { - plateDO.getCustomPlateNoBuilder().append(plateNoRule.getValue()); + plateDO.getCustomPlateNoBuilder().append(plateNoRule.getStrValue()); } if (ObjectUtil.equal(CustomPlateNoRuleCodeEnum.DATE.getRuleCode(), plateNoRule.getRuleCode())) { - plateDO.getCustomPlateNoBuilder().append(plateNoRule.getNow().format(DateTimeFormatter.ofPattern(plateNoRule.getValue()))); + plateDO.getCustomPlateNoBuilder().append(plateNoRule.getNow().format(DateTimeFormatter.ofPattern(plateNoRule.getDateValue()))); } // 遍历规则生成服务列表,获取对应的规则服务 for (CustomPlateNoGenerateRuleService ruleService : ruleServices) { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/vo/CustomPlateNoRuleVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/vo/CustomPlateNoRuleVO.java index 47c8713d3..ea2517df3 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/vo/CustomPlateNoRuleVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/customplateno/vo/CustomPlateNoRuleVO.java @@ -21,9 +21,14 @@ public class CustomPlateNoRuleVO implements Serializable { private String ruleCode; /** - * 规则值 + * 自定义类型字符串规则值 */ - private String value; + private String strValue; + + /** + * 时间类型字符串规则值 + */ + private String dateValue; /** * 初始值 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 a62b981b4..620bd8ff9 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,15 @@ 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(Integer.parseInt(nowYearFormat)); + orgCustomPlateNoSeqRespDTO.setLastYear(nowDayNum); // 复位 - return initValue; + return nowDayNum; } - return curr + plateNoRule.getIncrementStep(); + return curr; } /** @@ -188,15 +188,15 @@ 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(Integer.parseInt(nowMonthFormat)); + orgCustomPlateNoSeqRespDTO.setLastMonth(nowDayNum); // 复位 - return initValue; + return nowDayNum; } - return curr + plateNoRule.getIncrementStep(); + return curr; } /** @@ -210,14 +210,14 @@ 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(Integer.parseInt(nowDayFormat)); + orgCustomPlateNoSeqRespDTO.setLastDay(nowDayNum); // 复位 - return initValue; + return nowDayNum; } - return curr + plateNoRule.getIncrementStep(); + return curr; } } diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/systemconfig/factory/service/impl/CustomPlateNoServiceHandler.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/systemconfig/factory/service/impl/CustomPlateNoServiceHandler.java index 58fd5b583..c93a127ed 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/systemconfig/factory/service/impl/CustomPlateNoServiceHandler.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/systemconfig/factory/service/impl/CustomPlateNoServiceHandler.java @@ -113,7 +113,7 @@ public class CustomPlateNoServiceHandler extends AbstractSystemConfigServiceHand checkCustom(custBoardRuleCodeEnum, jsonObject); // 3.时间格式校验 - checkDateFormat(custBoardRuleCodeEnum, jsonObject.getString("value"), dateTypeFormatDictList); + checkDateFormat(custBoardRuleCodeEnum, jsonObject.getString("dateValue"), dateTypeFormatDictList); // 4.序号类型校验数字和布尔类型 checkNoType(custBoardRuleCodeEnum, jsonObject); @@ -169,7 +169,7 @@ public class CustomPlateNoServiceHandler extends AbstractSystemConfigServiceHand */ private void checkCustom(CustomPlateNoRuleCodeEnum custBoardRuleCodeEnum, JSONObject jsonObject) { if (ObjectUtil.equal(CustomPlateNoRuleCodeEnum.CUSTOM, custBoardRuleCodeEnum)) { - if (ObjectUtil.isEmpty(jsonObject.get("value"))) { + if (ObjectUtil.isEmpty(jsonObject.get("strValue"))) { throw ServiceExceptionUtil.exception(CUSTOM_PLATE_NO_RULE_CHECK_CUSTOM_VALUE_EMPTY_ERROR, jsonObject.get("ruleCode")); } }