合并分支 'dev_foton_CD' 到 'FOTON'
Dev foton cd 查看合并请求 laws-foton-slrs/foton-slrs-system-rest!10
This commit is contained in:
+23
-3
@@ -10,18 +10,21 @@ import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.Query;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -44,6 +47,8 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
private ITsPositionService tsPositionService;
|
||||
@Autowired
|
||||
private ITsRoleMenuDataService iTsRoleMenuDataService;
|
||||
@Autowired
|
||||
private IZlTreeService zlTreeService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -70,12 +75,27 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
if(StringUtils.isEmpty(queryPage.getTreeId())) {
|
||||
queryPage.setTreeIdList(treeIdList);
|
||||
} else {
|
||||
// 查看菜单是否有数据权限
|
||||
if (!treeIdList.contains(queryPage.getTreeId())) {
|
||||
//通过当前treeId查询该节点及下级节点的全部数据
|
||||
List<String> treeIds = new ArrayList<>();
|
||||
zlTreeService.subordinateTreeNodes(treeIds, queryPage.getTreeId());
|
||||
if (ObjectUtils.isEmpty(treeIds)) {
|
||||
return null;
|
||||
}
|
||||
// 查看菜单是否有数据权限
|
||||
treeIds = treeIds.stream().filter(treeId -> treeIdList.contains(treeId)).collect(Collectors.toList());
|
||||
if (ObjectUtils.isEmpty(treeIds)) {
|
||||
return null;
|
||||
}
|
||||
queryPage.setTreeIdList(treeIds);
|
||||
}
|
||||
return fileMaterialDao.getFileMaterialPage(page,queryPage);
|
||||
queryPage.setTreeId(null);
|
||||
IPage<FileMaterial> fileMaterialPage = fileMaterialDao.getFileMaterialPage(page, queryPage);
|
||||
if (ObjectUtils.isNotEmpty(queryPage.getDataType())) {
|
||||
List<FileMaterial> fileMaterials = fileMaterialPage.getRecords().stream().filter(fileMaterial -> fileMaterial.getDataType().equals(queryPage.getDataType())).collect(Collectors.toList());
|
||||
fileMaterialPage.setRecords(fileMaterials);
|
||||
fileMaterialPage.setTotal(fileMaterials.size());
|
||||
}
|
||||
return fileMaterialPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.adc.da.slrs.zlTree.entity.ZlTree;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,4 +52,6 @@ public interface IZlTreeService extends IService<ZlTree> {
|
||||
* @return
|
||||
*/
|
||||
ZlTree queryTree(String treeId);
|
||||
|
||||
void subordinateTreeNodes(List<String> treeIds,String parentTreeId);
|
||||
}
|
||||
|
||||
@@ -154,4 +154,23 @@ public class ZlTreeServiceImpl extends ServiceImpl<ZlTreeDao, ZlTree> implements
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据树的父节点查询所有子节点id
|
||||
*
|
||||
* @param parentTreeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void subordinateTreeNodes(List<String> treeIds, String parentTreeId) {
|
||||
treeIds.add(parentTreeId);
|
||||
QueryWrapper<ZlTree> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("p_id", parentTreeId);
|
||||
List<ZlTree> list = list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
for (ZlTree zlTree : list) {
|
||||
subordinateTreeNodes(treeIds,zlTree.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -38,9 +38,6 @@
|
||||
<if test="flieM.id != null and flieM.id != ''">
|
||||
and fm.id=#{flieM.id}
|
||||
</if>
|
||||
<if test="flieM.dataType != null and flieM.dataType != ''">
|
||||
AND fm.data_type like concat('%',#{flieM.dataType},'%')
|
||||
</if>
|
||||
<if test="flieM.dataTitle != null and flieM.dataTitle != ''">
|
||||
AND fm.data_title like concat('%',#{flieM.dataTitle},'%')
|
||||
</if>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
LEFT JOIN ts_user_position on ts_user.USID = ts_user_position.user_id
|
||||
WHERE ts_user_position.position_id in (
|
||||
SELECT ts_position_role.position_id from ts_position_role
|
||||
WHERE ts_position_role.role_id = #{role.roleId} )
|
||||
WHERE ts_position_role.role_id = #{role.roleId} ) and ts_user.DISABLE_FLAG = '0'
|
||||
<if test="null != role.userId and role.userId != ''">
|
||||
and ts_user.USID like concat(concat('%',#{role.userId}),'%')
|
||||
</if>
|
||||
@@ -177,7 +177,7 @@
|
||||
LEFT JOIN ts_user_position on ts_user.USID = ts_user_position.user_id
|
||||
WHERE ts_user_position.position_id in (
|
||||
SELECT ts_position_role.position_id from ts_position_role
|
||||
WHERE ts_position_role.role_id = #{role.roleId} )
|
||||
WHERE ts_position_role.role_id = #{role.roleId} ) and ts_user.DISABLE_FLAG = '0'
|
||||
<if test="null != role.userId and role.userId != ''">
|
||||
and ts_user.USID like concat(concat('%',#{role.userId}),'%')
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user