|
|
@@ -96,17 +96,17 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
|
|
|
}
|
|
|
|
|
|
|
|
|
- final List<Long> pointIds = appRulePointMapper.selectPointIds(item.getId());
|
|
|
+ List<Long> pointIds = appRulePointMapper.selectPointIds(item.getId());
|
|
|
if (pointIds.size() > 0) {
|
|
|
List<Long> idList2 = pointDtoList.stream().map(AppRulePointDto::getId).collect(Collectors.toList());
|
|
|
- for (Long pointId : pointIds) {
|
|
|
- if (!idList2.contains(pointId)) {
|
|
|
- Integer isUsed = appRulePointMapper.checkIsUsed(pointId);
|
|
|
- if (isUsed == null) {
|
|
|
- appRulePointMapper.deleteById(pointId);
|
|
|
- } else {
|
|
|
- throw new RuntimeException("履职内容已被使用,不能删除!");
|
|
|
- }
|
|
|
+ pointIds= pointIds.stream().filter(p->!idList2.contains(p))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(CollectionUtil.isNotEmpty(pointIds)){
|
|
|
+ Integer isUsed= appRulePointMapper.checkIsJoinResumptionPlan(pointIds);
|
|
|
+ if(ObjectUtil.isNotNull(isUsed)){
|
|
|
+ throw new RuntimeException("履职内容已被履职计划使用,不能删除!");
|
|
|
+ }else{
|
|
|
+ appRulePointMapper.deleteBatchIds(pointIds);
|
|
|
}
|
|
|
}
|
|
|
}
|