|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysDictionaryService;
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.StringTool;
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.StringTool;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
|
|
@ -66,6 +67,7 @@ public class SysDictionaryService implements ISysDictionaryService {
|
|
|
|
|
|
|
|
|
|
|
|
sysDictionary.setParentNameRdd(parentSysDictionary.getName());
|
|
|
|
sysDictionary.setParentNameRdd(parentSysDictionary.getName());
|
|
|
|
sysDictionary.setParentCodeRdd(parentSysDictionary.getDictionaryCode());
|
|
|
|
sysDictionary.setParentCodeRdd(parentSysDictionary.getDictionaryCode());
|
|
|
|
|
|
|
|
sysDictionary.setDictionaryGroup(parentSysDictionary.getDictionaryGroup());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sysDictionary.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
|
|
|
|
sysDictionary.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -85,7 +87,7 @@ public class SysDictionaryService implements ISysDictionaryService {
|
|
|
|
@ApiOperation(value = "修改字典")
|
|
|
|
@ApiOperation(value = "修改字典")
|
|
|
|
public void updateSysDictionary(SysDictionary sysDictionary) {
|
|
|
|
public void updateSysDictionary(SysDictionary sysDictionary) {
|
|
|
|
// 校验唯一
|
|
|
|
// 校验唯一
|
|
|
|
String hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary);
|
|
|
|
DdlPackBean hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary);
|
|
|
|
long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack);
|
|
|
|
long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack);
|
|
|
|
if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
|
|
|
|
if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
@ -127,6 +129,7 @@ public class SysDictionaryService implements ISysDictionaryService {
|
|
|
|
|
|
|
|
|
|
|
|
newSysDict.setParentNameRdd(parentSysDictionary.getName());
|
|
|
|
newSysDict.setParentNameRdd(parentSysDictionary.getName());
|
|
|
|
newSysDict.setParentCodeRdd(parentSysDictionary.getDictionaryCode());
|
|
|
|
newSysDict.setParentCodeRdd(parentSysDictionary.getDictionaryCode());
|
|
|
|
|
|
|
|
newSysDict.setDictionaryGroup(parentSysDictionary.getDictionaryGroup());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LOGGER.info("字典 SYS_DICTIONARY sysDictionary:{}", newSysDict);
|
|
|
|
LOGGER.info("字典 SYS_DICTIONARY sysDictionary:{}", newSysDict);
|
|
|
@ -159,7 +162,7 @@ public class SysDictionaryService implements ISysDictionaryService {
|
|
|
|
public ListPager querySysDictionaryByPager(SysDictionary sysDictionary, Pager pager) {
|
|
|
|
public ListPager querySysDictionaryByPager(SysDictionary sysDictionary, Pager pager) {
|
|
|
|
sysDictionary = sysDictionary == null ? new SysDictionary() : sysDictionary;
|
|
|
|
sysDictionary = sysDictionary == null ? new SysDictionary() : sysDictionary;
|
|
|
|
|
|
|
|
|
|
|
|
String hqlPack = CoreHqlPack.packHqlSysDictionary(sysDictionary);
|
|
|
|
DdlPackBean hqlPack = CoreHqlPack.packHqlSysDictionaryPage(sysDictionary);
|
|
|
|
pager = PagerHelper.getPager(pager, sysDictionaryRDao.findByHqlWhereCount(hqlPack));
|
|
|
|
pager = PagerHelper.getPager(pager, sysDictionaryRDao.findByHqlWhereCount(hqlPack));
|
|
|
|
return new ListPager(sysDictionaryRDao.findByHqlWherePage(hqlPack + sysDictionary.orderBy(), pager), pager);
|
|
|
|
return new ListPager(sysDictionaryRDao.findByHqlWherePage(hqlPack + sysDictionary.orderBy(), pager), pager);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -248,4 +251,10 @@ public class SysDictionaryService implements ISysDictionaryService {
|
|
|
|
public List<SysDictionary> findSysDictionaryByParentId(Long parentId) {
|
|
|
|
public List<SysDictionary> findSysDictionaryByParentId(Long parentId) {
|
|
|
|
return sysDictionaryRDao.findByProperty("parentId", parentId);
|
|
|
|
return sysDictionaryRDao.findByProperty("parentId", parentId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@ApiOperation(value = "按条件查询字典")
|
|
|
|
|
|
|
|
public List<SysDictionary> findSysDictionary(SysDictionary sysDictionary) {
|
|
|
|
|
|
|
|
return sysDictionaryRDao.findByHqlWhere(CoreHqlPack.packHqlSysDictionary(sysDictionary));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|