Pārlūkot izejas kodu

员工转正申请

sangwenwei 1 gadu atpakaļ
vecāks
revīzija
c2fa2b7729
33 mainītis faili ar 945 papildinājumiem un 34 dzēšanām
  1. 24 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/ApplyFallbackFactory.java
  2. 16 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/RegularApplyApi.java
  3. 12 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/controller/BorrowController.java
  4. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/domain/Refund.java
  5. 5 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/domain/RefundHis.java
  6. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java
  7. 14 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml
  8. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java
  9. 43 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/controller/StaffUserInfoController.java
  10. 33 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/RegularApply.java
  11. 1 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/StaffUserInfo.java
  12. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/RegularApplyMapper.java
  13. 7 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/StaffUserInfoMapper.java
  14. 97 3
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffUserInfoMapper.xml
  15. 183 13
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/StaffUserInfoService.java
  16. 10 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/dto/StaffUserInfoDTO.java
  17. 1 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyMapper.xml
  18. 8 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyService.java
  19. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/service/JyWorkContractService.java
  20. 2 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/constant/FlowableConstant.java
  21. 1 1
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
  22. 4 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/Flow.java
  23. 11 3
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java
  24. 103 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/RegularApplyListener.java
  25. 10 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/OfficeController.java
  26. 39 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  27. 1 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java
  28. 3 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml
  29. 15 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java
  30. 5 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java
  31. 155 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/StaffUserInfoDTO.java
  32. 10 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/ApplyFeignApi.java
  33. 103 8
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 24 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/ApplyFallbackFactory.java

@@ -0,0 +1,24 @@
+package com.jeeplus.flowable.factory;
+
+import com.jeeplus.flowable.feign.RegularApplyApi;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class ApplyFallbackFactory implements FallbackFactory<RegularApplyApi> {
+
+    @Override
+    public RegularApplyApi create(Throwable cause) {
+        log.error ( "嘉溢项目服务调用失败:{}", cause.getMessage ( ) );
+        return new RegularApplyApi(){
+
+
+            @Override
+            public String getList() {
+                return null;
+            }
+        };
+    }
+}

+ 16 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/RegularApplyApi.java

@@ -0,0 +1,16 @@
+package com.jeeplus.flowable.feign;
+
+import com.jeeplus.common.constant.AppNameConstants;
+import com.jeeplus.flowable.factory.ApplyFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+
+
+@FeignClient(contextId = "ApplyApi", name = AppNameConstants.APP_JYPROJECT_MODULES, fallbackFactory = ApplyFallbackFactory.class)
+public interface RegularApplyApi {
+
+    @GetMapping(value = "/employeeEntry/getList")
+    String getList();
+
+
+}

+ 12 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/controller/BorrowController.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.domain.Refund;
+import com.jeeplus.business.borrow.domain.RefundHis;
 import com.jeeplus.business.borrow.service.BorrowService;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.borrow.service.dto.RefundDTO;
@@ -14,7 +15,6 @@ import com.jeeplus.common.excel.annotation.ExportMode;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.logging.annotation.ApiLog;
 import com.jeeplus.logging.constant.enums.LogTypeEnum;
-import com.jeeplus.pubmodules.collect.service.dto.CollectDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.http.ResponseEntity;
@@ -186,6 +186,17 @@ public class BorrowController {
     }
 
 
+    /**
+     * 根据还款历史id查询还款历史
+     */
+    @ApiOperation(value = "根据还款历史id查询还款历史")
+    @GetMapping(value = "findHisById")
+    public ResponseEntity<RefundHis> findHisById(@RequestParam String id){
+        RefundHis refundHis=borrowService.findHisById(id);
+        return ResponseEntity.ok(refundHis);
+    }
+
+
 
 
 

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/domain/Refund.java

