Prechádzať zdrojové kódy

王子文 专项培养
1) 继任者清单、培养计划、月度反馈、季度汇报页面新增、查询下拉列表过滤离职人员

wangggziwen 3 rokov pred
rodič
commit
19d581cd33

+ 3 - 2
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -499,8 +499,9 @@ public class TStaffmgrController extends BaseController
         }
         // 王子文 2022年6月27日 添加
         // 离职时修改继任者清单状态、培养计划状态
-        stSuccessorService.updateStateByStaffId(id);
-        tStPlanService.updateStudyStateByStaffId(id);
+        Long staffId = Long.parseLong(tStaffmgrService.selectTStaffmgrById(id).getStaffid());
+        stSuccessorService.updateStateByStaffId(staffId);
+        tStPlanService.updateStudyStateByStaffId(staffId);
         return toAjax(tStaffmgrService.deleteLeftTStaffmgrByIds(id));
     }
 

+ 4 - 2
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -52,9 +52,11 @@
         LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
         LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
 
-        where s.DICT_LABEL like '%主管%'
+        where
+        (s.DICT_LABEL like '%主管%'
         or s.DICT_LABEL like '%经理%'
-        or s.DICT_LABEL like '%工程师%'
+        or s.DICT_LABEL like '%工程师%')
+        and d.DEL_FLAG!=9
     </select>
 
     <select id="selectTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">

+ 2 - 0
master/src/main/resources/mybatis/training/spec/TStFeedbackMapper.xml

@@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from
             t_st_feedback d
         left join sys_user u on d.successor_id = u.staffid
+        left join T_STAFFMGR s on d.SUCCESSOR_ID = s.staffid
     </sql>
 
     <select id="selectInvitedSuccessorList" parameterType="TStFeedback" resultMap="TStFeedbackResult">
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="mentorId != null  and mentorId != ''"> and mentor_id = #{mentorId}</if>
             and parent_id is not null
             and d.del_flag = 0
+            and s.del_flag != 9
         </where>
     </select>
 

+ 5 - 5
master/src/main/resources/mybatis/training/spec/TStPlanMapper.xml

@@ -60,6 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join T_ST_YEARPlAN yp on d.year_plan_id = yp.id
     </sql>
 
+    <!-- 根据staffId修改“未完成”的继任者计划状态为“因离职中止” -->
+    <update id="updateStudyStateByStaffId" parameterType="Long">
+        update t_st_plan set study_state = 4 where (staff_id = #{staffId} or staff_id in (select staff_id from T_ST_SUCCESSOR where mentor_staff_id = #{staffId})) and study_state in (0,2,3)
+    </update>
+
     <!-- 查询季度培训计划列表 -->
     <select id="selectSeasonalTStPlanList" parameterType="TStFeedback" resultMap="TStPlanResult">
         <include refid="selectTStPlanVo"/>
@@ -231,9 +236,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
-    <!-- 根据staffId修改“未完成”的继任者计划状态为“因离职中止” -->
-    <update id="updateStudyStateByStaffId" parameterType="Long">
-        update t_st_plan set studyState = 4 where (staff_id = #{staffId} or staff_id = (select staff_id from T_ST_SUCCESSOR where mentor_staff_id = #{staffId})) and study_state in (0,2,3)
-    </update>
-
 </mapper>

+ 13 - 12
master/src/main/resources/mybatis/training/spec/TStSuccessorMapper.xml

@@ -21,20 +21,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTStSuccessorVo">
-          select d.id, d.staff_id,t.name as staffName,m.name as mentorStaffName, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.actualpost, d.mentor_staff_id, d.state ,s.dept_name
-         from t_st_successor d
-         left join sys_dept s on s.dept_id = d.dept_id
-          left join t_staffmgr t on t.staffid = d.staff_id
-          left join t_staffmgr m on m.staffid = d.mentor_staff_id
+        select d.id, d.staff_id,t.name as staffName,m.name as mentorStaffName, d.remarks, d.del_flag, d.creater_code,
+        d.createdate, d.updater_code, d.updatedate, d.dept_id, d.actualpost, d.mentor_staff_id, d.state ,s.dept_name
+        from t_st_successor d
+        left join sys_dept s on s.dept_id = d.dept_id
+        left join t_staffmgr t on t.staffid = d.staff_id
+        left join t_staffmgr m on m.staffid = d.mentor_staff_id
     </sql>
 
-    <!--王子文 2022年4月18日-->
+    <!-- 根据staffId修改“进行中”的继任者计划状态为“因离职中止” -->
+    <update id="updateStateByStaffId" parameterType="Long">
+        update t_st_successor set state = 2 where (staff_id = #{staffId} or mentor_staff_id = #{staffId}) and state = 0
+    </update>
+
     <!--根据导师ID查询学员列表-->
     <select id="selectSuccessorListByMentorId" parameterType="TStSuccessor" resultMap="TStSuccessorResult">
         <include refid="selectTStSuccessorVo"/>
         <where>
             <if test="mentorStaffId != null  and mentorStaffId != ''"> and mentor_staff_id = #{mentorStaffId}</if>
             and d.del_flag = 0
+            and d.state != 2
         </where>
         <!-- 数据范围过滤 -->
     </select>
@@ -45,11 +51,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="mentorStaffId != null  and mentorStaffId != ''"> and staff_id = #{staffId}</if>
             and d.del_flag = 0
+            and d.state != 2
         </where>
         <!-- 数据范围过滤 -->
     </select>
 
-
     <select id="selectTStSuccessorList" parameterType="TStSuccessor" resultMap="TStSuccessorResult">
         <include refid="selectTStSuccessorVo"/>
         <where>
@@ -131,9 +137,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
-    <!-- 根据staffId修改“进行中”的继任者计划状态为“因离职中止” -->
-    <update id="updateStateByStaffId" parameterType="Long">
-        update t_st_successor set state = 2 where (staff_id = #{staffId} or mentor_staff_id = #{staffId}) and state = 0
-    </update>
-
 </mapper>