Commit 025e4d6e authored by zhangsen's avatar zhangsen

区域接口组装

parent 872fe1f2
...@@ -954,4 +954,24 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -954,4 +954,24 @@ public class BigScreenAnalyseController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取区域信息,根据层级查询单位信息 key 和 value都是区域名称")
@GetMapping("/getAreaListByLevel")
public ResponseModel<List<Map<String, String>>> getAreaListByLevel(@RequestParam("level") String level) throws Exception {
FeignClientResult<List<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList(level);
ArrayList<Map<String, String>> maps = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
listFeignClientResult.getResult().forEach(item -> {
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("key", item.getCompanyName());
resultMap.put("value", item.getCompanyName());
maps.add(resultMap);
});
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
return ResponseHelper.buildResponse(maps);
}
} }
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