Browse Source

履职计划取消树结构

jiawuxian 2 years ago
parent
commit
902665a54b

+ 4 - 1
project_data/sql/0.0.2/soc/soc.sql

@@ -1558,4 +1558,7 @@ END$$
 DELIMITER ;
 
 CALL modify_protection();
-DROP PROCEDURE modify_protection;
+DROP PROCEDURE modify_protection;
+
+
+DELETE from sys_menu WHERE perms in ('device:protection:add','device:protection:edit','device:protection:remove');

+ 6 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/AppPlanMapper.java

@@ -36,12 +36,12 @@ public interface AppPlanMapper extends BaseMapper<AppPlan> {
      */
     Page<ResumptionPlanPageVo> selectPage(Page<ResumptionPlanPageVo> page, @Param("info") CoreResumptionPlanPageDto plan);
 
-    /**
-     *
-     * @param plan
-     * @return
-     */
-    List<ResumptionPlanPageVo> selectChildren(@Param("info") CoreResumptionPlanPageDto plan);
+//    /**
+//     *
+//     * @param plan
+//     * @return
+//     */
+//    List<ResumptionPlanPageVo> selectChildren(@Param("info") CoreResumptionPlanPageDto plan);
 
 //    List<AppPlan> selectAll(@Param("info") CoreResumptionPlanPageDto plan);
 

+ 37 - 52
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -80,62 +80,47 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
         Page<ResumptionPlanPageVo> result = info.getPageDto();
         result = baseMapper.selectPage(result, info);
-        info.setParentId(result.getRecords().stream().map(r -> r.getId()).collect(Collectors.toList()));
-        List<ResumptionPlanPageVo> allChildren = new ArrayList<>();
-        if (CollectionUtil.isNotEmpty(info.getParentId())) {
-            allChildren = baseMapper.selectChildren(info);
-        }
-        Long order = ((info.getPageNum() - 1) * info.getPageSize()) + 1;
-        for (ResumptionPlanPageVo r : result.getRecords()) {
-            r.setIndex(order++);
-            Long childOrder = 1L;
-            List<ResumptionPlanPageVo> children = allChildren.stream().filter(c -> ObjectUtil.equal(c.getParentId(), r.getId())).collect(Collectors.toList());
-            for (ResumptionPlanPageVo child : children) {
-                child.setIndex(childOrder++);
-            }
-            r.setChildren(children);
-        }
 
         return result;
     }
 
-    /**
-     * dept递归方法转换成树形结构
-     *
-     * @param treeList
-     * @return
-     */
-    public static List<ResumptionPlanPageVo> recursionDept(List<ResumptionPlanPageVo> treeList, Long orgid) {
-        List<ResumptionPlanPageVo> trees = new ArrayList<>();
-        for (ResumptionPlanPageVo tree : treeList) {
-            // 找出父节点
-            if (-1 == tree.getParentId()) {
-                // 调用递归方法填充子节点列表
-                trees.add(findChildren(tree, treeList));
-            }
-        }
-        return trees;
-    }
-
-    /**
-     * dept递归方法
-     *
-     * @param tree     父节点对象
-     * @param treeList 所有的List
-     * @return
-     */
-    public static ResumptionPlanPageVo findChildren(ResumptionPlanPageVo tree, List<ResumptionPlanPageVo> treeList) {
-        for (ResumptionPlanPageVo node : treeList) {
-            if (tree.getId().equals(node.getParentId())) {
-                if (tree.getChildren() == null) {
-                    tree.setChildren(new ArrayList<>());
-                }
-                // 递归 调用自身
-                tree.getChildren().add(findChildren(node, treeList));
-            }
-        }
-        return tree;
-    }
+//    /**
+//     * dept递归方法转换成树形结构
+//     *
+//     * @param treeList
+//     * @return
+//     */
+//    public static List<ResumptionPlanPageVo> recursionDept(List<ResumptionPlanPageVo> treeList, Long orgid) {
+//        List<ResumptionPlanPageVo> trees = new ArrayList<>();
+//        for (ResumptionPlanPageVo tree : treeList) {
+//            // 找出父节点
+//            if (-1 == tree.getParentId()) {
+//                // 调用递归方法填充子节点列表
+//                trees.add(findChildren(tree, treeList));
+//            }
+//        }
+//        return trees;
+//    }
+
+//    /**
+//     * dept递归方法
+//     *
+//     * @param tree     父节点对象
+//     * @param treeList 所有的List
+//     * @return
+//     */
+//    public static ResumptionPlanPageVo findChildren(ResumptionPlanPageVo tree, List<ResumptionPlanPageVo> treeList) {
+//        for (ResumptionPlanPageVo node : treeList) {
+//            if (tree.getId().equals(node.getParentId())) {
+//                if (tree.getChildren() == null) {
+//                    tree.setChildren(new ArrayList<>());
+//                }
+//                // 递归 调用自身
+//                tree.getChildren().add(findChildren(node, treeList));
+//            }
+//        }
+//        return tree;
+//    }
 
 
     @Override

