Browse Source

人力资源代码调整

wangqiang 1 year ago
parent
commit
27fd4ad1f4
19 changed files with 374 additions and 7 deletions
  1. 12 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/HumanApiFallBackFactory.java
  2. 14 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IHumanApi.java
  3. 5 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/UserApiFallbackFactory.java
  4. 3 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IUserApi.java
  5. 3 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
  6. 6 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java
  7. 117 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/controller/EnrollmentRegistrationController.java
  8. 2 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/domain/EnrollmentRegistration.java
  9. 7 0
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/mapper/EnrollmentRegistrationMapper.java
  10. 20 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/mapper/xml/EnrollmentRegistrationMapper.xml
  11. 67 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java
  12. 3 2
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/mapper/xml/InterRegistrationMapper.xml
  13. 3 1
      jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/mapper/xml/ReimburseRegisterMapper.xml
  14. 9 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  15. 5 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/UserApiImpl.java
  16. 5 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java
  17. 6 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml
  18. 13 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java
  19. 74 1
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 12 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/HumanApiFallBackFactory.java

@@ -5,6 +5,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @author 王强
  * @version 1.0
@@ -34,6 +36,16 @@ public class HumanApiFallBackFactory implements FallbackFactory<IHumanApi> {
             public String getFormalUserInfo() {
                 return null;
             }
+
+            @Override
+            public void insertIntoEnrollmentRegistrationInfo(String value) {
+
+            }
+
+            @Override
+            public List<String> getAllUserIdInSuccess() {
+                return null;
+            }
         };
     }
 }

+ 14 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IHumanApi.java

@@ -4,6 +4,9 @@ import com.jeeplus.common.constant.AppNameConstants;
 import com.jeeplus.flowable.factory.HumanApiFallBackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
 
 /**
  * @author 王强
@@ -33,4 +36,15 @@ public interface IHumanApi {
      */
     @GetMapping(value = "/register/getFormalUserInfo")
     String getFormalUserInfo();
+
+    /**
+     * 定时任务发起  个人信息完善所用
+     * @param value
+     */
+    @GetMapping(value = "/enrollmentRegistration/insertIntoEnrollmentRegistrationInfo")
+    void insertIntoEnrollmentRegistrationInfo(@RequestParam(value = "value")String value);
+
+    //获取所有的入职登记表中的有效数据的id
+    @GetMapping(value = "/enrollmentRegistration/getAllUserIdInSuccess")
+    List<String> getAllUserIdInSuccess();
 }

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/UserApiFallbackFactory.java

