gonglilong
2024-09-13 0cf306a80a8f189a2a664cf447cc0fbef5684bf8
skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/DeptController.java
@@ -48,6 +48,8 @@
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -137,7 +139,7 @@
   @GetMapping("/lazy-tree")
   @ApiOperationSupport(order = 5)
   @ApiOperation(value = "懒加载树形结构", notes = "树形结构")
   public R<List<DeptVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) {
   public R<List<DeptVO>> lazyTree(String tenantId, String parentId, BladeUser bladeUser) {
      List<DeptVO> tree = deptService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId);
      return R.data(tree);
   }
@@ -204,5 +206,23 @@
      return R.data(number);
   }
   @GetMapping("/getDwByParentId")
   @ApiOperationSupport(order = 10)
   @ApiOperation(value = "获取单位树形结构", notes = "获取单位树形结构")
   public R<Map<String,List<DeptVO>>> getDwByParentId(String precinct) {
      Map<String,List<DeptVO>> map=new HashMap<>();
      if(precinct==null||precinct.equals("")){
         map.put("one",new ArrayList<>());
         map.put("two",new ArrayList<>());
         map.put("three",new ArrayList<>());
      }else {
         List<DeptVO> tree1 = deptService.treeByParentIdNew("1821370772215062530", precinct);
         List<DeptVO> tree2 = deptService.treeByParentIdNew("1821370871330660353", precinct);
         List<DeptVO> tree3 = deptService.treeByParentIdNew("1806175841028685826", precinct);
         map.put("one", tree1);
         map.put("two", tree2);
         map.put("three", tree3);
      }
      return R.data(map);
   }
}