This commit is contained in:
lym
2024-12-05 18:03:41 +08:00
6 changed files with 129 additions and 37 deletions
@@ -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<PlateDO> 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);