diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/SubCheckDictionaryServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/SubCheckDictionaryServiceImpl.java index bbb876b69..eb1b06bfa 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/SubCheckDictionaryServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/SubCheckDictionaryServiceImpl.java @@ -102,6 +102,12 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl 0) { + throw new RenException("您输入的考核编码已存在!"); + } + } SubCheckDictionaryEntity entity = ConvertUtils.sourceToTarget(dto, SubCheckDictionaryEntity.class); insert(entity); } @@ -115,6 +121,12 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl 0) { + throw new RenException("您输入的考核编码已存在!"); + } + } SubCheckDictionaryEntity entity = ConvertUtils.sourceToTarget(dto, SubCheckDictionaryEntity.class); updateById(entity); } @@ -126,7 +138,21 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq("checkLabel", dto.getCheckLabel()); + wrapper.eq("CHECK_LABEL", dto.getCheckLabel()); + String id = dto.getId(); + wrapper.ne(id != null, "id", dto.getId()); + wrapper.eq("del_flag", "0"); + return baseDao.selectCount(wrapper); + } + + /** + * 统计考核项code数量 + * @param dto + * @return + */ + public Integer getCheckCodeCount(SubCheckDictionaryDTO dto) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("CHECK_CODE", dto.getCheckCode()); String id = dto.getId(); wrapper.ne(id != null, "id", dto.getId()); wrapper.eq("del_flag", "0");