|
|
|
@ -102,6 +102,12 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl<SubCheckDicti |
|
|
|
throw new RenException("您输入的考核项名称已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
String checkCode = dto.getCheckCode(); |
|
|
|
if (StringUtils.isNotBlank(checkCode)) { |
|
|
|
if (getCheckCodeCount(dto) > 0) { |
|
|
|
throw new RenException("您输入的考核编码已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
SubCheckDictionaryEntity entity = ConvertUtils.sourceToTarget(dto, SubCheckDictionaryEntity.class); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
@ -115,6 +121,12 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl<SubCheckDicti |
|
|
|
throw new RenException("您输入的考核项名称已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
String checkCode = dto.getCheckCode(); |
|
|
|
if (StringUtils.isNotBlank(checkCode)) { |
|
|
|
if (getCheckCodeCount(dto) > 0) { |
|
|
|
throw new RenException("您输入的考核编码已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
SubCheckDictionaryEntity entity = ConvertUtils.sourceToTarget(dto, SubCheckDictionaryEntity.class); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
@ -126,7 +138,21 @@ public class SubCheckDictionaryServiceImpl extends BaseServiceImpl<SubCheckDicti |
|
|
|
*/ |
|
|
|
public Integer getcheckLabelCount(SubCheckDictionaryDTO dto) { |
|
|
|
QueryWrapper<SubCheckDictionaryEntity> 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<SubCheckDictionaryEntity> 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"); |
|
|
|
|