Kaynağa Gözat

增加工作台组织树下拉

tags/24080901
WendyYang 6 ay önce
ebeveyn
işleme
4014ec29a9
2 değiştirilmiş dosya ile 20 ekleme ve 0 silme
  1. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/user/controller/MhUnitController.java
  2. +14
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java

+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/user/controller/MhUnitController.java Dosyayı Görüntüle

@@ -45,6 +45,12 @@ public class MhUnitController {
return mhUnitManage.getMhUnitStripTree();
}

@GetMapping("/dashboard/option")
@ApiOperation("工作台单位下拉")
public List<MhUnitTreeDTO> dashboardUnitOption() {
return mhUnitManage.getMhUnitDashboardOption();
}

@GetMapping("/page")
@ApiOperation("单位列表")
public PageVo<MhUnitListVO> page(MhUnitListReq req) {


+ 14
- 0
hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java Dosyayı Görüntüle

@@ -89,6 +89,20 @@ public class MhUnitManage {
return nodes;
}

public List<MhUnitTreeDTO> getMhUnitDashboardOption() {
List<UnitDTO> allUnits = mhUnitCache.all();
List<MhUnitTreeDTO> nodes = allUnits.stream()
.filter(w -> MhUnitTypeEnum.SASAC.equals(w.getType()) ||
((MhUnitTypeEnum.REGION.equals(w.getType()) || MhUnitTypeEnum.NODE.equals(w.getType()))
&& (w.getName().endsWith("信创办") || "市级部门".equals(w.getName()) || "杭州市".equals(w.getName()))))
.map(w -> BeanUtil.copyProperties(w, MhUnitTreeDTO.class))
.collect(Collectors.toList());
Function<MhUnitTreeDTO, Integer> function = w -> w.getType().getStrip().getCode();
nodes.sort(Comparator.comparing(MhUnitTreeDTO::getName)
.thenComparing(function, Comparator.reverseOrder()));
return nodes;
}

public PageVo<MhUnitListVO> page(MhUnitListReq req) {
LambdaQueryWrapper<MhUnit> query = Wrappers.lambdaQuery(MhUnit.class);
if (StrUtils.isNotBlank(req.getName())) {


Yükleniyor…
İptal
Kaydet