|
|
@ -86,6 +86,7 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
if (inspectionItem == null){
|
|
|
|
if (inspectionItem == null){
|
|
|
|
throw BusinessException.build("检验项目清单不存在!!!");
|
|
|
|
throw BusinessException.build("检验项目清单不存在!!!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String category = resourceInspectPlan.getCategory();
|
|
|
|
//查询设备计划是否存在
|
|
|
|
//查询设备计划是否存在
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
resourceInspectPlan.setSite(site);
|
|
|
|
resourceInspectPlan.setSite(site);
|
|
|
@ -134,15 +135,23 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
throw BusinessException.build("未添加设备!!!");
|
|
|
|
throw BusinessException.build("未添加设备!!!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Collection<ResourceInspectResource> resourceColl = new ArrayList<>();
|
|
|
|
Collection<ResourceInspectResource> resourceColl = new ArrayList<>();
|
|
|
|
|
|
|
|
StringBuffer resInfo = new StringBuffer("[");
|
|
|
|
for (ResourceInspectResource equip: equips) {
|
|
|
|
for (ResourceInspectResource equip: equips) {
|
|
|
|
equip.setResourceInspectPlanBo(handle);
|
|
|
|
equip.setResourceInspectPlanBo(handle);
|
|
|
|
equip.setCreateUser(user);
|
|
|
|
equip.setCreateUser(user);
|
|
|
|
equip.setCreatedDateTime(LocalDateTime.now());
|
|
|
|
equip.setCreatedDateTime(LocalDateTime.now());
|
|
|
|
String resourceNo = equip.getResourceNo();
|
|
|
|
String resourceNo = equip.getResourceNo();
|
|
|
|
|
|
|
|
Integer cnt = resourceInspectTaskMapper.findResourceTaskByResrceAndCategory(site, category, resourceNo);
|
|
|
|
|
|
|
|
if (cnt > 0){
|
|
|
|
|
|
|
|
resInfo.append(resourceNo+",");
|
|
|
|
|
|
|
|
}
|
|
|
|
String resourceHandle = HandleEnum.RESOURCE.getHandle(site, resourceNo);
|
|
|
|
String resourceHandle = HandleEnum.RESOURCE.getHandle(site, resourceNo);
|
|
|
|
equip.setHandle(HandleEnum.RESOURCE_INSPECT_RESOURCE.getHandle(site,handle,resourceHandle));
|
|
|
|
equip.setHandle(HandleEnum.RESOURCE_INSPECT_RESOURCE.getHandle(site,handle,resourceHandle));
|
|
|
|
resourceColl.add(equip);
|
|
|
|
resourceColl.add(equip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!resInfo.equals("")){
|
|
|
|
|
|
|
|
throw BusinessException.build("设备编号" + resInfo.append("]") + "已经维护了相同点检类型的点检计划!");
|
|
|
|
|
|
|
|
}
|
|
|
|
resourceInspectResourceService.saveBatch(resourceColl);
|
|
|
|
resourceInspectResourceService.saveBatch(resourceColl);
|
|
|
|
// 保存用户组清单
|
|
|
|
// 保存用户组清单
|
|
|
|
List<InspectPlanUserGroup> userGroups = resourceInspectPlan.getInspectPlanUserGroupList();
|
|
|
|
List<InspectPlanUserGroup> userGroups = resourceInspectPlan.getInspectPlanUserGroupList();
|
|
|
@ -380,6 +389,9 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ResourceInspectResource resource = resourceInspectResourceService.getById(HandleEnum.RESOURCE_INSPECT_RESOURCE.getHandle(site,planHandle,resourceBo));
|
|
|
|
ResourceInspectResource resource = resourceInspectResourceService.getById(HandleEnum.RESOURCE_INSPECT_RESOURCE.getHandle(site,planHandle,resourceBo));
|
|
|
|
|
|
|
|
if (resource == null){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
String resourceStatus = resource.getStatus();
|
|
|
|
String resourceStatus = resource.getStatus();
|
|
|
|
// 设备非启用状态
|
|
|
|
// 设备非启用状态
|
|
|
|
if (!resourceStatus.equals("301")){
|
|
|
|
if (!resourceStatus.equals("301")){
|
|
|
|