@@ -20,6 +20,9 @@ public class Refund extends BaseEntity {
     //借款表id
     private String borrowId;
 
+    //剩余借款金额
+    private String finalMoney;
+
     /**
      * 流程
      */

+ 5 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/domain/RefundHis.java

@@ -20,6 +20,11 @@ public class RefundHis extends BaseEntity {
      */
     private String refundId;
 
+    /**
+     * 剩余借款金额
+     */
+    private String finalMoney;
+
     @TableField(exist = false)
     private String createName;
 

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.domain.Refund;
+import com.jeeplus.business.borrow.domain.RefundHis;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -32,4 +33,6 @@ public interface BorrowMapper extends BaseMapper<BorrowMoney> {
     IPage<BorrowMoney> listByUserId(@Param(Constants.WRAPPER)QueryWrapper<BorrowMoney> queryWrapper, Page<BorrowDTO> page);
 
     List<Refund> findByBorId(@Param("id") String id);
+
+    RefundHis findHisById(@Param("id")String id);
 }

+ 14 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml

@@ -107,6 +107,7 @@
             a.id,
             a.no,
             a.money_lower,
+            a.final_money,
             a.reason,
             so.name as officeName,
             su.name as createName
@@ -128,6 +129,19 @@
         where  a.del_flag = '0' and a.refund_id = #{id} order by a.create_time DESC
     </select>
 
+    <select id="findHisById" resultType="com.jeeplus.business.borrow.domain.RefundHis">
+        select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.refund_money,
+            a.final_money,
+            su.name as createName
+        from jy_refund_history a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        where a.id = #{id}
+    </select>
+
 
 
 </mapper>

+ 10 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java

@@ -99,6 +99,11 @@ public class BorrowService {
                             Float refund=Float.parseFloat(item.getRefundLower());
                             Float lower=refund+number;
                             item.setRefundLower(lower.toString());
+                            //同时修改剩余借款金额
+                            BorrowMoney borrowMoney = new BorrowMoney();
+                            borrowMoney.setId(item.getId());
+                            borrowMoney.setFinalMoney(money.toString());
+                            borrowMapper.updateById(borrowMoney);
                         }else {
                             Float moneyLower=Float.parseFloat(item.getMoneyLower());
                             Float number=Float.parseFloat(infoBorrow.getNumber());
@@ -258,6 +263,7 @@ public class BorrowService {
             refundHis.setRefundMoney(refund.getRefundLower());
             refundHis.setCreateById(refund.getCreateById());
             refundHis.setRefundId(refund.getId());
+            refundHis.setFinalMoney(refund.getFinalMoney());
             refundHis.setCreateTime(new Date());
             refundHisMapper.insert(refundHis);
         }
@@ -341,6 +347,10 @@ public class BorrowService {
         }else {
             return new BorrowDTO();
         }
+    }
 
+    public RefundHis findHisById(String id) {
+        RefundHis refundHis = borrowMapper.findHisById(id);
+        return refundHis;
     }
 }

+ 43 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/controller/StaffUserInfoController.java

@@ -1,15 +1,18 @@
 package com.jeeplus.business.humanResources.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.google.common.collect.Lists;
 import com.jeeplus.business.finance.util.EasyPoiUtil;
+import com.jeeplus.business.humanResources.domain.RegularApply;
 import com.jeeplus.business.humanResources.service.StaffUserInfoService;
 import com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO;
 import com.jeeplus.business.humanResources.service.dto.UserInfo;
 import com.jeeplus.business.humanResources.utils.IdCardUtil;
+import com.jeeplus.business.monthly.service.dto.MonthlyDTO;
 import com.jeeplus.common.excel.ExcelOptions;
 import com.jeeplus.common.excel.annotation.ExportMode;
 import com.jeeplus.common.utils.ResponseUtil;
@@ -17,8 +20,7 @@ import com.jeeplus.logging.annotation.ApiLog;
 import com.jeeplus.logging.constant.enums.LogTypeEnum;
 import com.jeeplus.sys.feign.IOfficeApi;
 import com.jeeplus.sys.service.dto.OfficeDTO;
-import com.jeeplus.sys.service.dto.UserDTO;
-import com.jeeplus.sys.utils.UserUtils;
+
 import com.jeeplus.sys.utils.excel.UserEasyExcel;
 import com.jeeplus.utils.StringUtils;
 import io.swagger.annotations.Api;
@@ -237,6 +239,45 @@ public class StaffUserInfoController {
 
     }
 
+    /**
+     * 根据id查询转正信息
+     */
+    @ApiOperation(value = "根据id查询转正信息")
+    @GetMapping(value = "findByApplyId")
+    public ResponseEntity<RegularApply> findByApplyId(@RequestParam String id){
+        RegularApply regularApply =staffUserInfoService.findByApplyId(id);
+        return ResponseEntity.ok(regularApply);
+    }
+
+    /**
+     * 保存/修改  转正信息
+     */
+    @ApiOperation(value = "保存/修改  转正信息")
+    @PostMapping(value = "/saveApplyForm")
+    public ResponseEntity saveApplyForm(@RequestBody RegularApply regularApply) throws Exception{
+        RegularApply apply= staffUserInfoService.saveApplyForm(regularApply);
+        return ResponseUtil.newInstance().add("businessTable", "jy_regular_apply").add("businessId", apply.getId()).add("isPass",apply.getIsPass()).add("isEmploy",apply.getIsEmploy()).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改转正状态status
+     * @param
+     */
+    @ApiOperation(value = "根据id修改转正状态status")
+    @PostMapping(value = "/updateStatusByApplyId")
+    public void updateStatusByApplyId(@RequestBody RegularApply regularApply) {
+        staffUserInfoService.updateStatusByApplyId(regularApply);
+    }
+
+    /**
+     * 获取试用期的所有人员信息
+     */
+    @GetMapping(value = "/getList")
+    public String getList() throws Exception {
+        List<StaffUserInfoDTO> pageList=staffUserInfoService.getList();
+        return JSON.toJSONString(pageList);
+    }
+
 
 
 

+ 33 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/RegularApply.java

@@ -0,0 +1,33 @@
+package com.jeeplus.business.humanResources.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_regular_apply")
+public class RegularApply extends BaseEntity {
+
+    //流程信息
+    private String procInsId;
+    private String processDefinitionId;
+    //状态
+    private String status;
+    //是否通过
+    private String isPass;
+    //是否留用
+    private String isEmploy;
+    //是否顺延
+    private String isPostpone;
+    //转正原因
+    private String reason;
+    //入职信息id
+    private String infoId;
+
+    @TableField(exist = false)
+    private String createName;
+    @TableField(exist = false)
+    private String officeName;
+
+}

+ 1 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/domain/StaffUserInfo.java

@@ -57,6 +57,7 @@ public class StaffUserInfo extends BaseEntity {
     private String email;               //邮箱
     private String fundNumber;          //公积金账号
     private String managerOffice;       //管理部门
+    private String timeLimit;   //试用期限
 
 
 

+ 10 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/RegularApplyMapper.java

@@ -0,0 +1,10 @@
+package com.jeeplus.business.humanResources.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.humanResources.domain.RegularApply;
+import org.apache.ibatis.annotations.Mapper;
+
+
+@Mapper
+public interface RegularApplyMapper extends BaseMapper<RegularApply> {
+}

+ 7 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/StaffUserInfoMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.humanResources.domain.RegularApply;
 import com.jeeplus.business.humanResources.domain.StaffUserInfo;
 import com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
@@ -24,4 +25,10 @@ public interface StaffUserInfoMapper extends BaseMapper<StaffUserInfo> {
     List<WorkAttachmentInfo> findDtos(@Param("id") String id,@Param("attachmentFlag") String attachmentFlag);
 
     void updatestatusById(@Param("type") String type, @Param("id") String id);
+
+    RegularApply findByApplyId(@Param("id")String id);
+
+    void updateStatusByApplyId(@Param("id")String id, @Param("status")String status);
+
+    List<StaffUserInfoDTO> getList();
 }

+ 97 - 3
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffUserInfoMapper.xml

@@ -43,17 +43,25 @@
             a.email,
             a.type,
             a.fund_number,
-            (case when su.login_flag = '0' then '冻结' when su.login_flag = '1' then '正常' else '' end) as flagName,
+            (case when su1.login_flag = '0' then '冻结' when su1.login_flag = '1' then '正常' else '' end) as flagName,
             a.manager_office,
             so.name as officeName,
             su.name as createName,
-            su.login_flag,
+            su1.login_flag,
             (select group_concat(name) from sys_role sr where FIND_IN_SET(sr.id,(select role_id from staff_user_info where id=a.id))) as roleName,
-            art1.ID_ as task_id
+            art1.ID_ as task_id,
+            ra.id as applyId,
+            ra.proc_ins_id as procInsIdApply,
+            ra.process_definition_id as procDefIdApply,
+            ra.status as applyStatus,
+            art2.ID_ as task_id_apply
         from staff_user_info a
         left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
         left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        left join sys_user su1 on a.user_id = su1.id and su1.del_flag = '0'
+        left join jy_regular_apply ra on ra.info_id = a.id and ra.del_flag = '0'
         LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.PROC_INST_ID_
+        LEFT JOIN act_ru_task art2 ON ra.proc_ins_id = art2.PROC_INST_ID_
          ${ew.customSqlSegment}
         ORDER BY a.update_time DESC
     </select>
@@ -96,6 +104,7 @@
             a.email,
             a.type,
             a.remarks,
+            a.time_limit,
             a.fund_number,
             a.manager_office,
             so.name as officeName,
@@ -129,6 +138,91 @@
         update staff_user_info set type = #{type} where id=#{id}
     </update>
 
+    <select id="findByApplyId" resultType="com.jeeplus.business.humanResources.domain.RegularApply">
+        select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.info_id,
+            a.is_pass,
+            a.is_employ,
+            a.is_postpone,
+            a.status,
+            a.reason,
+            su.name as createName,
+            so.name as officeName
+        from jy_regular_apply a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on so.id = su.office_id and so.del_flag = '0'
+        where a.id = #{id}
+    </select>
+
+    <update id="updateStatusByApplyId">
+        update jy_regular_apply set status = #{status} where id=#{id}
+    </update>
+
+    <select id="getList" resultType="com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO">
+    select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.name,
+            a.sex,
+            a.age,
+            a.birthday,
+            a.political_outlook,
+            a.native_place,
+            a.nation,
+            a.marital_status,
+            a.mobile_phone,
+            a.id_card,
+            a.home_address,
+            a.permanent_address,
+            a.graduated_from,
+            a.speciality,
+            a.start_time,
+            a.end_time,
+            a.education,
+            a.education_nature,
+            a.graduated_or_not,
+            a.english_level,
+            a.ncre,
+            a.department,
+            (select name from sys_office where id = a.department) as departmentName,
+            a.in_time,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.user_id,
+            a.on_job_status,
+            a.role_id,
+            a.post_id,
+            a.bank_number,
+            a.email,
+            a.type,
+            a.fund_number,
+            (case when su1.login_flag = '0' then '冻结' when su1.login_flag = '1' then '正常' else '' end) as flagName,
+            a.manager_office,
+            so.name as officeName,
+            su.name as createName,
+            su1.login_flag,
+            (select group_concat(name) from sys_role sr where FIND_IN_SET(sr.id,(select role_id from staff_user_info where id=a.id))) as roleName,
+            art1.ID_ as task_id,
+            ra.id as applyId,
+            ra.proc_ins_id as procInsIdApply,
+            ra.process_definition_id as procDefIdApply,
+            ra.status as applyStatus,
+            art2.ID_ as task_id_apply
+        from staff_user_info a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        left join sys_user su1 on a.user_id = su1.id and su1.del_flag = '0'
+        left join jy_regular_apply ra on ra.info_id = a.id and ra.del_flag = '0'
+        LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.PROC_INST_ID_
+        LEFT JOIN act_ru_task art2 ON ra.proc_ins_id = art2.PROC_INST_ID_
+    where a.on_job_status = '1'
+    </select>
 
 
 

+ 183 - 13
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/StaffUserInfoService.java

@@ -1,20 +1,30 @@
 package com.jeeplus.business.humanResources.service;
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.humanResources.domain.RegularApply;
 import com.jeeplus.business.humanResources.domain.StaffUserInfo;
+import com.jeeplus.business.humanResources.mapper.RegularApplyMapper;
 import com.jeeplus.business.humanResources.mapper.StaffUserInfoMapper;
 import com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO;
+import com.jeeplus.common.SecurityUtils;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IPostApi;
+import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.PostDTO;
+import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.utils.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -29,6 +39,9 @@ public class StaffUserInfoService {
     @Resource
     private StaffUserInfoMapper staffUserInfoMapper;
 
+    @Resource
+    private RegularApplyMapper regularApplyMapper;
+
     public IPage<StaffUserInfoDTO> findPageList(StaffUserInfoDTO userInfoDTO, Page<StaffUserInfoDTO> page) throws Exception {
         QueryWrapper<StaffUserInfoDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(userInfoDTO, StaffUserInfoDTO.class);
         queryWrapper.eq("a.del_flag",0);
@@ -171,36 +184,89 @@ public class StaffUserInfoService {
      */
     public String saveForm(StaffUserInfoDTO staffUserInfoDTO) {
         String id="";
-        //根据姓名获取员工信息
-        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getUserDTOByName(staffUserInfoDTO.getName());
+        //获取当前登陆人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
         String userId="";
-        if (ObjectUtils.isNotEmpty(userDTO)){
-            userId=userDTO.getId();
-        }else {
-            UserDTO dto = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
-            userId=dto.getId();
-        }
         StaffUserInfo staffUserInfo = new StaffUserInfo();
+
+        BeanUtils.copyProperties(staffUserInfoDTO,staffUserInfo);
+
+        staffUserInfo.setUpdateById(userDTO.getId());
+        staffUserInfo.setUpdateTime(new Date());
         String roleId="";
+        ArrayList<RoleDTO> roleDTOS = new ArrayList<>();
         //获取角色
         if (ObjectUtils.isNotEmpty(staffUserInfoDTO.getRoleIdList())){
             for (String role : staffUserInfoDTO.getRoleIdList()) {
+                RoleDTO roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(role);
+                roleDTOS.add(roleDTO);
                 roleId+=role+",";
             }
-        }else {
-            roleId=userDTO.getRoleIds();
         }
         //获取岗位
         String postId="";
+        ArrayList<PostDTO> postDTOS = new ArrayList<>();
+        PostDTO postDTO = new PostDTO();
         if (ObjectUtils.isNotEmpty(staffUserInfoDTO.getPostIdList())){
             for (String post : staffUserInfoDTO.getPostIdList()) {
+                postDTO.setId(post);
                 postId+=post+",";
             }
         }
-
-        BeanUtils.copyProperties(staffUserInfoDTO,staffUserInfo);
+        postDTOS.addAll(postDTOS);
         staffUserInfo.setPostId(postId);
         staffUserInfo.setRoleId(roleId);
+
+        //审核通过的时候往用户表中新增一条数据
+        if (StringUtils.isNotBlank(staffUserInfo.getType())){
+            if ("5".equals(staffUserInfo.getType())){
+                StaffUserInfoDTO staffUserInfoDTO1=staffUserInfoMapper.findById(staffUserInfo.getId());
+                if (StringUtils.isNotBlank(staffUserInfoDTO1.getUserId())){
+                    userId=staffUserInfoDTO1.getUserId();
+                }else {
+                    userId = UUID.randomUUID().toString().replace("-", "");
+                }
+                UserDTO dto = new UserDTO();
+                dto.setId(userId);
+                dto.setName(staffUserInfo.getName());
+                dto.setLoginName(staffUserInfo.getName());
+                dto.setLoginFlag("1");
+                dto.setPassword(SecurityUtils.encryptPassword("123456"));
+                dto.setMobile(staffUserInfo.getMobilePhone());
+                dto.setTenantDTO(userDTO.getTenantDTO());
+                dto.setCompanyDTO(userDTO.getCompanyDTO());
+                OfficeDTO officeDTO = new OfficeDTO();
+                officeDTO.setId(staffUserInfo.getDepartment());
+                dto.setOfficeDTO(officeDTO);
+                dto.setManageOfficeIds(staffUserInfo.getManagerOffice());
+                dto.setPostDTOList(postDTOS);
+                dto.setRoleDTOList(roleDTOS);
+                SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
+
+                staffUserInfo.setUserId(userId);
+
+                //如果是员工状态为试用的话,则往转正申请表中添加一条数据
+                if ("1".equals(staffUserInfo.getOnJobStatus())){
+                    //先判断转正表中有没有数据
+                    LambdaQueryWrapper<RegularApply> queryWrapper = new LambdaQueryWrapper<>();
+                    queryWrapper.eq(RegularApply::getInfoId,staffUserInfo.getId());
+                    RegularApply regularApply = regularApplyMapper.selectOne(queryWrapper);
+                    if (ObjectUtil.isEmpty(regularApply)){
+                        RegularApply regularApply1 = new RegularApply();
+                        regularApply1.setInfoId(staffUserInfo.getId());
+                        regularApply1.setCreateById(staffUserInfo.getUserId());
+                        regularApply1.setCreateTime(new Date());
+                        regularApply1.setUpdateById(staffUserInfo.getUserId());
+                        regularApply1.setUpdateTime(new Date());
+                        regularApply1.setStatus("0");
+                        regularApplyMapper.insert(regularApply1);
+                    }
+                }
+
+            }
+
+        }
+
         if (StringUtils.isNotBlank(staffUserInfoDTO.getId())){
             id=staffUserInfoDTO.getId();
             staffUserInfoMapper.updateById(staffUserInfo);
@@ -208,9 +274,9 @@ public class StaffUserInfoService {
             //获取id
             id = UUID.randomUUID().toString().replace("-", "");
             staffUserInfo.setId(id);
-            staffUserInfo.setUserId(userId);
             staffUserInfoMapper.insert(staffUserInfo);
         }
+
         if (ObjectUtils.isNotEmpty(staffUserInfoDTO)){
             Map<String,String> map = new HashMap<>();
             //承诺书
@@ -285,4 +351,108 @@ public class StaffUserInfoService {
         staffUserInfoMapper.deleteById(id);
         return "操作成功";
     }
+
+    /**
+     * 根据id查询转正信息
+     * @param id
+     * @return
+     */
+    public RegularApply findByApplyId(String id) {
+        RegularApply regularApply=staffUserInfoMapper.findByApplyId(id);
+        return regularApply;
+    }
+
+    /**
+     * 保存/修改转正信息
+     * @param regularApply
+     * @return
+     */
+    public RegularApply saveApplyForm(RegularApply regularApply) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        RegularApply apply = new RegularApply();
+        BeanUtils.copyProperties(regularApply,apply);
+        apply.setUpdateTime(new Date());
+        apply.setUpdateById(userDTO.getId());
+        if (StringUtils.isNotBlank(regularApply.getId())){
+            regularApplyMapper.updateById(apply);
+        }else {
+            regularApplyMapper.insert(apply);
+        }
+        RegularApply applyId = findByApplyId(regularApply.getId());
+        //查询入职表中的信息
+        StaffUserInfoDTO infoDTO = findById(applyId.getInfoId());
+        //判断是否通过
+        if (StringUtils.isNotBlank(regularApply.getIsPass()) ){
+            if (regularApply.getIsPass().equals("1")){
+                //不通过则去判断是否留用
+                if (StringUtils.isNotBlank(regularApply.getIsEmploy())){
+                    //不通过也不留用同时状态为5 则将该员工账号冻结
+                    if (regularApply.getIsPass().equals("1")&& regularApply.getIsEmploy().equals("1") && regularApply.getStatus().equals("5")){
+                        UserDTO dto = new UserDTO();
+                        dto.setLoginFlag("0");
+                        dto.setId(infoDTO.getUserId());
+                        SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
+                    }
+                    if (regularApply.getIsPass().equals("1") && regularApply.getIsEmploy().equals("0") && regularApply.getStatus().equals("5")){
+                        //不通过  留用  但发起人驳回的情况下获取当前登录人所属岗位是否是人事部  若是人事部则冻结账号
+                        for (PostDTO postDTO : userDTO.getPostDTOList()) {
+                            if ("人事部".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
+                                UserDTO dto = new UserDTO();
+                                dto.setLoginFlag("0");
+                                dto.setId(infoDTO.getUserId());
+                                SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
+                                break;
+                            }else if ("分管领导".equals(postDTO.getId()) && regularApply.getStatus().equals("5")){
+                                //否则的话则顺延一个月
+                                if (regularApply.getIsPostpone().equals("0")){
+                                    StaffUserInfo staffUserInfo = new StaffUserInfo();
+                                    staffUserInfo.setId(applyId.getInfoId());
+                                    //获取到原本的试用期限
+                                    int parseInt = Integer.parseInt(infoDTO.getTimeLimit());
+                                    //顺延一个月
+                                    int limit = parseInt+1;
+                                    staffUserInfo.setTimeLimit(limit+"");
+                                    //修改员工信息
+                                    staffUserInfoMapper.updateById(staffUserInfo);
+                                }
+                            }
+                        }
+
+
+                    }
+
+                }
+            }else {
+                if (regularApply.getStatus().equals("5")){
+                    //将员工状态改为正式
+                    StaffUserInfo staffUserInfo = new StaffUserInfo();
+                    staffUserInfo.setOnJobStatus("2");
+                    staffUserInfo.setId(applyId.getInfoId());
+                    staffUserInfoMapper.updateById(staffUserInfo);
+                }
+
+            }
+
+        }
+
+        return apply;
+    }
+
+    /**
+     * 根据id修改转正状态
+     * @param regularApply
+     */
+    public void updateStatusByApplyId(RegularApply regularApply) {
+        staffUserInfoMapper.updateStatusByApplyId(regularApply.getId(),regularApply.getStatus());
+    }
+
+    /**
+     * 获取试用期的所有人员信息
+     * @return
+     */
+    public List<StaffUserInfoDTO> getList() {
+        List<StaffUserInfoDTO> list=staffUserInfoMapper.getList();
+        return list;
+    }
 }

+ 10 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/service/dto/StaffUserInfoDTO.java

@@ -15,7 +15,6 @@ import java.util.Date;
 import java.util.List;
 
 @Data
-@TableName("staff_user_info")
 public class StaffUserInfoDTO extends BaseEntity {
 
     /**
@@ -158,6 +157,16 @@ public class StaffUserInfoDTO extends BaseEntity {
     @ExcelIgnore
     private String taskId;
 
+    private String timeLimit;   //试用期限
+
+
+    //转正申请
+    private String procInsIdApply;
+    private String procDefIdApply;
+    private String taskIdApply;
+    private String applyId;
+    private String applyStatus;
+
 
 
 

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyMapper.xml

@@ -61,7 +61,7 @@
         a.office_id,
         a.proc_ins_id,
         a.process_definition_id,
-        u.name,
+        u.name as createName,
         u.photo,
         b.read_num,
         b.un_read_num,

+ 8 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyService.java

@@ -29,12 +29,14 @@ import com.jeeplus.business.project.domain.JyProjectEiaQualificationFile;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.utils.CommonUtils;
+import com.jeeplus.notify.domain.Notify;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.utils.StringUtils;
 import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
@@ -290,7 +292,12 @@ public class JyNotifyService extends ServiceImpl <JyNotifyMapper, JyNotify> {
     public String saveForm(JyNotifyDTO notifyDTO) {
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         JyNotify notify = JyNotifyWrapper.INSTANCE.toEntity ( notifyDTO );
-        super.saveOrUpdate ( notify );
+        if (StringUtils.isNotBlank(notify.getId())){
+            notifyMapper.updateById(notify);
+        }else {
+            notifyMapper.insert(notify);
+        }
+//        super.saveOrUpdate ( notify );
         notifyDTO.setId ( notify.getId () );
         if (ObjectUtil.isNotEmpty(notifyDTO)) {
             //富文本内容

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/service/JyWorkContractService.java

@@ -90,6 +90,9 @@ public class JyWorkContractService {
         if (StringUtils.isNotEmpty(no)){
             queryWrapper.like("a.no",no);
         }
+        if (StringUtils.isNotEmpty(name)){
+            queryWrapper.like("a.name",name);
+        }
         if (StringUtils.isNotEmpty(filedType)) {
             queryWrapper.eq("a.filed_type", filedType);
         }

+ 2 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/constant/FlowableConstant.java

@@ -24,5 +24,7 @@ public interface FlowableConstant {
     String BEFORE_ADDSIGN = "before";    //前加签
     String RECORDTYPE="recordType";   //项目类型
     String DAYS="days"; //请假天数
+    String ISPASS="isPass";//是否通过
+    String ISEMPLOY="isEmploy"; // 是否留用
 
 }

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

@@ -167,7 +167,7 @@ public class FlowableTaskController {
      */
     @PostMapping("start")
     public ResponseEntity start(@RequestBody Flow flow) {
-        String procInsId = flowTaskService.startProcess ( flow.getProcDefKey ( ), flow.getBusinessTable ( ), flow.getBusinessId ( ), flow.getTitle ( ),flow.getRecordType(), flow.getProcDefId(),flow.getDays() );
+        String procInsId = flowTaskService.startProcess ( flow.getProcDefKey ( ), flow.getBusinessTable ( ), flow.getBusinessId ( ), flow.getTitle ( ),flow.getRecordType(), flow.getProcDefId(),flow.getDays(),flow.getIsPass(),flow.getIsEmploy() );
 
         //指定下一步处理人
         if ( StringUtils.isNotBlank ( flow.getAssignee ( ) ) ) {

+ 4 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/Flow.java

@@ -76,6 +76,10 @@ public class Flow {
 
     private String days;// 请假天数
 
+    private String isPass;  //是否通过
+
+    private String isEmploy; // 是否留用
+
 
     public Flow() {
         super ( );

+ 11 - 3
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -615,9 +615,9 @@ public class FlowTaskService {
      * @param recordType    项目类型
      * @return 流程实例ID
      */
-    public String startProcess(String procDefKey, String businessTable, String businessId, String title,String recordType, String procDefId,String days) {
+    public String startProcess(String procDefKey, String businessTable, String businessId, String title,String recordType, String procDefId,String days,String isPass,String isEmploy) {
         Map <String, Object> vars = Maps.newHashMap ( );
-        return startProcess ( procDefKey, businessTable, businessId, title,  vars ,recordType, procDefId,days);
+        return startProcess ( procDefKey, businessTable, businessId, title,  vars ,recordType, procDefId,days,isPass,isEmploy);
     }
 
     /**
@@ -631,7 +631,7 @@ public class FlowTaskService {
      * @return 流程实例ID
      */
     @SuppressWarnings("unused")
-    public String startProcess(String procDefKey, String businessTable, String businessId, String title, Map <String, Object> vars,String recordType,  String procDefId,String days) {
+    public String startProcess(String procDefKey, String businessTable, String businessId, String title, Map <String, Object> vars,String recordType,  String procDefId,String days,String isPass,String isEmploy) {
         //String userId = UserUtils.getUser().getLoginName();//ObjectUtils.toString(UserUtils.getUser().getId())
         // 设置流程变量
         if ( vars == null ) {
@@ -660,6 +660,14 @@ public class FlowTaskService {
         if (StrUtil.isNotBlank(days)){
             vars.put(FlowableConstant.DAYS,days);
         }
+        //设置是否通过
+        if (StrUtil.isNotBlank(isPass)){
+            vars.put(FlowableConstant.ISPASS,isPass);
+        }
+        //设置是否留用
+        if (StrUtil.isNotBlank(isEmploy)){
+            vars.put(FlowableConstant.ISEMPLOY,isEmploy);
+        }
 
         // 启动流程
         ProcessInstance procIns = runtimeService.startProcessInstanceByKeyAndTenantId ( procDefKey, businessTable + ":" + businessId, vars, /*tenantApi.getCurrentTenantId ( )*/ flowMapper.getTenantIdByProcDefKey(procDefKey) );

+ 103 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/RegularApplyListener.java

@@ -0,0 +1,103 @@
+package com.jeeplus.modules.flowable.listener;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.jeeplus.extension.domain.FlowCopy;
+import com.jeeplus.extension.service.FlowCopyService;
+import com.jeeplus.flowable.model.ActRuTaskInfo;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.flowable.service.MyNoticeService;
+import com.jeeplus.sys.feign.IPostApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.PostDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.SneakyThrows;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.ExecutionListener;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+@Component("RegularApplyListener")
+public class RegularApplyListener implements ExecutionListener {
+    @SneakyThrows
+    public void notify(DelegateExecution delegateExecution) {
+        String eventName = delegateExecution.getEventName ( );
+        System.out.println("--------- delegateExecution -----------" + delegateExecution);
+
+        if ( "start".equals ( eventName ) ) {
+            System.out.println ( "start=========" );
+        } else if ( "end".equals ( eventName ) ) {
+            //根据这里的 delegateExecution的id去act_ru_task表中查该流程的数据 对应表中的EXECUTION_ID_
+            ActRuTaskInfo task = SpringUtil.getBean(MyNoticeService.class).getTaskInfoByID(delegateExecution.getId());
+
+            if (null != task) {
+                List<Flow> flows = SpringUtil.getBean(FlowTaskService.class).historicTaskList(task.getProcInstId());
+                //根据PROC_DEF_ID_去act_re_deployment中查询流程的名称
+                String substring = task.getProcDefId().substring(0, task.getProcDefId().indexOf(":"));
+                String actName = SpringUtil.getBean(FlowTaskService.class).getActNameByDefId(substring);
+
+                String titleName = "";
+                // 根据流程定义ID查询流程实例
+                ProcessInstance processInstance = SpringUtil.getBean(RuntimeService.class).createProcessInstanceQuery()
+                        .processInstanceId(task.getProcInstId())
+                        .singleResult();
+
+                if (processInstance != null) {
+                    // 获取流程实例标题变量名(假设标题存储在名为"title"的变量中)
+                    String titleVariableName = "title";
+
+                    // 查询流程实例的标题变量
+                    Object title = SpringUtil.getBean(RuntimeService.class).getVariable(processInstance.getId(), titleVariableName);
+
+                    if (title != null) {
+                        titleName = title.toString();
+                    } else {
+                        // 如果标题变量不存在或者没有值,可以返回默认标题
+                        titleName = "";
+                    }
+                }
+                Flow flow = new Flow();
+                for (int i=0;i<flows.size();i++){
+                    if (flows.get(i).getComment().getMessage().equals("发起流程")){
+                        flow = flows.get(i);
+                    }
+                }
+
+                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+                UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(flow.getAssigneeId());
+                //获取到岗位为财务和出纳的人员信息
+                ArrayList<UserDTO> userDTOS = new ArrayList<>();
+
+                PostDTO postDTOByName = SpringUtil.getBean(IPostApi.class).getPostDTOByName("财务");
+                PostDTO postDTOByName1 = SpringUtil.getBean(IPostApi.class).getPostDTOByName("人事部");
+                List<UserDTO> listByPostId = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName.getId());
+                userDTOS.addAll(listByPostId);
+                List<UserDTO> listByPostId1 = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName1.getId());
+                userDTOS.addAll(listByPostId1);
+                String finalTitleName = titleName;
+                userDTOS.stream().forEach(item->{
+                    FlowCopy flowCopy = new FlowCopy();
+                    flowCopy.setProcDefId(task.getProcDefId());
+//                        flowCopy.setProcDefId(task.getProcDefId());
+                    flowCopy.setProcInsName(finalTitleName);
+                    flowCopy.setProcInsId(task.getProcInstId());
+                    flowCopy.setUserId(item.getId());
+                    SpringUtil.getBean(FlowCopyService.class).save(flowCopy);
+
+                });
+
+
+            }
+
+            System.out.println ( "end=========" );
+        } else if ( "take".equals ( eventName ) ) {//连线监听
+            System.out.println ( "take=========" );
+        }
+
+    }
+}

+ 10 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -151,6 +151,16 @@ public class OfficeController {
 
 
     /**
+     * 根据当前登陆人获取所在部门信息
+     */
+    @ApiLog("根据当前登陆人获取所在部门信息")
+    @GetMapping("JyListByUser")
+    public ResponseEntity <List <OfficeDTO>> JyListByUser(){
+        List <OfficeDTO> list = officeService.JyListByUser ( );
+        return ResponseEntity.ok ( list );
+    }
+
+    /**
      * 获取机构JSON数据。
      *
      * @param extId   排除的ID

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

@@ -847,6 +847,37 @@ public class UserController {
         return false;
     }
 
+    /**
+     * 判断当前登录人的岗位是否是部门主任
+     */
+    @ApiLog("判断当前登录人的岗位是否是部门主任")
+    @GetMapping("isBmzr")
+    @ApiOperation(value = "判断当前登录人的岗位是否是部门主任")
+    public Boolean isBmzr() {
+        UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
+        List<PostDTO> postDTOList = currentUserDTO.getPostDTOList();
+        for (PostDTO postDTO : postDTOList) {
+            if (postDTO.getCode().equals("bmzr")){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 判断当前登录人是否是admin
+     */
+    @ApiLog("判断当前登录人是否是admin")
+    @GetMapping("isJyAdmin")
+    @ApiOperation(value = "判断当前登录人是否是admin")
+    public Boolean isJyAdmin() {
+        UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
+        if (currentUserDTO.getName().equals("admin")){
+            return true;
+        }
+        return false;
+    }
+
 
 
 
@@ -1080,6 +1111,14 @@ public class UserController {
         userService.updateLoginFlag(id);
     }
 
+    //将人员激活
+    @ApiOperation(value = "将人员激活")
+    @PostMapping("updateLoginFlag1")
+    public void updateLoginFlag1(@RequestParam String id){
+        userService.updateLoginFlag1(id);
+    }
+
+
 
 
 

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

@@ -245,6 +245,7 @@ public interface UserMapper extends BaseMapper <User> {
     List<UserDTO> getJyUserList();
 
     void updateLoginFlag(@Param("id") String id);
+    void updateLoginFlag1(@Param("id") String id);
     /**
      * 删除原有员工管理的部门信息
      * @param userDTO

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

@@ -568,6 +568,9 @@ select DISTINCT a.id, a.company_id as "companyDTO.id", a.office_id as "officeDTO
     <update id="updateLoginFlag">
         update sys_user set login_flag = '0' where id = #{id}
     </update>
+    <update id="updateLoginFlag1">
+        update sys_user set login_flag = '1' where id = #{id}
+    </update>
 
     <delete id="deleteUserManageOffice">
 		delete from sys_user_manage_office where user_id = #{id}

+ 15 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -124,6 +124,21 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
         return baseMapper.findList ( queryWrapper );
     }
 
+
+    /**
+     * 获取列表
+     */
+    public List <OfficeDTO> JyListByUser(){
+        QueryWrapper queryWrapper = new QueryWrapper ( );
+        //根据当前人的所属部门去查相关数据
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        queryWrapper.eq("a.id",userDTO.getOfficeDTO().getId());
+        if(!"10000".equals(userDTO.getTenantDTO().getId()) && !"10002".equals(userDTO.getTenantDTO().getId())){
+            queryWrapper.eq ( StringUtils.isNotBlank ( userDTO.getTenantDTO().getId() ), "a.tenant_id", userDTO.getTenantDTO().getId() );
+        }
+        return baseMapper.findList ( queryWrapper );
+    }
+
     /**
      * 获取列表
      *

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

@@ -625,4 +625,9 @@ public class UserService extends ServiceImpl <UserMapper, User> {
     public void updateLoginFlag(String id) {
         userMapper.updateLoginFlag(id);
     }
+
+    //激活人员信息
+    public void updateLoginFlag1(String id) {
+        userMapper.updateLoginFlag1(id);
+    }
 }

+ 155 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/StaffUserInfoDTO.java

@@ -0,0 +1,155 @@
+package com.jeeplus.domain;
+
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class StaffUserInfoDTO extends BaseEntity {
+
+    /**
+     * 员工入职日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+
+    private Date inTime;
+
+    /**
+     * 用户id
+     */
+    @ExcelIgnore
+
+    private String userId;
+
+    private String name;                //姓名
+    @ExcelIgnore
+    private String sex;                 //性别
+    @ExcelIgnore
+    private String age;                 //年龄
+    @ExcelIgnore
+    private String birthday;            //出生日期
+    @ExcelIgnore
+    private String politicalOutlook;    //政治面貌
+
+    private String nativePlace;         //籍贯
+    @ExcelIgnore
+    private String nation;              //民族
+    @ExcelIgnore
+    private String maritalStatus;       //婚姻状况
+
+    private String mobilePhone;         //联系电话
+
+    private String idCard;              //身份证号码
+    @ExcelIgnore
+    private String homeAddress;         //家庭住址
+    @ExcelIgnore
+    private String permanentAddress;    //常住地址
+    @ExcelIgnore
+    private String graduatedFrom;       //毕业院校
+    @ExcelIgnore
+    private String speciality;          //专业
+    @ExcelIgnore
+    private String startTime;           //开始时间
+    @ExcelIgnore
+    private String endTime;             //毕业时间
+    @ExcelIgnore
+    private String education;           //学历
+    @ExcelIgnore
+    private String educationNature;     //学历性质
+    @ExcelIgnore
+    private String graduatedOrNot;      //是否毕业
+    @ExcelIgnore
+    private String englishLevel;        //英语等级
+    @ExcelIgnore
+    private String ncre;                //计算机等级
+
+    private String department;          //所属部门
+    @ExcelIgnore
+    private String departmentName;
+    @ExcelIgnore
+    private String remarks;             //备注
+    @ExcelIgnore
+
+    private String type;                //流程状态
+    @ExcelIgnore
+    private String procInsId;
+    @ExcelIgnore
+    private String processDefinitionId;
+    @ExcelIgnore
+
+    private String onJobStatus;       //在职状态
+    @ExcelIgnore
+    private String roleId;            //角色
+    @ExcelIgnore
+    private String postId;            //岗位
+    @ExcelIgnore
+    private String bankNumber;        //银行账号
+    @ExcelIgnore
+    private String email;               //邮箱
+    @ExcelIgnore
+    private String fundNumber;          //公积金账号
+    @ExcelIgnore
+    private String managerOffice;       //管理部门
+
+
+
+
+    //部门
+    @ExcelIgnore
+    private String officeId;
+    @ExcelIgnore
+
+    private String officeName;
+    @ExcelIgnore
+
+    private String createName;
+
+    private Date createTime;
+
+
+    //员工状态
+    @ExcelIgnore
+
+    private String loginFlag;
+
+    private String flagName;
+
+    //创建时间
+    @ExcelIgnore
+    private String[] createDates;
+
+    //角色名称
+    @ExcelIgnore
+
+    private String roleName;
+    @ExcelIgnore
+    private List<String> roleIdList;
+    @ExcelIgnore
+    private List<String> postIdList;
+    @ExcelIgnore
+    private List<String> manageList;
+    @ExcelIgnore
+    private String taskId;
+
+    private String timeLimit;   //试用期限
+
+
+    //转正申请
+    private String procInsIdApply;
+    private String procDefIdApply;
+    private String taskIdApply;
+    private String applyId;
+    private String applyStatus;
+
+
+
+
+}

+ 10 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/feign/ApplyFeignApi.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.feign;
+
+import com.jeeplus.common.constant.AppNameConstants;
+import com.jeeplus.flowable.feign.MonthlyApi;
+import com.jeeplus.flowable.feign.RegularApplyApi;
+import org.springframework.cloud.openfeign.FeignClient;
+
+@FeignClient(contextId = "ApplyFeignApi", name = AppNameConstants.APP_JYPROJECT_MODULES)
+public interface ApplyFeignApi extends RegularApplyApi {
+}

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

@@ -6,19 +6,15 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.jeeplus.domain.*;
-import com.jeeplus.flowable.feign.IAssessApi;
-import com.jeeplus.flowable.feign.IFlowableApi;
-import com.jeeplus.flowable.feign.IJyProjectApi;
-import com.jeeplus.flowable.feign.MonthlyApi;
+import com.jeeplus.flowable.feign.*;
 import com.jeeplus.sys.feign.IOfficeApi;
+import com.jeeplus.sys.feign.IPostApi;
 import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.PostDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.executor.feign.AssessFeignApi;
-import com.xxl.job.executor.feign.JyProjectAuditFeignApi;
-import com.xxl.job.executor.feign.JyProjectUserSealFeignApi;
-import com.xxl.job.executor.feign.ReportsSubmitFeignApi;
+import com.xxl.job.executor.feign.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,6 +61,105 @@ public class SampleXxlJob {
     }
 
     /**
+     * 嘉溢转正申请发送通知
+     */
+    @XxlJob("regularApply")
+    public void regularApply() throws ParseException {
+        System.out.println("进来了---");
+        //获取人员信息
+        String list = SpringUtil.getBean(ApplyFeignApi.class).getList();
+        List<StaffUserInfoDTO> staffUserInfoDTOS = JSON.parseObject(list, new TypeReference<List<StaffUserInfoDTO>>() {});
+        for (StaffUserInfoDTO staffUserInfoDTO : staffUserInfoDTOS) {
+            //根据所在部门获取部门主任
+            List<UserDTO> userDTOS = SpringUtil.getBean(IUserApi.class).findListByOfficeId(staffUserInfoDTO.getDepartment());
+            for (UserDTO userDTO : userDTOS) {
+                if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
+                    for (PostDTO postDTO : userDTO.getPostDTOList()) {
+                        if (postDTO.getCode().equals("bmzr")){
+                            //创建calendar对象
+                            Calendar instance = Calendar.getInstance();
+                            //获取员工试用期限后的日期
+                            instance.setTime(staffUserInfoDTO.getInTime());
+                            //根据试用期限往后推相应的时间
+                            instance.add(Calendar.MONTH,Integer.parseInt(staffUserInfoDTO.getTimeLimit()));
+                            //获取推送后的日期
+                            Date newDate = instance.getTime();
+                            //获取到当前日期
+                            Date beginDate = new Date();
+                            //计算时间只差
+                            int interval1 = Integer.parseInt(this.getInterval(beginDate, newDate));
+                            String taskName = null;
+                            String titleStr = null;
+                            //如果还剩三天则发送通知
+                            if (interval1<=3 && interval1 >=0) {
+                                taskName = "转正申请还未提交";
+                                titleStr = "距离转正申请提交还剩" + interval1 + "天,请尽快提交";
+                                Set<String> noticeUserSet = new HashSet<String>();
+
+                                String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(userDTO.getId());
+                                UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
+                                if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
+                                    noticeUserSet.add(createUser.getId());
+                                }
+
+                                List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
+                                if(noticeUserList.size()>0) {
+                                    MyNoticeList myNotice = new MyNoticeList();
+                                    myNotice.setCreateById("1");
+                                    myNotice.setCreateTime(new Date());
+                                    myNotice.setUpdateById("1");
+                                    myNotice.setUpdateTime(new Date());
+                                    myNotice.setDelFlag(0);
+                                    //根据procInsId获取taskId
+//                        String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(jyAudit.getProjectProId());
+                                    myNotice.setTaskId("");
+                                    myNotice.setDefId("");
+                                    myNotice.setTitle(titleStr);
+                                    myNotice.setTaskName(taskName);
+                                    myNotice.setLink("结束");
+                                    myNotice.setType("0");
+                                    myNotice.setCreateUser("管理员");
+                                    myNotice.setCreateTime(new Date());
+                                    for (String noticeUserId : noticeUserList) {
+                                        myNotice.setNoticeId(noticeUserId);
+                                        myNotice.setNoticeName(createUser.getName());
+                                        //根据taskName和通知人 查询重复数量
+                                        String myNoticeInfo = JSON.toJSONString(myNotice);
+                                        Map<String, String> map = new HashMap();
+                                        map.put("myNoticeInfo", myNoticeInfo);
+                                        String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                                        MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {
+                                        });
+
+                                        if (null == repetitionCountBymyNotice) {
+                                            // 生成id
+                                            String id = UUID.randomUUID().toString().replace("-", "");
+                                            myNotice.setId(id);
+                                            myNotice.setRepetitionCount(0);
+
+                                            myNoticeInfo = JSON.toJSONString(myNotice);
+                                            map.put("myNoticeInfo", myNoticeInfo);
+                                            SpringUtil.getBean(IFlowableApi.class).insertMyNotice(map);
+                                        } else {
+                                            myNotice.setId(repetitionCountBymyNotice.getId());
+                                            myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount() + 1);
+
+                                            myNoticeInfo = JSON.toJSONString(myNotice);
+                                            map.put("myNoticeInfo", myNoticeInfo);
+                                            SpringUtil.getBean(IFlowableApi.class).updateMyNotice(map);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
+    /**
      * 嘉溢月报发送通知
      */
     @XxlJob("monthly")