@@ -31,6 +31,11 @@ public class UserApiFallbackFactory implements FallbackFactory <IUserApi> {
         throwable.printStackTrace ( );
         return new IUserApi ( ) {
             @Override
+            public List<UserDTO> getAllUserInfos() {
+                return null;
+            }
+
+            @Override
             public Integer selectCountByMobile(String mobile) {
                 return null;
             }

+ 3 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IUserApi.java

@@ -21,6 +21,9 @@ public interface IUserApi {
 
     String BASE_URL = "/feign/sys/user";
 
+    @RequestMapping(value = BASE_URL + "/getAllUserInfos", method = RequestMethod.GET)
+    List<UserDTO> getAllUserInfos();
+
     /**
      * 根据联系电话查询用户
      * @return

+ 3 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -257,6 +257,9 @@ public class FlowableTaskController {
             } else if (key.equals("入职")){
                 String procInsId = getProcInsId(entry);
                 map1.put("入职", procInsId);
+            } else if (key.equals("完善个人信息")){
+                String procInsId = getProcInsId(entry);
+                map1.put("完善个人信息", procInsId);
             }
         }
         return map1 ;

+ 6 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/depart/handover/service/HandoverService.java

@@ -357,6 +357,12 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
         report.setUpdateById(userDTO.getId());
         report.setUpdateTime(new Date());
 
+        //设置底稿管理员
+
+        PostDTO accountsRoleInfo = SpringUtil.getBean(IPostApi.class).getPostDTOByName("底稿管理员");
+        String accountsAssignee = getAssignee(accountsRoleInfo.getId());
+        report.setDraftAdministrator(accountsAssignee);
+
         mapper.insert(report);
 
         //根据freemarker模板生成离职证明XML文件

+ 117 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/controller/EnrollmentRegistrationController.java

@@ -1,8 +1,12 @@
 package com.jeeplus.human.enrollment.enrollmentRegistration.controller;
 
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.human.depart.handover.domain.Handover;
 import com.jeeplus.human.depart.handover.service.HandoverService;
 import com.jeeplus.human.enrollment.enrollmentRegistration.domain.*;
@@ -11,10 +15,13 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.utils.HunamFreemarker
 import com.jeeplus.human.practice.register.domain.Registration;
 import com.jeeplus.logging.annotation.ApiLog;
 import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDPage;
 import org.apache.pdfbox.pdmodel.PDPageContentStream;
@@ -47,6 +54,7 @@ import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.time.LocalDate;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author 王强
@@ -201,13 +209,27 @@ public class EnrollmentRegistrationController {
     }
 
     /**
+     * 保存个人信息完善登记信息
+     * @param registration
+     * @return
+     */
+    @ApiLog(value = "保存个人信息完善登记信息", type = LogTypeEnum.SAVE)
+    @PostMapping("save2")
+    public ResponseEntity save2(@Valid @RequestBody EnrollmentRegistration registration) throws Exception {
+        EnrollmentRegistration s = service.saveRegistration2(registration);
+        return ResponseUtil.newInstance().add("businessTable", "human_resources_enrollment_registration")
+                .add("businessId", s.getId())
+                .ok ("操作成功");
+    }
+
+    /**
      * 保存入职人员登记信息
      * @param registration
      * @return
      */
     @ApiLog(value = "修改入职人员登记信息", type = LogTypeEnum.SAVE)
     @PostMapping("updateInfo")
-    public ResponseEntity updateInfo(@Valid @RequestBody Registration registration) throws Exception {
+    public ResponseEntity updateInfo(@Valid @RequestBody EnrollmentRegistration registration) throws Exception {
         service.updateRegistration(registration);
         return ResponseUtil.newInstance().ok("操作成功");
     }
@@ -267,6 +289,100 @@ public class EnrollmentRegistrationController {
     }
 
     /**
+     * 根据人员id查询是否有对应信息
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "根据人员id查询是否有对应信息")
+    @GetMapping("/findByUserId")
+    public Integer findByUserId(@RequestParam String userId) throws Exception{
+
+        /*List<UserDTO> allUserInfos = SpringUtil.getBean(IUserApi.class).getAllUserInfos();
+        List<String> allUserIdInSuccess = service.getAllUserIdInSuccess();
+        // 使用流操作过滤掉 allUserIdInSuccess 中存在的用户数据
+        List<UserDTO> filteredUsers = allUserInfos.stream()
+                .filter(user -> !allUserIdInSuccess.contains(user.getId()))
+                .collect(Collectors.toList());
+
+        for (int i=0;i<filteredUsers.size();i++){
+            //发起完善个人信息流程
+            Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("完善个人信息");
+            String procDefId = map.get("id")+"";
+
+            EnrollmentRegistration report = new EnrollmentRegistration();
+            String id = UUID.randomUUID().toString().replace("-", "");
+            report.setId(id);
+            report.setCreateById("1");
+            report.setCreateTime(new Date());
+            report.setUpdateById("1");
+            report.setType("2");
+            report.setUserId(filteredUsers.get(i).getId());
+            report.setUpdateTime(new Date());
+
+            report.setProcessDefinitionId(procDefId);
+
+            String value = JSON.toJSONString(report);
+            //先保存数据
+            service.insertIntoEnrollmentRegistrationInfo(value);
+
+
+
+            Map<String ,Map<String,String >>  allMap = new HashMap<>();
+
+            String procDefKey = map.get("key")+"";
+            String businessTable = "human_resources_enrollment_registration";
+
+            String businessId = id;
+            String title = "管理员发起了- [" + filteredUsers.get(i).getName() + "完善个人信息]";
+
+            String assignee = filteredUsers.get(i).getId();
+            String recordType = "";
+
+            Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
+            allMap.put("完善个人信息",newMap);
+            SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
+        }*/
+
+        return service.findByUserId(userId);
+    }
+
+    public Map<String,String> pingMap(String procDefId,String procDefKey,String businessTable,
+                                      String businessId,String title,String assignee,String recordType){
+        Map<String,String> map = new HashMap();
+        map.put("procDefId", procDefId);
+        map.put("procDefKey", procDefKey);
+        map.put("businessTable", businessTable);
+        map.put("businessId", businessId);
+        map.put("title", title);
+        map.put("assignee", assignee);
+        map.put("recordType", recordType);
+        return map;
+    }
+
+    /**
+     * 定时任务发起  个人信息完善所用
+     * @param value
+     * @return
+     */
+    @ApiOperation(value = "保存信息")
+    @GetMapping("/insertIntoEnrollmentRegistrationInfo")
+    public void insertIntoEnrollmentRegistrationInfo(String value) throws Exception{
+
+        service.insertIntoEnrollmentRegistrationInfo(value);
+
+    }
+
+    /**
+     * 获取所有的入职登记表中的有效数据的id
+     * @return
+     */
+    @ApiOperation(value = "获取所有的入职登记表中的有效数据的id")
+    @GetMapping("/getAllUserIdInSuccess")
+    public List<String> getAllUserIdInSuccess() throws Exception{
+        return service.getAllUserIdInSuccess();
+    }
+
+    /**
      * 根据人员登记id查询社保信息
      * @param id
      * @return

+ 2 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/domain/EnrollmentRegistration.java

@@ -38,12 +38,14 @@ public class EnrollmentRegistration extends BaseEntity {
     private String department;          //所属部门
     private String entryDate;           //进所日期
     private String contractStartDate;   //合同开始日期
+    private String contractEndDate;   //合同结束日期
     private String remarks;             //备注
     private String type;                //流程状态
     private String procInsId;
     private String processDefinitionId;
     private String userId;              //用户id
     private String projectManager;      //项目经理
+    private String processType;      //流程类型(0:入职登记流程,1:信息完善流程)
 
     @TableField(exist = false)
     private String socialSecurityNumber;        //社保编号

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

@@ -43,4 +43,11 @@ public interface EnrollmentRegistrationMapper extends BaseMapper<EnrollmentRegis
     void updateByUserId(@Param("userId") String userId);
 
     List<EnrollmentRegistration> getFormalUserInfo();
+
+    /**
+     * 查询出 实习与入职登记表中 有效的用户id
+     * @return
+     */
+    @InterceptorIgnore(tenantLine = "true")
+    List<String> getAllUserIdInSuccess();
 }

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

@@ -33,6 +33,7 @@
         a.department,
         a.entry_date,
         a.contract_start_date,
+        a.contract_end_date,
         a.tenant_id,
         a.type,
         a.proc_ins_id,
@@ -40,7 +41,8 @@
         a.user_id,
         a.project_manager,
         a.remarks,
-        a.on_job_status
+        a.on_job_status,
+        a.process_type
     </sql>
     <update id="updateStatusById">
         UPDATE human_resources_enrollment_registration SET type = #{type}
@@ -88,4 +90,21 @@
         LEFT JOIN sys_user su on a.user_id = su.id and su.del_flag = '0'
         WHERE a.on_job_status = '离职'
     </select>
+    <select id="getAllUserIdInSuccess" resultType="java.lang.String">
+        SELECT DISTINCT a.user_id
+        FROM human_resources_enrollment_registration a
+        LEFT JOIN sys_user su ON a.user_id = su.id
+        WHERE a.del_flag = '0' AND a.user_id IS NOT NULL AND a.user_id != '' and su.del_flag = '0'
+
+        UNION
+
+        SELECT DISTINCT b.user_id
+        FROM (
+            SELECT DISTINCT a.user_id
+            FROM human_resources_practice_registration a
+                LEFT JOIN sys_user su ON a.user_id = su.id
+            WHERE a.del_flag = '0' AND a.user_id IS NOT NULL AND a.user_id != '' and su.del_flag = '0'
+
+        ) b;
+    </select>
 </mapper>

+ 67 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java

@@ -1,6 +1,8 @@
 package com.jeeplus.human.enrollment.enrollmentRegistration.service;
 
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -88,6 +90,17 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         return add(registration);
     }
 
+    public EnrollmentRegistration saveRegistration2(EnrollmentRegistration registration) throws Exception {
+        if (StringUtils.isNotEmpty(registration.getId())){
+
+            EnrollmentRegistration report = mapper.getById(registration.getId());
+            if (report != null){
+                return update2(registration);
+            }
+        }
+        return add(registration);
+    }
+
     /**
      * 新增
      */
@@ -419,12 +432,38 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         return report;
     }
 
