Bladeren bron

改成 树结构

master
PoffyZhang 1 jaar geleden
bovenliggende
commit
1141aff932
3 gewijzigde bestanden met toevoegingen van 10 en 6 verwijderingen
  1. +1
    -1
      kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.java
  2. +2
    -2
      kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/NdKqZzsfwMenuController.java
  3. +7
    -3
      kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/manage/MatterManage.java

+ 1
- 1
kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.java Bestand weergeven

@@ -16,7 +16,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
* @Version 1.0
**/
@RestControllerAdvice(basePackages = {
"com.ningdatech.kqapi.zzsfw.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 2
- 2
kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/NdKqZzsfwMenuController.java Bestand weergeven

@@ -34,7 +34,7 @@ public class NdKqZzsfwMenuController {

@ApiOperation(value = "获取政务事项数据列表", notes = "获取政务事项数据列表")
@GetMapping("/matters")
public ApiResponse<List<TreeVO>> getMatters() {
return ApiResponse.ofSuccess(matterManage.getMatters());
public List<TreeVO> getMatters() {
return matterManage.getMatters();
}
}

+ 7
- 3
kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/manage/MatterManage.java Bestand weergeven

@@ -51,7 +51,8 @@ public class MatterManage {

private List<TreeVO> generateWindows(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) {
Set<String> windowSet = new HashSet<>();
return matters.stream().filter(m -> windowSet.add(m.getWindow()) && StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName()))
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName())
&& windowSet.add(m.getWindow()))
.map(m -> {
TreeVO window = new TreeVO();
window.setName(m.getWindow());
@@ -63,7 +64,8 @@ public class MatterManage {

private List<TreeVO> generateDepartment(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) {
Set<String> departmentSet = new HashSet<>();
return matters.stream().filter(m -> departmentSet.add(m.getDepartment()) && StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow()))
return matters.stream().filter( m -> StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow()) &&
m.getZoneName().equals(menu.getZoneName()) && departmentSet.add(m.getDepartment()))
.map(m -> {
TreeVO department = new TreeVO();
department.setName(m.getDepartment());
@@ -74,7 +76,9 @@ public class MatterManage {
}

private List<TreeVO> generateMatters(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) {
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getDepartment()) && m.getDepartment().equals(menu.getDepartment()))
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getDepartment()) &&
m.getDepartment().equals(menu.getDepartment()) && m.getWindow().equals(menu.getWindow()) &&
m.getZoneName().equals(menu.getZoneName()))
.map(m -> {
TreeVO matter = new TreeVO();
matter.setName(m.getItemName());


Laden…
Annuleren
Opslaan