|
|
|
@ -30,9 +30,11 @@ import com.foreverwin.mesnac.meapi.service.*;
|
|
|
|
|
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
|
|
|
|
|
import com.foreverwin.mesnac.production.mapper.SfcDataAssembleMapper;
|
|
|
|
|
import com.foreverwin.mesnac.production.model.LoadInventory;
|
|
|
|
|
import com.foreverwin.mesnac.production.model.SfcHoldLog;
|
|
|
|
|
import com.foreverwin.mesnac.production.service.LoadInventoryService;
|
|
|
|
|
import com.foreverwin.mesnac.production.service.PodTemplateService;
|
|
|
|
|
import com.foreverwin.mesnac.production.service.SfcCrossService;
|
|
|
|
|
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BaseException;
|
|
|
|
|
import com.foreverwin.modular.core.meext.MEServices;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
@ -88,6 +90,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
private SfcDispatchCommonService sfcDispatchCommonService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private LoadInventoryService loadInventoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SfcHoldLogService sfcHoldLogService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
|
|
|
|
@ -235,7 +239,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
ExceptionUtil.throwException(e);
|
|
|
|
|
}
|
|
|
|
|
//更改派工单状态
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode());
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -309,9 +313,18 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc));
|
|
|
|
|
long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds();
|
|
|
|
|
BigDecimal workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
|
|
|
|
|
//减去暂停时间
|
|
|
|
|
QueryWrapper<SfcHoldLog> queryWrapper=new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq(SfcHoldLog.SFC,sfc);
|
|
|
|
|
queryWrapper.eq(SfcHoldLog.STEP_ID,stepId);
|
|
|
|
|
List<SfcHoldLog> list = sfcHoldLogService.list(queryWrapper);
|
|
|
|
|
if (!list.isEmpty()){
|
|
|
|
|
BigDecimal holdTime = list.stream().map(SfcHoldLog::getHoldDuration).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
workHour=workHour.subtract(holdTime);
|
|
|
|
|
}
|
|
|
|
|
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
|
|
|
|
|
//更改派工单状态
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode());
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour);
|
|
|
|
|
//报工
|
|
|
|
|
//sendErp(sfc, stepId, qty, BigDecimal.ZERO, workHour);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|