浏览代码

数据应用审批管理改造

wangzhe 2 年之前
父节点
当前提交
0ea5b185a3

+ 25 - 0
leiSP-admin/src/main/java/com/sooka/web/controller/system/SysDeptController.java

@@ -192,6 +192,31 @@ public class SysDeptController extends BaseController
     }
 
     /**
+     * 数据申请选择部门树
+     *
+     * @param deptId 部门ID
+     * @param shareType 共享类型
+     */
+    @GetMapping(value = {"/selectDeptDataTreeByShareType/{deptId}/{shareType}" })
+    public String selectDeptDataTreeByShareType(@PathVariable("deptId") Long deptId,
+                                            @PathVariable(value = "shareType", required = false) String shareType, ModelMap mmap)
+    {
+        mmap.put("dept", deptService.selectDeptById(deptId));
+        mmap.put("shareType", shareType);
+        return "applyData/record" + "/provideDeptTree";
+    }
+    /**
+     * 数据申请加载部门列表树
+     */
+    @GetMapping("/provideDeptDataTreeData/{shareType}")
+    @ResponseBody
+    public List<Ztree> provideDeptDataTreeData(@PathVariable(value = "shareType", required = false) String shareType)
+    {
+        List<Ztree> ztrees = deptService.selectProvideDeptDataTree(shareType);
+        return ztrees;
+    }
+
+    /**
      * 加载部门列表树
      */
     @GetMapping("/treeData")

+ 8 - 0
leiSP-system/src/main/java/com/sooka/system/mapper/SysDeptMapper.java

@@ -45,6 +45,14 @@ public interface SysDeptMapper
     public List<SysDept> selectProvideDeptList(String shareType);
 
     /**
+     * 查询数据提供部门数据
+     *
+     * @param shareType 共享类型
+     * @return 部门信息集合
+     */
+    public List<SysDept> selectProvideDeptDataList(String shareType);
+
+    /**
      * 删除部门管理信息
      * 
      * @param deptId 部门ID

+ 8 - 0
leiSP-system/src/main/java/com/sooka/system/service/ISysDeptService.java

@@ -37,6 +37,14 @@ public interface ISysDeptService
     public List<Ztree> selectProvideDeptTree(String shareType);
 
     /**
+     * 查询数据提供部门数据
+     *
+     * @param shareType 共享类型
+     * @return 部门信息集合
+     */
+    public List<Ztree> selectProvideDeptDataTree(String shareType);
+
+    /**
      * 查询部门管理树(排除下级)
      * 
      * @param dept 部门信息

+ 14 - 0
leiSP-system/src/main/java/com/sooka/system/service/impl/SysDeptServiceImpl.java

@@ -73,6 +73,20 @@ public class SysDeptServiceImpl implements ISysDeptService
     }
 
     /**
+     * 查询部门管理树
+     *
+     * @param shareType 共享类型
+     * @return 所有部门信息
+     */
+    @Override
+    public List<Ztree> selectProvideDeptDataTree(String shareType)
+    {
+        List<SysDept> deptList = deptMapper.selectProvideDeptDataList(shareType);
+        List<Ztree> ztrees = initZtree(deptList);
+        return ztrees;
+    }
+
+    /**
      * 查询部门管理树(排除下级)
      * 
      * @param deptId 部门ID

+ 8 - 0
leiSP-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -58,6 +58,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where d.del_flag = '0'
 		and t.share_type = #{shareType} group by d.dept_id
     </select>
+
+	<select id="selectProvideDeptDataList" parameterType="java.lang.String" resultMap="SysDeptResult">
+        <include refid="selectDeptVo"/>
+
+		left join t_u_interfaceinfo t on d.dept_id = t.dept_id
+        where d.del_flag = '0'
+		and t.share_type = #{shareType} group by d.dept_id
+    </select>
 	
 	<select id="checkDeptExistUser" parameterType="Long" resultType="int">
 		select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'

+ 1 - 1
mybusiness/src/main/resources/templates/applyData/record/add.html

@@ -249,7 +249,7 @@
         var treeId = $("#treeId").val();
         var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
         // var url = ctx + "system/dept/selectDeptTree/" + deptId;
-        var url = ctx + "system/dept/selectDeptTreeByShareType/" + deptId + "/" + shareType;
+        var url = ctx + "system/dept/selectDeptDataTreeByShareType/" + deptId + "/" + shareType;
         var options = {
             title: '选择部门',
             width: "380",

+ 1 - 1
mybusiness/src/main/resources/templates/applyData/record/provideDeptTree.html

@@ -34,7 +34,7 @@
 	    var shareType = [[${shareType}]];
 		$(function() {
 			// var url = $.common.isEmpty(excludeId) ? prefix + "/treeData" + "/" + shareType: prefix + "/treeData/" + excludeId;
-			var url = prefix + "/provideDeptTreeData" + "/" + shareType;
+			var url = prefix + "/provideDeptDataTreeData" + "/" + shareType;
 			var options = {
 		        url: url,
 		        expandLevel: 2,