|
@@ -861,22 +861,56 @@ public class AdminUserLogic {
|
|
|
}
|
|
|
List<AdminModuleTree> parents = trees.stream().filter(v -> v.getLevel() == 1).collect(Collectors.toList());
|
|
|
for (AdminModuleTree adminModuleTree : parents) {
|
|
|
- adminModuleTree.setChildren(this.treeModule(trees, adminModuleTree.getModuleId(), hasModule, admin));
|
|
|
+ adminModuleTree.setChildren(this.treeModule(trees, adminModuleTree.getModuleId(), hasModule, admin, false));
|
|
|
+ }
|
|
|
+ // 检查用户绑定网点是否为二级网点
|
|
|
+ final List<AdminUserWebsitRela> relas = adminUserWebsitRelaService.lambdaQuery()
|
|
|
+ .eq(AdminUserWebsitRela::getAdminUserId, adminUser.getAdminUserId())
|
|
|
+ .list();
|
|
|
+ if (CollectionUtil.isNotEmpty(relas) && relas.size() == 1) {
|
|
|
+ final AdminUserWebsitRela rela = relas.get(0);
|
|
|
+ final AdminWebsit websit = adminWebsitService.lambdaQuery()
|
|
|
+ .eq(AdminWebsit::getWebsitId, rela.getAdminWebsitId())
|
|
|
+ .one();
|
|
|
+ if (websit.getLevel() == 2) {
|
|
|
+ Integer existCount = websitContractSignRecordService.lambdaQuery()
|
|
|
+ .eq(WebsitContractSignRecord::getWebsitId, websit.getWebsitId())
|
|
|
+ .eq(WebsitContractSignRecord::getStatus, SignContractStatusEnum.OK.getKey())
|
|
|
+ .ge(WebsitContractSignRecord::getSignOverTime, DateUtil.formatDateTime(DateUtil.date()))
|
|
|
+ .count();
|
|
|
+ // 没有签成功并且审核通过未过期的记录,只有签约菜单
|
|
|
+ if (existCount == 0 && CollectionUtil.isNotEmpty(trees)) {
|
|
|
+ List<AdminModuleTree> filterTree = trees.stream().filter(v -> v.getLevel() == 1 && v.getNotSign()).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(filterTree)) {
|
|
|
+ for (AdminModuleTree moduleTree : filterTree) {
|
|
|
+ moduleTree.setChildren(this.treeModule(trees, moduleTree.getModuleId(), hasModule, admin, true));
|
|
|
+ }
|
|
|
+ return filterTree;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
return parents;
|
|
|
}
|
|
|
|
|
|
- private List<AdminModuleTree> treeModule(List<AdminModuleTree> list, String parentId, List<String> hasModule, Boolean admin) {
|
|
|
+ private List<AdminModuleTree> treeModule(List<AdminModuleTree> list, String parentId, List<String> hasModule, Boolean admin, Boolean levelWebsit) {
|
|
|
//最父级资源树
|
|
|
if (StringUtils.isBlank(parentId)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
- List<AdminModuleTree> collect = list.stream().filter(e -> e.getParentId().equals(parentId)).collect(Collectors.toList());
|
|
|
+ List<AdminModuleTree> collect = null;
|
|
|
+ if (!levelWebsit) {
|
|
|
+ collect = list.stream().filter(e -> e.getParentId().equals(parentId)).collect(Collectors.toList());
|
|
|
+ } else {
|
|
|
+ collect = list.stream().filter(e -> e.getParentId().equals(parentId) && e.getNotSign()).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
for (AdminModuleTree bean : collect) {
|
|
|
if ((hasModule != null && hasModule.contains(bean.getModuleId())) || admin) {
|
|
|
bean.setShow(true);
|
|
|
}
|
|
|
- bean.setChildren(this.treeModule(list, bean.getModuleId(), hasModule, admin));
|
|
|
+ bean.setChildren(this.treeModule(list, bean.getModuleId(), hasModule, admin, levelWebsit));
|
|
|
}
|
|
|
return collect;
|
|
|
}
|