专检优化

master
philip 4 years ago
parent a35da8e733
commit 71dd346a75

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

@ -260,5 +260,48 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
return null;
}
@Override
public void createCompleteTask(Map<String, Object> paramMap) {
String site = CommonMethods.getSite();
String category = (String) paramMap.get("CATEGORY");
String sfc = (String) paramMap.get("SFC");
String shopOrder = (String) paramMap.get("SHOP_ORDER");
String operation = (String) paramMap.get("OPERATION");
String stepId = (String) paramMap.get("STEP_ID");
String itemNumber = (String) paramMap.get("ITEM_NUMBER");
String handle = "InspectionTaskBO:" + site + "," + UUID.randomUUID().toString();
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
String taskNo = "";
if (StringUtil.isBlank(itemNumber)) {
taskNo = "P_" + dateFormat1.format(date);
} else {
taskNo = "P_" + itemNumber + "_" + dateFormat1.format(date);
}
InspectionTask task = new InspectionTask();
task.setHandle(handle);
task.setSite(site);
task.setCategory(category);
task.setTaskNo(taskNo);
task.setStatus(Constants.INSPECTION_TASK_STATUS_COMPLETE);
task.setResrce(Constants.RSESULT_OK);
task.setDescription("专检检验任务");
task.setInspectionItemBo( null);
task.setShopOrder(shopOrder);
task.setWorkCenter((String) paramMap.get("WORK_CENTER"));
task.setSfc(sfc);
task.setOperation(operation);
task.setStepId(stepId);
task.setResrce((String) paramMap.get("RESRCE"));
task.setCreateUser(CommonMethods.getUser());
task.setCreatedDateTime(LocalDateTime.now());
task.setModifyUser(CommonMethods.getUser());
task.setModifiedDateTime(LocalDateTime.now());
task.setSfcDispatchBo((String) paramMap.get("SFC_DISPATCH_DETAIL_BO"));
task.setSfc(sfc);
save(task);
}
}

@ -219,6 +219,16 @@ public class PodTemplateServiceImpl implements PodTemplateService {
throw new BaseException("互检任务不合格,不能开始请检查");
}
}
//是否完成专检
QueryWrapper<InspectionTask> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(InspectionTask.CATEGORY,Constants.INSPECTION_TYPE_P);
queryWrapper.eq(InspectionTask.SFC,sfc);
queryWrapper.ne(InspectionTask.STATUS,Constants.INSPECTION_TASK_STATUS_COMPLETE);
queryWrapper.ne(InspectionTask.RESULT,Constants.RSESULT_OK);
List<InspectionTask> list = inspectionTaskService.list(queryWrapper);
if (!list.isEmpty()) {
throw new BaseException("请完成专检检验任务");
}
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) {
@ -294,6 +304,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
paramMap.put("CATEGORY",Constants.INSPECTION_TYPE_P);
inspectionTaskService.createTask(paramMap);
}else {
paramMap.put("CATEGORY",Constants.INSPECTION_TYPE_P);
inspectionTaskService.createCompleteTask(paramMap);
}
//首件创建
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc,operation, stepId, Constants.INSPECTION_TYPE_S);

Loading…
Cancel
Save