+    /**
+     * 修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public EnrollmentRegistration update2(EnrollmentRegistration reportData) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
+
+        EnrollmentRegistration report = new EnrollmentRegistration();
+        BeanUtils.copyProperties(reportData, report);
+        report.setUpdateById(userDTO.getId());
+        report.setUpdateTime(new Date());
+
+        mapper.updateById(report);
+        return report;
+    }
+
     public EnrollmentRegistration findById(String id) throws Exception {
         // 查询基础信息表
         EnrollmentRegistration info = mapper.getById(id);
         return info;
     }
 
+    public Integer findByUserId(String userId) throws Exception {
+        QueryWrapper<EnrollmentRegistration> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId);
+        queryWrapper.eq("del_flag", 0);
+        // 删除基础信息表
+        Integer integer = mapper.selectCount(queryWrapper);
+        return integer;
+    }
+
     public void updateStatusById(EnrollmentRegistration dto) {
         mapper.updateStatusById(dto.getId(), dto.getType());
     }
@@ -458,7 +497,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         return mapper.getFormalUserInfo();
     }
 
-    public void updateRegistration(Registration reportData) {
+    public void updateRegistration(EnrollmentRegistration reportData) {
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
 
@@ -468,5 +507,32 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         report.setUpdateTime(new Date());
 
         mapper.updateById(report);
+
+        if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
+            EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
+            String amountId = UUID.randomUUID().toString().replace("-", "");
+            securityCard.setId(amountId);
+            securityCard.setCreateById("1");
+            securityCard.setCreateTime(new Date());
+            securityCard.setUpdateById("1");
+            securityCard.setUpdateTime(new Date());
+            securityCard.setSocialSecurityNumber(report.getSocialSecurityNumber());
+            securityCard.setSocialSecurityBankNumber(report.getSocialSecurityBankNumber());
+            securityCard.setSocialSecurityPictureFront(report.getSocialSecurityPictureFront());
+            securityCard.setSocialSecurityPictureOpposite(report.getSocialSecurityPictureOpposite());
+            securityCard.setEnrollmentRegistrationId(report.getId());
+
+            socialSecurityCardMapper.insert(securityCard);
+        }
+
+    }
+
+    public void insertIntoEnrollmentRegistrationInfo(String value) {
+        EnrollmentRegistration infos = JSON.parseObject(value, new TypeReference<EnrollmentRegistration>() {});
+        mapper.insert(infos);
+    }
+
+    public List<String> getAllUserIdInSuccess() {
+        return mapper.getAllUserIdInSuccess();
     }
 }

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

@@ -39,7 +39,7 @@
         update human_resources_practice_registration set del_flag = '1' where id = #{id}
     </update>
     <update id="updatePracticeStatus">
-        update human_resources_practice_registration set practice_status = '已结束',practice_complete_day = #{endTime} where user_id = #{createById}
+        update human_resources_practice_registration set practice_status = '1',practice_complete_day = #{endTime} where user_id = #{createById}
     </update>
 
     <select id="findList" resultType="com.jeeplus.human.practice.register.service.dto.RegistrationDto">
@@ -80,6 +80,7 @@
         <where>
             a.del_flag = 0
             and a.type = 5
+            and a.practice_status = '0'
             AND b.last_create_time &lt;= #{threeDayAgo}
         </where>
         ORDER BY a.update_time DESC
@@ -120,6 +121,6 @@
         create_by_id
         ) b ON a.user_id = b.create_by_id
         left join sys_user su on a.user_id = su.id
-        where a.practice_status = '结束' and su.del_flag = '0'
+        where a.practice_status = '1' and su.del_flag = '0'
     </select>
 </mapper>

+ 3 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/mapper/xml/ReimburseRegisterMapper.xml

@@ -67,7 +67,9 @@
         left join human_resources_practice_registration_bank hbank on a.create_by_id = hbank.user_id
         ${ew.customSqlSegment}
         and a.id not in (
-        select DISTINCT human_reimburse_register_id from human_reimbursement_detail_info_procured WHERE del_flag = '0'
+        select DISTINCT a.human_reimburse_register_id from human_reimbursement_detail_info_procured a
+        LEFT JOIN cw_reimbursement_info b on a.info_id = b.id
+        WHERE a.del_flag = '0' and b.type = '5'
         )
         ORDER BY a.create_time DESC
     </select>

+ 9 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -1374,6 +1374,15 @@ public class UserController {
         return "修改成功";
     }
 
+    /**
+     * 根据用户id获取电话号码
+     */
+    @ApiLog("根据用户id获取电话号码")
+    @PostMapping("getMobileById")
+    public String getMobileById(String id){
+        return userService.getMobileById(id);
+    }
+
 
 
 

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/UserApiImpl.java

