fix:字典翻译数据权限问题修复
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.zt.plat.module.qms.common.dic.dal.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
@@ -21,6 +23,12 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface DictionaryBusinessMapper extends BaseMapperX<DictionaryBusinessDO> {
|
||||
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
default List<DictionaryBusinessDO> selectListWithoutPermissionCheck(Wrapper<DictionaryBusinessDO> queryWrapper){
|
||||
return selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
default PageResult<DictionaryBusinessDO> selectPage(DictionaryBusinessPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DictionaryBusinessDO>()
|
||||
.eqIfPresent(DictionaryBusinessDO::getIdPath, reqVO.getIdPath())
|
||||
@@ -36,7 +44,8 @@ public interface DictionaryBusinessMapper extends BaseMapperX<DictionaryBusiness
|
||||
.eqIfPresent(DictionaryBusinessDO::getRemark, reqVO.getRemark())
|
||||
.orderByAsc(DictionaryBusinessDO::getSortNo));
|
||||
}
|
||||
|
||||
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
default List<DictionaryBusinessExtendRespVO> selectItemByCategoryKeys(List<String> keys) {
|
||||
return selectJoinList(DictionaryBusinessExtendRespVO.class, new MPJLambdaWrapperX<DictionaryBusinessDO>()
|
||||
.leftJoin(DictionaryBusinessDO.class, "dbd", DictionaryBusinessDO::getId, DictionaryBusinessDO::getParentId)
|
||||
@@ -56,6 +65,7 @@ public interface DictionaryBusinessMapper extends BaseMapperX<DictionaryBusiness
|
||||
* @param filterSql 条件sql
|
||||
* @param keys 存储字段值 作为查询条件in
|
||||
*/
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
List<DictModel> queryTableDictCustom(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql,
|
||||
@Param("keys") List<String> keys);
|
||||
|
||||
@@ -64,7 +74,10 @@ public interface DictionaryBusinessMapper extends BaseMapperX<DictionaryBusiness
|
||||
* @param code
|
||||
* @param key
|
||||
*/
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
String queryDictTextByKey(@Param("code") String code, @Param("key") String key);
|
||||
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
String queryDictTextByID(@Param("code") String code, @Param("id") String id);
|
||||
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
query.in(DictionaryBusinessDO::getKey, dictCodeList);
|
||||
query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY);
|
||||
// query.eq(DictionaryBusinessDO::getDeleted, 0);
|
||||
List<DictionaryBusinessDO> parList = dictionaryBusinessMapper.selectList(query);
|
||||
List<DictionaryBusinessDO> parList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
if(parList.isEmpty())
|
||||
return dictMap;
|
||||
List<Long> parIds = parList.stream().map(DictionaryBusinessDO::getId).toList();
|
||||
@@ -159,7 +159,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
query.in(DictionaryBusinessDO::getKey, itemKeys);
|
||||
else
|
||||
query.in(DictionaryBusinessDO::getId, itemKeys);
|
||||
List<DictionaryBusinessDO> itemList = dictionaryBusinessMapper.selectList(query);
|
||||
List<DictionaryBusinessDO> itemList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
List<DictModelMany> modelItemList = new ArrayList<>();
|
||||
for(DictionaryBusinessDO item: itemList){
|
||||
Long parId = item.getParentId();
|
||||
@@ -185,7 +185,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
// query.in(DictionaryBusinessDO::getKey, dictCodeList);
|
||||
// query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY);
|
||||
//// query.eq(DictionaryBusinessDO::getDeleted, 0);
|
||||
// List<DictionaryBusinessDO> parList = dictionaryBusinessMapper.selectList(query);
|
||||
// List<DictionaryBusinessDO> parList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
// if(parList.isEmpty())
|
||||
// return dictMap;
|
||||
// List<Long> parIds = parList.stream().map(DictionaryBusinessDO::getId).toList();
|
||||
@@ -193,7 +193,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
// query.in(DictionaryBusinessDO::getParentId, parIds);
|
||||
// query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA);
|
||||
// query.in(DictionaryBusinessDO::getId, ids);
|
||||
// List<DictionaryBusinessDO> itemList = dictionaryBusinessMapper.selectList(query);
|
||||
// List<DictionaryBusinessDO> itemList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
// List<DictModelMany> modelItemList = new ArrayList<>();
|
||||
// for(DictionaryBusinessDO item: itemList){
|
||||
// Long parId = item.getParentId();
|
||||
@@ -216,7 +216,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
LambdaQueryWrapper<DictionaryBusinessDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(DictionaryBusinessDO::getKey, key);
|
||||
query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY);
|
||||
List<DictionaryBusinessDO> list = dictionaryBusinessMapper.selectList(query);
|
||||
List<DictionaryBusinessDO> list = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
if(list.isEmpty())
|
||||
throw exception(DICTIONARY_BUSINESS_NOT_EXISTS);
|
||||
if(list.size() > 1)
|
||||
@@ -234,7 +234,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
LambdaQueryWrapper<DictionaryBusinessDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(DictionaryBusinessDO::getKey, key);
|
||||
query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA);
|
||||
List<DictionaryBusinessDO> list = dictionaryBusinessMapper.selectList(query);
|
||||
List<DictionaryBusinessDO> list = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
if(list.isEmpty())
|
||||
return CommonResult.error(DICTIONARY_BUSINESS_NOT_EXISTS);
|
||||
if(list.size() > 1)
|
||||
@@ -325,7 +325,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
LambdaQueryWrapper<DictionaryBusinessDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY);
|
||||
query.orderByAsc(DictionaryBusinessDO::getSortNo);
|
||||
return dictionaryBusinessMapper.selectList(query);
|
||||
return dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,7 +335,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
if(!ObjectUtils.isEmpty(nodeType))
|
||||
query.eq(DictionaryBusinessDO::getNodeType, nodeType);
|
||||
query.orderByAsc(DictionaryBusinessDO::getSortNo);
|
||||
return dictionaryBusinessMapper.selectList(query);
|
||||
return dictionaryBusinessMapper.selectListWithoutPermissionCheck(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user