|
@@ -34,20 +34,31 @@ public class DictAppAppServiceImpl implements DictAppService {
|
|
|
@Override
|
|
|
public List<SysDictDataDO> getDictDataList(String dictType,Long userId) {
|
|
|
List<SysDictDataDO> dictDataList = new ArrayList<>();
|
|
|
- UserDO userDO = userMapper.selectById(userId);
|
|
|
- Wrapper<SysDictDataDO> wrapper = new EntityWrapper<SysDictDataDO>();
|
|
|
- if (dictType != null) {
|
|
|
- wrapper.eq("dict_type", dictType);
|
|
|
- }
|
|
|
- if(userDO != null && userDO.getCompanyId() != null){
|
|
|
- wrapper.eq("company_id", userDO.getCompanyId());
|
|
|
+ if(userId != null){
|
|
|
+ UserDO userDO = userMapper.selectById(userId);
|
|
|
+ Wrapper<SysDictDataDO> wrapper = new EntityWrapper<SysDictDataDO>();
|
|
|
+ if (dictType != null) {
|
|
|
+ wrapper.eq("dict_type", dictType);
|
|
|
+ }
|
|
|
+ if(userDO != null && userDO.getCompanyId() != null){
|
|
|
+ wrapper.eq("company_id", userDO.getCompanyId());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ wrapper.eq("company_id", 1);
|
|
|
+ }
|
|
|
+ wrapper.orderBy("sort",true);
|
|
|
+ dictDataList = sysDictDataMapper.selectList(wrapper);
|
|
|
+ return dictDataList;
|
|
|
}
|
|
|
else{
|
|
|
+ Wrapper<SysDictDataDO> wrapper = new EntityWrapper<SysDictDataDO>();
|
|
|
+ wrapper.eq("dict_type", dictType);
|
|
|
wrapper.eq("company_id", 1);
|
|
|
+ wrapper.orderBy("sort",true);
|
|
|
+ dictDataList = sysDictDataMapper.selectList(wrapper);
|
|
|
+ return dictDataList;
|
|
|
}
|
|
|
- wrapper.orderBy("sort",true);
|
|
|
- dictDataList = sysDictDataMapper.selectList(wrapper);
|
|
|
- return dictDataList;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|