Commit 2a8e6d99 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.4' into MVP1.4

# Conflicts:
#	yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/EmployeeBusinessController.java
#	yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TBusinessEmployeeExtendInfoService.java
#	yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TBusinessEmployeeExtendInfoServiceImpl.java
parents 8bcdbbb8 d41f0d29
......@@ -8,8 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.time.LocalDate;
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @description: 分页查询VO
* @author: wangweiguo
* @date: 2021/8/10
*/
@Setter
@Getter
@ToString
public class BusinessEmployeeExtendListVO implements Serializable {
/**
* 人员表主键
*/
@Schema(description = "人员表主键", name = "id")
private String id;
/**
* 人员拓展表主键
*/
@Schema(description = "人员拓展表主键", name = "extendId")
private String extendId;
/**
* 姓名
*/
@Schema(description = "姓名", name = "empName")
private String empName;
/**
* 身份证号
*/
@Schema(description = "身份证号")
private String empIdcard;
/**
* 入职日期
*/
@Schema(description = "入职日期", name = "businessEnjoinDate")
private LocalDate businessEnjoinDate;
/**
* 业务项目
*/
@Schema(description = "业务项目", name = "settleDomain")
private String settleDomain;
/**
* 部门名称
*/
@Schema(description ="所属部门")
private String departName;
/**
* 部门id
*/
@Schema(description ="部门id")
private Integer departId;
/**
* b端岗位
*/
@Schema(description ="岗位")
private String businessPost;
/**
* b端员工工号
*/
@Schema(description ="电信工号")
private String businessTelecomNumber;
/**
* 标签,字典值(英文逗号分割)
*/
@Schema(description ="标签,字典值(英文逗号分割)")
private String employeeTags;
/**
* B端在职状态 0在职 1离职 3临时
*/
@Schema(description ="B端在职状态 0在职 1离职 3临时")
private String businessWorkingStatus;
/**
* hro在职状态 0 在职 1 离职
*/
@Schema(description ="职状态 0 在职 1 离职 和businessWorkFlag字段联合判断临时")
private String workFlag;
/**
* hro在职状态 3临时
*/
@Schema(description ="3 临时,其他状态不判断")
private String workingStatusSub;
/**
* B端维护的离职时间
*/
@Schema(description ="B端维护的离职时间")
private LocalDateTime businessLeaveDate;
/**
* 证件类型 逗号分割
*/
@Schema(description ="证件类型 逗号分割")
private String documentType;
/**
* 结算主体名称
*/
@Schema(description ="结算主体名称")
private String settleDomainName;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @description: b端人员信息导出excel VO
* @author: wangweiguo
* @date: 2021/8/10
*/
@Getter
@Setter
@ToString
public class BusinessEmployeeExtentExcelVO implements Serializable {
/**
* 姓名
*/
@Schema(description = "姓名", name = "empName")
private String empName;
/**
* 身份证号
*/
@Schema(description = "身份证号")
private String empIdcard;
/**
* b端员工工号
*/
@Schema(description ="电信工号")
private String businessTelecomNumber;
/**
* 部门名称
*/
@Schema(description ="所属部门")
private String departName;
/**
* 部门id
*/
@Schema(description ="部门id")
private Integer departId;
/**
* 业务项目
*/
@Schema(description = "业务项目", name = "settleDomain")
private String settleDomain;
/**
* b端岗位
*/
@Schema(description ="岗位")
private String businessPost;
/**
* 第一学历和专业
*/
@Schema(description ="第一学历和专业")
private String firstDegreeAndMajor;
/**
* 第一学历院校
*/
@Schema(description ="第一学历院校")
private String firstDegreeGraduateSchool;
/**
* 最高学历和专业
*/
@Schema(description ="最高学历和专业")
private String highestDegreeAndMajor;
/**
* 最高学历院校
*/
@Schema(description ="最高学历院校")
private String highestDegreeGraduateSchool;
/**
* 联系方式
*/
@Schema(description ="联系方式")
private String contactInfo;
/**
* 档案所在地
*/
@Schema(description ="档案所在地")
private String archivesAddr;
/**
* 入职日期
*/
@Schema(description = "入职日期", name = "businessEnjoinDate")
private LocalDate businessEnjoinDate;
/**
* 标签,字典值(英文逗号分割)
*/
@Schema(description ="标签,字典值(英文逗号分割)")
private String employeeTags;
/**
* B端在职状态 0在职 1离职 3临时
*/
@Schema(description ="B端在职状态 0在职 1离职 3临时")
private String businessWorkingStatus;
/**
* hro在职状态 0 在职 1 离职
*/
@Schema(description ="职状态 0 在职 1 离职 和businessWorkFlag字段联合判断临时")
private String workFlag;
/**
* hro在职状态 3临时
*/
@Schema(description ="3 临时,其他状态不判断")
private String workingStatusSub;
/**
* B端维护的离职时间
*/
@Schema(description ="B端维护的离职时间")
private LocalDateTime businessLeaveDate;
/**
* 证件类型 逗号分割
*/
@Schema(description ="证件类型 逗号分割")
private String documentType;
/**
* 结算主体名称
*/
@Schema(description ="结算主体名称")
private String settleDomainName;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import lombok.Data;
import java.util.List;
/**
* @author hgw2
* @description B端使用的远程接口
* @date 2023/1/4
*/
@Data
public class BusinessEmployeeListVo {
private List<TBusinessEmployeeExtendInfo> empList;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
/**
* B端员工合同列表对象
* @Author fxj
* @Date 2020-08-25
**/
@Data
public class EmpContractBusinessPageVo {
/**
* 主键
*/
@Schema(description = "主键", name = "id")
private String id;
/**
* 员工主键
*/
@Schema(description = "员工主键", name = "empId")
private String empId;
/**
* 员工编码
*/
@Schema(description = "员工编码", name = "empNo")
private String empNo;
/**
* 员工姓名
*/
@Schema(description = "姓名", name = "empName")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号", name = "empIdcard")
private String empIdcard;
/**
* 合同性质
*/
@Schema(description = "合同性质", name = "contractName")
private String contractName;
/**
* 合同类型
*/
@Schema(description = "合同类型", name = "contractType")
private String contractType;
/**
* 合同起始日期
*/
@Schema(description = "合同起始日期", name = "contractStart")
private LocalDate contractStart;
/**
* 合同结束日期
*/
@Schema(description = "合同结束日期", name = "contractEnd")
private LocalDate contractEnd;
/**
* 签订情况
*/
@Schema(description = "签订情况", name = "situation")
private String situation;
/**
* 是否作废 0否/1是
*/
@Schema(description = "是否作废 0否/1是", name = "isObsolete")
private String isObsolete;
/**
* 是否在用 0是/1否
*/
@Schema(description = "是否在用 0是/1否", name = "inUse")
private String inUse;
/**
* 结算主体
*/
@Schema(description = "结算主体", name = "settleDomain")
private String settleDomain;
/**
* 续签次数
*/
@Schema(description = "续签次数", name = "settleDomain")
@TableField(exist = false)
private Integer renewCount;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import lombok.Data;
import java.util.List;
/**
* 获取B端员工详情
* @Author fxj
* @Date 2020-08-25
**/
@Data
public class EmployeeBusinessDetailVo {
/**
* 员工详情
**/
private EmployeeBusinessVo employeeBusinessVo;
/**
* 员工合同信息
**/
private List<TEmployeeContractInfo> contractInfoList;
/**
* 员工劳动合同开始日期
**/
private String contractStartDate;
/**
* 员工劳动合同结束日期
**/
private String contractEndDate;
/**
* 合同签订情况 新签/续签
**/
private String situation;
/**
* 累计续签次数
**/
private Integer situationCount;
/**
* 合同过期天数 默认提醒3个月的到期的合同,如果三个月外才到期的不做提示
**/
private Integer contractOverdue;
/**
* 社保停缴时间 如果有离职日期 限制对应离职的那条档案的社保派减日期
**/
private String socialReduceDate;
/**
* 公积金停缴时间 如果有离职日期 限制对应离职的那条档案的公积金派减日期
**/
private String fundReduceDate;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* B端列表对象
* @Author fxj
* @Date 2020-08-25
* @return
**/
@Data
public class EmployeeBusinessVo {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelAttribute(name = "主键", maxLength = 32)
@Schema(description = "主键", name = "id")
private String id;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空")
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelAttribute(name = "姓名", isNotEmpty = true, errorInfo = "姓名不能为空", maxLength = 32)
@Schema(description = "姓名", name = "empName")
private String empName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32, isIdCard = true)
@Schema(description = "身份证号", name = "empIdcard")
private String empIdcard;
/**
* 性别(1.男 2.女)
*/
@Length(max = 32, message = "性别不能超过32个字符")
@ExcelAttribute(name = "性别", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.SEX)
@Schema(description = "性别", name = "empSex")
private String empSex;
/**
* 年龄
*/
@ExcelAttribute(name = "年龄", errorInfo = "年龄不能为空",needExport = true)
@Schema(description = "年龄", name = "empAge")
private Integer empAge;
/**
* 出生日期
*/
@ExcelAttribute(name = "出生日期",isDate =true ,dateFormat = DateUtil.ISO_EXPANDED_DATE_FORMAT)
@Schema(description = "出生日期", name = "empBirthday")
private Date empBirthday;
/**
* 民族
*/
@Length(max = 32, message = "民族不能超过32个字符")
@ExcelAttribute(name = "民族", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.NATION)
@Schema(description = "民族", name = "empNational")
private String empNational;
/**
* 户口性质
*/
@Length(max = 32, message = "户口类型不能超过32个字符")
@ExcelAttribute(name = "户口类型", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.HOUSEHOLD_NATURE)
@Schema(description = "户口类型", name = "empRegisType")
private String empRegisType;
/**
* 银行卡号
*/
@Length(max = 32, message = "银行卡号不能超过32个字符")
@ExcelAttribute(name = "银行卡号", maxLength = 32)
@Schema(description = "银行卡号", name = "empBankNo")
private String empBankNo;
/**
* 开户行
*/
@Length(max = 32, message = "开户行不能超过32个字符")
@ExcelAttribute(name = "开户行", maxLength = 32)
@Schema(description = "开户行", name = "empBankName")
private String empBankName;
/**
* 学历
*/
@TableField(exist = false)
@ExcelAttribute(name = "学历", maxLength = 32,isNotEmpty = true,isDataId = true, dataType = ExcelAttributeConstants.EDUCATION)
@Schema(description = "学历", name = "educationName")
private String educationName;
/**
* 毕业学校
*/
@TableField(exist = false)
@ExcelAttribute(name = "毕业学校", maxLength = 64, isNotEmpty = true)
@Schema(description = "毕业学校", name = "school")
private String school;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期",isDate =true)
@Schema(description = "入职日期", name = "enjoinDate")
private LocalDate enjoinDate;
/**
* 业务项目
*/
@Length(max = 32, message = "业务项目不能超过32个字符")
@ExcelAttribute(name = "业务项目", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_LABLE)
@Schema(description = "业务项目", name = "empLabel")
private String empLabel;
/**
* 岗位
*/
@Length(max = 50, message = "岗位不能超过50个字符")
@ExcelAttribute(name = "岗位", maxLength = 50)
@Schema(description = "岗位", name = "post")
private String post;
/**
* 工时制度(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 32, message = "工时制度不能超过32个字符")
@ExcelAttribute(name = "工时制度", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
@Schema(description = "工时制度(数据字典) 1标准工时 2 综合工时 3不定时工时制", name = "workingHours")
private String workingHours;
/**
* 离职日期
*/
@ExcelAttribute(name = "离职日期",isDate =true)
@Schema(description = "离职日期", name = "leaveDate")
private Date leaveDate;
/**
* 离职原因
*/
@ExcelAttribute(name = "离职原因",isDataId = true, dataType = ExcelAttributeConstants.REDUCE_REASON)
@Schema(description = "离职原因", name = "leaveReason")
private String leaveReason;
/**
* 离职备注
*/
@ExcelAttribute(name = "离职备注")
@Schema(description = "离职备注", name = "leaveRemark")
private String leaveRemark;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
@Length(max = 32, message = "手机号不能超过32个字符")
@ExcelAttribute(name = "手机号", errorInfo = "手机号不能为空", maxLength = 32,isPhone = false)
@Schema(description = "手机号", name = "empPhone")
private String empPhone;
/**
* 备注
*/
@Length(max = 500, message = "备注不能超过32个字符")
@ExcelAttribute(name = "备注", maxLength = 500)
@Schema(description = "备注", name = "remark")
private String remark;
/**
* 是否删除 0未删除/1删除
*/
@NotBlank(message = "是否删除 0未删除/1删除不能为空")
@Length(max = 1, message = "是否删除 0未删除/1删除不能超过1个字符")
@ExcelAttribute(name = "是否删除 0未删除/1删除", errorInfo = "是否删除 0未删除/1删除不能为空", maxLength = 1, isDataId =true, dataType = ExcelAttributeConstants.STATUS_FLAG)
@Schema(description = "是否删除 0未删除/1删除", name = "deleteFlag")
private String deleteFlag;
/**
* 在职状态 0是/1否
*/
@NotBlank(message = "在职状态 0是/1否不能为空")
@Length(max = 1, message = "在职状态 0是/1否不能超过1个字符")
@ExcelAttribute(name = "在职状态", errorInfo = "在职状态 0是/1否不能为空", maxLength = 1, isDataId =true, dataType = ExcelAttributeConstants.STATUS_FLAG)
@Schema(description = "在职状态 0是/1否", name = "workFlag")
private String workFlag;
/**
* 所属单位
*/
@NotBlank(message = "所属单位不能为空")
@Length(max = 32, message = "所属单位不能超过32个字符")
@ExcelAttribute(name = "所属单位", isNotEmpty = true, errorInfo = "所属单位编码不能为空", maxLength = 32, isOrgan = true,isDataId = true, dataType = ExcelAttributeConstants.CUSTOMER)
@Schema(description = "所属单位", name = "belongUnit")
private String belongUnit;
/**
* 结算主体
*/
@NotBlank(message = "结算主体不能为空")
@Length(max = 32, message = "结算主体不能超过32个字符")
@ExcelAttribute(name = "结算主体", isNotEmpty = true, errorInfo = "结算主体编码不能为空", maxLength = 32,isOrgan = true,isDataId = true, dataType = ExcelAttributeConstants.DEPART)
@Schema(description = "结算主体", name = "settleDomain")
private String settleDomain;
/**
* b端员工工号
*/
@Schema(description ="电信员工工号")
private String businessTelecomNumber;
/**
* 标签,字典值(英文逗号分割)
*/
@Schema(description ="标签,字典值(英文逗号分割)")
private String employeeTags;
/**
* 第一学历和专业
*/
@Schema(description ="第一学历和专业")
private String firstDegreeAndMajor;
/**
* 第一学历院校
*/
@Schema(description ="第一学历院校")
private String firstDegreeGraduateSchool;
/**
* 最高学历和专业
*/
@Schema(description ="最高学历和专业")
private String highestDegreeAndMajor;
/**
* 最高学历院校
*/
@Schema(description ="最高学历院校")
private String highestDegreeGraduateSchool;
/**
* 联系方式
*/
@Schema(description ="联系方式")
private String contactInfo;
/**
* 档案所在地
*/
@Schema(description ="档案所在地")
private String archivesAddr;
/**
* 部门名称
*/
@Schema(description ="部门名称")
private String departName;
/**
* 拓展表id
*/
@Schema(description ="拓展表id")
private String extendId;
/**
* b端岗位
*/
private String businessPost;
/**
* B端维护的离职时间
*/
private LocalDate businessLeaveDate;
/**
* 入职时间
*/
@Schema(description ="入职时间")
private LocalDate businessEnjoinDate;
/**
* 部门id
*/
@Schema(description ="部门id")
private Integer departId;
/**
* 部门编码 对应部门实体中的TreeLogo
*/
@Schema(description ="部门编码 对应部门实体中的TreeLogo")
private String departCode;
@TableField(exist = false)
private List<String> settleDomainIds;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
/**
* 获取社保公积金派减日期
* @Author fxj
* @Date 2020-08-25
**/
@Data
public class SocialAndFundReduceVo {
private String empId;
/**
* 社保停缴时间 如果有离职日期 限制对应离职的那条档案的社保派减日期
**/
private String socialReduceDate;
/**
* 公积金停缴时间 如果有离职日期 限制对应离职的那条档案的公积金派减日期
**/
private String fundReduceDate;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @description: hroB端人员信息列表查询条件
* @author: wangweiguo
* @date: 2021/8/9
*/
@Getter
@Setter
@ToString
public class THroBusinessUserQuery implements Serializable {
/**
* 身份证号码
*/
@Schema(description ="身份证号码")
private String empIdcard;
/**
* 员工姓名
*/
@Schema(description ="姓名")
private String empName;
/**
* 部门名称
*/
@Schema(description ="部门名称")
private String departName;
/**
* 部门id
*/
@Schema(description ="部门id")
private String departId;
/**
* b端岗位
*/
@Schema(description ="岗位")
private String businessPost;
/**
* b端员工工号
*/
@Schema(description ="电信工号")
private String businessTelecomNumber;
/**
* 标签,字典值(英文逗号分割)
*/
@Schema(description ="标签名称")
private String employeeTagName;
/**
* 0 在职 1 个人离职 2 临时
*/
@Schema(description ="0 在职 1 离职 3 临时")
private String businessWorkingStatus;
/**
* 是否持证 0否 1是
*/
@Schema(description ="是否持证 0否 1是")
private String documentStatus;
/**
* 结算主体id
*/
@Schema(description ="结算主体id")
private String settleDomainId;
@JsonIgnore
private String deleteFlag;
@JsonIgnore
List<String> settleDomainIds;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
......@@ -17,6 +17,11 @@
<dependencies>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-business-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-check-api</artifactId>
......
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TBusinessDataListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.EmpBusinessConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -31,181 +47,257 @@ import java.util.List;
@Slf4j
public class EmployeeBusinessController {
private final TEmployeeInfoService tEmployeeInfoService;
private final TEmployeeProjectService tEmployeeProjectService;
private final TEmployeeContractInfoService tEmployeeContractInfoService;
private final TBusinessEmployeeExtendInfoService businessEmployeeExtendInfoService;
// @ApiOperation(value = "B端花名册简单分页查询")
// @GetMapping("/page")
// public R<IPage<BusinessEmployeeExtendListVO>> getTEmployeeBusinessPage(Page page, THroBusinessUserQuery query) {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// if (!R.isSuccess(businessPowerCheck(query))) {
// return R.fail(businessPowerCheck(query).getMsg());
// }
// return new R<>(tEmployeeInfoService.getTEmployeeBusinessPage(page, query));
// }
//
// /**
// * 通过id查询单条记录
// *
// * @param id
// * @return R
// */
// @ApiOperation(value = "B端获取员工的相关信息")
// @GetMapping("/getEmployeeBusinessInfoById")
// public R<EmployeeBusinessDetailVo> getEmployeeBusinessInfoById(@RequestParam(value = "id",required = true) String id, @RequestParam("settleDomain") String settleDomain) {
// if (!Common.isNotKong(id)){
// return R.fail("员工ID不可为空!");
// }
// return new R<>(tEmployeeInfoService.getEmployeeBusinessInfoById(id, settleDomain));
// }
//
// /**
// * 通过id查询单条记录
// *
// * @param id
// * @return R
// */
// @ApiOperation(value = "B端获取员工及B端附属信息")
// @GetMapping("/getEmployeeBusinessVoById")
// public R<EmployeeBusinessVo> getEmployeeBusinessVoById(@RequestParam(value = "id",required = true) String id) {
// if (!Common.isNotKong(id)){
// return R.fail("员工ID不可为空!");
// }
// return tEmployeeInfoService.getEmployeeBusinessVoById(id);
// }
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param dto
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "编辑:b端人员信息编辑拓展信息")
// @PutMapping("/updateEmployInfoByExtendId")
// public R<Boolean> updateEmployInfoByExtendId(@RequestBody @Valid UpdateBusinessEmployeeExtendDTO dto) {
// TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.getDataById(dto.getExtendId());
// if (null == tBusinessEmployeeExtendInfo) {
// tBusinessEmployeeExtendInfo = new TBusinessEmployeeExtendInfo();
// }
// tBusinessEmployeeExtendInfo.setId(dto.getExtendId());
// BeanUtil.copyProperties(dto, tBusinessEmployeeExtendInfo, CopyOptions.create().setIgnoreNullValue(true));
// if (StringUtils.isBlank(tBusinessEmployeeExtendInfo.getEmpName())) {
// TEmployeeInfo employeeInfo = this.tEmployeeInfoService.lambdaQuery().eq(TEmployeeInfo::getEmpIdcard, dto.getEmpIdcard()).last(CommonConstants.SQL_LIMIT_ONE).one();
// if (null != employeeInfo) {
// tBusinessEmployeeExtendInfo.setEmpName(employeeInfo.getEmpName());
// }
// }
// return businessEmployeeExtendInfoService.saveOrUpdateData(tBusinessEmployeeExtendInfo);
// }
//
// /**
// * b端人员信息批量导入更新人员信息拓展表
// * @description: 批量更新:b端人员信息批量导入更新人员信息拓展表
// * @param jsonStr
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "批量更新:b端人员信息批量导入更新人员信息拓展表")
// @PutMapping("/batchUpdateEmployeeExtendByJsonStr")
// public R<Boolean> batchUpdateEmployeeExtendByJsonStr(@RequestBody String jsonStr) {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail(CommonConstants.USER_FAIL);
// }
// if (CollUtil.isEmpty(user.getSettleIdList())) {
// return R.fail(BasicCommonErrorMsg.NO_SETTLE_DOMAIN_AUTH);
// }
// List<TEmployeeInfo> employeeInfoList = tEmployeeInfoService.lambdaQuery().in(TEmployeeInfo::getSettleDomain, user.getSettleIdList()).list();
// if (CollUtil.isEmpty(employeeInfoList)) {
// return R.fail(HRO_EMPLOYEE_NULL);
// }
//
// HashMap<String, TEmployeeInfo> empInfoMap = Common.listToHashMapByKey(employeeInfoList, "empIdcard");
// return businessEmployeeExtendInfoService.batchUpdateEmployeeExtendByJsonStr(jsonStr, empInfoMap);
// }
//
// /**
// * b端人员信息导出
// * @description: 导出:b端人员信息导出
// * @param query
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "导出:b端人员信息导出")
// @GetMapping("/exportByParams")
// public R<List<BusinessEmployeeExtentExcelVO>> exportByParams(THroBusinessUserQuery query) {
// if (!R.isSuccess(businessPowerCheck(query))) {
// return R.fail(businessPowerCheck(query).getMsg());
// }
// return this.tEmployeeInfoService.exportByParams(query);
// }
@Operation(description = "B端花名册简单分页查询")
@GetMapping("/page")
public R<IPage<BusinessEmployeeExtendListVO>> getTEmployeeBusinessPage(Page page, THroBusinessUserQuery query) {
YifuUser user = SecurityUtils.getUser();
if (user == null) {
return R.failed("请登录!");
}
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
* @param dto
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.List<ErrorMessage>>
* @author: wangweiguo
* @date: 2021/8/12
*/
@Inner
@PostMapping("/inner/updateEmployeeExtendRedundancy")
public Boolean updateEmployeeExtendRedundancy(@RequestBody UpdateEmployeeExtendRedundancyDTO dto) {
return this.businessEmployeeExtendInfoService.updateEmployeeExtendRedundancy(dto);
}
if (!R.isSuccess(businessPowerCheck(query))) {
return R.failed(businessPowerCheck(query).getMsg());
}
return new R<>(tEmployeeProjectService.getTEmployeeBusinessPage(page, query));
}
// /**
// * 按身份证单个更新证件冗余信息
// * @author: fxj
// * @date 2021-08-23
// * @param dto
// * @return
// */
// @Inner
// @PostMapping("/inner/updateEmpExtendCertInfo")
// public R<String> updateEmpExtendCertInfo(@RequestBody UpdateEmployeeExtendRedundancyDTO dto) {
// return this.businessEmployeeExtendInfoService.updateEmpExtendCertInfo(dto);
// }
//
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// @Inner
// @PostMapping("/inner/getListByIdcartList")
// public R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(@RequestBody List<String> idcardList) {
// if (CollUtil.isEmpty(idcardList)) {
// return R.fail("身份证号列表为空");
// }
// return this.businessEmployeeExtendInfoService.getListByIdcartList(idcardList);
// }
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(description = "B端获取员工的相关信息")
@GetMapping("/getEmployeeBusinessInfoById")
public R<EmployeeBusinessDetailVo> getEmployeeBusinessInfoById(@RequestParam(value = "id") String id, @RequestParam("settleDomain") String settleDomain) {
if (!Common.isNotNull(id)){
return R.failed("员工ID不可为空!");
}
return new R<>(tEmployeeProjectService.getEmployeeBusinessInfoById(id, settleDomain));
}
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Inner
@PostMapping("/inner/getNotLeaveExtendList")
public TBusinessDataListVo getNotLeaveExtendList() {
return this.businessEmployeeExtendInfoService.getNotLeaveExtendList();
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(description = "B端获取员工及B端附属信息")
@GetMapping("/getEmployeeBusinessVoById")
public R<EmployeeBusinessVo> getEmployeeBusinessVoById(@RequestParam(value = "id") String id) {
if (!Common.isNotNull(id)){
return R.failed("员工ID不可为空!");
}
return tEmployeeProjectService.getEmployeeBusinessVoById(id);
}
/**
* b端人员信息编辑拓展信息
* @description: b端人员信息编辑拓展信息
* @param dto
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
@Operation(description = "编辑:b端人员信息编辑拓展信息")
@PutMapping("/updateEmployInfoByExtendId")
public R<Boolean> updateEmployInfoByExtendId(@RequestBody @Valid UpdateBusinessEmployeeExtendDTO dto) {
TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo = businessEmployeeExtendInfoService.getDataById(dto.getExtendId());
if (null == tBusinessEmployeeExtendInfo) {
tBusinessEmployeeExtendInfo = new TBusinessEmployeeExtendInfo();
}
tBusinessEmployeeExtendInfo.setId(dto.getExtendId());
BeanUtil.copyProperties(dto, tBusinessEmployeeExtendInfo, CopyOptions.create().setIgnoreNullValue(true));
if (StringUtils.isBlank(tBusinessEmployeeExtendInfo.getEmpName())) {
TEmployeeProject employeeInfo = this.tEmployeeProjectService.lambdaQuery().eq(TEmployeeProject::getEmpIdcard, dto.getEmpIdcard()).last(CommonConstants.LAST_ONE_SQL).one();
if (null != employeeInfo) {
tBusinessEmployeeExtendInfo.setEmpName(employeeInfo.getEmpName());
}
}
return businessEmployeeExtendInfoService.saveOrUpdateData(tBusinessEmployeeExtendInfo);
}
/**
* b端人员信息批量导入更新人员信息拓展表
* @description: 批量更新:b端人员信息批量导入更新人员信息拓展表
* @param jsonStr
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
@Operation(description = "批量更新:b端人员信息批量导入更新人员信息拓展表")
@PutMapping("/batchUpdateEmployeeExtendByJsonStr")
public R<List<ErrorMessage>> batchUpdateEmployeeExtendByJsonStr(@RequestBody String jsonStr) {
YifuUser user = SecurityUtils.getUser();
if (user == null) {
return R.failed(CommonConstants.USER_FAIL);
}
if (CollUtil.isEmpty(user.getSettleIdList())) {
return R.failed(CommonConstants.NO_SETTLE_DOMAIN_AUTH);
}
List<TEmployeeProject> employeeInfoList = tEmployeeProjectService.lambdaQuery().in(TEmployeeProject::getDeptId, user.getSettleIdList()).list();
if (CollUtil.isEmpty(employeeInfoList)) {
return R.failed(CommonConstants.HRO_EMPLOYEE_NULL);
}
HashMap<String, TEmployeeProject> empInfoMap = Common.listToHashMapByKey(employeeInfoList, "empIdcard");
return businessEmployeeExtendInfoService.batchUpdateEmployeeExtendByJsonStr(jsonStr, empInfoMap);
}
/**
* b端人员信息导出
* @description: 导出:b端人员信息导出
* @param query
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
@Operation(description = "导出:b端人员信息导出")
@GetMapping("/exportByParams")
public R<List<BusinessEmployeeExtentExcelVO>> exportByParams(THroBusinessUserQuery query) {
if (!R.isSuccess(businessPowerCheck(query))) {
return R.failed(businessPowerCheck(query).getMsg());
}
return this.tEmployeeProjectService.exportByParams(query);
}
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
* @param dtoList
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.List<ErrorMessage>>
* @author: wangweiguo
* @date: 2021/8/12
*/
@Inner
@PostMapping("/inner/updateEmployeeExtendRedundancy")
public Boolean updateEmployeeExtendRedundancy(@RequestBody UpdateEmployeeExtendRedundancyDTO dtoList) {
return this.businessEmployeeExtendInfoService.updateEmployeeExtendRedundancy(dtoList);
}
/**
* 按身份证单个更新证件冗余信息
* @author: fxj
* @date 2021-08-23
* @param dto
* @return
*/
@Inner
@PostMapping("/inner/updateEmpExtendCertInfo")
public boolean updateEmpExtendCertInfo(@RequestBody UpdateEmployeeExtendRedundancyDTO dto) {
return this.businessEmployeeExtendInfoService.updateEmpExtendCertInfo(dto);
}
/**
* 根据身份证号获取拓展信息列表
* @description: 根据身份证号获取拓展信息列表
* @param idCardList
* @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
* @author: wangweiguo
* @date: 2021/8/16
*/
@Inner
@PostMapping("/inner/getListByIdCartList")
public BusinessEmployeeListVo getListByIdcartList(@RequestBody List<String> idCardList) {
BusinessEmployeeListVo vo = new BusinessEmployeeListVo();
if (CollUtil.isEmpty(idCardList)) {
return vo;
}
vo.setEmpList(businessEmployeeExtendInfoService.getListByIdCardList(idCardList));
return vo;
}
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Inner
@GetMapping("/inner/getNotLeaveExtendList")
public R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList() {
return this.businessEmployeeExtendInfoService.getNotLeaveExtendList();
}
/**
* @param
* @Description: 获取所有附属信息
* @Author: hgw
* @Date: 2021/8/18 16:46
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
**/
@Inner
@GetMapping("/inner/getInfoByLeaveMap")
public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
return this.businessEmployeeExtendInfoService.getInfoByLeaveMap();
}
/**
* @description: 校验数据权限
* @param query
* @return: com.yifu.cloud.v1.common.core.util.R
* @author: wangweiguo
* @date: 2021/8/11
*/
private R businessPowerCheck(THroBusinessUserQuery query) {
YifuUser user = SecurityUtils.getUser();
if (null == query){
query = new THroBusinessUserQuery();
}
// 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
// hrob2.0 去掉该判断,因为能查到不是b端的人员信息 --wwg 2021-08-12
// if (Common.isNotNull(query.getEmpName()))
// query.setSettleDomainId(null)
// return R.success("success")
List<String> settleDomainIds = new ArrayList<>();
boolean flag = !SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user);
if (flag){
settleDomainIds = user.getSettleIdList();
if (Common.isEmpty(settleDomainIds)) {
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
query.setSettleDomainIds(settleDomainIds);
// 无权限提示 有权限 按结算主体/项目ID 查询
if (Common.isNotNull(query.getSettleDomainId()) && checkUserAuth(query.getSettleDomainId(), settleDomainIds)){
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
// 管理员权限特殊处理
}else {
if (Common.isEmpty(query.getSettleDomainId()) && Common.isEmpty(query.getDepartId())){
return R.failed("项目和部门不可同时为空");
}
}
if (Common.isNotNull(settleDomainIds)){
query.setSettleDomainIds(settleDomainIds);
}
return R.ok();
}
/**
* 查看有无权限:无权限 true 有权限 false
* @Author fxj
* @Date 2020-09-04
* @param idStr
* @param settleDomainIds
* @return
**/
public static boolean checkUserAuth(String idStr, List<String> settleDomainIds) {
for (String id:settleDomainIds){
if (id.equals(idStr)){
return false;
}
}
return true;
}
/**
* 查询-列表:内部服务调用,获取所有员工拓展表信息
......@@ -216,8 +308,8 @@ public class EmployeeBusinessController {
*/
@Inner
@PostMapping("/inner/getAllExtendList")
public TBusinessDataListVo getAllExtendList() {
TBusinessDataListVo vo = new TBusinessDataListVo();
public TSettleDomainListVo getAllExtendList() {
TSettleDomainListVo vo = new TSettleDomainListVo();
List<TBusinessEmployeeExtendInfo> list = this.businessEmployeeExtendInfoService.list();
vo.setExtendInfo(list);
return vo;
......@@ -231,172 +323,113 @@ public class EmployeeBusinessController {
*/
@Inner
@PostMapping("/inner/getExtendByBusinessTelecomNumber")
public TBusinessEmployeeExtendInfo getExtendByBusinessTelecomNumber(@RequestBody String businessTelecomNumber) {
return this.businessEmployeeExtendInfoService.lambdaQuery()
.eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber)
.last(CommonConstants.LAST_ONE_SQL)
.one();
R<TBusinessEmployeeExtendInfo> getExtendByBusinessTelecomNumber(@RequestParam("businessTelecomNumber") String businessTelecomNumber) {
TBusinessEmployeeExtendInfo businessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.lambdaQuery()
.eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber)
.last(CommonConstants.LAST_ONE_SQL)
.one();
return R.ok(businessEmployeeExtendInfo,CommonConstants.SEARCH_SUCCESS);
}
// /**
// * @param
// * @Description: 获取所有附属信息
// * @Author: hgw
// * @Date: 2021/8/18 16:46
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// @Inner
// @GetMapping("/inner/getInfoByLeaveMap")
// public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
// return this.businessEmployeeExtendInfoService.getInfoByLeaveMap();
// }
//
//
// /**
// * @description: 校验数据权限
// * @param query
// * @return: com.yifu.cloud.v1.common.core.util.R
// * @author: wangweiguo
// * @date: 2021/8/11
// */
// private R businessPowerCheck(THroBusinessUserQuery query) {
// ExtendUser user = SecurityUtils.getUser();
// if (null == query){
// query = new THroBusinessUserQuery();
// }
// // 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
// // hrob2.0 去掉该判断,因为能查到不是b端的人员信息 --wwg 2021-08-12
//// if (Common.isNotKong(query.getEmpName())){
//// query.setSettleDomainId(null);
//// return R.success("success");
//// }
// List<String> settleDomainIds = new ArrayList<>();
// boolean flag = !SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user);
// if (flag){
// settleDomainIds = user.getSettleIdList();
// if (Common.isEmpty(settleDomainIds)) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// query.setSettleDomainIds(settleDomainIds);
// if (Common.isNotKong(query.getSettleDomainId())){
// // 无权限提示 有权限 按结算主体/项目ID 查询
// if (ServiceUtil.checkUserAuth(query.getSettleDomainId(),settleDomainIds)){
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// }
// // 管理员权限特殊处理
// }else {
// if (Common.isEmpty(query.getSettleDomainId()) && Common.isEmpty(query.getDepartId())){
// return R.fail("项目和部门不可同时为空");
// }
// }
// if (Common.isNotKong(settleDomainIds)){
// query.setSettleDomainIds(settleDomainIds);
// }
// return R.success("success");
// }
//
// /**
// * B端合同列表查询接口
// * @Author fxj
// * @Date 2020-08-25
// * @param page
// * @param contractBusinessPageVo
// * @param flag 0 按3个月内到期提醒 1 不安提醒查询
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端合同列表查询接口(flag: 0-按3个月内到期提醒 1-不安提醒查询)")
// @GetMapping("/getContractBusinessPage")
// public R<IPage<EmpContractBusinessPageVo>> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, Integer flag) {
// if (null == flag){
// flag = 1;
// }
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// if (null == contractBusinessPageVo){
// contractBusinessPageVo = new EmpContractBusinessPageVo();
// }
// contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO);
// // 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
// if (Common.isNotKong(contractBusinessPageVo.getEmpName())){
// contractBusinessPageVo.setSettleDomain(null);
// }
// List<String> settleDomainIds = new ArrayList<>();
// if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
// settleDomainIds = user.getSettleIdList();
// if (Common.isEmpty(settleDomainIds)) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// if (Common.isNotKong(contractBusinessPageVo.getSettleDomain())){
// // 无权限提示 有权限 按结算主体/项目ID 查询
// if (ServiceUtil.checkUserAuth(contractBusinessPageVo.getSettleDomain(),settleDomainIds)){
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// settleDomainIds = null;
// }
// // 管理员权限特殊处理
// }else {
// if (Common.isEmpty(contractBusinessPageVo.getSettleDomain())){
// return new R<>(null);
// }
// }
// return new R<>(tEmployeeContractInfoService.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds, flag));
// }
//
// /**
// * B端查询合同到期提醒数(查询3个月内到期的合同)
// * @Author fxj
// * @Date 2020-08-25
// * @param
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端查询合同到期提醒数(查询3个月内到期的合同)")
// @GetMapping("/getContractBusinessAlertCount")
// public R<Integer> getContractBusinessAlertCount() {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// List<String> settleDomainIds = new ArrayList<>();
// if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
// settleDomainIds = user.getSettleIdList();
// if (settleDomainIds == null || settleDomainIds.isEmpty()) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// }
// return new R<>(tEmployeeContractInfoService.getContractBusinessAlertCount(settleDomainIds));
// }
//
// /**
// * B端查询对应员工指定合同ID之外的其他合同信息
// * @Author fxj
// * @Date 2020-08-25
// * @param empId
// * @param contractId
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端查询对应员工指定合同ID之外的其他合同信息")
// @GetMapping("/getOtherContractBusinessInfo")
// public R<List<EmpContractBusinessPageVo>> getOtherContractBusinessInfo(@RequestParam(value = "empId",required = true)String empId,@RequestParam(value = "contractId", required = true)String contractId) {
// return new R<>(tEmployeeContractInfoService.getOtherContractBusinessInfo(empId,contractId));
// }
//
/**
* @param businessTelecomNumber
* @Description: 根据电信编号,获取附属信息
* @Author: hgw
* @Date: 2021/8/18 17:06
* @return: com.yifu.cloud.v1.common.core.util.R<com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo>
**/
/**
* B端合同列表查询接口
* @Author fxj
* @Date 2020-08-25
* @param page
* @param contractBusinessPageVo
* @param flag 0 按3个月内到期提醒 1 不安提醒查询
* @return
**/
@Operation(description = "B端合同列表查询接口(flag: 0-按3个月内到期提醒 1-不安提醒查询)")
@GetMapping("/getContractBusinessPage")
public R<IPage<EmpContractBusinessPageVo>> getContractBusinessPage(Page<EmpContractBusinessPageVo> page
, EmpContractBusinessPageVo contractBusinessPageVo, Integer flag) {
if (null == flag){
flag = 1;
}
YifuUser user = SecurityUtils.getUser();
if (user == null) {
return R.failed("请登录!");
}
if (null == contractBusinessPageVo){
contractBusinessPageVo = new EmpContractBusinessPageVo();
}
contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO_STRING);
// 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
if (Common.isNotNull(contractBusinessPageVo.getEmpName())){
contractBusinessPageVo.setSettleDomain(null);
}
List<String> settleDomainIds = new ArrayList<>();
if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
settleDomainIds = user.getSettleIdList();
if (Common.isEmpty(settleDomainIds)) {
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
if (Common.isNotNull(contractBusinessPageVo.getSettleDomain())){
// 无权限提示 有权限 按结算主体/项目ID 查询
if (checkUserAuth(contractBusinessPageVo.getSettleDomain(),settleDomainIds)){
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
settleDomainIds = null;
}
// 管理员权限特殊处理
}else {
if (Common.isEmpty(contractBusinessPageVo.getSettleDomain())){
return new R<>(null);
}
}
return new R<>(tEmployeeContractInfoService.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds, flag));
}
/**
* B端查询合同到期提醒数(查询3个月内到期的合同)
* @Author fxj
* @Date 2020-08-25
* @param
* @return
**/
@Operation(description = "B端查询合同到期提醒数(查询3个月内到期的合同)")
@GetMapping("/getContractBusinessAlertCount")
public R<Integer> getContractBusinessAlertCount() {
YifuUser user = SecurityUtils.getUser();
if (user == null) {
return R.failed("请登录!");
}
List<String> settleDomainIds = new ArrayList<>();
if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
settleDomainIds = user.getSettleIdList();
if (settleDomainIds == null || settleDomainIds.isEmpty()) {
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
}
return new R<>(tEmployeeContractInfoService.getContractBusinessAlertCount(settleDomainIds));
}
/**
* B端查询对应员工指定合同ID之外的其他合同信息
* @Author fxj
* @Date 2020-08-25
* @param empId
* @param contractId
* @return
**/
@Operation(description = "B端查询对应员工指定合同ID之外的其他合同信息")
@GetMapping("/getOtherContractBusinessInfo")
public R<List<EmpContractBusinessPageVo>> getOtherContractBusinessInfo(@RequestParam(value = "empId")String empId,@RequestParam(value = "contractId", required = true)String contractId) {
return new R<>(tEmployeeContractInfoService.getOtherContractBusinessInfo(empId,contractId));
}
/**
* @param businessTelecomNumber
* @Description: 根据电信编号,获取附属信息
* @Author: hgw
* @Date: 2021/8/18 17:06
* @return: com.yifu.cloud.v1.common.core.util.R<com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo>
**/
@Operation(description = "根据电信编号,获取附属信息")
@PostMapping("/getByBusinessTelecomNumber")
public R<TBusinessEmployeeExtendInfo> getByBusinessTelecomNumber(@RequestParam String businessTelecomNumber) {
return new R<>(businessEmployeeExtendInfoService.getByBusinessTelecomNumber(businessTelecomNumber));
}
@GetMapping("/getByBusinessTelecomNumber")
public R<TBusinessEmployeeExtendInfo> getByBusinessTelecomNumber(@RequestParam String businessTelecomNumber) {
return new R<>(businessEmployeeExtendInfoService.getByBusinessTelecomNumber(businessTelecomNumber));
}
}
......@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -87,4 +84,17 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
List<EmployeeContractExportAuditVO> noPageDiy(@Param("tEmployeeContractInfo")TEmployeeContractSearchVo searchVo);
int noPageCountDiy(@Param("tEmployeeContractInfo")TEmployeeContractSearchVo searchVo);
/**
* B端获取在用合同信息
**/
IPage<EmpContractBusinessPageVo> getContractBusinessPage(Page page, @Param("tEmployeeContractInfo") EmpContractBusinessPageVo tEmployeeContractInfo, @Param("settleDomainIds") List<String> settleDomainIds, @Param("flag") Integer flag);
/**
* B获取3个月内的到期合同提醒
**/
Integer getContractBusinessAlertCount(@Param("tEmployeeContractInfo") EmpContractBusinessPageVo tEmployeeContractInfo
, @Param("settleDomainIds") List<String> settleDomainIds, @Param("alertMonth")Integer alertMonth);
List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(@Param("empId")String empId, @Param("contractId")String contractId);
}
......@@ -22,9 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpIdCardAndDeptVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -93,4 +91,24 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
**/
int everyDayUpdateEmployeContractStatus();
/**
* 分页:B端获取登录用户对应单位的员工数据
* @Author fxj
* @Date 2020-08-25
* @UpdateDate 2021-08-09 wwg
* @param page
* @param query
**/
IPage<BusinessEmployeeExtendListVO> getTEmployeeBusinessPage(Page page, @Param("query") THroBusinessUserQuery query);
/**
* 根据条件查询,不分页
* @description: 根据条件查询,不分页
* @param query
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtentExcelVO>
* @author: wangweiguo
* @date: 2021/8/10
*/
List<BusinessEmployeeExtentExcelVO> getTEmployeeBusinessList(@Param("query") THroBusinessUserQuery query);
}
......@@ -3,8 +3,17 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TBusinessDataListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendByLeave;
import com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description: b端员工信息拓展信息 service
......@@ -12,36 +21,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO
* @date: 2021/8/6
*/
public interface TBusinessEmployeeExtendInfoService extends IService<TBusinessEmployeeExtendInfo> {
// /**
// * @description: 根据身份证号查询人员拓展表信息
// * @param empIdcard 身份证号
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard);
//
/**
* @param businessTelecomNumber
* @Description: 根据工号返回附属信息
* @Author: hgw
* @Date: 2021/8/18 17:03
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
**/
TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber);
//
// /**
// * 根据jsonStr批量更新人员信息拓展表信息
// * @description:
// * @param jsonStr
// * @param empInfoMap
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// R<Boolean> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeInfo> empInfoMap);
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
......@@ -51,46 +30,74 @@ public interface TBusinessEmployeeExtendInfoService extends IService<TBusinessEm
* @date: 2021/8/12
*/
Boolean updateEmployeeExtendRedundancy(UpdateEmployeeExtendRedundancyDTO dto);
/**
* @description: 根据身份证号查询人员拓展表信息
* @param empIdcard 身份证号
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
* @author: wangweiguo
* @date: 2021/8/10
*/
TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard);
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(List<String> idcardList);
//
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
TBusinessDataListVo getNotLeaveExtendList();
//
// /**
// * @param
// * @Description: 获取所有附属信息
// * @Author: hgw
// * @Date: 2021/8/18 16:45
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap();
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param tBusinessEmployeeExtendInfo 实体
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo);
//
// R<String> updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO dto);
//
// TBusinessEmployeeExtendInfo getDataById(String extendId);
/**
* @param businessTelecomNumber
* @Description: 根据工号返回附属信息
* @Author: hgw
* @Date: 2021/8/18 17:03
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
**/
TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber);
/**
* 根据jsonStr批量更新人员信息拓展表信息
* @description:
* @param jsonStr
* @param empInfoMap
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
R<List<ErrorMessage>> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeProject> empInfoMap);
/**
* 根据身份证号获取拓展信息列表
* @description: 根据身份证号获取拓展信息列表
* @param idCardList
* @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
* @author: wangweiguo
* @date: 2021/8/16
*/
List<TBusinessEmployeeExtendInfo> getListByIdCardList(List<String> idCardList);
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList();
/**
* @param
* @Description: 获取所有附属信息
* @Author: hgw
* @Date: 2021/8/18 16:45
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
**/
R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap();
/**
* b端人员信息编辑拓展信息
* @description: b端人员信息编辑拓展信息
* @param tBusinessEmployeeExtendInfo 实体
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/19
*/
R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo);
boolean updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO dto);
TBusinessEmployeeExtendInfo getDataById(String extendId);
}
......@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAuditVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
......@@ -180,4 +177,11 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
void exportAuditContractInfo(TEmployeeContractSearchVo contractInfo, HttpServletResponse response);
R<List<ErrorMessage>> auditContractBatch(EmpContractAuditVo contractAuditVo, YifuUser user);
IPage<EmpContractBusinessPageVo> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, List<String> settleDomainIds, Integer alertFlag);
Integer getContractBusinessAlertCount(List<String> settleDomainIds);
List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(String empId, String contractId);
}
......@@ -23,10 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainDataVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -228,4 +225,35 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R<List<TSettleDomainDataVo>> selectSettleMentData(List<String> deptNoList);
/**
* B端获取登录用户对应单位的员工数据
* @Author fxj
* @Date 2020-08-25
* @UpdaeDate 2021-08-09 wwg
* @param page
* @param query
* @return
**/
IPage<BusinessEmployeeExtendListVO> getTEmployeeBusinessPage(Page<EmployeeBusinessVo> page, THroBusinessUserQuery query);
/**
* 获取档案B端要求数据
* @Author fxj
* @Date 2020-05-25
* @param empId
* @return
**/
EmployeeBusinessDetailVo getEmployeeBusinessInfoById(String empId, String settleDomain);
R<EmployeeBusinessVo> getEmployeeBusinessVoById(String empId);
/**
* b端人员信息导出
* @description: 导出:b端人员信息导出
* @param query
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
R<List<BusinessEmployeeExtentExcelVO>> exportByParams(THroBusinessUserQuery query);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import com.yifu.cloud.plus.v1.business.entity.system.TBusDept;
import com.yifu.cloud.plus.v1.business.entity.system.TBusLable;
import com.yifu.cloud.plus.v1.business.vo.system.BusDeptVo;
import com.yifu.cloud.plus.v1.business.vo.system.BusLableVo;
import com.yifu.cloud.plus.v1.business.vo.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TBusinessEmployeeExtendInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendByLeave;
import com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TBusinessDataListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateBusinessEmployeeExtendDTO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprBusinessProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
/**
* @description: b端员工信息拓展信息 service实现
......@@ -23,211 +40,35 @@ import java.util.List;
*/
@Service
@AllArgsConstructor
@EnableConfigurationProperties(DaprBusinessProperties.class)
public class TBusinessEmployeeExtendInfoServiceImpl extends ServiceImpl<TBusinessEmployeeExtendInfoMapper, TBusinessEmployeeExtendInfo>
implements TBusinessEmployeeExtendInfoService {
// private final ObjectMapper objectMapper;
// /**
// * @description: 根据身份证号查询人员拓展表信息
// * @param empIdcard 身份证号
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @Override
// public TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard) {
// if (StringUtils.isNotBlank(empIdcard)) {
// return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getEmpIdcard, empIdcard).last(CommonConstants.SQL_LIMIT_ONE).one();
// }
// return null;
// }
//
/**
* @param businessTelecomNumber
* @Description: 根据电信工号获取详情
* @Author: hgw
* @Date: 2021/8/18 17:04
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
**/
@Override
public TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber) {
if (StringUtils.isNotBlank(businessTelecomNumber)) {
return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber).last(CommonConstants.LAST_ONE_SQL).one();
}
return null;
}
//
// /**
// * 根据jsonStr批量更新人员信息拓展表信息
// * @description:
// * @param jsonStr
// * @param empInfoMap
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @Override
// public R<Boolean> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeInfo> empInfoMap) {
// List<UpdateBusinessEmployeeExtendDTO> list = null;
// List<ErrorMessage> errorMessageList = new ArrayList<>();
// try {
// list = objectMapper.readValue(jsonStr, new TypeReference<List<UpdateBusinessEmployeeExtendDTO>>(){});
// } catch (InvalidFormatException e) {
// e.printStackTrace();
// if (e.getCause().toString().contains("DateTimeParseException")) {
// errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_DATE_RESOLVER_ERROR.concat("错误值:" + e.getValue().toString())));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_RESOLVER_ERROR.concat(e.getCause().toString())));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// } catch (Exception e) {
// e.printStackTrace();
// errorMessageList.add(new ErrorMessage(null, e.getCause().toString()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (!CollUtil.isEmpty(list)) {
// List<TBusinessEmployeeExtendInfo> dtoList = new ArrayList<>();
// R<List<TBusDept>> busDeptListR = remoteBusDeptService.getTBusDeptList(SecurityConstants.FROM_IN);
// R<List<TBusLable>> busLableListR = remoteBusLableService.getTBusLableList(SecurityConstants.FROM_IN);
// if (!R.isSuccess(busDeptListR)) {
// errorMessageList.add(new ErrorMessage(null, busDeptListR.getMsg()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (!R.isSuccess(busLableListR)) {
// errorMessageList.add(new ErrorMessage(null,busLableListR.getMsg()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (CollUtil.isEmpty(busDeptListR.getData())) {
// errorMessageList.add(new ErrorMessage(null, DEPT_LIST_IS_NULL));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (CollUtil.isEmpty(busLableListR.getData())) {
// errorMessageList.add(new ErrorMessage(null, LABEL_LIST_IS_NULL));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
//
// List<ErrorMessage> beforeErrorMessageList = Common.commonImportErrorMessage(list);
// HashMap<String, TBusDept> busDeptMap = Common.listToHashMapByKey(busDeptListR.getData(), "name");
// HashMap<String, TBusLable> busLableMap = Common.listToHashMapByKey(busLableListR.getData(), "name");
// HashMap<String, ErrorMessage> errorMessageHashMap = Common.listToHashMapByKey(beforeErrorMessageList, "line");
//
// List<TBusinessEmployeeExtendInfo> employeeExtendInfoList = TBusinessEmployeeExtendInfo.covertDtoListToList(list);
// // 导入数据校验
// errorMessageList.addAll(beforeErrorMessageList);
// // 数据导入
// for (int i = 0; i < employeeExtendInfoList.size(); i++) {
// boolean isSave = true;
// int line = i + 2;
// TBusinessEmployeeExtendInfo v = employeeExtendInfoList.get(i);
// TBusinessEmployeeExtendInfo entity = this.baseMapper.getDataByEmpIdcard(v.getEmpIdcard());
// if (null != entity) {
// v.setId(entity.getId());
// v.setEmpName(entity.getEmpName());
// }
// if (busDeptMap.containsKey(v.getDepartName())) {
// TBusDept busDept = busDeptMap.get(v.getDepartName());
// v.setDepartCode(busDept.getTreeLogo());
// v.setDepartId(busDept.getId());
// }
// ErrorMessage errorMessage = errorMessageHashMap.get(line + "");
// if (errorMessage != null) {
// continue;
// }
// // 部门是否存在判断
// if (!busDeptMap.containsKey(v.getDepartName())) {
// errorMessageList.add(new ErrorMessage(line, DEPT_NAME_IS_NOT_EXIST));
// isSave = false;
// }
// // 身份证是否存在hro系统判断
// if (!empInfoMap.containsKey(v.getEmpIdcard())) {
// errorMessageList.add(new ErrorMessage(line, ID_CARD_IS_NOT_EXIST));
// isSave = false;
// }
//
// // 标签判断,并处理
// if (StringUtils.isNotBlank(v.getEmployeeTags())) {
// List<String> tagList = new ArrayList<>();
// String[] tags = v.getEmployeeTags().split(",");
// for (String tag : tags) {
// TBusLable tBusLable = busLableMap.get(tag);
// if (null != tBusLable) {
// if (tBusLable.getStatus() != 0) {
// errorMessageList.add(new ErrorMessage(line, "[" + tBusLable.getName() + "]" + TAG_IS_BANED));
// isSave = false;
// }
// if (tBusLable.getStatus() == 0) {
// tagList.add(String.valueOf(tBusLable.getId()));
// } else {
// tagList.clear();
// }
// } else {
// errorMessageList.add(new ErrorMessage(line, "[" + tag + "]" + TAG_IS_NOT_EXIST));
// isSave = false;
// }
// }
//
// if (!CollUtil.isEmpty(tagList) && tagList.size() > 10) {
// errorMessageList.add(new ErrorMessage(line, EMPLOYEE_TAGS_EXCEED));
// isSave = false;
// }
// // 处理标签格式化
// List<String> tagFormatList = new ArrayList<>();
// if (!CollUtil.isEmpty(tagList)) {
// tagList.forEach(tag -> tagFormatList.add(String.format("%04d", Integer.valueOf(tag))));
// v.setEmployeeTags(StringUtils.join(tagFormatList, ","));
// } else if (null != entity){
// v.setEmployeeTags(entity.getEmployeeTags());
// }
// }
// try {
// // 校验电信编号是否重复
// if (existBusinessTelecomNumber(v)) {
// errorMessageList.add(new ErrorMessage(line, TELECOMNUMBER_IS_EXIST));
// continue;
// }
// // 冗余的字段,岗位,工号变更要同步过去
// if (null != entity && isUpdateRedundancy(v, entity)) {
// dtoList.add(v);
// }
// if (!isSave) {
// continue;
// }
// boolean isSuccess = this.saveOrUpdate(v);
// if (!isSuccess) {
// errorMessageList.add(new ErrorMessage(line, CommonConstants.DATA_UPDATE_FAIL));
// } else {
// errorMessageList.add(new ErrorMessage(line, CommonConstants.UPDATE_DATA_SUCCESS, CommonConstants.GREEN));
// }
// } catch (Exception e) {
// errorMessageList.add(new ErrorMessage(null, BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL, BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString());
// }
// }
// this.updateRedundancyEmployeeFields(dtoList);
// }
// if (CollUtil.isEmpty(errorMessageList)) {
// return R.success(CommonConstants.NO_DATA_TO_HANDLE, true, errorMessageList);
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS, true, errorMessageList);
// }
//
// /**
// * 是否更新冗余字段
// * @param v 当前值
// * @param entity 原有值
// * @return boolean
// */
// private boolean isUpdateRedundancy(TBusinessEmployeeExtendInfo v, TBusinessEmployeeExtendInfo entity) {
// if (!StringUtils.equals(v.getBusinessTelecomNumber(), entity.getBusinessTelecomNumber())
// || !StringUtils.equals(v.getBusinessPost(), entity.getBusinessPost())
// || !StringUtils.equals(v.getEmpName(), entity.getEmpName())
// || !(Objects.equals(v.getDepartId(), entity.getDepartId()))
// ){
// return true;
// }
// return false;
// }
private final ObjectMapper objectMapper;
private final DaprBusinessProperties daprBusinessProperties;
public static final String TAG_IS_BANED = "标签被禁用";
public static final String TAG_IS_NOT_EXIST = "标签不存在";
public static final String TELECOMNUMBER_IS_EXIST = "电信工号已存在";
public static final String EMPLOYEE_TAGS_EXCEED = "人员标签不能超过10个";
public static final String DEPT_NAME_IS_NOT_EXIST = "部门名称不存在";
public static final String JSON_DATE_RESOLVER_ERROR = "入职时间,请使用正确的日期格式,如:XXXX-XX-XX,";
public static final String JSON_RESOLVER_ERROR = "批量导入更新人员信息json数据格式解析失败";
public static final String DEPT_LIST_IS_NULL = "部门列表为空";
public static final String LABEL_LIST_IS_NULL = "标签列表为空";
public static final String BATCH_USER_EXTEND_DATA_ERROR = "批量更新人员附表信息数据失败";
public static final String ID_CARD_IS_NOT_EXIST = "Hro系统中身份证号不存在,或者没有该人员的结算主体权限";
/**
* 更新人员信息冗余字段
......@@ -267,151 +108,6 @@ implements TBusinessEmployeeExtendInfoService {
}
return true;
}
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// @Override
// public R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(List<String> idcardList) {
// List<TBusinessEmployeeExtendInfo> list = this.lambdaQuery().in(TBusinessEmployeeExtendInfo::getEmpIdcard, idcardList).list();
// return R.success(CommonConstants.SEARCH_SUCCESS, list);
// }
//
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Override
public TBusinessDataListVo getNotLeaveExtendList() {
List<BusinessEmployeeExtendVO> list = this.baseMapper.getNotLeaveExtendList();
TBusinessDataListVo vo = new TBusinessDataListVo();
vo.setExtendVO(list);
return vo;
}
//
// /**
// * @param
// * @Description: 获取所有扩展信息-不要离职的
// * @Author: hgw
// * @Date: 2021/8/18 16:41
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// @Override
// public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
// List<BusinessEmployeeExtendByLeave> list = this.baseMapper.getInfoByLeaveList();
// Map<String, BusinessEmployeeExtendByLeave> leaveMap = new HashMap<>();
// if (list != null && !list.isEmpty()) {
// for (BusinessEmployeeExtendByLeave leave : list) {
// leaveMap.put(leave.getBusinessTelecomNumber(), leave);
// }
// }
// return new R<>(leaveMap);
// }
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param entity 实体
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// @Override
// public R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo entity) {
// if (existBusinessTelecomNumber(entity)) {
// return R.fail(TELECOMNUMBER_IS_EXIST);
// }
//
// // 标签id格式化
// entity.setEmployeeTags(BusinessCommonUtils.formatLabelId(entity.getEmployeeTags()));
// int tagSize = StringUtils.split(entity.getEmployeeTags(), ",").length;
// if (tagSize > 10) {
// return R.fail(EMPLOYEE_TAGS_EXCEED);
// }
// boolean isSuccess = this.saveOrUpdate(entity);
// if (isSuccess) {
// this.updateRedundancyEmployeeFields(CollUtil.newArrayList(entity));
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS, isSuccess);
// }
//
// @LcnTransaction
// @Override
// public R<String> updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO v) {
// if (Common.isEmpty(v)) {
// return R.fail(CommonConstants.NO_DATA_TO_HANDLE);
// }
// // 根据部门id更新冗余的部门信息
// if (null != v.getDepartId()) {
// this.lambdaUpdate()
// .eq(TBusinessEmployeeExtendInfo::getDepartId, v.getDepartId())
// .set(TBusinessEmployeeExtendInfo::getDepartName, v.getDepartName())
// .set(TBusinessEmployeeExtendInfo::getDepartCode, v.getTreeLogo())
// .update();
// } else {
// if (StringUtils.isBlank(v.getEmpIdcard())) {
// return R.fail(ID_CARD_IS_NULL);
// }
// // 身份证号更新冗余的离职,标签,证件相关信息
// boolean isSuccess = this.lambdaUpdate()
// .eq(TBusinessEmployeeExtendInfo::getEmpIdcard, v.getEmpIdcard())
// .set(TBusinessEmployeeExtendInfo::getDocumentType, v.getDocumentType())
// .update();
// if (!isSuccess) {
// return R.fail(CommonConstants.UPDATE_DATA_FAIL);
// }
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS);
// }
//
// @Override
// public TBusinessEmployeeExtendInfo getDataById(String extendId) {
// return this.baseMapper.getDataById(extendId);
// }
//
// /**
// * @description: 是否存在电信编号
// * @param info 实体
// * @return: boolean
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// private boolean existBusinessTelecomNumber(TBusinessEmployeeExtendInfo info) {
// TBusinessEmployeeExtendInfo entity = this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, info.getBusinessTelecomNumber()).last(CommonConstants.SQL_LIMIT_ONE).one();
// if (null != entity && !StringUtils.equals(entity.getId(), info.getId())) {
// return true;
// }
// return false;
// }
//
// /**
// * @description: 更新其他表冗余字段
// * @param list
// * @return: void
// * @author: wangweiguo
// * @date: 2021/8/23
// */
// private void updateRedundancyEmployeeFields(List<TBusinessEmployeeExtendInfo> list) {
// List<UpdateVacationRedundancyDTO> dtoList = new ArrayList<>();
// if (!CollUtil.isEmpty(list)) {
// list.forEach(v -> {
// UpdateVacationRedundancyDTO dto = new UpdateVacationRedundancyDTO(v.getEmpIdcard(), v.getEmpName(), v.getBusinessTelecomNumber(), v.getBusinessPost(), v.getDepartId(),v.getEmployeeTags());
// dtoList.add(dto);
// });
// this.remoteVacationMonitorService.updateRedundancyEmployeeFields(dtoList, SecurityConstants.FROM_IN);
// this.remoteVacationInfoService.updateRedundancyEmployeeFields(dtoList, SecurityConstants.FROM_IN);
// remoteBusCertService.updateRedundancyEmpOfCert(dtoList,SecurityConstants.FROM_IN);
// }
// }
/**
* 格式化标签id
*
......@@ -432,6 +128,354 @@ implements TBusinessEmployeeExtendInfoService {
return StringUtils.join(tagList, ",");
}
/**
* @description: 根据身份证号查询人员拓展表信息
* @param empIdcard 身份证号
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
* @author: wangweiguo
* @date: 2021/8/10
*/
@Override
public TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard) {
if (StringUtils.isNotBlank(empIdcard)) {
return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getEmpIdcard, empIdcard).last(CommonConstants.LAST_ONE_SQL).one();
}
return null;
}
/**
* @param businessTelecomNumber
* @Description: 根据电信工号获取详情
* @Author: hgw
* @Date: 2021/8/18 17:04
* @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
**/
@Override
public TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber) {
if (StringUtils.isNotBlank(businessTelecomNumber)) {
return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber).last(CommonConstants.LAST_ONE_SQL).one();
}
return null;
}
/**
* 根据jsonStr批量更新人员信息拓展表信息
* @description:
* @param jsonStr
* @param empInfoMap
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/10
*/
@Override
public R<List<ErrorMessage>> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeProject> empInfoMap) {
List<UpdateBusinessEmployeeExtendDTO> list = null;
List<ErrorMessage> errorMessageList = new ArrayList<>();
try {
list = objectMapper.readValue(jsonStr, new TypeReference<List<UpdateBusinessEmployeeExtendDTO>>(){});
} catch (InvalidFormatException e) {
e.printStackTrace();
if (e.getCause().toString().contains("DateTimeParseException")) {
errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_DATE_RESOLVER_ERROR.concat("错误值:" + e.getValue().toString())));
return R.failed(errorMessageList);
}
errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_RESOLVER_ERROR.concat(e.getCause().toString())));
return R.failed(errorMessageList);
} catch (Exception e) {
e.printStackTrace();
errorMessageList.add(new ErrorMessage(null, e.getCause().toString()));
return R.failed(errorMessageList);
}
if (!CollUtil.isEmpty(list)) {
List<TBusinessEmployeeExtendInfo> dtoList = new ArrayList<>();
TBusDept busDeptParam = new TBusDept();
R<BusDeptVo> busDeptListR = HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId()
, "/tbusdept/inner/getTBusDeptList", busDeptParam, BusDeptVo.class, SecurityConstants.FROM_IN);
TBusLable busLableParam = new TBusLable();
R<BusLableVo> busLableListR = HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId()
, "/tbuslable/inner/getTBusLableList", busLableParam, BusLableVo.class, SecurityConstants.FROM_IN);
if (!R.isSuccess(busDeptListR)) {
errorMessageList.add(new ErrorMessage(null, busDeptListR.getMsg()));
return R.failed(errorMessageList);
}
if (!R.isSuccess(busLableListR)) {
errorMessageList.add(new ErrorMessage(null,busLableListR.getMsg()));
return R.failed(errorMessageList);
}
if (CollUtil.isEmpty(busDeptListR.getData().getBusDeptList())) {
errorMessageList.add(new ErrorMessage(null, DEPT_LIST_IS_NULL));
return R.failed(errorMessageList);
}
if (CollUtil.isEmpty(busLableListR.getData().getBusLableList())) {
errorMessageList.add(new ErrorMessage(null, LABEL_LIST_IS_NULL));
return R.failed(errorMessageList);
}
List<ErrorMessage> beforeErrorMessageList = Common.commonImportErrorMessage(list);
HashMap<String, TBusDept> busDeptMap = Common.listToHashMapByKey(busDeptListR.getData().getBusDeptList(), "name");
HashMap<String, TBusLable> busLableMap = Common.listToHashMapByKey(busLableListR.getData().getBusLableList(), "name");
HashMap<String, ErrorMessage> errorMessageHashMap = Common.listToHashMapByKey(beforeErrorMessageList, "line");
List<TBusinessEmployeeExtendInfo> employeeExtendInfoList = TBusinessEmployeeExtendInfo.covertDtoListToList(list);
// 导入数据校验
errorMessageList.addAll(beforeErrorMessageList);
// 数据导入
for (int i = 0; i < employeeExtendInfoList.size(); i++) {
boolean isSave = true;
int line = i + 2;
TBusinessEmployeeExtendInfo v = employeeExtendInfoList.get(i);
TBusinessEmployeeExtendInfo entity = this.baseMapper.getDataByEmpIdcard(v.getEmpIdcard());
if (null != entity) {
v.setId(entity.getId());
v.setEmpName(entity.getEmpName());
}
if (busDeptMap.containsKey(v.getDepartName())) {
TBusDept busDept = busDeptMap.get(v.getDepartName());
v.setDepartCode(busDept.getTreeLogo());
v.setDepartId(busDept.getId());
}
ErrorMessage errorMessage = errorMessageHashMap.get(line + "");
if (errorMessage != null) {
continue;
}
// 部门是否存在判断
if (!busDeptMap.containsKey(v.getDepartName())) {
errorMessageList.add(new ErrorMessage(line, DEPT_NAME_IS_NOT_EXIST));
isSave = false;
}
// 身份证是否存在hro系统判断
if (!empInfoMap.containsKey(v.getEmpIdcard())) {
errorMessageList.add(new ErrorMessage(line, ID_CARD_IS_NOT_EXIST));
isSave = false;
}
// 标签判断,并处理
if (StringUtils.isNotBlank(v.getEmployeeTags())) {
List<String> tagList = new ArrayList<>();
String[] tags = v.getEmployeeTags().split(",");
for (String tag : tags) {
TBusLable tBusLable = busLableMap.get(tag);
if (null != tBusLable) {
if (tBusLable.getStatus() != 0) {
errorMessageList.add(new ErrorMessage(line, "[" + tBusLable.getName() + "]" + TAG_IS_BANED));
isSave = false;
}
if (tBusLable.getStatus() == 0) {
tagList.add(String.valueOf(tBusLable.getId()));
} else {
tagList.clear();
}
} else {
errorMessageList.add(new ErrorMessage(line, "[" + tag + "]" + TAG_IS_NOT_EXIST));
isSave = false;
}
}
if (!CollUtil.isEmpty(tagList) && tagList.size() > 10) {
errorMessageList.add(new ErrorMessage(line, EMPLOYEE_TAGS_EXCEED));
isSave = false;
}
// 处理标签格式化
List<String> tagFormatList = new ArrayList<>();
if (!CollUtil.isEmpty(tagList)) {
tagList.forEach(tag -> tagFormatList.add(String.format("%04d", Integer.valueOf(tag))));
v.setEmployeeTags(StringUtils.join(tagFormatList, ","));
} else if (null != entity){
v.setEmployeeTags(entity.getEmployeeTags());
}
}
try {
// 校验电信编号是否重复
if (existBusinessTelecomNumber(v)) {
errorMessageList.add(new ErrorMessage(line, TELECOMNUMBER_IS_EXIST));
continue;
}
// 冗余的字段,岗位,工号变更要同步过去
if (null != entity && isUpdateRedundancy(v, entity)) {
dtoList.add(v);
}
if (!isSave) {
continue;
}
boolean isSuccess = this.saveOrUpdate(v);
if (!isSuccess) {
errorMessageList.add(new ErrorMessage(line, CommonConstants.UPDATE_DATA_FAIL));
} else {
errorMessageList.add(new ErrorMessage(line, CommonConstants.UPDATE_SUCCESS, CommonConstants.GREEN));
}
} catch (Exception e) {
errorMessageList.add(new ErrorMessage(null, BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString()));
return R.failed(BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString());
}
}
this.updateRedundancyEmployeeFields(dtoList);
}
if (CollUtil.isEmpty(errorMessageList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return R.ok(errorMessageList);
}
/**
* 是否更新冗余字段
* @param v 当前值
* @param entity 原有值
* @return boolean
*/
private boolean isUpdateRedundancy(TBusinessEmployeeExtendInfo v, TBusinessEmployeeExtendInfo entity) {
if (!StringUtils.equals(v.getBusinessTelecomNumber(), entity.getBusinessTelecomNumber())
|| !StringUtils.equals(v.getBusinessPost(), entity.getBusinessPost())
|| !StringUtils.equals(v.getEmpName(), entity.getEmpName())
|| !(Objects.equals(v.getDepartId(), entity.getDepartId()))
){
return true;
}
return false;
}
/**
* 根据身份证号获取拓展信息列表
* @description: 根据身份证号获取拓展信息列表
* @param idCardList
* @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
* @author: wangweiguo
* @date: 2021/8/16
*/
@Override
public List<TBusinessEmployeeExtendInfo> getListByIdCardList(List<String> idCardList) {
List<TBusinessEmployeeExtendInfo> list = this.lambdaQuery().in(TBusinessEmployeeExtendInfo::getEmpIdcard, idCardList).list();
return list;
}
/**
* 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Override
public R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList() {
List<BusinessEmployeeExtendVO> list = this.baseMapper.getNotLeaveExtendList();
return R.ok(list);
}
/**
* @param
* @Description: 获取所有扩展信息-不要离职的
* @Author: hgw
* @Date: 2021/8/18 16:41
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
**/
@Override
public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
List<BusinessEmployeeExtendByLeave> list = this.baseMapper.getInfoByLeaveList();
Map<String, BusinessEmployeeExtendByLeave> leaveMap = new HashMap<>();
if (list != null && !list.isEmpty()) {
for (BusinessEmployeeExtendByLeave leave : list) {
leaveMap.put(leave.getBusinessTelecomNumber(), leave);
}
}
return new R<>(leaveMap);
}
/**
* b端人员信息编辑拓展信息
* @description: b端人员信息编辑拓展信息
* @param entity 实体
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/19
*/
@Override
public R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo entity) {
if (existBusinessTelecomNumber(entity)) {
return R.failed(TELECOMNUMBER_IS_EXIST);
}
// 标签id格式化
entity.setEmployeeTags(formatLabelId(entity.getEmployeeTags()));
int tagSize = StringUtils.split(entity.getEmployeeTags(), ",").length;
if (tagSize > 10) {
return R.failed(EMPLOYEE_TAGS_EXCEED);
}
boolean isSuccess = this.saveOrUpdate(entity);
if (isSuccess) {
this.updateRedundancyEmployeeFields(CollUtil.newArrayList(entity));
}
return R.ok();
}
@Transactional
@Override
public boolean updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO v) {
if (Common.isEmpty(v)) {
return false;
}
// 根据部门id更新冗余的部门信息
if (null != v.getDepartId()) {
this.lambdaUpdate()
.eq(TBusinessEmployeeExtendInfo::getDepartId, v.getDepartId())
.set(TBusinessEmployeeExtendInfo::getDepartName, v.getDepartName())
.set(TBusinessEmployeeExtendInfo::getDepartCode, v.getTreeLogo())
.update();
} else {
if (StringUtils.isBlank(v.getEmpIdcard())) {
return false;
}
// 身份证号更新冗余的离职,标签,证件相关信息
return this.lambdaUpdate()
.eq(TBusinessEmployeeExtendInfo::getEmpIdcard, v.getEmpIdcard())
.set(TBusinessEmployeeExtendInfo::getDocumentType, v.getDocumentType())
.update();
}
return true;
}
@Override
public TBusinessEmployeeExtendInfo getDataById(String extendId) {
return this.baseMapper.getDataById(extendId);
}
/**
* @description: 是否存在电信编号
* @param info 实体
* @return: boolean
* @author: wangweiguo
* @date: 2021/8/19
*/
private boolean existBusinessTelecomNumber(TBusinessEmployeeExtendInfo info) {
TBusinessEmployeeExtendInfo entity = this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, info.getBusinessTelecomNumber()).last(CommonConstants.LAST_ONE_SQL).one();
if (null != entity && !StringUtils.equals(entity.getId(), info.getId())) {
return true;
}
return false;
}
/**
* @description: 更新其他表冗余字段
* @param list
* @return: void
* @author: wangweiguo
* @date: 2021/8/23
*/
private void updateRedundancyEmployeeFields(List<TBusinessEmployeeExtendInfo> list) {
List<UpdateVacationRedundancyDTO> dtoList = new ArrayList<>();
if (!CollUtil.isEmpty(list)) {
list.forEach(v -> {
UpdateVacationRedundancyDTO dto = new UpdateVacationRedundancyDTO(v.getEmpIdcard(), v.getEmpName(), v.getBusinessTelecomNumber(), v.getBusinessPost(), v.getDepartId(),v.getEmployeeTags());
dtoList.add(dto);
});
HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId()
, "/vacationInfo/inner/updateRedundancyEmployeeFields", dtoList, Object.class, SecurityConstants.FROM_IN);
HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId()
, "/vacationMonitor/inner/updateRedundancyEmployeeFields", dtoList, Object.class, SecurityConstants.FROM_IN);
HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId()
, "/tcertinfo/inner/updateRedundancyEmpOfCert", dtoList, Object.class, SecurityConstants.FROM_IN);
}
}
}
......
......@@ -67,6 +67,7 @@ import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
......@@ -1400,4 +1401,76 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
return R.ok(errorMessages);
}
/**
* B端合同列表查询接口
* @Author fxj
* @Date 2020-08-25
* @param page
* @param contractBusinessPageVo
* @param flag 0 按3个月内到期提醒 1 不安提醒查询
* @return
**/
@Override
public IPage<EmpContractBusinessPageVo> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, List<String> settleDomainIds, Integer flag) {
IPage<EmpContractBusinessPageVo> pageVoList = baseMapper.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds,flag);
List<EmpContractBusinessPageVo> voList = pageVoList.getRecords();
List<TEmployeeContractInfo> contractInfoList = null;
List<String> empIds = new ArrayList<>();
if (Common.isNotNull(voList)){
for (EmpContractBusinessPageVo vo:voList){
empIds.add(vo.getEmpId());
}
}
if (Common.isNotNull(empIds)){
contractInfoList = baseMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.in(TEmployeeContractInfo::getEmpId,empIds));
}
HashMap<String,Integer> countMap = new HashMap<>();
if (Common.isNotNull(contractInfoList)){
Integer count;
for (TEmployeeContractInfo contractInfo:contractInfoList){
count = countMap.get(contractInfo.getEmpId());
count = null ==count?1:(count+1);
countMap.put(contractInfo.getEmpId(),count);
}
}
if (Common.isNotNull(voList)){
for (EmpContractBusinessPageVo pageVo:voList){
pageVo.setRenewCount(countMap.get(pageVo.getEmpId()));
}
}
pageVoList.setRecords(voList);
return pageVoList;
}
/**
* B端查询合同到期提醒数(查询3个月内到期的合同)
* @Author fxj
* @Date 2020-08-25
* @param
* @return
**/
@Override
public Integer getContractBusinessAlertCount(List<String> settleDomainIds) {
EmpContractBusinessPageVo contractBusinessPageVo = new EmpContractBusinessPageVo();
contractBusinessPageVo.setInUse(CommonConstants.ZERO_STRING);
contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO_STRING);
return baseMapper.getContractBusinessAlertCount(contractBusinessPageVo,settleDomainIds,CommonConstants.THREE_INT);
}
/**
* B端查询对应员工指定合同ID之外的其他合同信息
* @Author fxj
* @Date 2020-08-25
* @param empId
* @param contractId
* @return
**/
@Override
public List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(String empId, String contractId) {
return baseMapper.getOtherContractBusinessInfo(empId,contractId);
}
}
......@@ -27,17 +27,17 @@ import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
......@@ -45,11 +45,15 @@ import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.EmpBusinessConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -76,7 +80,7 @@ import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@Log4j2
@EnableConfigurationProperties({DaprUpmsProperties.class, DaprCheckProperties.class})
@EnableConfigurationProperties({DaprUpmsProperties.class, DaprCheckProperties.class, DaprSocialProperties.class})
public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService {
@Autowired
......@@ -91,6 +95,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired
private TEmployeeContractInfoMapper contractInfoMapper;
@Autowired
private TEmpEducationMapper empEducationMapper;
@Autowired
private TBusinessEmployeeExtendInfoService businessEmployeeExtendInfoService;
@Autowired
private DaprSocialProperties daprSocialProperties;
@Autowired
@Lazy
private DoJointTask doJointTask;
......@@ -1497,4 +1510,183 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
}
/**
* B端获取登录用户对应单位的员工数据
* @Author fxj
* @Date 2020-08-25
* @UpdateDate 2021-08-09 wwg
* @param page
* @param query
* @return
**/
@Override
public IPage<BusinessEmployeeExtendListVO> getTEmployeeBusinessPage(Page<EmployeeBusinessVo> page, THroBusinessUserQuery query) {
if (StringUtils.isNotBlank(query.getEmployeeTagName())) {
String empTag = String.format(CommonConstants.TAG_FROMAT, Integer.valueOf(query.getEmployeeTagName()));
query.setEmployeeTagName(empTag);
}
IPage<BusinessEmployeeExtendListVO> pageData = baseMapper.getTEmployeeBusinessPage(page,query);
List<BusinessEmployeeExtendListVO> voList = pageData.getRecords();
if (Common.isNotNull(voList)){
pageData.setRecords(voList);
}
return pageData;
}
@Override
public EmployeeBusinessDetailVo getEmployeeBusinessInfoById(String empId, String settleDomain) {
EmployeeBusinessDetailVo businessDetailVo = new EmployeeBusinessDetailVo();
TEmployeeProject employeeInfo = baseMapper.selectById(empId);
TEmployeeInfo employee = null;
EmployeeBusinessVo businessVo = new EmployeeBusinessVo();
// 有档案数据封装数据 无数据直接返回
if (null == employeeInfo){
return businessDetailVo;
}else {
TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.getByEmpIdCard(employeeInfo.getEmpIdcard());
employee = tEmployeeInfoMapper.selectById(employeeInfo.getEmpId());
initEmpBusinessInfo(employeeInfo, employee, businessVo, tBusinessEmployeeExtendInfo);
}
// 获取合同数据
List<TEmployeeContractInfo> contractInfoList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard,employeeInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getSettleDomain, settleDomain)
.orderByDesc(TEmployeeContractInfo::getContractStart));
// 处理详情对应的合同信息
if (Common.isNotNull(contractInfoList)){
initEmpBusinessContractInfo(businessDetailVo, contractInfoList);
}
// 获取最高学历
List<TEmpEducation> educations = empEducationMapper.selectList(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEmpId,empId)
.eq(TEmpEducation::getHighIdentification,CommonConstants.ZERO_STRING)
.eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING)
.orderByDesc(TEmpEducation::getCreateTime));
// 处理学历信息
if (Common.isNotNull(educations)){
TEmpEducation empEducation = educations.get(CommonConstants.ZERO_INT);
if (null != empEducation){
businessVo.setSchool(empEducation.getSchool());
businessVo.setEducationName(empEducation.getEducationName());
}
}
// 处理人员离职信息 和社保公积金派减信息
if (employee != null) {
businessVo.setLeaveDate(employee.getLeaveTime());
businessVo.setLeaveReason(employee.getLeaveReason());
businessVo.setLeaveRemark(employee.getLeaveRemark());
}
// 获取社保和公积金派减信息
SocialAndFundReduceVo vo = new SocialAndFundReduceVo();
vo.setEmpId(empId);
R<SocialAndFundReduceVo> reduceVoR = HttpDaprUtil.invokeMethodPost(daprSocialProperties.getAppUrl(), daprSocialProperties.getAppId()
, "/tdispatchinfo/inner/getSocialAndFundReduceInfo", vo, SocialAndFundReduceVo.class, SecurityConstants.FROM_IN);
if (null != reduceVoR && reduceVoR.getData() != null){
businessDetailVo.setSocialReduceDate(reduceVoR.getData().getSocialReduceDate());
businessDetailVo.setFundReduceDate(reduceVoR.getData().getFundReduceDate());
}
businessDetailVo.setEmployeeBusinessVo(businessVo);
return businessDetailVo;
}
@Override
public R<EmployeeBusinessVo> getEmployeeBusinessVoById(String empId) {
TEmployeeProject employeeInfo = baseMapper.selectById(empId);
EmployeeBusinessVo businessVo = new EmployeeBusinessVo();
// 有档案数据封装数据 无数据直接返回
if (null == employeeInfo){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}else {
TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.getByEmpIdCard(employeeInfo.getEmpIdcard());
TEmployeeInfo employee = tEmployeeInfoMapper.selectById(employeeInfo.getEmpId());
initEmpBusinessInfo(employeeInfo, employee, businessVo, tBusinessEmployeeExtendInfo);
}
return R.ok(businessVo);
}
private void initEmpBusinessContractInfo(EmployeeBusinessDetailVo businessDetailVo, List<TEmployeeContractInfo> contractInfoList) {
businessDetailVo.setSituationCount(contractInfoList.size());
if (businessDetailVo.getSituationCount() > CommonConstants.ONE_INT){
businessDetailVo.setSituation(EmpBusinessConstants.empContractSituationRenew);
}else {
businessDetailVo.setSituation(EmpBusinessConstants.empContractSituationNew);
}
businessDetailVo.setContractInfoList(contractInfoList);
TEmployeeContractInfo contractInfo = contractInfoList.get(CommonConstants.ZERO_INT);
if (null != contractInfo.getContractEnd()){
businessDetailVo.setContractEndDate(DateUtil.formatDate(contractInfo.getContractEnd()));
}
if (null != contractInfo.getContractStart()){
businessDetailVo.setContractStartDate(DateUtil.formatDate(contractInfo.getContractStart()));
}
for (TEmployeeContractInfo info:contractInfoList){
//在用的,固定期限的,尝试计算过期天数
if (CommonConstants.ZERO_STRING.equals(info.getInUse()) && null != info.getContractEnd()){
int dayCount = DateUtil.getDayDiff(info.getContractEnd(), new Date());
if (dayCount <= EmpBusinessConstants.ninety && dayCount > CommonConstants.ZERO_INT){
businessDetailVo.setContractOverdue(dayCount);
}
break;
}
}
}
private void initEmpBusinessInfo(TEmployeeProject employeeInfo, TEmployeeInfo employee
, EmployeeBusinessVo businessVo, TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo) {
businessVo.setSettleDomain(employeeInfo.getDeptId());
businessVo.setBelongUnit(employeeInfo.getUnitId());
if (employee != null) {
businessVo.setEmpAge(employee.getEmpAge());
businessVo.setEmpBirthday(employee.getEmpBirthday());
businessVo.setEmpNational(employee.getEmpNational());
businessVo.setEmpRegisType(employee.getEmpRegisType());
businessVo.setEmpSex(employee.getEmpSex());
}
businessVo.setEmpIdcard(employeeInfo.getEmpIdcard());
businessVo.setEmpName(employeeInfo.getEmpName());
businessVo.setEmpPhone(employeeInfo.getEmpPhone());
businessVo.setEnjoinDate(employeeInfo.getEnjoinDate());
businessVo.setPost(employeeInfo.getPost());
businessVo.setRemark(employeeInfo.getRemark());
businessVo.setWorkFlag(String.valueOf(employeeInfo.getProjectStatus()));
businessVo.setWorkingHours(employeeInfo.getWorkingHours());
businessVo.setBusinessEnjoinDate(employeeInfo.getEnjoinDate());
businessVo.setBusinessPost(employeeInfo.getPost());
// 设置拓展表信息 合电2.0版本 ---wwg
if (null != tBusinessEmployeeExtendInfo) {
businessVo.setFirstDegreeAndMajor(tBusinessEmployeeExtendInfo.getFirstDegreeAndMajor());
businessVo.setFirstDegreeGraduateSchool(tBusinessEmployeeExtendInfo.getFirstDegreeGraduateSchool());
businessVo.setHighestDegreeAndMajor(tBusinessEmployeeExtendInfo.getHighestDegreeAndMajor());
businessVo.setHighestDegreeGraduateSchool(tBusinessEmployeeExtendInfo.getHighestDegreeGraduateSchool());
businessVo.setContactInfo(tBusinessEmployeeExtendInfo.getContactInfo());
businessVo.setArchivesAddr(tBusinessEmployeeExtendInfo.getArchivesAddr());
businessVo.setEmployeeTags(tBusinessEmployeeExtendInfo.getEmployeeTags());
businessVo.setDepartName(tBusinessEmployeeExtendInfo.getDepartName());
businessVo.setDepartId(tBusinessEmployeeExtendInfo.getDepartId());
businessVo.setDepartCode(tBusinessEmployeeExtendInfo.getDepartCode());
businessVo.setExtendId(tBusinessEmployeeExtendInfo.getId());
if (null != tBusinessEmployeeExtendInfo.getBusinessEnjoinDate()) {
businessVo.setBusinessEnjoinDate(tBusinessEmployeeExtendInfo.getBusinessEnjoinDate());
}
if(StringUtils.isNotBlank(tBusinessEmployeeExtendInfo.getBusinessPost())) {
businessVo.setBusinessPost(tBusinessEmployeeExtendInfo.getBusinessPost());
}
businessVo.setBusinessLeaveDate(tBusinessEmployeeExtendInfo.getBusinessLeaveDate());
businessVo.setBusinessTelecomNumber(tBusinessEmployeeExtendInfo.getBusinessTelecomNumber());
businessVo.setLeaveReason(tBusinessEmployeeExtendInfo.getBusinessLeaveReason());
}
}
@Override
public R<List<BusinessEmployeeExtentExcelVO>> exportByParams(THroBusinessUserQuery query) {
if (StringUtils.isNotBlank(query.getEmployeeTagName())) {
String empTag = String.format(CommonConstants.TAG_FROMAT, Integer.valueOf(query.getEmployeeTagName()));
query.setEmployeeTagName(empTag);
}
return R.ok(this.baseMapper.getTEmployeeBusinessList(query));
}
}
......@@ -556,4 +556,126 @@
</if>
</where>
</select>
<!--*********************************B端合同列表开始2020-08-27**************************************-->
<resultMap id="tEmpContractInfoBusinessMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractBusinessPageVo">
<id property="id" column="ID"/>
<result property="empNo" column="EMP_NO"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="contractName" column="CONTRACT_NAME"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="situation" column="SITUATION"/>
<result property="isObsolete" column="IS_OBSOLETE"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="inUse" column="IN_USE"/>
</resultMap>
<!--B端合同列表简单分页查询-->
<select id="getContractBusinessPage" resultMap="tEmpContractInfoBusinessMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_contract_info a
LEFT JOIN t_employee_contract_info b on a.EMP_ID=b.EMP_ID and b.CREATE_TIME >a.CREATE_TIME
<where>
b.id is NULL
<if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.empName != null and tEmployeeContractInfo.empName.trim() != ''">
AND a.EMP_NAME like CONCAT('%',#{tEmployeeContractInfo.empName},'%')
</if>
<if test="tEmployeeContractInfo.situation != null and tEmployeeContractInfo.situation != ''">
AND a.SITUATION = #{tEmployeeContractInfo.situation}
</if>
<if test="tEmployeeContractInfo.isObsolete != null and tEmployeeContractInfo.isObsolete.trim() != ''">
AND a.IS_OBSOLETE = #{tEmployeeContractInfo.isObsolete}
</if>
<if test="tEmployeeContractInfo.settleDomain != null and tEmployeeContractInfo.settleDomain != ''">
AND a.SETTLE_DOMAIN = #{tEmployeeContractInfo.settleDomain}
</if>
<if test="tEmployeeContractInfo.inUse != null and tEmployeeContractInfo.inUse.trim() != ''">
AND a.IN_USE = #{tEmployeeContractInfo.inUse}
</if>
</if>
<if test="settleDomainIds != null and settleDomainIds.size >0">
AND a.SETTLE_DOMAIN in
<foreach item="item" index="index" collection="settleDomainIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="flag != null and flag == 0">
AND a.CONTRACT_END <![CDATA[<]]> ADDDATE(current_date,INTERVAL 3 month) AND a.CONTRACT_END <![CDATA[>]]> now()
AND a.IN_USE = '0'
</if>
</where>
order by a.EMP_ID,a.CONTRACT_START DESC
</select>
<select id="getContractBusinessAlertCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_info a
LEFT JOIN t_employee_contract_info b on a.EMP_ID=b.EMP_ID and b.CREATE_TIME >a.CREATE_TIME
<where>
b.id is NULL
<if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.empName != null and tEmployeeContractInfo.empName.trim() != ''">
AND a.EMP_NAME like CONCAT(#{tEmployeeContractInfo.empName},'%')
</if>
<if test="tEmployeeContractInfo.situation != null and tEmployeeContractInfo.situation != ''">
AND a.SITUATION = #{tEmployeeContractInfo.situation}
</if>
<if test="tEmployeeContractInfo.isObsolete != null and tEmployeeContractInfo.isObsolete.trim() != ''">
AND a.IS_OBSOLETE = #{tEmployeeContractInfo.isObsolete}
</if>
<if test="tEmployeeContractInfo.settleDomain != null and tEmployeeContractInfo.settleDomain != ''">
AND a.SETTLE_DOMAIN = #{tEmployeeContractInfo.settleDomain}
</if>
<if test="tEmployeeContractInfo.inUse != null and tEmployeeContractInfo.inUse.trim() != ''">
AND a.IN_USE = #{tEmployeeContractInfo.inUse}
</if>
</if>
<if test="settleDomainIds != null and settleDomainIds.size >0">
AND a.SETTLE_DOMAIN in
<foreach item="item" index="index" collection="settleDomainIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="alertMonth != null">
AND a.CONTRACT_END <![CDATA[<]]> ADDDATE(current_date,INTERVAL #{alertMonth} month) AND a.CONTRACT_END <![CDATA[>]]> now()
</if>
</where>
</select>
<!--获取最新合同,通过员工身份证-->
<select id="getOtherContractBusinessInfo" resultMap="tEmpContractInfoBusinessMap">
SELECT
a.ID,
a.EMP_NO,
a.EMP_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.CONTRACT_NAME,
a.CONTRACT_TYPE,
a.CONTRACT_START,
a.CONTRACT_END,
a.SITUATION,
a.IS_OBSOLETE,
a.SETTLE_DOMAIN,
a.IN_USE
FROM t_employee_contract_info a
where
IS_OBSOLETE = '0'
<if test="empId != null">
AND a.EMP_ID = #{empId}
</if>
<if test="contractId != null">
AND a.id != #{contractId}
</if>
ORDER BY a.CREATE_TIME DESC
</select>
</mapper>
......@@ -874,4 +874,125 @@
where e.CONTRACT_STATUS != 2 and c.CONTRACT_END <![CDATA[ < ]]> DATE_FORMAT(curdate(),"%Y-%m-%d")
</update>
<resultMap id="businessEmployeeExtendListVO" type="com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendListVO">
</resultMap>
<select id="getTEmployeeBusinessPage" resultMap="businessEmployeeExtendListVO">
SELECT
a.ID,
b.ID as extendId,
a.EMP_NAME,
a.EMP_IDCARD,
if(b.BUSINESS_ENJOIN_DATE is not null, b.BUSINESS_ENJOIN_DATE, a.ENJOIN_DATE) as BUSINESS_ENJOIN_DATE,
a.DEPT_ID SETTLE_DOMAIN,
b.DEPART_NAME,
b.DEPART_ID,
b.BUSINESS_POST,
b.BUSINESS_TELECOM_NUMBER,
b.EMPLOYEE_TAGS,
if(b.BUSINESS_WORKING_STATUS is not null, b.BUSINESS_WORKING_STATUS, a.PROJECT_STATUS) as BUSINESS_WORKING_STATUS,
a.PROJECT_STATUS WORK_FLAG,
a.STATUS WORKING_STATUS_SUB,
if(b.BUSINESS_LEAVE_DATE is not null, b.BUSINESS_LEAVE_DATE, a.LEAVE_TIME) as BUSINESS_LEAVE_DATE,
b.DOCUMENT_TYPE,
c.DEPART_NAME as SETTLE_DOMAIN_NAME
FROM t_employee_project a
left join t_business_employee_extend_info b on a.EMP_IDCARD = b.EMP_IDCARD
left join t_settle_domain c on a.DEPT_ID = c.ID
where a.DELETE_FLAG = '0' and c.DELETE_FLAG = '0'
<include refid="BusinessQuery"/>
order by a.ENJOIN_DATE DESC
</select>
<sql id="BusinessQuery">
<if test="query.empIdcard != null and query.empIdcard.trim() != ''">
AND a.EMP_IDCARD like CONCAT('%', #{query.empIdcard},'%')
</if>
<if test="query.empName != null and query.empName.trim() != ''">
AND a.EMP_NAME like CONCAT('%',#{query.empName},'%')
</if>
<if test="query.settleDomainId != null and query.settleDomainId.trim() != ''">
AND a.DEPT_ID = #{query.settleDomainId}
</if>
<if test="query.businessPost != null and query.businessPost != ''">
AND b.BUSINESS_POST like CONCAT('%',#{query.businessPost},'%')
</if>
<if test="query.departName != null and query.departName.trim() != ''">
AND b.DEPART_NAME like CONCAT(#{query.departName},'%')
</if>
<if test="query.departId != null and query.departId != 1">
AND (b.DEPART_ID = #{query.departId} or b.DEPART_CODE like concat('%-', #{query.departId},'-%'))
</if>
<if test="query.businessTelecomNumber != null and query.businessTelecomNumber.trim() != ''">
AND b.BUSINESS_TELECOM_NUMBER like CONCAT('%',#{query.businessTelecomNumber} ,'%')
</if>
<if test="query.businessWorkingStatus == null">
<!--AND if(b.BUSINESS_WORKING_STATUS is not null, b.BUSINESS_WORKING_STATUS is not null, a.WORK_FLAG = '0') 2022-01-19 fxj 调整-->
AND a.PROJECT_STATUS = '0'
</if>
<!-- businessWorkingStatus: 0 在职 1 离职 -->
<if test="query.businessWorkingStatus != null and query.businessWorkingStatus.trim() != ''">
<!-- 0查询在职 -->
<if test="query.businessWorkingStatus == '0'.toString()">
<!-- 在职状态为 0在职 3临时 不等于1为在职 -->
<!-- AND if(b.BUSINESS_WORKING_STATUS is not null, b.BUSINESS_WORKING_STATUS <![CDATA[<>]]> '1', a.WORK_FLAG = '0') 2022-01-19 fxj 调整-->
AND a.PROJECT_STATUS = '0'
</if>
<!-- 1查询离职 -->
<if test="query.businessWorkingStatus == '1'.toString()">
<!-- 离职 1 -->
AND a.PROJECT_STATUS = '0'
AND b.BUSINESS_WORKING_STATUS = '1'
</if>
</if>
<if test="query.employeeTagName != null and query.employeeTagName.trim() != ''">
AND b.EMPLOYEE_TAGS like CONCAT('%',#{query.employeeTagName},'%')
</if>
<!-- 是否持证 0否 1是 -->
<if test="query.documentStatus != null and query.documentStatus.trim() != '' and query.documentStatus == '0'.toString()">
AND if(b.DOCUMENT_TYPE = '', b.DOCUMENT_TYPE = '', b.DOCUMENT_TYPE is null)
</if>
<if test="query.documentStatus != null and query.documentStatus.trim() != '' and query.documentStatus == '1'.toString()">
AND b.DOCUMENT_TYPE is NOT NULL AND b.DOCUMENT_TYPE <![CDATA[<>]]> ''
</if>
<if test="query.settleDomainIds != null and query.settleDomainIds.size >0">
and a.DEPT_ID in
<foreach item="settleDomainId" index="index" collection="query.settleDomainIds" open="(" separator="," close=")">
#{settleDomainId}
</foreach>
</if>
</sql>
<resultMap id="businessEmployeeExtentExcelVO" type="com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtentExcelVO">
</resultMap>
<select id="getTEmployeeBusinessList" resultMap="businessEmployeeExtentExcelVO">
SELECT
a.EMP_NAME,
a.EMP_IDCARD,
b.BUSINESS_TELECOM_NUMBER,
b.DEPART_NAME,
b.DEPART_ID,
a.DEPT_ID SETTLE_DOMAIN,
b.BUSINESS_POST,
b.FIRST_DEGREE_AND_MAJOR,
b.FIRST_DEGREE_GRADUATE_SCHOOL,
b.HIGHEST_DEGREE_AND_MAJOR,
b.HIGHEST_DEGREE_GRADUATE_SCHOOL,
b.CONTACT_INFO,
b.ARCHIVES_ADDR,
if(b.BUSINESS_ENJOIN_DATE is not null, b.BUSINESS_ENJOIN_DATE, a.ENJOIN_DATE) as BUSINESS_ENJOIN_DATE,
b.EMPLOYEE_TAGS,
if(b.BUSINESS_WORKING_STATUS is not null, b.BUSINESS_WORKING_STATUS, a.PROJECT_STATUS) as BUSINESS_WORKING_STATUS,
a.PROJECT_STATUS WORK_FLAG,
a.STATUS WORKING_STATUS_SUB,
if(b.BUSINESS_LEAVE_DATE is not null, b.BUSINESS_LEAVE_DATE, a.LEAVE_TIME) as BUSINESS_LEAVE_DATE,
b.DOCUMENT_TYPE,
c.DEPART_NAME as SETTLE_DOMAIN_NAME
FROM t_employee_project a
left join t_business_employee_extend_info b on a.EMP_IDCARD = b.EMP_IDCARD
left join t_settle_domain c on a.DEPT_ID = c.ID
where a.DELETE_FLAG = '0' and c.DELETE_FLAG = '0'
<include refid="BusinessQuery"/>
order by a.ENJOIN_DATE DESC
</select>
</mapper>
package com.yifu.cloud.plus.v1.business.vo.cert;
import com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import com.yifu.cloud.plus.v1.business.entity.system.TBusAttaInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName TCertInfoVo
* @Description 页面详情获取
* @Author fxj
* @Created 2021/8/18 17:36
* @Version 1.0
*/
@Data
public class TCertInfoVo implements Serializable {
/**
* 证件信息表
*/
private TCertInfo certInfo;
/**
* 变更记录表
*/
private List<TUpdateRecord> recordList;
/**
* 附件表
*/
private List<TBusAttaInfo> attaInfos;
}
package com.yifu.cloud.plus.v1.business.vo.system;
import com.yifu.cloud.plus.v1.business.entity.system.TBusDept;
import lombok.Data;
import java.util.List;
/**
* @Description: B端部门vo
* @Author: hgw
* @Date: 2023-1-4 11:32:01
**/
@Data
public class BusDeptVo {
private List<TBusDept> busDeptList;
}
package com.yifu.cloud.plus.v1.business.vo.system;
import com.yifu.cloud.plus.v1.business.entity.system.TBusLable;
import lombok.Data;
import java.util.List;
/**
* @Description: B端标签vo
* @Author: hgw
* @Date: 2023-1-4 11:32:01
**/
@Data
public class BusLableVo {
private List<TBusLable> busLableList;
}
package com.yifu.cloud.plus.v1.business.vo.vacation;
import lombok.*;
import java.io.Serializable;
/**
* @description: UpdateVacationMonitorRedundancyDTO
* @author: wangweiguo
* @date: 2021/8/23
*/
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class UpdateVacationRedundancyDTO implements Serializable {
/**
* 身份证号
*/
private String empIdcard;
/**
* 姓名
*/
private String empName;
/**
* 电信工号
*/
private String businessTelecomNumber;
/**
* 岗位
*/
private String businessPost;
/**
* 部门id
*/
private Integer departId;
/**
* 标签
*/
private String label;
}
package com.yifu.cloud.plus.v1.business.controller.cert;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo;
import com.yifu.cloud.plus.v1.business.service.cert.TCertInfoService;
import com.yifu.cloud.plus.v1.business.vo.cert.TCertInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
/**
* 人员证书信息表
*
* @author fxj
* @date 2021-08-16 15:34:16
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tcertinfo")
@Tag(name = "人员证书信息表")
public class TCertInfoController {
private final TCertInfoService tCertInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tCertInfo 人员证书信息表
* @return
*/
@Operation(summary = "简单分页查询")
@GetMapping("/page")
public R<IPage<TCertInfo>> getTCertInfoPage(Page<TCertInfo> page, TCertInfo tCertInfo) {
if (StringUtils.isNotBlank(tCertInfo.getLabel())) {
String empTag = String.format(CommonConstants.TAG_FROMAT, Integer.valueOf(tCertInfo.getLabel()));
tCertInfo.setLabel(empTag);
}
return new R<>(tCertInfoService.getTCertInfoPage(page, tCertInfo));
}
/**
* 简单分页查询
*
* @param tCertInfo 人员证书信息表
* @return
*/
@Operation(summary = "导出查询")
@GetMapping("/getCertInfoForExport")
public R<List<TCertInfo>> getCertInfoForExport(TCertInfo tCertInfo) {
if (StringUtils.isNotBlank(tCertInfo.getLabel())) {
String empTag = String.format(CommonConstants.TAG_FROMAT, Integer.valueOf(tCertInfo.getLabel()));
tCertInfo.setLabel(empTag);
}
return R.ok(tCertInfoService.getCertInfoForExport(tCertInfo));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(summary = "id查询")
@GetMapping("/{id}")
public R<TCertInfoVo> getById(@PathVariable("id") String id) {
return tCertInfoService.getVoById(id);
}
/**
* 通过身份证号查询单条记录
*
* @param empIdcard
* @return R
*/
@Operation(summary = "empIdcard查询所有证件信息")
@GetMapping("/getByempIdcard")
public R<List<TCertInfoVo>> getByempIdcard(@RequestParam(name = "empIdcard") String empIdcard) {
return tCertInfoService.getByEmpIdcard(empIdcard);
}
/**
* 新增记录
*
* @param tCertInfo
* @return R
*/
@Operation(summary = "新增(yifu-hro-business:tcertinfo_add)")
@PostMapping
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tcertinfo_add')")
public R<TCertInfo> save(@Valid @RequestBody TCertInfo tCertInfo) {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed("获取用户信息失败!");
}
tCertInfo.setStatus(CommonConstants.ZERO_STRING);
tCertInfo.setCreateUser(user.getNickname());
tCertInfo.setCreateTime(LocalDateTime.now());
return tCertInfoService.saveAsso(tCertInfo);
}
/**
* 修改记录
*
* @param tCertInfo
* @return R
*/
@Operation(summary = "修改(yifu-hro-business:tcertinfo_edit)")
@SysLog("修改人员证书信息表")
@PutMapping
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tcertinfo_edit')")
public R<String> update(@RequestBody TCertInfo tCertInfo) {
return tCertInfoService.updateByIdDiy(tCertInfo);
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation(summary = "删除(yifu-hro-business:tcertinfo_del)")
@SysLog("删除人员证书信息表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tcertinfo_del')")
public R<Boolean> removeById(@PathVariable String id) {
return tCertInfoService.removeByIdDiy(id);
}
/**
* b端人员证件信息批量导入
*
* @param jsonStr
* @description: b端人员证件信息批量导入
* @author: fxj
* @date: 2021/8/10
*/
@Operation(summary = "批量导入:b端人员证件信息批量导入")
@PutMapping("/batchImportCertByJsonStr")
public R<List<ErrorMessage>> batchImportCertByJsonStr(@RequestBody String jsonStr) {
return tCertInfoService.batchImportCertByJsonStr(jsonStr);
}
/**
* b端人员证件信息批量更新
*
* @param jsonStr
* @description: b端人员证件信息批量更新
* @author: fxj
* @date: 2021/8/10
*/
@Operation(summary = "批量更新:b端人员证件信息批量更新")
@PutMapping("/batchUpdateCertByJsonStr")
public R<List<ErrorMessage>> batchUpdateCertByJsonStr(@RequestBody String jsonStr) {
return tCertInfoService.batchUpdateCertByJsonStr(jsonStr);
}
/**
* 定时任务更新证件状态信息
*
* @return
* @date 2021-08-23
* @author: fxj
*/
@Inner
@Operation(summary = "B端定时更新证件状态")
@PostMapping("/inner/updateCertStatusTask")
public R<Boolean> updateCertStatusTask() {
return tCertInfoService.updateCertStatusTask();
}
/**
* 更新证件信息中的冗余信息
*
* @param dtoList
* @return
*/
@Inner
@PostMapping("/inner/updateRedundancyEmpOfCert")
public void updateRedundancyEmpOfCert(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
tCertInfoService.updateRedundancyEmpOfCert(dtoList);
}
}
package com.yifu.cloud.plus.v1.business.controller.cert;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import com.yifu.cloud.plus.v1.business.service.cert.TUpdateRecordService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 证书变更记录表
*
* @author fxj
* @date 2021-08-16 15:34:16
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tupdaterecord")
@Tag(name = "证书变更记录表")
public class TUpdateRecordController {
private final TUpdateRecordService tUpdateRecordService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param updateRecord 证书变更记录表
* @return
*/
@Operation(summary = "简单分页查询")
@GetMapping("/page")
public R<IPage<TUpdateRecord>> getTCertInfoPage(Page<TUpdateRecord> page, TUpdateRecord updateRecord) {
return new R<>(tUpdateRecordService.getTUpdateRecordPage(page, updateRecord));
}
/**
* 通过id查询单条记录
*
* @param domainId
* @return R
*/
@Operation(summary = "通过实体类ID查询对应变更记录信息")
@GetMapping("/getRecordsByDomainId")
public R<List<TUpdateRecord>> getById(@PathVariable("domainId") String domainId) {
return tUpdateRecordService.getRecordsByDomainId(domainId);
}
}
package com.yifu.cloud.plus.v1.business.controller.fileupload;
import com.yifu.cloud.plus.v1.business.entity.system.TBusAttaInfo;
import com.yifu.cloud.plus.v1.business.service.system.TBusAttaInfoService;
import com.yifu.cloud.plus.v1.business.vo.BusFileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
/**
* @author hgw
* 文件上传接口
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fileUpload")
@Tag(name = "文件上传接口")
@Slf4j
public class FileUploadController {
private final OSSUtil ossUtil;
private final TBusAttaInfoService busAttaInfoService;
/**
* 阿里云处理文件上传
*
* @param file 文件
* @param filePath 如: import 或 import/test/test..../test
* @return
* @throws IOException
*/
// @ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
// @ApiImplicitParam(name = "filePath", value = "文件上传路径", dataType = "String", paramType = "form"),
// @ApiImplicitParam(name = "type", value = "上传类型0结算单;1社保;2公积金;3代发工资;4餐补;5春节大礼包;6证件附件;7假勤信息附件8学信网证明", required = true, dataType = "int", paramType = "form"),
// @ApiImplicitParam(name = "domain", value = "实体id(传入就插入对应关系)", paramType = "form")
@Operation(summary = "OSS文件上传接口", description = "上传文件并保持文件路径到数据库")
@PostMapping(value = "/ossUploadFile")
public R<BusFileVo> uploadFile(@RequestBody MultipartFile file, String filePath, Integer type, String domain) throws IOException {
return busAttaInfoService.uploadFile(file, filePath, type, domain);
}
/**
* 获取附件下载地址
*
* @param id
* @return
* @Author fxj
* @Date 2019-08-16
**/
@Operation(summary = "附件预览下载地址")
@GetMapping("/ossFileUrl/{id}")
public R ossFileUrl(@PathVariable String id) {
TBusAttaInfo busAtta = busAttaInfoService.getById(id);
if (null == busAtta) {
return R.failed("无对应附件信息");
}
URL url = ossUtil.getObjectUrl(null, busAtta.getAttaSrc());
busAtta.setAttaSrc(url.toString());
return new R<>(busAtta);
}
// @ApiImplicitParam(name = "file", value = "Form文件上传", required = true, allowMultiple = true, dataType = "__file", paramType = "form"),
// @ApiImplicitParam(name = "filePath", value = "文件上传路径", required = false, dataType = "String", paramType = "form"),
// @ApiImplicitParam(name = "type",allowMultiple = true, value = "上传类型0结算单;1社保;2公积金;3代发工资;4餐补;5春节大礼包;6证件附件;7假勤信息附件8学信网证明", required = true, dataType = "String", paramType = "form"),
// @ApiImplicitParam(name = "domain",allowMultiple = true, value = "实体id(传入就插入对应关系)", paramType = "form")
@Operation(summary = "OSS多文件上传接口", description = "上传文件并保持文件路径到数据库")
@PostMapping(value = "/ossUploadFileMultipart", headers = "content-type=multipart/form-data")
public R<List<R<BusFileVo>>> ossUploadFileMultipart(HttpServletRequest request,
@RequestParam(value = "filePath", required = false) String filePath,
@RequestParam(value = "type", required = true)String[] type,
@RequestParam(value = "domain", required = true)String[] domain,
@RequestParam(value = "file", required = true)MultipartFile[] file) throws IOException {
if (Common.isEmpty(file) || Common.isEmpty(type) || Common.isEmpty(domain)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
if (type.length != domain.length || type.length != file.length || domain.length != file.length){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
List<R<BusFileVo>> fileVos = new ArrayList<>();
//filePath不传默认存储空间的根目录
for (int i=0;i<file.length;i++) {
fileVos.add(busAttaInfoService.uploadFile(file[i], filePath, Integer.parseInt(type[i]), domain[i]));
}
return R.ok(fileVos);
}
/**
* 删除数据库记录和OSS文件
*
* @param id
* @return
* @Author fxj
* @Date 2019-09-09
**/
@Operation(summary = "附件删除")
@SysLog("附件删除")
@GetMapping("/ossFileDelete/{id}")
public R<Boolean> ossFileDelete(@PathVariable String id) {
try {
TBusAttaInfo busAtta = busAttaInfoService.getById(id);
if (null == busAtta) {
return R.failed("无对应附件信息");
}
if (busAttaInfoService.removeById(id)) {
ossUtil.deleteObject(null, busAtta.getAttaSrc());
return R.ok();
}
} catch (Exception e) {
log.error("附件删除异常:" + e.getMessage());
return R.failed("附件删除异常!!");
}
return R.failed("删除失败!!");
}
}
......@@ -8,7 +8,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......
......@@ -8,7 +8,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......
......@@ -13,7 +13,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......
......@@ -14,6 +14,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
......@@ -54,7 +55,9 @@ public class TBusSalaryItemController {
@Operation(summary = "工资详情")
@GetMapping("/getListBySalaryId")
public R<List<TBusSalaryItem>> getListBySalaryId(@RequestParam String salaryId) {
return new R<>(tBusSalaryItemService.getListBySalaryId(salaryId));
List<String> salaryIdList = new ArrayList<>();
salaryIdList.add(salaryId);
return new R<>(tBusSalaryItemService.getListBySalaryId(salaryIdList));
}
......
......@@ -10,7 +10,6 @@ import com.yifu.cloud.plus.v1.business.vo.salary.TSalaryTotalVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusDept;
import com.yifu.cloud.plus.v1.business.service.system.TBusDeptService;
import com.yifu.cloud.plus.v1.business.vo.system.BusDeptVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -12,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
......@@ -92,6 +94,21 @@ public class TBusDeptController {
return new R<>(tBusDeptService.getTBusDeptList(tBusDept));
}
/**
* @param tBusDept
* @Description: B端人员调用的部门
* @Author: hgw
* @Date: 2023/1/4 11:38
* @return: com.yifu.cloud.plus.v1.business.vo.system.BusDeptVo
**/
@PostMapping("/inner/getTBusDeptList")
@Inner
public BusDeptVo innerGetTBusDeptList(TBusDept tBusDept) {
BusDeptVo vo = new BusDeptVo();
vo.setBusDeptList(tBusDeptService.getTBusDeptList(tBusDept));
return vo;
}
/**
* 查询所有的list 包含删除
* @param tBusDept B端部门表
......
......@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusLable;
import com.yifu.cloud.plus.v1.business.service.system.TBusLableService;
import com.yifu.cloud.plus.v1.business.vo.system.BusLableVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -58,6 +60,21 @@ public class TBusLableController {
return new R<>(tBusLableService.getTBusLableList(tBusLable));
}
/**
* @param tBusLable
* @Description: B端人员调用的标签
* @Author: hgw
* @Date: 2023/1/4 11:38
* @return: com.yifu.cloud.plus.v1.business.vo.system.BusLableVo
**/
@PostMapping("/inner/getTBusLableList")
@Inner
public BusLableVo innerGetTBusLableList(TBusLable tBusLable) {
BusLableVo busLableVo = new BusLableVo();
busLableVo.setBusLableList(tBusLableService.getTBusLableList(tBusLable));
return busLableVo;
}
/**
* 通过id查询单条记录
......
......@@ -132,8 +132,8 @@ public class TVacationInfoController {
**/
@Inner
@PostMapping("/inner/updateRedundancyEmployeeFields")
public R<Boolean> updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
return this.tVacationInfoService.updateRedundancyEmployeeFields(dtoList);
public void updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
tVacationInfoService.updateRedundancyEmployeeFields(dtoList);
}
}
......
......@@ -89,8 +89,8 @@ public class TVacationMonitorController {
*/
@Inner
@PostMapping("/inner/updateRedundancyEmployeeFields")
public R<Boolean> updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
return this.tVacationMonitorService.updateRedundancyEmployeeFields(dtoList);
public void updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
tVacationMonitorService.updateRedundancyEmployeeFields(dtoList);
}
}
......
package com.yifu.cloud.plus.v1.business.mapper.cert;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 人员证书信息表
*
* @author fxj
* @date 2021-08-16 15:34:16
*/
@Mapper
public interface TCertInfoMapper extends BaseMapper<TCertInfo> {
/**
* 人员证书信息表简单分页查询
*
* @param tCertInfo 人员证书信息表
* @return
*/
IPage<TCertInfo> getTCertInfoPage(Page<TCertInfo> page, @Param("tCertInfo") TCertInfo tCertInfo);
List<TCertInfo> getCertInfoNoPage(@Param("tCertInfo") TCertInfo tCertInfo);
}
package com.yifu.cloud.plus.v1.business.mapper.cert;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TUpdateRecordMapper extends BaseMapper<TUpdateRecord> {
/**
* 简单分页查询
*
* @param tUpdateRecord
* @return
*/
IPage<TUpdateRecord> getTUpdateRecordPage(Page page, @Param("tUpdateRecord") TUpdateRecord tUpdateRecord);
}
......@@ -25,6 +25,6 @@ public interface TBusSalaryItemMapper extends BaseMapper<TBusSalaryItem> {
*/
IPage<TBusSalaryItem> getTBusSalaryItemPage(Page<TBusSalaryItem> page, @Param("tBusSalaryItem") TBusSalaryItem tBusSalaryItem);
List<TBusSalaryItem> getListBySalaryId(@Param("salaryId") String salaryId);
List<TBusSalaryItem> getListBySalaryId(@Param("salaryIdList") List<String> salaryIdList);
}
package com.yifu.cloud.plus.v1.business.service.cert;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo;
import com.yifu.cloud.plus.v1.business.vo.cert.TCertInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* 人员证书信息表
*
* @author fxj
* @date 2021-08-16 15:34:16
*/
public interface TCertInfoService extends IService<TCertInfo> {
/**
* 人员证书信息表简单分页查询
*
* @param tCertInfo 人员证书信息表
* @return
*/
IPage<TCertInfo> getTCertInfoPage(Page<TCertInfo> page, TCertInfo tCertInfo);
R<List<ErrorMessage>> batchImportCertByJsonStr(String jsonStr);
R<TCertInfo> saveAsso(TCertInfo tCertInfo);
R<String> updateByIdDiy(TCertInfo tCertInfo);
R<TCertInfoVo> getVoById(String id);
R<List<TCertInfoVo>> getByEmpIdcard(String empIdcard);
R<Boolean> removeByIdDiy(String id);
R<List<ErrorMessage>> batchUpdateCertByJsonStr(String jsonStr);
List<TCertInfo> getCertInfoForExport(TCertInfo tCertInfo);
R<Boolean> updateCertStatusTask();
R<List<ErrorMessage>> updateRedundancyEmpOfCert(List<UpdateVacationRedundancyDTO> dtoList);
}
package com.yifu.cloud.plus.v1.business.service.cert;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* @ClassName TUpdateRecordService
* @Description 证件修改记录表
* @Author fxj
* @Created 2021/8/16 15:12
* @Version 1.0
*/
public interface TUpdateRecordService extends IService<TUpdateRecord> {
/**
* 简单分页查询
*
* @param updateRecord
* @return
*/
IPage<TUpdateRecord> getTUpdateRecordPage(Page<TUpdateRecord> page, TUpdateRecord updateRecord);
/**
* 生成修改记录
* @Author fxj
* @Date 2021-08-16 15:14
* @param id
* @param module
* @param oldInfo
* @param newInfo
* @param tClass
* @return
**/
<T> TUpdateRecord saveModificationRecord(String id,String module,T oldInfo, T newInfo,Class<T> tClass);
<T> TUpdateRecord saveModificationRecord(String id, String module, String differenceKey, T oldInfo, T newInfo, Class<T> tClass);
R<List<TUpdateRecord>> getRecordsByDomainId(String domainId);
}
package com.yifu.cloud.plus.v1.business.service.cert.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import com.yifu.cloud.plus.v1.business.entity.system.SysBusDict;
import com.yifu.cloud.plus.v1.business.entity.system.TBusAttaInfo;
import com.yifu.cloud.plus.v1.business.mapper.cert.TCertInfoMapper;
import com.yifu.cloud.plus.v1.business.service.cert.TCertInfoService;
import com.yifu.cloud.plus.v1.business.service.cert.TUpdateRecordService;
import com.yifu.cloud.plus.v1.business.service.system.SysBusDictService;
import com.yifu.cloud.plus.v1.business.service.system.TBusAttaInfoService;
import com.yifu.cloud.plus.v1.business.vo.cert.TCertInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URLDecoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 人员证书信息表
*
* @author fxj
* @date 2021-08-16 15:34:16
*/
@AllArgsConstructor
@Service
public class TCertInfoServiceImpl extends ServiceImpl<TCertInfoMapper, TCertInfo> implements TCertInfoService {
private final DaprArchivesProperties daprArchivesProperties;
private final SysBusDictService busDictService;
private final TUpdateRecordService recordService;
private final TBusAttaInfoService busAttaInfoService;
private static final String CERT_TYPE = "cert_type";
/**
* 人员证书信息表简单分页查询
*
* @param tCertInfo 人员证书信息表
* @return
*/
@Override
public IPage<TCertInfo> getTCertInfoPage(Page<TCertInfo> page, TCertInfo tCertInfo) {
tCertInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
return baseMapper.getTCertInfoPage(page, tCertInfo);
}
/**
* 批量更新证件信息
*
* @param jsonStr
* @return
*/
@Transactional
@Override
public R<List<ErrorMessage>> batchUpdateCertByJsonStr(String jsonStr) {
//用于返回错误信息
List<ErrorMessage> errorMessageList = new ArrayList<>();
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,CommonConstants.USER_FAIL, CommonConstants.RED));
return R.failed(errorMessageList);
}
ExcelUtil<TCertInfo> util1;
//需要转换的数据
HashMap<String, String> otherMap = new HashMap<>();
// 导入字段封装
initBusiDict(otherMap, CommonConstants.ZERO_INT);
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
util1 = new ExcelUtil<>(TCertInfo.class);
util1.getJsonStringToList(jsonStr, initMapForImport(otherMap));
List<TCertInfo> list = util1.getEntityList();
Map<String, ErrorMessage> messageMap = new HashMap<>();
if (null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) {
for (ErrorMessage msg:util1.getErrorInfo()){
messageMap.put(null==msg.getLineNum()?"":msg.getLineNum().toString(),msg);
}
}
if (Common.isNotNull(list)) {
Map<String, TCertInfo> existMap = new HashMap<>();
// 初始化MAP
initExistMap(existMap, list);
TCertInfo temp;
List<TCertInfo> certInfoList;
LocalDate date = null;
LocalDate now = LocalDate.now();
// 数据导入
int i = 1;
for (TCertInfo cert : list) {
i++;
if (null != messageMap.get(Integer.toString(i))){
errorMessageList.add(messageMap.get(Integer.toString(i)));
continue;
}
temp = existMap.get(cert.getCertNum());
// 验证信息
if (Common.isEmpty(temp)) {
errorMessageList.add(new ErrorMessage(i, "未找到对应证书号的数据!", CommonConstants.RED));
continue;
}
cert.setId(temp.getId());
cert.setLabel(temp.getLabel());
cert.setBusinessTelecomNumber(temp.getBusinessTelecomNumber());
cert.setOrganId(temp.getOrganId());
cert.setPost(temp.getPost());
cert.setCreateTime(temp.getCreateTime());
cert.setCreateUser(temp.getCreateUser());
cert.setDeleteFlag(temp.getDeleteFlag());
cert.setEmpName(temp.getEmpName());
cert.setEmpIdcard(temp.getEmpIdcard());
cert.setOssUrlBack(temp.getOssUrlBack());
cert.setOssUrlFront(temp.getOssUrlFront());
if (Common.isNotNull(cert.getReviewDate())) {
date = getDayOfAdd(cert.getReviewDate(),CommonConstants.THIRTY_INT_NEGATIVE);
}
initCertStatusbByTime(date, cert, now);
if (baseMapper.updateById(cert) > 0) {
certInfoList = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getEmpIdcard, cert.getEmpIdcard()).eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
// 按身份证更新证件类型的冗余信息
updateExtendCertOfUpdate(errorMessageList, otherMap, certInfoList, i);
} else {
errorMessageList.add(new ErrorMessage(i, CommonConstants.UPDATE_DATA_FAIL,CommonConstants.RED));
}
}
}else{
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,"证件信息更新解析异常:" +CommonConstants.NO_DATA_TO_HANDLE, CommonConstants.RED));
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
} catch (Exception e) {
log.error("证件信息更新解析异常!", e);
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,"证件信息更新异常:" + e.getMessage(),CommonConstants.RED));
return R.failed(CommonConstants.UPDATE_DATA_FAIL);
}
return R.ok(errorMessageList);
}
public static LocalDate getDayOfAdd(LocalDate time,int d) {
return time.plusDays(d);
}
/**
* 证件状态逻辑产品确认:
* ①有效期以内,到达复审时间--待复审; 到达复审时间:到达复审时间前30天 至 复审时间
* ②超过有效期--失效(此时即时到了复审时间,也是失效);
* ③失效状态修改到期时间--状态 需要根据是否到达复审时间,来判断是 正常 还是 待复审
* @param date 复审日期
* @param cert
* @param now
*/
private static void initCertStatusbByTime(LocalDate date, TCertInfo cert, LocalDate now) {
// 转成待审核 isBefore
if (!CommonConstants.ONE_STRING.equals(cert.getStatus())
&& null != cert.getTermValidityEnd()
&& null != date
&& (date.isBefore(now) || date.equals(now))
&& (now.isBefore(cert.getTermValidityEnd()) || now.equals(cert.getTermValidityEnd()))) {
cert.setStatus(CommonConstants.ONE_STRING);
}
// 转成 已失效 isAfter 不包含等于
if (!CommonConstants.TWO_STRING.equals(cert.getStatus())
&& null != cert.getTermValidityEnd()
&& now.isAfter(cert.getTermValidityEnd())) {
cert.setStatus(CommonConstants.TWO_STRING);
}
// 转成 正常
if (!CommonConstants.ZERO_STRING.equals(cert.getStatus())
&& null != date
&& null != cert.getTermValidityEnd()
&& now.isBefore(date)
&& now.isBefore(cert.getTermValidityEnd())) {
cert.setStatus(CommonConstants.ZERO_STRING);
}
if (Common.isEmpty(cert.getTermValidityEnd()) && Common.isNotNull(date)){
if ((date.isBefore(now) || date.equals(now))){
cert.setStatus(CommonConstants.ONE_STRING);
}else {
cert.setStatus(CommonConstants.ZERO_STRING);
}
}
}
private void updateExtendCertOfUpdate(List<ErrorMessage> errorMessageList,
HashMap<String, String> otherMap,
List<TCertInfo> certInfoList, int i) {
if (Common.isNotNull(certInfoList)) {
UpdateEmployeeExtendRedundancyDTO updateDto = new UpdateEmployeeExtendRedundancyDTO();
for (TCertInfo c : certInfoList) {
updateDto.setEmpIdcard(c.getEmpIdcard());
c.setCertType(otherMap.get(CERT_TYPE + CommonConstants.DOWN_LINE_STRING + c.getCertType()));
}
initCertType(certInfoList, updateDto);
handleUpdateEmp(errorMessageList, i, updateDto);
errorMessageList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
}
}
@Override
public List<TCertInfo> getCertInfoForExport(TCertInfo tCertInfo) {
tCertInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
return baseMapper.getCertInfoNoPage(tCertInfo);
}
/**
* 定时任务更新证件状态信息
*
* @return
* @date 2021-08-23
* @author: fxj
*/
@Transactional
@Override
public R<Boolean> updateCertStatusTask() {
List<TCertInfo> certInfos = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.ne(TCertInfo::getStatus, CommonConstants.TWO_STRING));
try {
if (Common.isNotNull(certInfos)) {
LocalDate date;
LocalDate now = LocalDate.now();
for (TCertInfo certInfo : certInfos) {
date = getDayOfAdd(certInfo.getReviewDate(),CommonConstants.THIRTY_INT_NEGATIVE);
initCertStatusbByTime(date, certInfo, now);
baseMapper.updateById(certInfo);
}
}
} catch (Exception e) {
log.error("证件状态变更异常!", e);
return R.failed(CommonConstants.RESULT_DATA_FAIL);
}
return R.ok();
}
@Override
public R<List<ErrorMessage>> updateRedundancyEmpOfCert(List<UpdateVacationRedundancyDTO> dtoList) {
if (!CollUtil.isEmpty(dtoList)) {
dtoList.forEach(v -> {
this.lambdaUpdate().eq(TCertInfo::getEmpIdcard, v.getEmpIdcard())
.set(TCertInfo::getEmpName, v.getEmpName())
.set(TCertInfo::getBusinessTelecomNumber, v.getBusinessTelecomNumber())
.set(TCertInfo::getPost, v.getBusinessPost())
.set(TCertInfo::getOrganId,v.getDepartId())
.set(TCertInfo::getLabel,v.getLabel())
.update();
});
}
return R.ok();
}
private void initExistMap(Map<String, TCertInfo> existMap, List<TCertInfo> list) {
List<String> certNums = new ArrayList<>();
for (TCertInfo cert : list) {
certNums.add(cert.getCertNum());
}
if (Common.isNotNull(certNums)) {
List<TCertInfo> certRes = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.in(TCertInfo::getCertNum, certNums).eq(TCertInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(certRes)) {
for (TCertInfo certInfo : certRes) {
existMap.put(certInfo.getCertNum(), certInfo);
}
}
}
}
/**
* 批量导入证件信息
*
* @param jsonStr
* @return
*/
@Transactional
@Override
public R<List<ErrorMessage>> batchImportCertByJsonStr(String jsonStr) {
//用于返回错误信息
List<ErrorMessage> errorMessageList = new ArrayList<>();
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,CommonConstants.USER_FAIL, CommonConstants.RED));
return R.failed(errorMessageList);
}
ExcelUtil<TCertInfo> util;
//需要转换的数据
HashMap<String, String> otherMap = new HashMap<>();
// 导入字段封装
initBusiDict(otherMap, CommonConstants.ZERO_INT);
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
util = new ExcelUtil<>(TCertInfo.class);
util.getJsonStringToList(jsonStr, initMapForImport(otherMap));
List<TCertInfo> list = util.getEntityList();
Map<String, ErrorMessage> messageMap = new HashMap<>();
if (null != util.getErrorInfo() && !util.getErrorInfo().isEmpty()) {
for (ErrorMessage msg:util.getErrorInfo()){
messageMap.put(null==msg.getLineNum()?"":msg.getLineNum().toString(),msg);
}
}
if (!CollUtil.isEmpty(list)) {
Map<String, TCertInfo> existMap = new HashMap<>();
// 初始化MAP
initExistMap(existMap, list);
List<String> idCardList = new ArrayList<>();
for (TCertInfo cert : list) {
idCardList.add(cert.getEmpIdcard());
}
if (!Common.isNotNull(idCardList)) {
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,"获取B端人员信息失败!", CommonConstants.RED));
return R.failed(errorMessageList);
}
R<BusinessEmployeeListVo> empRes = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId()
, "/customerBusiness/temployeeBusiness/inner/getListByIdCartList", idCardList
, BusinessEmployeeListVo.class, SecurityConstants.FROM_IN);
Map<String, TBusinessEmployeeExtendInfo> empMap = new HashMap<>();
// 初始化MAP
initEmpMap(empRes, empMap);
TBusinessEmployeeExtendInfo extendInfo;
List<TCertInfo> certInfoList;
TCertInfo temp;
LocalDate now = LocalDate.now();
LocalDate date = null;
// 数据导入
int i = 1;
for (TCertInfo cert : list) {
i++;
if (null != messageMap.get(Integer.toString(i))){
errorMessageList.add(messageMap.get(Integer.toString(i)));
continue;
}
extendInfo = empMap.get(cert.getEmpIdcard() +
CommonConstants.DOWN_LINE_STRING +
cert.getBusinessTelecomNumber());
temp = existMap.get(cert.getCertNum());
// 验证信息
if (checkImport(errorMessageList, i, cert, extendInfo, temp)) {
continue;
}
cert.setLabel(extendInfo.getEmployeeTags());
cert.setBusinessTelecomNumber(extendInfo.getBusinessTelecomNumber());
cert.setOrganId(null == extendInfo.getDepartId() ? null : extendInfo.getDepartId().toString());
cert.setPost(extendInfo.getBusinessPost());
cert.setCreateTime(LocalDateTime.now());
cert.setCreateUser(user.getNickname());
cert.setEmpName(extendInfo.getEmpName());
cert.setEmpIdcard(extendInfo.getEmpIdcard());
cert.setDeleteFlag(CommonConstants.ZERO_STRING);
if (Common.isEmpty(cert.getStatus())){
cert.setStatus(CommonConstants.ZERO_STRING);
}
certInfoList = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getEmpIdcard, cert.getEmpIdcard()).eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(cert.getReviewDate())) {
date = getDayOfAdd(cert.getReviewDate(),CommonConstants.THIRTY_INT_NEGATIVE);
}
initCertStatusbByTime(date, cert, now);
if (baseMapper.insert(cert) > 0) {
existMap.put(cert.getCertNum(),cert);
// 更新证件信息
updateExtendCertInfo(errorMessageList, certInfoList, i, cert);
} else {
errorMessageList.add(new ErrorMessage(i, CommonConstants.SAVE_FAILED, CommonConstants.RED));
}
}
}else{
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,"证件信息数据导入解析异常:" +CommonConstants.NO_DATA_TO_HANDLE, CommonConstants.RED));
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
} catch (Exception e) {
log.error("证件信息数据导入解析异常!", e);
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT_NEGATE,"证件信息数据导入解析异常:" + e.getMessage(), CommonConstants.RED));
return R.failed(errorMessageList);
}
return R.ok(errorMessageList);
}
public static Map<String, String> initMapForImport(Map<String, String> otherMap) {
HashMap<String, String> dicMap = new HashMap<>();
if (null != otherMap){
dicMap.putAll(otherMap);
}
return dicMap;
}
/**
* B端字段数据封装
*
* @param otherMap
* @param type 0 导入 1 导出
*/
private void initBusiDict(HashMap<String, String> otherMap, int type) {
List<SysBusDict> dictList = busDictService.list(Wrappers.<SysBusDict>query().lambda().eq(SysBusDict::getStatus, CommonConstants.ZERO_STRING));
if (null != dictList) {
for (SysBusDict dict : dictList) {
if (CommonConstants.ZERO_INT == type) {
otherMap.put(dict.getItemType() + CommonConstants.DOWN_LINE_STRING + dict.getLabel(), dict.getValue());
}
if (CommonConstants.ONE_INT == type) {
otherMap.put(dict.getItemType() + CommonConstants.DOWN_LINE_STRING + dict.getValue(), dict.getLabel());
}
}
}
}
/**
* @auth fxj
* 单个更新员工的证件类型数据
* @param certInfoList
* @param certInfo
* @return
*/
private String updateExtendCertSingle(List<TCertInfo> certInfoList, TCertInfo certInfo) {
if (Common.isEmpty(certInfoList)) {
certInfoList = new ArrayList<>();
}
certInfoList.add(certInfo);
UpdateEmployeeExtendRedundancyDTO updateDto = new UpdateEmployeeExtendRedundancyDTO();
updateDto.setEmpIdcard(certInfo.getEmpIdcard());
initCertType(certInfoList, updateDto);
if (Common.isNotNull(updateDto.getEmpIdcard())) {
R<Boolean> remoteRes = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId()
, "/customerBusiness/temployeeBusiness/inner/updateEmpExtendCertInfo", updateDto
, Boolean.class, SecurityConstants.FROM_IN);
if (null == remoteRes || CommonConstants.FAIL == remoteRes.getCode()) {
return "更新证件冗余信息异常!";
}
}
return null;
}
private void initCertType(List<TCertInfo> certInfoList, UpdateEmployeeExtendRedundancyDTO updateDto) {
Map<String, String> strMap = new HashMap<>();
for (TCertInfo c : certInfoList) {
strMap.put(c.getCertType(),c.getCertType());
}
if (Common.isNotNull(strMap)){
for (String key:strMap.keySet()){
if (Common.isEmpty(updateDto.getDocumentType())) {
updateDto.setDocumentType(key);
} else {
updateDto.setDocumentType(updateDto.getDocumentType() +
CommonConstants.COMMA_STRING + key);
}
}
}
}
private void updateExtendCertInfo(List<ErrorMessage> errorMessageList, List<TCertInfo> certInfoList, int i, TCertInfo certInfo) {
if (Common.isEmpty(certInfoList)) {
certInfoList = new ArrayList<>();
certInfoList.add(certInfo);
}
UpdateEmployeeExtendRedundancyDTO updateDto = new UpdateEmployeeExtendRedundancyDTO();
updateDto.setEmpIdcard(certInfo.getEmpIdcard());
initCertType(certInfoList, updateDto);
handleUpdateEmp(errorMessageList, i, updateDto);
errorMessageList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
}
private void handleUpdateEmp(List<ErrorMessage> errorMessageList, int i, UpdateEmployeeExtendRedundancyDTO updateDto) {
if (Common.isNotNull(updateDto.getEmpIdcard()) && Common.isNotNull(updateDto.getDocumentType())) {
R<Boolean> remoteRes = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId()
, "/customerBusiness/temployeeBusiness/inner/updateEmpExtendCertInfo", updateDto
, Boolean.class, SecurityConstants.FROM_IN);
if (null == remoteRes || CommonConstants.FAIL == remoteRes.getCode()) {
errorMessageList.add(new ErrorMessage(i, "更新证件冗余信息异常!", CommonConstants.RED));
}
}
}
/**
* 证件信息单个保持接口
*
* @param tCertInfo
* @return
*/
@Transactional
@Override
public R<TCertInfo> saveAsso(TCertInfo tCertInfo) {
String checkRes = checkForSave(tCertInfo);
if (Common.isNotNull(checkRes)) {
return R.failed(checkRes);
}
tCertInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
initCertStatusbByTime(getDayOfAdd(tCertInfo.getReviewDate(),CommonConstants.THIRTY_INT_NEGATIVE), tCertInfo, LocalDate.now());
if (baseMapper.insert(tCertInfo) > CommonConstants.ZERO_INT) {
List<TCertInfo> certInfoList = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getEmpIdcard, tCertInfo.getEmpIdcard()).eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
String res = updateExtendCertSingle(certInfoList,tCertInfo);
if (Common.isNotNull(res)){
runTimeExceptionDiy("更新人员证件类型失败:"+res);
}
return R.ok(tCertInfo);
}
return R.failed(CommonConstants.SAVE_FAILED);
}
public static void runTimeExceptionDiy(String errorInfo) {
throw new CheckedException(errorInfo);
}
/**
* 修改证件信息并保存记录信息
*
* @param certInfo
* @return
*/
@Transactional
@Override
public R<String> updateByIdDiy(TCertInfo certInfo) {
if (null == certInfo || Common.isEmpty(certInfo.getId())) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
TCertInfo cert = baseMapper.selectById(certInfo.getId());
if (null == cert) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
certInfo.setCreateTime(cert.getCreateTime());
certInfo.setCreateUser(cert.getCreateUser());
certInfo.setPost(cert.getPost());
certInfo.setOrganId(cert.getOrganId());
certInfo.setLabel(cert.getLabel());
certInfo.setBusinessTelecomNumber(cert.getBusinessTelecomNumber());
certInfo.setEmpName(cert.getEmpName());
certInfo.setEmpIdcard(cert.getEmpIdcard());
certInfo.setDeleteFlag(cert.getDeleteFlag());
recordService.saveModificationRecord(certInfo.getId(), CommonConstants.ZERO_STRING, cert, certInfo, TCertInfo.class);
initCertStatusbByTime(getDayOfAdd(certInfo.getReviewDate(),CommonConstants.THIRTY_INT_NEGATIVE), certInfo, LocalDate.now());
int res = baseMapper.updateById(certInfo);
if (res >= CommonConstants.ZERO_INT) {
updateEmpCertType(certInfo, res, certInfo.getCertNum());
return R.ok(CommonConstants.SAVE_SUCCESS);
}
return R.failed(CommonConstants.SAVE_FAILED);
}
/**
* 获取证件信息及变更记录信息
*
* @param id
* @return
*/
@Override
public R<TCertInfoVo> getVoById(String id) {
TCertInfoVo vo = new TCertInfoVo();
if (Common.isEmpty(id)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
vo.setCertInfo(baseMapper.selectById(id));
vo.setRecordList(recordService.list(Wrappers.<TUpdateRecord>query().lambda()
.eq(TUpdateRecord::getModul, CommonConstants.ZERO_STRING).eq(TUpdateRecord::getDomainId, id)
.orderByDesc(TUpdateRecord::getCreateTime)));
List<TBusAttaInfo> busAttaInfos = busAttaInfoService.list(Wrappers.<TBusAttaInfo>query().lambda().eq(TBusAttaInfo::getRelationId,id));
List<TBusAttaInfo> res = new ArrayList<>();
if (Common.isNotNull(busAttaInfos)){
for (TBusAttaInfo attaInfo:busAttaInfos){
res.add(busAttaInfoService.getUrlByid(attaInfo.getId()));
}
}
vo.setAttaInfos(res);
return R.ok(vo);
}
/**
* 按身份证查询所有证件信息
*
* @param empIdcard
* @return
*/
@Override
public R<List<TCertInfoVo>> getByEmpIdcard(String empIdcard) {
if (Common.isEmpty(empIdcard)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
TCertInfoVo vo;
List<TCertInfoVo> voList = new ArrayList<>();
List<TBusAttaInfo> busAttaInfos;
List<TBusAttaInfo> res;
List<TCertInfo> certInfos = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getEmpIdcard, empIdcard).eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(certInfos)){
for (TCertInfo info:certInfos){
vo = new TCertInfoVo();
vo.setCertInfo(baseMapper.selectById(info.getId()));
vo.setRecordList(recordService.list(Wrappers.<TUpdateRecord>query().lambda()
.eq(TUpdateRecord::getModul, CommonConstants.ZERO_STRING).eq(TUpdateRecord::getDomainId, info.getId())
.orderByDesc(TUpdateRecord::getCreateTime)));
busAttaInfos = busAttaInfoService.list(Wrappers.<TBusAttaInfo>query().lambda().eq(TBusAttaInfo::getRelationId,info.getId()));
res = new ArrayList<>();
if (Common.isNotNull(busAttaInfos)){
for (TBusAttaInfo attaInfo:busAttaInfos){
res.add(busAttaInfoService.getUrlByid(attaInfo.getId()));
}
}
vo.setAttaInfos(res);
voList.add(vo);
}
}
return R.ok(voList);
}
/**
* 删除证件信息
*
* @param id
* @return
*/
@Override
public R<Boolean> removeByIdDiy(String id) {
if (Common.isEmpty(id)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
TCertInfo certInfo = baseMapper.selectById(id);
if (Common.isEmpty(certInfo)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
certInfo.setDeleteFlag(CommonConstants.ONE_STRING);
int res = baseMapper.updateById(certInfo);
if (res > CommonConstants.ZERO_INT) {
certInfo.setCertType(null);
updateEmpCertType(certInfo, res, certInfo.getCertNum());
return R.ok();
}
return R.failed(CommonConstants.RESULT_DATA_FAIL);
}
private void updateEmpCertType(TCertInfo certInfo, int res, String certNum) {
List<TCertInfo> certInfoList = baseMapper.selectList(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getEmpIdcard, certInfo.getEmpIdcard())
.ne(TCertInfo::getCertNum, certNum)
.eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
String result = updateExtendCertSingle(certInfoList, certInfo);
if (Common.isNotNull(result)) {
runTimeExceptionDiy("更新人员证件类型失败:" + res);
}
}
private String checkForSave(TCertInfo cert) {
if (Common.isEmpty(cert.getEmpName())
|| Common.isEmpty(cert.getEmpIdcard())
|| Common.isEmpty(cert.getCertNum())) {
return "姓名|身份证号|证件号不可为空!";
}
List<String> idCardList = new ArrayList<>();
idCardList.add(cert.getEmpIdcard());
R<BusinessEmployeeListVo> empRes = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId()
, "/customerBusiness/temployeeBusiness/inner/getListByIdCartList", idCardList
, BusinessEmployeeListVo.class, SecurityConstants.FROM_IN);
Map<String, TBusinessEmployeeExtendInfo> empMap = new HashMap<>();
if (Common.isEmpty(cert.getBusinessTelecomNumber())) {
return "暂无电信工号,请补充后,再添加证件信息!";
}
// 初始化MAP
initEmpMap(empRes, empMap);
TBusinessEmployeeExtendInfo extendInfo = empMap.get(cert.getEmpIdcard() +
CommonConstants.DOWN_LINE_STRING +
cert.getBusinessTelecomNumber());
if (Common.isEmpty(extendInfo)) {
return "未找到对应员工信息!";
}
cert.setLabel(extendInfo.getEmployeeTags());
cert.setBusinessTelecomNumber(extendInfo.getBusinessTelecomNumber());
cert.setPost(extendInfo.getBusinessPost());
cert.setOrganId(null == extendInfo.getDepartId() ? null : extendInfo.getDepartId().toString());
if (Common.isEmpty(cert.getCertType())) {
return "证件类型不可为空!";
}
if (Common.isEmpty(cert.getStatus())) {
return "证件状态不可为空!";
}
TCertInfo certTemp = baseMapper.selectOne(Wrappers.<TCertInfo>query().lambda()
.eq(TCertInfo::getCertNum, cert.getCertNum())
.eq(TCertInfo::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(certTemp)) {
return "已存在对应证件编号的信息!";
}
if (Common.isEmpty(cert.getJobClass())) {
return "作业类别不可为空!";
}
if (Common.isEmpty(cert.getReviewDate())) {
return "复审日期不可为空!";
}
return null;
}
private boolean checkImport(List<ErrorMessage> errorMessageList, int i, TCertInfo cert,
TBusinessEmployeeExtendInfo extendInfo, TCertInfo temp) {
if (Common.isNotNull(temp)) {
errorMessageList.add(new ErrorMessage(i, "已存在对应证件编号的信息!", CommonConstants.RED, cert.getEmpIdcard()));
return true;
}
if (Common.isEmpty(extendInfo)) {
errorMessageList.add(new ErrorMessage(i, "未找到对应身份证和电信编号的人员信息,请核实或补充后添加证件信息!", CommonConstants.RED, cert.getEmpIdcard()));
return true;
}
if (Common.isEmpty(extendInfo.getBusinessTelecomNumber())) {
errorMessageList.add(new ErrorMessage(i, "对应员工无电信工号,请去人员管理列表更新!", CommonConstants.RED, cert.getEmpIdcard()));
return true;
}
return false;
}
private void initEmpMap(R<BusinessEmployeeListVo> empRes, Map<String, TBusinessEmployeeExtendInfo> empMap) {
if (R.haveData(empRes)) {
for (TBusinessEmployeeExtendInfo extendInfo : empRes.getData().getEmpList()) {
empMap.put(extendInfo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
+ extendInfo.getBusinessTelecomNumber(), extendInfo);
}
}
}
}
package com.yifu.cloud.plus.v1.business.service.cert.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord;
import com.yifu.cloud.plus.v1.business.mapper.cert.TUpdateRecordMapper;
import com.yifu.cloud.plus.v1.business.service.cert.TUpdateRecordService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
/**
* @ClassName TUpdateRecordServiceImpl
* @Description 证件修改记录表
* @Author fxj
* @Created 2021/8/16 15:16
* @Version 1.0
*/
@Service
public class TUpdateRecordServiceImpl extends ServiceImpl<TUpdateRecordMapper, TUpdateRecord> implements TUpdateRecordService {
@Override
public IPage<TUpdateRecord> getTUpdateRecordPage(Page<TUpdateRecord> page, TUpdateRecord updateRecord) {
return baseMapper.getTUpdateRecordPage(page,updateRecord);
}
@Override
public <T> TUpdateRecord saveModificationRecord(String id, String module, T oldInfo, T newInfo, Class<T> tClass) {
return saveModificationRecord(id,module,null,oldInfo,newInfo,tClass);
}
/**
* 生成修改记录
* @Author fxj
* @Date 2021-08-16
* @param id
* @param module
* @param differenceKey 非空串必须以逗号结尾
* @param oldInfo
* @param newInfo
* @param tClass
* @return
**/
@Override
public <T> TUpdateRecord saveModificationRecord(String id, String module, String differenceKey, T oldInfo, T newInfo, Class<T> tClass){
try{
//比较记录不影响业务逻辑,用try套住
//比较差异
differenceKey = HrEquator.comparisonValue(oldInfo, newInfo,differenceKey);
//如果有差异保存差异
if(Common.isNotNull(differenceKey)){
TUpdateRecord record = new TUpdateRecord();
YifuUser user = SecurityUtils.getUser();
if (null != user){
record.setCreateUser(String.valueOf(user.getId()));
record.setCreateUserName(user.getNickname());
}else {
record.setCreateUser("305");
record.setCreateUserName("管理员");
}
record.setModul(module);
record.setDomainId(id);
record.setCreateTime(LocalDateTime.now());
record.setNewInfo(JSON.toJSONString(newInfo,features));
record.setOldInfo(JSON.toJSONString(oldInfo,features));
record.setDifferenceInfo(differenceKey);
record.setFullClassName(tClass.getName());
baseMapper.insert(record);
return record;
}
}catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
}
return null;
}
@Override
public R<List<TUpdateRecord>> getRecordsByDomainId(String domainId) {
if (Common.isEmpty(domainId)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
return R.ok(baseMapper.selectList(Wrappers.<TUpdateRecord>query().lambda().eq(TUpdateRecord::getDomainId,domainId)));
}
private SerializerFeature[] features = new SerializerFeature[] {
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty,WriteDateUseDateFormat
};
}
......@@ -24,12 +24,12 @@ public interface TBusSalaryItemService extends IService<TBusSalaryItem> {
IPage<TBusSalaryItem> getTBusSalaryItemPage(Page<TBusSalaryItem> page, TBusSalaryItem tBusSalaryItem);
/**
* @param salaryId
* @param salaryIdList
* @Description: 获取list
* @Author: hgw
* @Date: 2021/9/15 14:56
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.salary.TBusSalaryItem>
**/
List<TBusSalaryItem> getListBySalaryId(String salaryId);
List<TBusSalaryItem> getListBySalaryId(List<String> salaryIdList);
}
......@@ -31,8 +31,8 @@ public class TBusSalaryItemServiceImpl extends ServiceImpl<TBusSalaryItemMapper,
}
@Override
public List<TBusSalaryItem> getListBySalaryId(String salaryId) {
return baseMapper.getListBySalaryId(salaryId);
public List<TBusSalaryItem> getListBySalaryId(List<String> salaryIdList) {
return baseMapper.getListBySalaryId(salaryIdList);
}
}
......@@ -70,9 +70,23 @@ public class TBusSalaryServiceImpl extends ServiceImpl<TBusSalaryMapper, TBusSal
vo.setSalaryList(salaryList);
if (salaryList != null && !salaryList.isEmpty()) {
Set<String> title = new HashSet<>();
List<TBusSalaryItem> itemList;
List<String> salaryIdList = new ArrayList<>();
for (TBusSalary salary : salaryList) {
itemList = busSalaryItemService.getListBySalaryId(salary.getId());
salaryIdList.add(salary.getId());
}
List<TBusSalaryItem> allItemList = busSalaryItemService.getListBySalaryId(salaryIdList);
Map<String, List<TBusSalaryItem>> itemMap = new HashMap<>();
List<TBusSalaryItem> itemList;
for (TBusSalaryItem item : allItemList) {
itemList = itemMap.get(item.getSalaryId());
if (itemList == null) {
itemList = new ArrayList<>();
}
itemList.add(item);
itemMap.put(item.getSalaryId(), itemList);
}
for (TBusSalary salary : salaryList) {
itemList = itemMap.get(salary.getId());
if (itemList != null && !itemList.isEmpty()) {
salary.setBisList(itemList);
for (TBusSalaryItem items : itemList) {
......
......@@ -55,8 +55,11 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_salary_item a
where a.SALARY_ID = #{salaryId}
order by a.order_line asc
where a.SALARY_ID in
<foreach item="item" index="index" collection="salaryIdList" open="(" separator="," close=")">
#{item}
</foreach>
order by a.SALARY_ID,a.order_line asc
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.business.mapper.cert.TCertInfoMapper">
<resultMap id="tCertInfoMap" type="com.yifu.cloud.plus.v1.business.entity.cert.TCertInfo">
<id property="id" column="id"/>
<result property="certType" column="cert_type"/>
<result property="status" column="status"/>
<result property="empName" column="emp_name"/>
<result property="certNum" column="cert_num"/>
<result property="jobClass" column="job_class"/>
<result property="operationItem" column="operation_item"/>
<result property="receiveTime" column="receive_time"/>
<result property="termValidityStart" column="term_validity_start"/>
<result property="termValidityEnd" column="term_validity_end"/>
<result property="reviewDate" column="review_date"/>
<result property="ossUrlFront" column="oss_url_front"/>
<result property="ossUrlBack" column="oss_url_back"/>
<result property="createUser" column="create_user"/>
<result property="createTime" column="create_time"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="organId" column="organ_id"/>
<result property="post" column="post"/>
<result property="label" column="label"/>
<result property="businessTelecomNumber" column="business_telecom_number"/>
<result property="deleteFlag" column="delete_flag"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.cert_type,
a.status,
a.emp_name,
a.cert_num,
a.job_class,
a.operation_item,
a.receive_time,
a.term_validity_start,
a.term_validity_end,
a.review_date,
a.oss_url_front,
a.oss_url_back,
a.create_user,
a.create_time,
a.emp_idcard,
a.organ_id,
a.post,
a.label,
a.delete_flag,
a.business_telecom_number
</sql>
<sql id="tCertInfo_where">
<if test="tCertInfo != null">
<if test="tCertInfo.deleteFlag != null and tCertInfo.deleteFlag.trim() != ''">
AND a.delete_flag = #{tCertInfo.deleteFlag}
</if>
<if test="tCertInfo.organId != null and tCertInfo.organId != 1">
AND (b.id = #{tCertInfo.organId} or b.tree_logo like concat('%-', #{tCertInfo.organId},'-%'))
</if>
<if test="tCertInfo.post != null and tCertInfo.post.trim() != ''">
AND a.post like concat('%',#{tCertInfo.post},'%')
</if>
<if test="tCertInfo.label != null and tCertInfo.label.trim() != ''">
AND a.label like concat('%',#{tCertInfo.label},'%')
</if>
<if test="tCertInfo.businessTelecomNumber != null and tCertInfo.businessTelecomNumber.trim() != ''">
AND a.business_telecom_number like concat('%',#{tCertInfo.businessTelecomNumber},'%')
</if>
<if test="tCertInfo.id != null and tCertInfo.id.trim() != ''">
AND a.id = #{tCertInfo.id}
</if>
<if test="tCertInfo.certType != null and tCertInfo.certType.trim() != ''">
AND a.cert_type = #{tCertInfo.certType}
</if>
<if test="tCertInfo.status != null and tCertInfo.status.trim() != ''">
AND a.status = #{tCertInfo.status}
</if>
<if test="tCertInfo.empName != null and tCertInfo.empName.trim() != ''">
AND a.emp_name like concat('%',#{tCertInfo.empName},'%')
</if>
<if test="tCertInfo.certNum != null and tCertInfo.certNum.trim() != ''">
AND a.cert_num = #{tCertInfo.certNum}
</if>
<if test="tCertInfo.jobClass != null and tCertInfo.jobClass.trim() != ''">
AND a.job_class = #{tCertInfo.jobClass}
</if>
<if test="tCertInfo.operationItem != null and tCertInfo.operationItem.trim() != ''">
AND a.operation_item like concat('%',#{tCertInfo.operationItem},'%')
</if>
<if test="tCertInfo.receiveTime != null and tCertInfo.receiveTime.trim() != ''">
AND a.receive_time = #{tCertInfo.receiveTime}
</if>
<if test="tCertInfo.termValidityStart != null and tCertInfo.termValidityStart.trim() != ''">
AND a.term_validity_start >= #{tCertInfo.termValidityStart}
</if>
<if test="tCertInfo.termValidityEnd != null and tCertInfo.termValidityEnd.trim() != ''">
AND a.term_validity_end <![CDATA[ <= ]]> #{tCertInfo.termValidityEnd}
</if>
<if test="tCertInfo.reviewDate != null">
AND a.review_date = #{tCertInfo.reviewDate}
</if>
<if test="tCertInfo.ossUrlFront != null and tCertInfo.ossUrlFront.trim() != ''">
AND a.oss_url_front = #{tCertInfo.ossUrlFront}
</if>
<if test="tCertInfo.ossUrlBack != null and tCertInfo.ossUrlBack.trim() != ''">
AND a.oss_url_back = #{tCertInfo.ossUrlBack}
</if>
<if test="tCertInfo.createUser != null and tCertInfo.createUser.trim() != ''">
AND a.create_user = #{tCertInfo.createUser}
</if>
<if test="tCertInfo.createTime != null">
AND a.create_time = #{tCertInfo.createTime}
</if>
<if test="tCertInfo.empIdcard != null and tCertInfo.empIdcard.trim() != ''">
AND a.emp_idcard = #{tCertInfo.empIdcard}
</if>
</if>
</sql>
<!--tCertInfo简单分页查询-->
<select id="getTCertInfoPage" resultMap="tCertInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_cert_info a
left join t_bus_dept b on a.organ_id=b.id
<where>
1=1
<include refid="tCertInfo_where"/>
</where>
order by a.create_time DESC
</select>
<!--tCertInfo简单分页查询-->
<select id="getCertInfoNoPage" resultMap="tCertInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_cert_info a
left join t_bus_dept b on a.organ_id=b.id
<where>
1=1
<include refid="tCertInfo_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.business.mapper.cert.TUpdateRecordMapper">
<resultMap id="tUpdateRecordMap" type="com.yifu.cloud.plus.v1.business.entity.cert.TUpdateRecord">
<id property="id" column="id"/>
<result property="createUser" column="create_user"/>
<result property="createUserName" column="create_user_name"/>
<result property="createTime" column="create_time"/>
<result property="domainId" column="domain_id"/>
<result property="modul" column="modul"/>
<result property="fullClassName" column="full_class_name"/>
<result property="oldInfo" column="old_info"/>
<result property="newInfo" column="new_info"/>
<result property="differenceInfo" column="difference_info"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.create_user,
a.create_user_name,
a.create_time,
a.domain_id,
a.modul,
a.full_class_name,
a.old_info,
a.new_info,
a.difference_info
</sql>
<sql id="tUpdateRecord_where">
<if test="tUpdateRecord != null">
<if test="tUpdateRecord.domainId != null and tUpdateRecord.domainId.trim() != ''">
AND a.domain_id = #{tUpdateRecord.domainId}
</if>
<if test="tUpdateRecord.modul != null and tUpdateRecord.modul.trim() != ''">
AND a.modul = #{tUpdateRecord.modul}
</if>
<if test="tUpdateRecord.id != null and tUpdateRecord.id.trim() != ''">
AND a.id = #{tUpdateRecord.id}
</if>
<if test="tUpdateRecord.createUser != null and tUpdateRecord.createUser.trim() != ''">
AND a.create_user = #{tUpdateRecord.createUser}
</if>
<if test="tUpdateRecord.createUserName != null and tUpdateRecord.createUserName.trim() != ''">
AND a.create_user_name = #{tUpdateRecord.createUserName}
</if>
<if test="tUpdateRecord.createTime != null">
AND a.create_time = #{tUpdateRecord.createTime}
</if>
<if test="tUpdateRecord.fullClassName != null and tUpdateRecord.fullClassName.trim() != ''">
AND a.full_class_name = #{tUpdateRecord.fullClassName}
</if>
<if test="tUpdateRecord.oldInfo != null and tUpdateRecord.oldInfo.trim() != ''">
AND a.old_info = #{tUpdateRecord.oldInfo}
</if>
<if test="tUpdateRecord.newInfo != null and tUpdateRecord.newInfo.trim() != ''">
AND a.new_info = #{tUpdateRecord.newInfo}
</if>
<if test="tUpdateRecord.differenceInfo != null and tUpdateRecord.differenceInfo.trim() != ''">
AND a.difference_info = #{tUpdateRecord.differenceInfo}
</if>
</if>
</sql>
<!--tUpdateRecord简单分页查询-->
<select id="getTUpdateRecordPage" resultMap="tUpdateRecordMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_update_record a
<where>
1=1
<include refid="tUpdateRecord_where"/>
</where>
</select>
</mapper>
......@@ -559,4 +559,8 @@ public interface CommonConstants {
* @Date 2020-10-13
**/
public static final String SEARCH_SUCCESS = "查询成功!";
String NO_SETTLE_DOMAIN_AUTH = "Hro系统中身份证号不存在,或者没有该人员的结算主体权限";
String HRO_EMPLOYEE_NULL = "Hro人员列表为空";
int THIRTY_INT_NEGATIVE = -30;
}
......@@ -144,4 +144,12 @@ public class ExcelAttributeConstants {
//有工资无社保
public static final String HAVE_SALARY_NO_SOCIAL_TYPE="HAVE_SALARY_NO_SOCIAL_TYPE";
// B端人员使用的
public static final String REDUCE_REASON = "reduce_reason";
// B端人员使用的
public static final String DEPART = "depart";
// B端人员使用的
public static final String CUSTOMER = "customer";
}
......@@ -881,6 +881,41 @@ public class DateUtil {
}
}
/**
* @param date1
* @param date2
* @Description: date2比date1多的天数
* @Author: hgw
* @Date: 2023/1/5 10:18
* @return: int
**/
public static int getDayDiff(Date date1,Date date2) {
Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
int day1= cal1.get(Calendar.DAY_OF_YEAR);
int day2 = cal2.get(Calendar.DAY_OF_YEAR);
int year1 = cal1.get(Calendar.YEAR);
int year2 = cal2.get(Calendar.YEAR);
//同一年
if (year1 != year2) {
int timeDistance = 0 ;
for (int i = year1 ; i < year2 ; i++) {
//闰年
if (i%4==0 && i%100!=0 || i%400==0) {
timeDistance += 366;
} else {
timeDistance += 365;
}
}
return timeDistance + (day2-day1) ;
} else {
return day2-day1;
}
}
public static int getMonthCountByDate(Date startDate, Date endDate) {
// type:1.当月缴当月的 2.当月缴次月的
int monthC = 0;
......
......@@ -102,26 +102,28 @@ public class R<T> implements Serializable {
apiResult.setMsg(msg);
return apiResult;
}
/**
* 返回成功状态
* 判断date是否有数据
* @Author pwang
* @Date 2021-04-22 19:45
* @param
* @return
*@see
**/
public static boolean isSuccess(R r){
return r!=null && CommonConstants.SUCCESS == r.getCode();
public static boolean haveData(R r){
return isSuccess(r) && null != r.getData();
}
/**
* 判断date是否有数据
* 返回成功状态
* @Author pwang
* @Date 2021-04-22 19:45
* @param
* @return
*@see
**/
public static boolean haveData(R r){
return isSuccess(r) && null != r.getData();
public static boolean isSuccess(R r){
return r!=null && CommonConstants.SUCCESS == r.getCode();
}
}
......@@ -45,7 +45,7 @@ public class HrEquator extends GetterBaseEquator {
* @return
**/
public static String comparisonValue(Object oldInfo, Object newInfo){
StringBuffer sb = new StringBuffer(CommonConstants.EMPTY_STRING);
StringBuilder sb = new StringBuilder(CommonConstants.EMPTY_STRING);
Equator equator = new HrEquator();
// 获取不同的属性
List<FieldInfo> diff = equator.getDiffFields(oldInfo, newInfo);
......@@ -79,4 +79,31 @@ public class HrEquator extends GetterBaseEquator {
return sb.toString();
}
/**
* 比较对象的差异,返回差异的属性名
* @Author pwang
* @Date 2020-06-18 15:32
* @param oldInfo
* @param newInfo
* @param differenceKey
* @return
**/
public static String comparisonValue(Object oldInfo, Object newInfo, String differenceKey){
//防止new StringBuffer时空指针
if(null == differenceKey){
differenceKey = "";
}
StringBuilder sb = new StringBuilder(differenceKey);
Equator equator = new HrEquator();
// 获取不同的属性
List<FieldInfo> diff = equator.getDiffFields(oldInfo, newInfo);
if(Common.isNotNull(diff)){
for(FieldInfo field:diff){
sb.append(field.getFieldName()).append(",");
}
sb.deleteCharAt(sb.length()-1);
}
return sb.toString();
}
}
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SocialAndFundReduceVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -30,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
......@@ -481,4 +483,20 @@ public class TDispatchInfoController {
String sql = CommonConstants.EMPTY_STRING;
return tDispatchInfoService.getFundSupplementaryRecords(idStr,searchVo,settleDomains,sql);
}
/**
* 获取社保和公积金派减日期
* @Author hgw
* @Date 2020-08-25
* @return
**/
@SysLog("B端获取社保和公积金派减日期")
@PostMapping(value = "/inner/getSocialAndFundReduceInfo")
@Inner
public SocialAndFundReduceVo getSocialAndFundReduceInfo(@RequestBody SocialAndFundReduceVo vo) {
if (Common.isNotNull(vo.getEmpId())) {
return tDispatchInfoService.getSocialAndFundReduceInfo(vo.getEmpId());
}
return new SocialAndFundReduceVo();
}
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SocialAndFundReduceVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
......@@ -87,4 +88,14 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<FundSupplementaryExportVo>> getFundSupplementaryRecords(String idStr,SocialHandleSearchVo dispatchInfo, List<String> settleDomains, String sql);
void doexportFundRecordChange(HttpServletResponse response,String idStr, SocialHandleSearchVo searchVo);
/**
* 获取社保和公积金派减日期
* @Author hgw
* @Date 2023-1-5 11:00:47
* @param empId
* @return
**/
SocialAndFundReduceVo getSocialAndFundReduceInfo(String empId);
}
......@@ -4322,4 +4322,35 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return minStartDate;
}
/**
* 获取社保和公积金派减日期
* @Author hgw
* @Date 2023-1-5 11:00:47
* @param empId
* @return
**/
@Override
public SocialAndFundReduceVo getSocialAndFundReduceInfo(String empId) {
SocialAndFundReduceVo vo = new SocialAndFundReduceVo();
TSocialInfo socialInfo = socialMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpId,empId)
.eq(TSocialInfo::getHandleStatus,CommonConstants.THREE_STRING)
.eq(TSocialInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.orderByDesc(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
TProvidentFund fund = fundMapper.selectOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpId,empId)
.eq(TProvidentFund::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TProvidentFund::getHandleStatus,CommonConstants.THREE_STRING)
.orderByDesc(TProvidentFund::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null != socialInfo && null != socialInfo.getSocialReduceDate()){
vo.setSocialReduceDate(DateUtil.formatDate(socialInfo.getSocialReduceDate()));
}
if (null != fund && null != fund.getFundReduceDate()){
vo.setFundReduceDate(DateUtil.formatDate(fund.getFundReduceDate()));
}
return vo;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment