生产操作员面板计算实际工时调整

master
zpl 3 years ago
parent ad175fc046
commit 1baa3342fd

@ -22,6 +22,8 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ERPAPI; import com.foreverwin.mesnac.common.util.ERPAPI;
import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil; 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.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.mesnac.meapi.dto.BomComponentDto; import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
@ -103,7 +105,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private SfcDispatchCommonService sfcDispatchCommonService; private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired @Autowired
private ResrceMapper resrceMapper; private ResrceMapper resrceMapper;
@Autowired
private SfcDispatchService sfcDispatchService;
@Override @Override
@ -273,6 +276,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String stepId = sfcDto.getStepId(); String stepId = sfcDto.getStepId();
String dispatchNo = sfcDto.getDispatchNo(); String dispatchNo = sfcDto.getDispatchNo();
SfcDispatch sfcDispatchById = sfcDispatchService.getById(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
String status = StringUtil.trimHandle(sfcServiceById.getStatusBo()); String status = StringUtil.trimHandle(sfcServiceById.getStatusBo());
if (status.equals("404")) { if (status.equals("404")) {
@ -337,7 +341,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
inspectionTaskService.createTask(paramMap); 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(); long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds();
workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP); workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
//减去暂停时间 //减去暂停时间

Loading…
Cancel
Save