+ 1 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/ResumptionPlanPageVo.java

@@ -20,8 +20,6 @@ public class ResumptionPlanPageVo {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
-    private Long index;
-
     private Integer orgType;
     /**
      * 主键
@@ -131,5 +129,5 @@ public class ResumptionPlanPageVo {
     private String orgId;
 
 
-    private List<ResumptionPlanPageVo> children;
+//    private List<ResumptionPlanPageVo> children;
 }

+ 70 - 83
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -100,9 +100,6 @@
                 </foreach>
                 )
             </if>
-            and a.id in (
-            select id from core_resumption_plan
-            where 1=1
             <if test="info.checkSub==false">
                 and plan_of_org_id=#{info.orgId}
             </if>
@@ -110,89 +107,79 @@
                 and plan_of_org_id in (select id from sys_org
                 where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
             </if>
-            and parent_id not in (select id from core_resumption_plan
-            where 1=1
-            <if test="info.checkSub==false">
-                and plan_of_org_id=#{info.orgId}
-            </if>
-            <if test="info.checkSub==true">
-                and plan_of_org_id in (select id from sys_org
-                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
-            </if>)
-            )
         </where>
     </select>
-    <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"
-            resultMap="appPlans">
-        SELECT
-        a.*,
-        u2.name as update_name,
-        d.roleNames,
-        b.orgId,
-        b.orgNames,
-        o.short_name as plan_of_org_name,
-        g.short_name as plan_create_org_name
-        FROM
-        core_resumption_plan a
-        left join sys_user u2 on u2.id=a.modified_by
-        LEFT JOIN (
-        SELECT
-        m.plan_id,
-        GROUP_CONCAT( n.`short_name` ) orgNames,
-        GROUP_CONCAT( n.id ) orgId
-        FROM
-        core_resumption_plan_to_exec_org m
-        LEFT JOIN sys_org n ON m.org_id = n.id
+<!--    <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"-->
+<!--            resultMap="appPlans">-->
+<!--        SELECT-->
+<!--        a.*,-->
+<!--        u2.name as update_name,-->
+<!--        d.roleNames,-->
+<!--        b.orgId,-->
+<!--        b.orgNames,-->
+<!--        o.short_name as plan_of_org_name,-->
+<!--        g.short_name as plan_create_org_name-->
+<!--        FROM-->
+<!--        core_resumption_plan a-->
+<!--        left join sys_user u2 on u2.id=a.modified_by-->
+<!--        LEFT JOIN (-->
+<!--        SELECT-->
+<!--        m.plan_id,-->
+<!--        GROUP_CONCAT( n.`short_name` ) orgNames,-->
+<!--        GROUP_CONCAT( n.id ) orgId-->
+<!--        FROM-->
+<!--        core_resumption_plan_to_exec_org m-->
+<!--        LEFT JOIN sys_org n ON m.org_id = n.id-->
 
-        GROUP BY
-        m.plan_id
-        ) b ON a.id = b.plan_id
-        LEFT JOIN (
-        SELECT
-        r.plan_id,
-        group_concat( t.`role_name` ) roleNames
-        FROM
-        core_resumption_plan_to_role r
-        LEFT JOIN sys_role t ON r.role_id = t.id
-        GROUP BY
-        r.plan_id
-        ) d ON a.id = d.plan_id
-        LEFT JOIN sys_org o ON a.plan_of_org_id = o.id
-        LEFT JOIN sys_org g ON a.plan_create_org_id = g.id
-        <where>
-            a.deleted=0
-            <if test="info.planName != '' and info.planName != null">
-                and a.plan_name LIKE CONCAT('%', #{info.planName}, '%' )
-            </if>
-            <if test="info.planStatus != null">
-                and a.plan_status = #{info.planStatus}
-            </if>
-            <if test="info.planCycle != null">
-                and a.plan_cycle = #{info.planCycle}
-            </if>
-            <if test="info.planExec != null">
-                and a.plan_exec = #{info.planExec}
-            </if>
-            <if test="info.orgType != null">
-                and a.exec_org_type = #{info.orgType}
-            </if>
-            <!--            <if test="info.checkSub==true">-->
-            <!--                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where-->
-            <!--                id =#{info.orgId}),'%'))-->
-            <!--            </if>-->
-            <if test="info.roleList != null and info.roleList.size > 0">
-                and a.id in (select plan_id from core_resumption_plan_to_role where role_id in
-                <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">
-                    #{roleId}
-                </foreach>
-                )
-            </if>
-            and a.parent_id in
-            <foreach collection="info.parentId" item="id" open="(" close=")" separator=",">
-                #{id}
-            </foreach>
-        </where>
-    </select>
+<!--        GROUP BY-->
+<!--        m.plan_id-->
+<!--        ) b ON a.id = b.plan_id-->
+<!--        LEFT JOIN (-->
+<!--        SELECT-->
+<!--        r.plan_id,-->
+<!--        group_concat( t.`role_name` ) roleNames-->
+<!--        FROM-->
+<!--        core_resumption_plan_to_role r-->
+<!--        LEFT JOIN sys_role t ON r.role_id = t.id-->
+<!--        GROUP BY-->
+<!--        r.plan_id-->
+<!--        ) d ON a.id = d.plan_id-->
+<!--        LEFT JOIN sys_org o ON a.plan_of_org_id = o.id-->
+<!--        LEFT JOIN sys_org g ON a.plan_create_org_id = g.id-->
+<!--        <where>-->
+<!--            a.deleted=0-->
+<!--            <if test="info.planName != '' and info.planName != null">-->
+<!--                and a.plan_name LIKE CONCAT('%', #{info.planName}, '%' )-->
+<!--            </if>-->
+<!--            <if test="info.planStatus != null">-->
+<!--                and a.plan_status = #{info.planStatus}-->
+<!--            </if>-->
+<!--            <if test="info.planCycle != null">-->
+<!--                and a.plan_cycle = #{info.planCycle}-->
+<!--            </if>-->
+<!--            <if test="info.planExec != null">-->
+<!--                and a.plan_exec = #{info.planExec}-->
+<!--            </if>-->
+<!--            <if test="info.orgType != null">-->
+<!--                and a.exec_org_type = #{info.orgType}-->
+<!--            </if>-->
+<!--            &lt;!&ndash;            <if test="info.checkSub==true">&ndash;&gt;-->
+<!--            &lt;!&ndash;                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where&ndash;&gt;-->
+<!--            &lt;!&ndash;                id =#{info.orgId}),'%'))&ndash;&gt;-->
+<!--            &lt;!&ndash;            </if>&ndash;&gt;-->
+<!--            <if test="info.roleList != null and info.roleList.size > 0">-->
+<!--                and a.id in (select plan_id from core_resumption_plan_to_role where role_id in-->
+<!--                <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">-->
+<!--                    #{roleId}-->
+<!--                </foreach>-->
+<!--                )-->
+<!--            </if>-->
+<!--            and a.parent_id in-->
+<!--            <foreach collection="info.parentId" item="id" open="(" close=")" separator=",">-->
+<!--                #{id}-->
+<!--            </foreach>-->
+<!--        </where>-->
+<!--    </select>-->
     <select id="selectItemPage" parameterType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo"
             resultType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo">
         select

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -211,7 +211,8 @@
         t.des,
         t.ymd_date,
         t.plan_start_time,
-        t.plan_end_time
+        t.plan_end_time,
+        t.grant_user_id
         FROM core_safety_task t
         LEFT JOIN sys_org o1 ON o1.id = t.org_id
         LEFT JOIN sys_org o2 ON o2.id = t.check_org_id