|
|
|
@ -219,7 +219,20 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
|
|
|
|
|
throw new BaseException("请输入版本");
|
|
|
|
|
}
|
|
|
|
|
inspectionItem.setSite(CommonMethods.getSite());
|
|
|
|
|
inspectionItem.setHandle(HandleEnum.INSPECTION_ITEM.getHandle(inspectionItem.getSite(), inspectionItem.getInspectionItemNo(), inspectionItem.getRevision()));
|
|
|
|
|
String handle = HandleEnum.INSPECTION_ITEM.getHandle(inspectionItem.getSite(), inspectionItem.getInspectionItemNo(), inspectionItem.getRevision());
|
|
|
|
|
inspectionItem.setHandle(handle);
|
|
|
|
|
Integer num=inspectionItemMapper.resrcePlanCheck(handle);
|
|
|
|
|
if (num>0){
|
|
|
|
|
throw new BaseException("检验项目已被使用,无法删除");
|
|
|
|
|
}
|
|
|
|
|
num=inspectionItemMapper.resrceTaskCheck(handle);
|
|
|
|
|
if (num>0){
|
|
|
|
|
throw new BaseException("检验项目已被使用,无法删除");
|
|
|
|
|
}
|
|
|
|
|
num=inspectionItemMapper.inspectTaskCheck(handle);
|
|
|
|
|
if (num>0){
|
|
|
|
|
throw new BaseException("检验项目已被使用,无法删除");
|
|
|
|
|
}
|
|
|
|
|
HashMap<String, Object> removeCondition = new HashMap<>();
|
|
|
|
|
removeCondition.put(InspectionItemAddition.INSPECTION_ITEM_BO, inspectionItem.getHandle());
|
|
|
|
|
inspectionItemAdditionService.removeByMap(removeCondition);
|
|
|
|
|