mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
自定义板编号配置:1、前端入参自定义类型、时间类型value字段名调整;2、时间类型复位问题修复;
This commit is contained in:
+2
-2
@@ -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) {
|
||||
|
||||
+7
-2
@@ -21,9 +21,14 @@ public class CustomPlateNoRuleVO implements Serializable {
|
||||
private String ruleCode;
|
||||
|
||||
/**
|
||||
* 规则值
|
||||
* 自定义类型字符串规则值
|
||||
*/
|
||||
private String value;
|
||||
private String strValue;
|
||||
|
||||
/**
|
||||
* 时间类型字符串规则值
|
||||
*/
|
||||
private String dateValue;
|
||||
|
||||
/**
|
||||
* 初始值
|
||||
|
||||
+12
-12
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user