Kaynağa Gözat

1.系统人员,加入院系以及教育身份,修改新增修改接口
2.编写获取院系人员树-分级请求接口

honorfire 7 ay önce
ebeveyn
işleme
337ffe28be

+ 35 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CollegeController.java

@@ -18,6 +18,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -34,9 +35,12 @@ import vip.xiaonuo.disk.param.CollegePageParam;
 import vip.xiaonuo.disk.service.CollegeService;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * college控制器
@@ -168,5 +172,36 @@ public class CollegeController {
     }
 
 
+    /**
+     * 获取院系人员树
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:00
+     */
+    @ApiOperationSupport(order = 7)
+    @ApiOperation("获取组织人员树")
+    @GetMapping("/disk/college/orgUserTreeSelector")
+    public CommonResult<List<Tree<String>>> orgUserTreeSelector() {
+        return CommonResult.data(collegeService.orgUserTreeSelector());
+    }
+
+    /**
+     * 获取院系人员树-分级请求
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:00
+     */
+    @ApiOperationSupport(order = 7)
+    @ApiOperation("获取组织人员树-分级请求")
+    @GetMapping("/disk/college/orgUserTreeRespectively")
+    public CommonResult<List<Map<String, Object>>> orgUserTreeRespectively(HttpServletRequest req) {
+        Map param =new HashMap();
+        String collegeParentId="0";
+        if(StringUtils.isNotEmpty(req.getParameter("collegeParentId")))collegeParentId=req.getParameter("collegeParentId");
+        param.put("collegeParentId",collegeParentId );
+        List<Map<String, Object>> result=collegeService.orgUserTreeRespectively(param);
+        return CommonResult.data(result);
+    }
+
 
 }

+ 8 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/CollegeMapper.java

@@ -15,6 +15,9 @@ package vip.xiaonuo.disk.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import vip.xiaonuo.disk.domain.College;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * collegeMapper接口
  *
@@ -22,4 +25,9 @@ import vip.xiaonuo.disk.domain.College;
  * @date  2025/06/26 09:09
  **/
 public interface CollegeMapper extends BaseMapper<College> {
+
+    /**
+     * 获取院系人员树-院系部分
+     * */
+    List<Map<String, Object>> getOrgUserChildList(Map param);
 }

+ 11 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/CollegeMapper.xml

@@ -2,4 +2,15 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="vip.xiaonuo.disk.mapper.CollegeMapper">
 
+    <select id="getOrgUserChildList" resultType="java.util.Map">
+        SELECT
+            t1.ID AS id,
+            t1.NAME AS name,
+            'college' AS infoType
+        FROM college t1
+        WHERE t1.DELETE_FLAG = 'NOT_DELETE'
+        <if test="collegeParentId !=null and collegeParentId != ''">
+            AND t1.PARENT_ID =#{collegeParentId}
+        </if>
+    </select>
 </mapper>

+ 19 - 2
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/CollegeService.java

@@ -19,6 +19,7 @@ import vip.xiaonuo.disk.domain.College;
 import vip.xiaonuo.disk.param.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * collegeService接口
@@ -165,12 +166,28 @@ public interface CollegeService extends IService<College> {
     List<Tree<String>> orgTreeSelector();
 
     /**
-     * 获取组织列表选择器
+     * 获取组织人员树
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:08
+     */
+    List<Tree<String>> orgUserTreeSelector();
+
+    /**
+     * 获取院系列表选择器
      *
      * @author xuyuxiang
      * @date 2022/7/22 13:34
      **/
     Page<College> orgListSelector(CollegeOrgSelectorOrgListParam collegeSelectorOrgListParam);
 
- 
+    /**
+     * 获取院系人员树-分级请求
+     *
+     * @author xuyuxiang
+     * @date 2022/7/22 13:34
+     **/
+    List<Map<String, Object>> orgUserTreeRespectively(Map param);
+
+
 }

+ 43 - 2
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/CollegeServiceImpl.java

@@ -38,9 +38,13 @@ import vip.xiaonuo.disk.domain.College;
 import vip.xiaonuo.disk.mapper.CollegeMapper;
 import vip.xiaonuo.disk.param.*;
 import vip.xiaonuo.disk.service.CollegeService;
+import vip.xiaonuo.sys.modular.user.mapper.SysUserMapper;
 
