| | |
| | | @ApiModelProperty(value = "工程区划") |
| | | private String sgCode; |
| | | |
| | | /** |
| | | * 片区 所属标段 |
| | | */ |
| | | @ApiModelProperty(value = "片区 所属标段") |
| | | private String precinct; |
| | | |
| | | private String adGrad; |
| | | |
| | | private String resGuid; |
| | |
| | | private String deptCategoryName; |
| | | |
| | | private String sgCode; |
| | | /** |
| | | * 片区 所属标段 |
| | | */ |
| | | private String precinct; |
| | | |
| | | } |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | 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<>(); |
| | | 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); |
| | | } |
| | | } |
| | |
| | | Map<String, DeptUserTreeNode> getUserMap(@Param("treeNode") DeptUserTreeNode treeNode); |
| | | |
| | | String getResDept(@Param("deptIds") String deptIds); |
| | | |
| | | List<DeptVO> treeByParentIdNew(@Param("parentIds") List<String> parentIds,@Param("precinct")String precinct); |
| | | } |
| | |
| | | </if> |
| | | ORDER BY sort |
| | | </select> |
| | | <select id="treeByParentIdNew" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0 and precinct=#{precinct} |
| | | <if test="parentIds!=null and parentIds!=''"> |
| | | and |
| | | |
| | | <foreach item="id" collection="parentIds" open="(" separator="or" close=")"> |
| | | id = #{id} or parent_id = #{id} or parent_id in ( |
| | | select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{id} |
| | | ) |
| | | |
| | | </foreach> |
| | | |
| | | </if> |
| | | |
| | | ORDER BY sort |
| | | </select> |
| | | <select id="lazyTree" resultMap="treeNodeResultMap" > |
| | | SELECT |
| | | dept.id, |
| | |
| | | * @return |
| | | */ |
| | | String getResDept(String deptIds); |
| | | |
| | | List<DeptVO> treeByParentIdNew(String number,String precinct); |
| | | } |
| | |
| | | public String getResDept(String deptIds) { |
| | | return baseMapper.getResDept(deptIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVO> treeByParentIdNew(String parentId,String precinct) { |
| | | if (AuthUtil.isAdministrator() || AuthUtil.isAdmin()) { |
| | | return ForestNodeMerger.merge(baseMapper.tree(StringPool.EMPTY)); |
| | | } |
| | | String [] parentIds = parentId.split(","); |
| | | List<String> parentIdList = new ArrayList<>(); |
| | | for (String str:parentIds) { |
| | | parentIdList.add(str); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentIdNew(parentIdList,precinct)); |
| | | } |
| | | } |