From b00d9221dd5369cb9e45a4a1f2303ec636e86895 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Wed, 22 Jan 2025 14:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=9D=BF=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E9=85=8D=E7=BD=AE=EF=BC=9A=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89/=E6=97=B6=E9=97=B4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=85=8D=E7=BD=AE=E5=80=BC=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E8=AF=A5=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customplateno/CustomPlateNoGenerateServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 f40529648..bb6c2cd25 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 @@ -22,6 +22,7 @@ import com.cf.imes.module.system.api.systemconfig.SystemConfigApi; import com.cf.imes.module.system.api.systemconfig.dto.SystemConfigRespDTO; import com.cf.imes.module.system.enums.customplateno.CustomPlateNoRuleCodeEnum; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.util.StopWatch; @@ -123,10 +124,13 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe // 遍历规则列表 for (CustomPlateNoRuleVO plateNoRule : orgCustomPlateNoRuleVOList) { if (ObjectUtil.equal(CustomPlateNoRuleCodeEnum.CUSTOM.getRuleCode(), plateNoRule.getRuleCode())) { - plateDO.getCustomPlateNoBuilder().append(plateNoRule.getStrValue()); + plateDO.getCustomPlateNoBuilder().append(Optional.ofNullable(plateNoRule.getStrValue()).orElse("")); } if (ObjectUtil.equal(CustomPlateNoRuleCodeEnum.DATE.getRuleCode(), plateNoRule.getRuleCode())) { - plateDO.getCustomPlateNoBuilder().append(plateNoRule.getNow().format(DateTimeFormatter.ofPattern(plateNoRule.getDateValue()))); + String dateValue = plateNoRule.getDateValue(); + if (StringUtils.isNotEmpty(dateValue)) { + plateDO.getCustomPlateNoBuilder().append(plateNoRule.getNow().format(DateTimeFormatter.ofPattern(dateValue))); + } } // 遍历规则生成服务列表,获取对应的规则服务 for (CustomPlateNoGenerateRuleService ruleService : ruleServices) {