Commit 12acfb39 authored by lisong's avatar lisong

建筑树接口添加参数

parent 4cd56db7
......@@ -355,8 +355,8 @@ public class BuildingController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("公司消防建筑树")
@GetMapping(value = "/companyBuildingTree")
public List<BuildingTreeVo> getCompanyBuildingTree() {
return buildService.getCompanyBuildingTree(null);
public List<BuildingTreeVo> getCompanyBuildingTree(@RequestParam(required = false, value = "type")String type) {
return buildService.getCompanyBuildingTree(null, type);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -143,7 +143,7 @@ public interface JcsFeign {
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping(value = "/org-usr/{authKey}/listWithAuth")
FeignClientResult<List<OrgUsrDto>> getCompanyDeptListWithAuth(@PathVariable(value = "authKey") String authKey, @RequestParam(value = "orgTypes", required = false) String orgTypes);
FeignClientResult<List<OrgUsrDto>> getCompanyDeptListWithAuth(@PathVariable(value = "authKey") String authKey, @RequestParam(value = "orgTypes", required = false) String orgTypes, @RequestParam(value = "type", required = false) String type);
/**
* 获取机场人员
......@@ -190,4 +190,7 @@ public interface JcsFeign {
@GetMapping(value = "/org-person/getUser/{id}")
FeignClientResult selectById(@PathVariable String id);
@GetMapping(value = "/org-usr/getCompany")
FeignClientResult getCompany( @RequestParam("bizOrgCode") String bizOrgCode);
}
......@@ -310,7 +310,7 @@ public interface IBuilldService extends IService<Building> {
* @return list
* @param authKey
*/
List<BuildingTreeVo> getCompanyBuildingTree(String authKey);
List<BuildingTreeVo> getCompanyBuildingTree(String authKey, String type);
/**
* 获取单位树
......
......@@ -238,7 +238,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
@Override
public List<UnitAreaTreeVo> getAreaTreeListVo() {
// 获取公司list
List<OrgUsrDto> orgCompanyLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
List<OrgUsrDto> orgCompanyLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY", null);
if (orgCompanyLists.isEmpty()) {
return new ArrayList<>();
}
......
......@@ -1329,9 +1329,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public List<BuildingTreeVo> getCompanyBuildingTree(String authKey) {
public List<BuildingTreeVo> getCompanyBuildingTree(String authKey, String type) {
//1.组装数据
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(authKey);
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(authKey, type);
//2.list to tree
List<BuildingTreeVo> buildingTreeVos = companyBuildingList.stream().filter(a -> companyBuildingList.stream().noneMatch(c -> c.getId().toString().equals(a.getParentId()))).peek(b -> b.setChildren(getCompanyBuildingChildrenTree(b.getId().toString(), companyBuildingList))).collect(Collectors.toList());
// 任务 7481
......@@ -1391,13 +1391,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
private List<BuildingTreeVo> buildBuildingAndCompanyListVos(String authKey) {
private List<BuildingTreeVo> buildBuildingAndCompanyListVos(String authKey, String type) {
if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey;
}
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY", type);
if(orgUsrLists.isEmpty()){
return new ArrayList<>();
}
......@@ -1437,7 +1437,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<BuildingTreeVo> getBuildingVideoTreeNew() {
//1.组装数据
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(buildVideoAuthKey);
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(buildVideoAuthKey, null);
List<Map<String, Long>> countList = iFormInstanceService.getBuildVideoCount();
......
......@@ -1065,7 +1065,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public List<FireFightingSystemTreeVo> getSystemTreeByOrgCode(String bizOrgCode) {
// 获取公司部门list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth("COMPANY,DEPARTMENT", bizOrgCode);
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth("COMPANY,DEPARTMENT", bizOrgCode, null);
List<FireFightingSystemTreeVo> fireFightingSystemTreeList = orgUsrLists.stream().map(key -> {
FireFightingSystemTreeVo vo = new FireFightingSystemTreeVo();
vo.setId(valueOf(key.getSequenceNbr()));
......
......@@ -36,8 +36,8 @@ public class JCSRemoteService {
* @param orgTypes(多个逗号分隔) 为空默认查询公司和部门,COMPANY: 公司树 DEPARTMENT部门树
* @return List<OrgUsrDto>
*/
public List<OrgUsrDto> getCompanyDeptListWithAuth(String authKey, String orgTypes) {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, orgTypes);
public List<OrgUsrDto> getCompanyDeptListWithAuth(String authKey, String orgTypes,String type) {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, orgTypes, type);
return feignClientResult.getResult();
}
......@@ -52,4 +52,9 @@ public class JCSRemoteService {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getlistCompanyTree( orgType);
return feignClientResult.getResult();
}
public String getCompany(String bizOrgCode) {
FeignClientResult<String> feignClientResult = jcsFeignClient.getCompany(bizOrgCode);
return feignClientResult.getResult();
}
}
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