master
philip 3 years ago
parent 9b51db95ec
commit 3805f3d0be

@ -35,5 +35,5 @@ public interface InspectionTaskService extends IService<InspectionTask> {
InspectionTask isCreateTask(String site, String category, String sfc, String operation, String stepId); InspectionTask isCreateTask(String site, String category, String sfc, String operation, String stepId);
void createCompleteTask(Map<String, Object> paramMap); void createNewTask(Map<String, Object> paramMap);
} }

@ -264,7 +264,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
} }
@Override @Override
public void createCompleteTask(Map<String, Object> paramMap) { public void createNewTask(Map<String, Object> paramMap) {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
String category = (String) paramMap.get("CATEGORY"); String category = (String) paramMap.get("CATEGORY");
String sfc = (String) paramMap.get("SFC"); String sfc = (String) paramMap.get("SFC");

@ -220,11 +220,15 @@ public class PodTemplateServiceImpl implements PodTemplateService {
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>(); QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(InspectionTask.CATEGORY, Constants.INSPECTION_TYPE_P); queryWrapper.eq(InspectionTask.CATEGORY, Constants.INSPECTION_TYPE_P);
queryWrapper.eq(InspectionTask.SFC, sfc); queryWrapper.eq(InspectionTask.SFC, sfc);
queryWrapper.ne(InspectionTask.RESULT, Constants.RSESULT_OK); queryWrapper.orderByDesc(InspectionTask.CREATED_DATE_TIME);
List<InspectionTask> list = inspectionTaskService.list(queryWrapper); List<InspectionTask> list = inspectionTaskService.list(queryWrapper);
if (!list.isEmpty()) { if (!list.isEmpty()) {
InspectionTask inspectionTask = list.get(0);
String result = inspectionTask.getResult();
if (!inspectionTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)||StringUtil.isBlank(result)||!result.equals(Constants.RSESULT_OK)){
throw new BaseException("请完成专检检验任务"); throw new BaseException("请完成专检检验任务");
} }
}
try { try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty); sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) { } catch (Exception e) {
@ -289,7 +293,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
inspectionTaskService.createTask(paramMap); inspectionTaskService.createTask(paramMap);
} else { } else {
paramMap.put("CATEGORY", Constants.INSPECTION_TYPE_P); paramMap.put("CATEGORY", Constants.INSPECTION_TYPE_P);
inspectionTaskService.createCompleteTask(paramMap); inspectionTaskService.createNewTask(paramMap);
} }
//首件创建 //首件创建
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_S); inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_S);

Loading…
Cancel
Save