|
|
@@ -56,7 +56,7 @@ public class CoreDrillDictionaryServiceImpl extends ServiceImpl<CoreDrillDiction
|
|
|
if (!request.getCheckSub()) {
|
|
|
page = coreDrillDictionaryMapper.selectPageData1(request.getPageRequest(), request);
|
|
|
} else {
|
|
|
- page = coreDrillDictionaryMapper.selectPageData2(request.getPageRequest(), request);
|
|
|
+ page = coreDrillDictionaryMapper.selectPageData4(request.getPageRequest(), request);
|
|
|
}
|
|
|
} else {
|
|
|
if (!request.getCheckSub()) {
|
|
|
@@ -81,20 +81,36 @@ public class CoreDrillDictionaryServiceImpl extends ServiceImpl<CoreDrillDiction
|
|
|
|
|
|
private void dealPageRequestParam(CoreDrillDictionaryPageDto request) {
|
|
|
|
|
|
+ // 演练范本 查询时除了 查询机构 还要考虑登录人所在机构,不然会放大查询数据范围; 比如登录人是网点的,但是选择了省联社下穿查询
|
|
|
+
|
|
|
+ SysOrg loginUserOrgInfo = SecurityUtils.getLoginUser().getSysOrg();
|
|
|
SysOrg curOrg = getOrg(request.getOrgId());
|
|
|
request.setOrgParentId(curOrg.getParentId());
|
|
|
if (request.getCheckSub()) {
|
|
|
- //顶级机构下穿 :查询所有
|
|
|
- if (ObjectUtil.equal(Constants.TOP_ORG_PARENT_ID, curOrg.getParentId())) {
|
|
|
- request.setOrgPath(curOrg.getPath());
|
|
|
- return;
|
|
|
- }
|
|
|
//普通机构下穿,查询父机构数据和下面机构所有数据
|
|
|
List<Long> collect = Arrays.stream(curOrg.getPath().split("-")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
- //这里如果不remove,那么根据orgIdList和path查询 实际上是重复了的
|
|
|
- collect.remove(curOrg.getId());
|
|
|
- request.setOrgIdList(collect);
|
|
|
- request.setOrgPath(curOrg.getPath());
|
|
|
+ List<Long> userOrgIds = Arrays.stream(loginUserOrgInfo.getPath().split("-")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //如果登录人机构层级 比查询机构机构层级低, 则不能直接用查询机构的Path 要用 登录人的机构Path
|
|
|
+ if(userOrgIds.size()>collect.size())
|
|
|
+ {
|
|
|
+ //这里如果不remove,那么根据orgIdList和path查询 实际上是重复了的
|
|
|
+ userOrgIds.remove(loginUserOrgInfo.getId());
|
|
|
+ request.setOrgIdList(userOrgIds);
|
|
|
+ request.setOrgPath(loginUserOrgInfo.getPath());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //顶级机构下穿 :查询所有
|
|
|
+ if (ObjectUtil.equal(Constants.TOP_ORG_PARENT_ID, curOrg.getParentId())) {
|
|
|
+ request.setOrgPath(curOrg.getPath());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //这里如果不remove,那么根据orgIdList和path查询 实际上是重复了的
|
|
|
+ collect.remove(curOrg.getId());
|
|
|
+ request.setOrgIdList(collect);
|
|
|
+ request.setOrgPath(curOrg.getPath());
|
|
|
+ }
|
|
|
} else {
|
|
|
//顶级机构不下穿 :查询自己的数据
|
|
|
if (ObjectUtil.equal(Constants.TOP_ORG_PARENT_ID, curOrg.getParentId())) {
|