|
|
|
@ -1,7 +1,14 @@
|
|
|
|
|
package com.foreverwin.mesnac.production.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.foreverwin.mesnac.common.constant.Constants;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
|
|
|
|
|
import com.foreverwin.mesnac.common.model.InspectionTask;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.CommonService;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.InspectionItemService;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.InspectionTaskService;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.ExceptionUtil;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
|
|
|
@ -44,6 +51,12 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
private SfcCrossService sfcCrossService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private OperationService operationService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private InspectionTaskService inspectionTaskService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private InspectionItemService inspectionItemService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SfcDispatchCommonService sfcDispatchCommonService;
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
@ -138,6 +151,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
|
|
|
|
|
String resrce = sfcDto.getResrce();
|
|
|
|
|
String sfc = sfcDto.getSfc();
|
|
|
|
|
String stepId = sfcDto.getStepId();
|
|
|
|
|
String dispatchNo = sfcDto.getDispatchNo();
|
|
|
|
|
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
|
|
|
|
|
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
|
|
|
|
|
try {
|
|
|
|
@ -145,6 +160,20 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ExceptionUtil.throwException(e);
|
|
|
|
|
}
|
|
|
|
|
//更改派工单状态
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site,CommonMethods.getUser(),dispatchNo, DispatchStatusEnum.START.getCode());
|
|
|
|
|
//是否有互检检验项目
|
|
|
|
|
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_H);
|
|
|
|
|
if (inspectionItemDetails.size()>0&&StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
|
|
|
|
|
//是否有互检检验任务及已完成
|
|
|
|
|
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_H, sfc, operation, stepId);
|
|
|
|
|
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){
|
|
|
|
|
throw new BaseException("请完成互检检验任务");
|
|
|
|
|
}
|
|
|
|
|
if (!createTask.getResult().equals(Constants.RSESULT_OK)){
|
|
|
|
|
throw new BaseException("互检任务不合格,不能开始请检查");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
@ -155,6 +184,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
|
|
|
|
|
String resrce = sfcDto.getResrce();
|
|
|
|
|
String sfc = sfcDto.getSfc();
|
|
|
|
|
String stepId = sfcDto.getStepId();
|
|
|
|
|
|
|
|
|
|
String dispatchNo = sfcDto.getDispatchNo();
|
|
|
|
|
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
|
|
|
|
|
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
|
|
|
|
|
try {
|
|
|
|
@ -162,6 +194,22 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ExceptionUtil.throwException(e);
|
|
|
|
|
}
|
|
|
|
|
//更改派工单状态
|
|
|
|
|
sfcDispatchCommonService.updateSfcDispatchStatus(site,CommonMethods.getUser(),dispatchNo, DispatchStatusEnum.COMPLETE.getCode());
|
|
|
|
|
|
|
|
|
|
//是否有自检检验项目
|
|
|
|
|
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
|
|
|
|
|
if (inspectionItemDetails.size()>0&&StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
|
|
|
|
|
//是否有自检检验任务
|
|
|
|
|
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId);
|
|
|
|
|
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){
|
|
|
|
|
throw new BaseException("请完成自检检验任务");
|
|
|
|
|
}
|
|
|
|
|
if (!createTask.getResult().equals(Constants.RSESULT_OK)){
|
|
|
|
|
throw new BaseException("自检任务不合格,不能完成请检查");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|