Browse Source

【网格实体化运作打分】操作记录后台管理-王公峰-2020-12-08

feature/dangjian
wanggongfeng 5 years ago
parent
commit
258aa9de70
  1. 28
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/SubCheckDictionaryServiceImpl.java

28
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<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");

Loading…
Cancel
Save