Browse Source

入职登记驳回与实现登记驳回调整

wangqiang 1 year ago
parent
commit
60bc04182b

+ 6 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/mapper/EnrollmentRegistrationMapper.java

@@ -50,4 +50,10 @@ public interface EnrollmentRegistrationMapper extends BaseMapper<EnrollmentRegis
      */
     @InterceptorIgnore(tenantLine = "true")
     List<String> getAllUserIdInSuccess();
+
+    /**
+     * 根据id物理删除这条入职登记信息 (包括入职登记信息,社保卡信息)
+     * @param id
+     */
+    void deleteByIdOnPhysic(@Param("id") String id);
 }

+ 6 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/mapper/xml/EnrollmentRegistrationMapper.xml

@@ -55,6 +55,12 @@
     <update id="updateByUserId">
         update human_resources_enrollment_registration SET on_job_status = '离职' where user_id = #{userId}
     </update>
+    <delete id="deleteByIdOnPhysic">
+         DELETE a, b
+        FROM human_resources_enrollment_registration a
+        LEFT JOIN human_resources_enrollment_social_security_card b ON a.id = b.enrollment_registration_id
+        WHERE a.id = #{id};
+    </delete>
 
     <select id="findList"
             resultType="com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentRegistration">

+ 11 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java

@@ -154,6 +154,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                 String procDefId = map.get("id")+"";
 
                 report.setProcessDefinitionId(procDefId);
+                report.setProcessType("0");
                 mapper.insert(report);
 
                 Map<String ,Map<String,String >>  allMap = new HashMap<>();
@@ -465,7 +466,17 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
     }
 
     public void updateStatusById(EnrollmentRegistration dto) {
+        EnrollmentRegistration registration = mapper.getById(dto.getId());
         mapper.updateStatusById(dto.getId(), dto.getType());
+        //判断流程的类型  是入职登记流程 还是 个人信息完善流程
+        if (StringUtils.isNotBlank(registration.getProcessType()) && registration.getProcessType().equals("0")) {
+            //说明是入职登记流程  这时删除入职登记相关信息
+            mapper.deleteByIdOnPhysic(dto.getId());
+
+        }
+
+
+
     }
 
     public String remove(String id) {

+ 6 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/mapper/InterRegistrationMapper.java

@@ -45,4 +45,10 @@ public interface InterRegistrationMapper extends BaseMapper<Registration> {
 
     //获取最后一次发起报销且实习状态为结束,并且报销状态为完成的
     List<Registration> getTimeOutReimburseRegisters();
+
+    /**
+     * 根据id物理删除这条实习信息 (包括实现登记信息,实现经验信息,家庭成员信息)
+     * @param id
+     */
+    void deleteByIdOnPhysic(@Param("id")String id);
 }

+ 9 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/mapper/xml/InterRegistrationMapper.xml

@@ -41,6 +41,15 @@
     <update id="updatePracticeStatus">
         update human_resources_practice_registration set practice_status = '1',practice_complete_day = #{endTime} where user_id = #{createById}
     </update>
+    <delete id="deleteByIdOnPhysic">
+
+        DELETE a, b, c
+        FROM human_resources_practice_registration a
+        LEFT JOIN human_resources_practice_registration_experience b ON a.id = b.registration_id
+        LEFT JOIN human_resources_practice_registration_family_members c ON a.id = c.registration_id
+        WHERE a.id = #{id};
+
+    </delete>
 
     <select id="findList" resultType="com.jeeplus.human.practice.register.service.dto.RegistrationDto">
         select

+ 2 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/service/RegistrationService.java

@@ -69,6 +69,8 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 
     public void updateStatusById(RegistrationDto dto) {
         mapper.updateStatusById(dto.getId(), dto.getType());
+        //根据id将这一条实习登记信息物理删除
+        mapper.deleteByIdOnPhysic(dto.getId());
     }
 
     public Registration findById(String id) {