diff --git a/common/src/main/java/com/foreverwin/mesnac/common/mapper/InspectionItemMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/InspectionItemMapper.java index b084ecc5..f434ec01 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/mapper/InspectionItemMapper.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/InspectionItemMapper.java @@ -24,4 +24,10 @@ public interface InspectionItemMapper extends BaseMapper { List selectWidestQualityInspection(@Param("site")String site,@Param("inspectionType")String inspectionType,@Param("additionalObject")String additionalObject); Integer checkRouterStep(@Param("site")String site,@Param("operation") String operation,@Param("stepId") String stepId); + + Integer resrcePlanCheck(String handle); + + Integer resrceTaskCheck(String handle); + + Integer inspectTaskCheck(String handle); } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionItemServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionItemServiceImpl.java index 97370026..833f5766 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionItemServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionItemServiceImpl.java @@ -219,7 +219,20 @@ public class InspectionItemServiceImpl extends ServiceImpl0){ + throw new BaseException("检验项目已被使用,无法删除"); + } + num=inspectionItemMapper.resrceTaskCheck(handle); + if (num>0){ + throw new BaseException("检验项目已被使用,无法删除"); + } + num=inspectionItemMapper.inspectTaskCheck(handle); + if (num>0){ + throw new BaseException("检验项目已被使用,无法删除"); + } HashMap removeCondition = new HashMap<>(); removeCondition.put(InspectionItemAddition.INSPECTION_ITEM_BO, inspectionItem.getHandle()); inspectionItemAdditionService.removeByMap(removeCondition); diff --git a/common/src/main/resources/mapper/InspectionItemMapper.xml b/common/src/main/resources/mapper/InspectionItemMapper.xml index ac19108f..65f625bd 100644 --- a/common/src/main/resources/mapper/InspectionItemMapper.xml +++ b/common/src/main/resources/mapper/InspectionItemMapper.xml @@ -475,4 +475,14 @@ WHERE (ziia.ADDITIONAL_OBJECT_TYPE='ITEM' OR ziia.ADDITIONAL_OBJECT_TYPE='OPERATION') AND zii.STATUS='Y' AND zii.INSPECTION_TYPE=#{inspectionType} AND ziia.ADDITIONAL_OBJECT=#{additionalObject} AND zii.SITE=#{site} + + + +