Commit f91378a6 authored by chenzhao's avatar chenzhao

修改bug

parent 9f410732
...@@ -288,13 +288,9 @@ public class DataSourcesImpl implements DataSources { ...@@ -288,13 +288,9 @@ public class DataSourcesImpl implements DataSources {
} }
private String[] getCompanyList() throws Exception { private String[] getCompanyList() throws Exception {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.selectCompanyDepartmentMsg(),
// 权限处理 OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
PermissionInterceptorContext.setDataAuthRule("fire_fighters_info");
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
// List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.selectCompanyDepartmentMsg(),
// OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
List<String> stringList = new ArrayList<String>(); List<String> stringList = new ArrayList<String>();
initCompanyList(orgUsrTree, stringList); initCompanyList(orgUsrTree, stringList);
String[] str = stringList.toArray(new String[stringList.size()]); String[] str = stringList.toArray(new String[stringList.size()]);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom; import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author DELL * @author DELL
...@@ -26,11 +33,20 @@ public class EquipmentServiceImpl { ...@@ -26,11 +33,20 @@ public class EquipmentServiceImpl {
@Autowired @Autowired
WaterResourceServiceImpl waterResourceServiceImpl; WaterResourceServiceImpl waterResourceServiceImpl;
@Autowired
private RedisUtils redisUtils;
public List<MenuFrom> getFireSystemList() { public List<MenuFrom> getFireSystemList() {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_water_info");
ResponseModel<Object> response = equipFeignClient.getFireSystemListAll(); ResponseModel<Object> response = equipFeignClient.getFireSystemListAll();
List<Map<String, Object>> fireSystemMapList = (List<Map<String, Object>>) response.getResult(); List<Map<String, Object>> fireSystemMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> fireSystemDtoList = Lists.newArrayList(); List<MenuFrom> fireSystemDtoList = Lists.newArrayList();
fireSystemMapList.forEach(system -> { fireSystemMapList.stream().filter(
result -> result.get("bizOrgCode") != null && result.get("bizOrgCode").toString().startsWith(reginParams.getPersonIdentity().getBizOrgCode()))
.forEach(
system -> {
MenuFrom menuFrom = new MenuFrom((String) system.get("id"), (String) system.get("name"), "0", "0"); MenuFrom menuFrom = new MenuFrom((String) system.get("id"), (String) system.get("name"), "0", "0");
fireSystemDtoList.add(menuFrom); fireSystemDtoList.add(menuFrom);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment