From 49b588d621af67082b3d26f61100da2d94943810 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Wed, 4 Dec 2024 17:29:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=87=AA=E5=AE=9A=E4=B9=89=E6=9D=BF?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E7=94=9F=E6=88=90=E8=8E=B7=E5=8F=96=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=A9=BA=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=EF=BC=9B?= =?UTF-8?q?2=E3=80=81=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=9D=BF=E7=BC=96=E5=8F=B7=E7=94=9F=E6=88=90=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=AE=B0=E5=BD=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customplateno/CustomPlateNoGenerateServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 1e7a4633c..2c9dd981e 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 @@ -24,6 +24,7 @@ import com.cf.imes.module.system.enums.customplateno.CustomPlateNoRuleCodeEnum; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +import org.springframework.util.StopWatch; import javax.annotation.Resource; import java.time.LocalDateTime; @@ -61,6 +62,9 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe @Override public void generateCustomPlateNo(OrderDO orderDO, List plateDOList, boolean newOrder) { + // 执行时间记录 + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); Long orderId = orderDO.getId(); // 1、获取生产配置 CustomPlateNoGenerateConfigVO generateConfig = getGenerateConfig(orderId); @@ -102,6 +106,8 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe if (orgCustomPlateNoSeqModifyResult.isError() || !orgCustomPlateNoSeqModifyResult.getData().booleanValue()) { throw new ServiceException(ErrorCodeConstants.CUSTOM_PLATENO_GENERATE_ORG_CUSTOM_PLATENO_SEQ_MODIFY_ERROR); } + stopWatch.stop(); + log.info("生成板编号耗时:{} seconds", stopWatch.getTotalTimeSeconds()); } /** @@ -158,7 +164,7 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe customPlateNoRuleVOS = Optional.ofNullable(orgCustomPlateNoConfig) .map(config -> JSON.parseArray(config.getSetting(), CustomPlateNoRuleVO.class)) .orElse(List.of()); - customPlateNoGenerateConfigVO.setOrgCustomPlateNoConfigId(Optional.ofNullable(orgCustomPlateNoConfig.getId()).orElse(null)); + customPlateNoGenerateConfigVO.setOrgCustomPlateNoConfigId(Optional.ofNullable(orgCustomPlateNoConfig).map(SystemConfigRespDTO::getId).orElse(null)); } OrderDO order = orderService.getOrder(orderId);