@@ -34,6 +34,11 @@ public class UserApiImpl implements IUserApi {
     private UserService userService;
 
     @Override
+    public List<UserDTO> getAllUserInfos() {
+        return userService.getAllUserInfoByTentId();
+    }
+
+    @Override
     public Integer selectCountByMobile(String mobile) {
         Integer num = userService.selectCountByMobile(mobile);
         return num;

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -255,4 +255,9 @@ public interface UserMapper extends BaseMapper <User> {
     @InterceptorIgnore(tenantLine = "true")
     Integer getUserPostCountById(@Param("id") String id);
 
+    @InterceptorIgnore(tenantLine = "true")
+    List<UserDTO> getAllUserInfoByTentId(@Param("tentId1")String tentId1, @Param("tentId2")String tentId2);
+
+    @InterceptorIgnore(tenantLine = "true")
+    String getMobileById(String id);
 }

+ 6 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -581,5 +581,11 @@ select a.id, a.company_id as "companyDTO.id", a.office_id as "officeDTO.id", a.l
             sp.CODE = 'bmzr'
             AND a.id = #{id}
     </select>
+    <select id="getAllUserInfoByTentId" resultType="com.jeeplus.sys.service.dto.UserDTO">
+        select distinct id,name from sys_user where del_flag = '0' and tenant_id IN (#{tentId1},#{tentId2})
+    </select>
+    <select id="getMobileById" resultType="java.lang.String">
+        select mobile from sys_user where del_flag = '0' and id = #{id}
+    </select>
 
 </mapper>

+ 13 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -611,6 +611,15 @@ public class UserService extends ServiceImpl <UserMapper, User> {
     }
 
     /**
+     * 获取所有的用户数据
+     * @return
+     */
+    public List<UserDTO> getAllUserInfoByTentId() {
+        List<UserDTO> allUserInfo = userMapper.getAllUserInfoByTentId("10001","10003");
+        return allUserInfo;
+    }
+
+    /**
      * 查询出拥有权限的用户的部门id
      * @return
      */
@@ -684,4 +693,8 @@ public class UserService extends ServiceImpl <UserMapper, User> {
     public Integer getUserPostCountById(String id) {
         return userMapper.getUserPostCountById (id);
     }
+
+    public String getMobileById(String id) {
+        return userMapper.getMobileById(id);
+    }
 }

+ 74 - 1
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

@@ -7,9 +7,11 @@ import com.jeeplus.domain.*;
 import com.jeeplus.flowable.feign.IAssessApi;
 import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.sys.feign.IPostApi;
+import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.ITenantApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.PostDTO;
+import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -32,6 +34,7 @@ import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 /**
  * XxlJob开发示例(Bean模式)
@@ -93,6 +96,63 @@ public class SampleXxlJob {
     }
 
     /**
+     * 6、给所有的财务员工及评估员工发送完善个人信息待办
+     */
+    @XxlJob("processForUser")
+    public void processForUser() throws Exception {
+        //查询出所有的评估员工及财务员工的用户信息
+        List<UserDTO> allUserInfos = SpringUtil.getBean(IUserApi.class).getAllUserInfos();
+        //查询出 入职登记表中所有的有效的数据
+        List<String> allUserIdInSuccess = SpringUtil.getBean(HumanFeignApi.class).getAllUserIdInSuccess();
+        //两者匹配看是对应否在库中已经登记过信息,如果没有,那么则发送待办
+        // 使用流操作过滤掉 allUserIdInSuccess 中存在的用户数据
+        List<UserDTO> filteredUsers = allUserInfos.stream()
+                .filter(user -> !allUserIdInSuccess.contains(user.getId()))
+                .collect(Collectors.toList());
+
+
+        for (int i=0;i<filteredUsers.size();i++){
+            //发起完善个人信息流程
+            Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen(" - 完善个人信息");
+            String procDefId = map.get("id")+"";
+
+            EnrollmentRegistrationInfo report = new EnrollmentRegistrationInfo();
+            String id = UUID.randomUUID().toString().replace("-", "");
+            report.setId(id);
+            report.setCreateById("1");
+            report.setCreateTime(new Date());
+            report.setUpdateById("1");
+            report.setUpdateTime(new Date());
+            report.setType("2");
+            report.setUserId(filteredUsers.get(i).getId());
+
+            report.setProcessDefinitionId(procDefId);
+
+            String value = JSON.toJSONString(report);
+            //先保存数据
+            SpringUtil.getBean ( HumanFeignApi.class ).insertIntoEnrollmentRegistrationInfo(value);
+
+
+
+            Map<String ,Map<String,String >>  allMap = new HashMap<>();
+
+            String procDefKey = map.get("key")+"";
+            String businessTable = "human_resources_enrollment_registration";
+
+            String businessId = id;
+            String title = "管理员发起了- [" + filteredUsers.get(i).getName() + "完善个人信息]";
+
+            String assignee = filteredUsers.get(i).getId();
+            String recordType = "";
+
+            Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
+            allMap.put("完善个人信息",newMap);
+            SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
+        }
+
+    }
+
+    /**
      * 3、检查超过一定期限未提交实习日志且为【实习状态的】实习生信息 发送通知给杨娟(Bean模式)
      */
     @XxlJob("timeOutRegisters")
@@ -107,7 +167,7 @@ public class SampleXxlJob {
             String titleStr = null;
 
             taskName = "实习日志超时提醒";
-            titleStr = "实习生-"+ info.getName()+"已超过3天未发起日志填写。";
+            titleStr = "实习生-"+ info.getName()+"已超过7天未发起日志填写。";
 
 
 //            Set<String> noticeUserSet = new HashSet<String>();
@@ -524,4 +584,17 @@ public class SampleXxlJob {
     public void notFiledYetReportArchiveListTask() {
         SpringUtil.getBean ( FinanceFeignApi.class ).getNotFiledYetList();
     }
+
+    public Map<String,String> pingMap(String procDefId,String procDefKey,String businessTable,
+                                      String businessId,String title,String assignee,String recordType){
+        Map<String,String> map = new HashMap();
+        map.put("procDefId", procDefId);
+        map.put("procDefKey", procDefKey);
+        map.put("businessTable", businessTable);
+        map.put("businessId", businessId);
+        map.put("title", title);
+        map.put("assignee", assignee);
+        map.put("recordType", recordType);
+        return map;
+    }
 }