|
@@ -13,6 +13,7 @@ import com.ningdatech.kqapi.zzsfw.entity.dto.NdKqZzsfwMenuDTO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMattersDeduplicate; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMattersDeduplicate; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; |
|
|
|
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.MattersVO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; |
|
|
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; |
|
|
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; |
|
@@ -75,7 +76,7 @@ public class MatterManage { |
|
|
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) |
|
|
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
Set<String> zoneSet = new HashSet<>(); |
|
|
Set<String> zoneSet = new HashSet<>(); |
|
|
List<TreeVO> res = matters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { |
|
|
|
|
|
|
|
|
List<TreeVO> res = finalMatters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { |
|
|
TreeVO zone = new TreeVO(); |
|
|
TreeVO zone = new TreeVO(); |
|
|
zone.setName(m.getZoneName()); |
|
|
zone.setName(m.getZoneName()); |
|
|
zone.setChilren(generateWindows(m, finalMatters)); |
|
|
zone.setChilren(generateWindows(m, finalMatters)); |
|
@@ -85,6 +86,84 @@ public class MatterManage { |
|
|
return res; |
|
|
return res; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询社区 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public List<TreeVO> getZones() { |
|
|
|
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
|
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
|
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//如果是政府类型的 就隐藏 没有链接的 |
|
|
|
|
|
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && |
|
|
|
|
|
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
Set<String> zoneSet = new HashSet<>(); |
|
|
|
|
|
List<TreeVO> res = finalMatters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { |
|
|
|
|
|
TreeVO zone = new TreeVO(); |
|
|
|
|
|
zone.setName(m.getZoneName()); |
|
|
|
|
|
zone.setType(ZzsfwMenuConstant.MENU_TYPE_ZONE); |
|
|
|
|
|
return zone; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
return res; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<TreeVO> getWindows(String zoneName) { |
|
|
|
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) |
|
|
|
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
|
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Set<String> windowSet = new HashSet<>(); |
|
|
|
|
|
return matters.stream().filter(m -> windowSet.add(m.getWindow())) |
|
|
|
|
|
.map(m -> { |
|
|
|
|
|
TreeVO window = new TreeVO(); |
|
|
|
|
|
window.setName(m.getWindow()); |
|
|
|
|
|
window.setType(ZzsfwMenuConstant.MENU_TYPE_WINDOW); |
|
|
|
|
|
return window; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<TreeVO> getDepartments(String zoneName,String windowName) { |
|
|
|
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(windowName),NdKqZzsfwMenu::getWindow,windowName) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) |
|
|
|
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
|
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Set<String> departMentSet = new HashSet<>(); |
|
|
|
|
|
return matters.stream().filter(m -> departMentSet.add(m.getDepartment())) |
|
|
|
|
|
.map(m -> { |
|
|
|
|
|
TreeVO department = new TreeVO(); |
|
|
|
|
|
department.setName(m.getDepartment()); |
|
|
|
|
|
department.setType(ZzsfwMenuConstant.MENU_TYPE_DEPARTMENT); |
|
|
|
|
|
return department; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<MattersVO> matterList(String zoneName, String windowName, String department, Integer type) { |
|
|
|
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(windowName),NdKqZzsfwMenu::getWindow,windowName) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(zoneName),NdKqZzsfwMenu::getZoneName,zoneName) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(department),NdKqZzsfwMenu::getDepartment,department) |
|
|
|
|
|
.eq(Objects.nonNull(type),NdKqZzsfwMenu::getType,type) |
|
|
|
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
|
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return matters.stream() |
|
|
|
|
|
.map(m -> BeanUtil.copyProperties(m,MattersVO.class)) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private List<TreeVO> generateWindows(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { |
|
|
private List<TreeVO> generateWindows(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { |
|
|
Set<String> windowSet = new HashSet<>(); |
|
|
Set<String> windowSet = new HashSet<>(); |
|
|
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName()) |
|
|
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName()) |
|
|