mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
1、自定义板编号生成获取配置空异常处理;2、新增自定义板编号生成执行时间记录;
This commit is contained in:
+7
-1
@@ -24,6 +24,7 @@ import com.cf.imes.module.system.enums.customplateno.CustomPlateNoRuleCodeEnum;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StopWatch;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -61,6 +62,9 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateCustomPlateNo(OrderDO orderDO, List<PlateDO> plateDOList, boolean newOrder) {
|
public void generateCustomPlateNo(OrderDO orderDO, List<PlateDO> plateDOList, boolean newOrder) {
|
||||||
|
// 执行时间记录
|
||||||
|
StopWatch stopWatch = new StopWatch();
|
||||||
|
stopWatch.start();
|
||||||
Long orderId = orderDO.getId();
|
Long orderId = orderDO.getId();
|
||||||
// 1、获取生产配置
|
// 1、获取生产配置
|
||||||
CustomPlateNoGenerateConfigVO generateConfig = getGenerateConfig(orderId);
|
CustomPlateNoGenerateConfigVO generateConfig = getGenerateConfig(orderId);
|
||||||
@@ -102,6 +106,8 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe
|
|||||||
if (orgCustomPlateNoSeqModifyResult.isError() || !orgCustomPlateNoSeqModifyResult.getData().booleanValue()) {
|
if (orgCustomPlateNoSeqModifyResult.isError() || !orgCustomPlateNoSeqModifyResult.getData().booleanValue()) {
|
||||||
throw new ServiceException(ErrorCodeConstants.CUSTOM_PLATENO_GENERATE_ORG_CUSTOM_PLATENO_SEQ_MODIFY_ERROR);
|
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)
|
customPlateNoRuleVOS = Optional.ofNullable(orgCustomPlateNoConfig)
|
||||||
.map(config -> JSON.parseArray(config.getSetting(), CustomPlateNoRuleVO.class))
|
.map(config -> JSON.parseArray(config.getSetting(), CustomPlateNoRuleVO.class))
|
||||||
.orElse(List.of());
|
.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);
|
OrderDO order = orderService.getOrder(orderId);
|
||||||
|
|||||||
Reference in New Issue
Block a user