+import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -51,8 +55,10 @@ import java.util.stream.Collectors;
  **/
 @Service
 public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> implements CollegeService {
-   @Autowired
-   private CollegeMapper collegeMapper;
+    @Resource
+    private CollegeMapper collegeMapper;
+    @Resource
+    private SysUserMapper sysUserMapper;
     @Override
     public Page<College> page(CollegePageParam collegePageParam) {
         QueryWrapper<College> queryWrapper = new QueryWrapper<>();
@@ -252,6 +258,21 @@ public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> impl
         return TreeUtil.build(treeNodeList, "0");
     }
 
+    /**
+     * 获取组织人员树
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:08
+     */
+    @Override
+    public List<Tree<String>> orgUserTreeSelector() {
+        List<College> collegeList = this.getAllOrgList();
+        List<TreeNode<String>> treeNodeList = collegeList.stream().map(college ->
+                new TreeNode<>(college.getId(), college.getParentId(), college.getName(), college.getSortCode()))
+                .collect(Collectors.toList());
+        return TreeUtil.build(treeNodeList, "0");
+    }
+
     @Override
     public Page<College> orgListSelector(CollegeOrgSelectorOrgListParam collegeSelectorOrgListParam) {
         LambdaQueryWrapper<College> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -268,6 +289,26 @@ public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> impl
         return this.page(CommonPageRequest.defaultPage(), lambdaQueryWrapper);
     }
 
+    /**
+     * 获取院系人员树-分级请求
+     *
+     * @author xuyuxiang
+     * @date 2022/7/22 13:34
+     **/
+    @Override
+    public List<Map<String, Object>> orgUserTreeRespectively(Map param) {
+        List<Map<String, Object>> resultList = new ArrayList<>();
+        //查询该父级院系id的子级院系
+        List<Map<String, Object>> collegeList = collegeMapper.getOrgUserChildList(param);
+        String collegeParentId = param.get("collegeParentId").toString();
+        param.put("collegeThreeCollege", collegeParentId);
+        //查询该父级id的子级人员
+        List<Map<String, Object>> userList = sysUserMapper.getOrgUserChildList(param);
+        resultList.addAll(collegeList);
+        resultList.addAll(userList);
+        return resultList;
+    }
+
 
 
     /* ====以下为各种递归方法==== */

+ 15 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/entity/SysUser.java

@@ -290,4 +290,19 @@ public class SysUser extends CommonEntity {
     @ApiModelProperty(value = "是否是资源库特殊账号,0否1是")
     private String isResourceaccount;
 
+    /** 教育身份 */
+    @ApiModelProperty(value = "教育身份", position = 7)
+    private String eduIdentity;
+
+    /** 所属院系ID */
+    @ApiModelProperty(value = "所属院系ID", position = 7)
+    private String collegeId;
+
+    /** 二级院系ID */
+    @ApiModelProperty(value = "二级院系ID", position = 7)
+    private String collegeTwoId;
+
+    /** 三级院系ID */
+    @ApiModelProperty(value = "三级院系ID", position = 7)
+    private String collegeThreeId;
 }

+ 6 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/mapper/SysUserMapper.java

@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import vip.xiaonuo.sys.modular.user.entity.SysUser;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -42,4 +43,9 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      * 资源共享-群组-分页列表
      */
     Page<Map<String,Object>> getGroupList(@Param("param") Map param, @Param("page") Page<Object> page);
+
+    /**
+     * 获取院系人员树-人员部分
+     * */
+    List<Map<String, Object>> getOrgUserChildList(Map param);
 }

+ 12 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/mapper/mapping/SysUserMapper.xml

@@ -21,4 +21,16 @@
             and t1.ID = #{param.groupId}
         </if>
     </select>
+
+    <select id="getOrgUserChildList" resultType="java.util.Map">
+        SELECT
+            t1.ID AS id,
+            t1.NAME AS name,
+            'user' AS infoType
+        FROM SYS_USER t1
+        WHERE t1.DELETE_FLAG = 'NOT_DELETE'
+        <if test="collegeThreeCollege !=null and collegeThreeCollege != ''">
+            AND t1.COLLEGE_THREE_ID =#{collegeThreeCollege}
+        </if>
+    </select>
 </mapper>

+ 16 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/param/SysUserAddParam.java

@@ -175,4 +175,20 @@ public class SysUserAddParam {
     /** 扩展信息 */
     @ApiModelProperty(value = "扩展信息", position = 36)
     private String extJson;
+
+    /** 教育身份 */
+    @ApiModelProperty(value = "教育身份", position = 7)
+    private String eduIdentity;
+
+    /** 所属院系ID */
+    @ApiModelProperty(value = "所属院系ID", position = 7)
+    private String collegeId;
+
+    /** 二级院系ID */
+    @ApiModelProperty(value = "二级院系ID", position = 7)
+    private String collegeTwoId;
+
+    /** 三级院系ID */
+    @ApiModelProperty(value = "三级院系ID", position = 7)
+    private String collegeThreeId;
 }

+ 16 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/param/SysUserEditParam.java

@@ -180,4 +180,20 @@ public class SysUserEditParam {
     /** 扩展信息 */
     @ApiModelProperty(value = "扩展信息", position = 37)
     private String extJson;
+
+    /** 教育身份 */
+    @ApiModelProperty(value = "教育身份", position = 7)
+    private String eduIdentity;
+
+    /** 所属院系ID */
+    @ApiModelProperty(value = "所属院系ID", position = 7)
+    private String collegeId;
+
+    /** 二级院系ID */
+    @ApiModelProperty(value = "二级院系ID", position = 7)
+    private String collegeTwoId;
+
+    /** 三级院系ID */
+    @ApiModelProperty(value = "三级院系ID", position = 7)
+    private String collegeThreeId;
 }