diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index cb8f73a9..47c5c856 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -22,6 +22,8 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService; import com.foreverwin.mesnac.common.util.ERPAPI; import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.StringUtil; +import com.foreverwin.mesnac.dispatch.model.SfcDispatch; +import com.foreverwin.mesnac.dispatch.service.SfcDispatchService; import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.mesnac.meapi.dto.BomComponentDto; @@ -103,7 +105,8 @@ public class PodTemplateServiceImpl implements PodTemplateService { private SfcDispatchCommonService sfcDispatchCommonService; @Autowired private ResrceMapper resrceMapper; - + @Autowired + private SfcDispatchService sfcDispatchService; @Override @@ -273,6 +276,7 @@ public class PodTemplateServiceImpl implements PodTemplateService { String stepId = sfcDto.getStepId(); String dispatchNo = sfcDto.getDispatchNo(); + SfcDispatch sfcDispatchById = sfcDispatchService.getById(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo)); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); String status = StringUtil.trimHandle(sfcServiceById.getStatusBo()); if (status.equals("404")) { @@ -337,7 +341,9 @@ public class PodTemplateServiceImpl implements PodTemplateService { inspectionTaskService.createTask(paramMap); } //计算工时 - LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc)); + //LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc)); + // 派工表实际开始时间 + LocalDateTime startTime = sfcDispatchById.getActualStartDate(); long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds(); workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP); //减去暂停时间