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);