From 1baa3342fdf15183c9a57eae2ec475aecb340304 Mon Sep 17 00:00:00 2001 From: zpl Date: Fri, 5 Nov 2021 10:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=93=8D=E4=BD=9C=E5=91=98?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=AE=A1=E7=AE=97=E5=AE=9E=E9=99=85=E5=B7=A5?= =?UTF-8?q?=E6=97=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PodTemplateServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); //减去暂停时间