字典功能优化

yun-zuoyi
汪云昊 6 years ago
parent cbe588449e
commit 667c334531

@ -39,7 +39,7 @@ public class SysDictionaryService implements ISysDictionaryService {
public void insertSysDictionary(SysDictionary sysDictionary) { public void insertSysDictionary(SysDictionary sysDictionary) {
long repeatCodeCount = sysDictionaryRDao.findByPropertyCount(new String[]{"dictionaryCode", "dictionarySoftType"}, long repeatCodeCount = sysDictionaryRDao.findByPropertyCount(new String[]{"dictionaryCode", "dictionarySoftType"},
new Object[]{sysDictionary.getDictionaryCode(), sysDictionary.getDictionarySoftType()}); new Object[]{sysDictionary.getDictionaryCode(), sysDictionary.getDictionarySoftType()});
if (repeatCodeCount > 0) { if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode()) .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
@ -87,7 +87,7 @@ public class SysDictionaryService implements ISysDictionaryService {
// 校验唯一 // 校验唯一
String hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary); String hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary);
long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack); long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack);
if (repeatCodeCount > 0) { if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode()) .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())

Loading…
Cancel
Save