Commit 990b7c34 authored by fangxinjiang's avatar fangxinjiang

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

parents 9785ccac 2fddaa3c
......@@ -36,6 +36,9 @@ public class TCompleteMonitor extends BaseEntity {
@Schema(description = "项目名称")
private String deptName;
@Schema(description = "项目id")
private String deptId;
@Schema(description = "项目编码")
private String deptNo;
......
......@@ -25,6 +25,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.Max;
import java.util.Date;
import java.util.List;
/**
* 员工学历信息表
......@@ -164,8 +165,6 @@ public class TEmpEducation extends BaseEntity {
@Max(value = 50)
@Schema(description = "专业")
private String major;
/**
* @Author fxj
* @Description 附件ID
......@@ -174,4 +173,7 @@ public class TEmpEducation extends BaseEntity {
@TableField(exist = false)
private String attaIds;
@TableField(exist = false)
private List<TAttaInfo> attaList;
}
......@@ -17,12 +17,13 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 员工职业资格信息表
*
......@@ -133,4 +134,7 @@ public class TEmpProfessionalQualification extends BaseEntity {
**/
@TableField(exist = false)
private String attaIds;
@TableField(exist = false)
private List<TAttaInfo> attaList;
}
......@@ -244,9 +244,9 @@ public class TEmployeeProject extends BaseEntity {
private String tryPeriod;
/**
* 项目档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬、6批量导入、7电子签)
* 项目档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬、6批量导入、7电子签8预入职
*/
@Schema(description ="项目档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬、6批量导入、7电子签)")
@Schema(description ="项目档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬、6批量导入、7电子签、8预入职)")
private String projectSource;
/**
......
......@@ -51,6 +51,15 @@ public class TPreEmpContactInfo extends BaseEntity {
@Schema(description = "id")
private String id;
/**
* empId
*/
@ExcelAttribute(name = "empId", maxLength = 32)
@Length(max = 32, message = "empId不能超过32个字符")
@ExcelProperty("empId")
@Schema(description = "empId")
private String empId;
/**
* 原ID——用来判断是否从档案查询带出的
*/
......
......@@ -162,10 +162,10 @@ public class TPreEmpDisabilityInfo extends BaseEntity {
private String settleDomain;
/**
* 0删除作废1正常
* 0正常1删除作废
*/
@TableLogic
@Schema(description ="0删除作废1正常")
@Schema(description ="0正常1删除作废")
private String deleteFlag;
/**
......
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
......@@ -172,6 +173,14 @@ public class TPreEmpMain extends BaseEntity {
@ExcelProperty("业务类型三级分类")
@Schema(description = "业务类型三级分类")
private String businessThirdType;
/**
* 业务类型汇总
*/
@ExcelAttribute(name = "业务类型汇总")
@ExcelProperty("业务类型汇总")
@Schema(description = "业务类型汇总")
@TableField(exist = false)
private String businessType;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
......@@ -204,6 +213,14 @@ public class TPreEmpMain extends BaseEntity {
@ExcelProperty("审核时间")
@Schema(description = "审核时间")
private Date auditTime;
/**
* 审核理由
*/
@ExcelAttribute(name = "审核理由", maxLength = 200)
@Length(max = 200, message = "审核理由不能超过200个字符")
@ExcelProperty("审核理由")
@Schema(description = "审核理由")
private String auditRemark;
/**
* 结算主体ID
*/
......@@ -221,4 +238,32 @@ public class TPreEmpMain extends BaseEntity {
@Schema(description = "员工申明表ID,新申明要加一条新数据,关联这个主表")
private String declarationId;
@Schema(description = "状态多个")
@TableField(exist = false)
private String[] statusArray;
@Schema(description = "员工类型多个")
@TableField(exist = false)
private String[] empNatureArray;
@Schema(description = "提交时间起")
@TableField(exist = false)
private String createTimeStart;
@Schema(description = "提交时间止")
@TableField(exist = false)
private String createTimeEnd;
@Schema(description = "查询limit 开始")
@TableField(exist = false)
private int limitStart;
@Schema(description = "查询limit 数据条数")
@TableField(exist = false)
private int limitEnd;
@Schema(description = "选中ID,多个逗号分割")
@TableField(exist = false)
private String ids;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 预入职审批记录表
*
* @author hgw
* @date 2024-06-24 14:27:15
*/
@Data
@TableName("t_pre_emp_main_log")
@Schema(description = "预入职审批记录表")
public class TPreEmpMainLog implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 实体id
*/
@ExcelAttribute(name = "实体id", isNotEmpty = true, errorInfo = "实体id不能为空", maxLength = 32)
@NotBlank(message = "实体id不能为空")
@Length(max = 32, message = "实体id不能超过32个字符")
@ExcelProperty("实体id")
@Schema(description = "实体id")
private String mainId;
/**
* 审核人id
*/
@ExcelAttribute(name = "审核人id", isNotEmpty = true, errorInfo = "审核人id不能为空", maxLength = 32)
@NotBlank(message = "审核人id不能为空")
@Length(max = 32, message = "审核人id不能超过32个字符")
@ExcelProperty("审核人id")
@Schema(description = "审核人id")
private String auditId;
/**
* 审核人姓名
*/
@ExcelAttribute(name = "审核人姓名", isNotEmpty = true, errorInfo = "审核人姓名不能为空", maxLength = 50)
@NotBlank(message = "审核人姓名不能为空")
@Length(max = 50, message = "审核人姓名不能超过50个字符")
@ExcelProperty("审核人姓名")
@Schema(description = "审核人姓名")
private String auditName;
/**
* 审核时间
*/
@ExcelAttribute(name = "审核时间", isDate = true)
@ExcelProperty("审核时间")
@Schema(description = "审核时间")
private Date auditTime;
/**
* 审核结果 3审核不通过;4审核通过
*/
@ExcelAttribute(name = "审核结果", maxLength = 1)
@Length(max = 1, message = "审核结果不能超过1个字符")
@ExcelProperty("审核结果3审核不通过;4审核通过")
@Schema(description = "审核结果3审核不通过;4审核通过")
private String auditResult;
/**
* 审核意见
*/
@ExcelAttribute(name = "审核意见", maxLength = 200)
@Length(max = 200, message = "审核意见不能超过200个字符")
@ExcelProperty("审核意见")
@Schema(description = "审核意见")
private String auditRemark;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 档案监控详情
*
* @author huyc
* @date 2024-6-28 11:43:37
*/
@Data
public class EmpMainDetailVo implements Serializable {
private static final long serialVersionUID = 1L;
// 员工不良记录表
private TEmpBadRecord tEmpBadRecord;
// 紧急联络人
private TEmpContactInfo tEmpContactInfo;
// 员工申明
private TPreEmpDeclaration tEmpDeclaration;
// 员工伤残信息表
private TEmpDisabilityInfo tEmpDisabilityInfo;
// 员工学历信息表
private TEmpEducation tEmpEducation;
// 员工家庭信息表
private List<TEmpFamily> tEmpFamilyList;
// 人员档案表
private TEmployeeInfo tEmployeeInfo;
// 项目档案表
private TEmployeeProject tEmployeeProject;
// 员工职业资格信息表
private List<TEmpProfessionalQualification> tEmpProfessionalQualificationList;
// 员工工作履历信息表
private List<TEmpWorkRecording> tEmpWorkRecordingList;
// 9身份证 10 户口本;附件 21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
private List<TAttaInfo> attaInfoList;
}
......@@ -36,25 +36,25 @@ public class PreEmpMainDetailVo implements Serializable {
// 主表
private TPreEmpMain main;
// 预入职-员工不良记录表
private TPreEmpBadRecord tPreEmpBadRecord;
private TPreEmpBadRecord tpreEmpBadRecord;
// 预入职-紧急联络人
private TPreEmpContactInfo tPreEmpContactInfo;
private TPreEmpContactInfo tpreEmpContactInfo;
// 预入职-员工申明
private TPreEmpDeclaration tPreEmpDeclaration;
private TPreEmpDeclaration tpreEmpDeclaration;
// 预入职-员工伤残信息表
private TPreEmpDisabilityInfo tPreEmpDisabilityInfo;
private TPreEmpDisabilityInfo tpreEmpDisabilityInfo;
// 预入职-员工学历信息表
private TPreEmpEducation tPreEmpEducation;
private TPreEmpEducation tpreEmpEducation;
// 预入职-员工家庭信息表
private List<TPreEmpFamily> tPreEmpFamilyList;
private List<TPreEmpFamily> tpreEmpFamilyList;
// 预入职-人员档案表
private TPreEmployeeInfo tPreEmployeeInfo;
private TPreEmployeeInfo tpreEmployeeInfo;
// 预入职-项目档案表
private TPreEmployeeProject tPreEmployeeProject;
private TPreEmployeeProject tpreEmployeeProject;
// 预入职-员工职业资格信息表
private List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList;
private List<TPreEmpProfessionalQualification> tpreEmpProfessionalQualificationList;
// 预入职-员工工作履历信息表
private List<TPreEmpWorkRecording> tPreEmpWorkRecordingList;
private List<TPreEmpWorkRecording> tpreEmpWorkRecordingList;
// 预入职-9身份证 10 户口本;附件 21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
private List<TAttaInfo> attaInfoList;
......
......@@ -15,76 +15,76 @@ import java.util.Date;
@Data
public class TCompleteMonitorFlagVo implements Serializable {
private String empSex;
public String empSex;
private Date validityStart;
public Date validityStart;
private Date validityEnd;
public Date validityEnd;
private Date empBirthday;
public Date empBirthday;
private Integer empAge;
public Integer empAge;
private String empMarriStatus;
public String empMarriStatus;
private String empNational;
public String empNational;
private String politicalStatus;
public String politicalStatus;
private String empPhone;
public String empPhone;
private String empRegisType;
public String empRegisType;
private Integer fileProvince;
public Integer fileProvince;
private Integer fileCity;
public Integer fileCity;
private Integer isCollege;
public Integer isCollege;
private String hignEducation;
public String hignEducation;
private String school;
public String school;
private String major;
public String major;
private Date admissionDate;
public Date admissionDate;
private Date gradutionDate;
public Date gradutionDate;
private String contactAddress;
public String contactAddress;
private String firstWorkFlag;
public String firstWorkFlag;
private String haveQualification;
public String haveQualification;
private String deptName;
public String deptName;
private String unitName;
public String unitName;
private String businessPrimaryType;
public String businessPrimaryType;
private String businessSecondType;
public String businessSecondType;
private String businessThirdType;
public String businessThirdType;
private String workingHours;
public String workingHours;
private String tryPeriod;
public String tryPeriod;
private Date enjoinDate;
public Date enjoinDate;
private String post;
public String post;
private String empProjectId;
public String empProjectId;
private String contactInfoId;
public String contactInfoId;
private String disabilityFlag;
public String disabilityFlag;
private String badRecordFlag;
public String badRecordFlag;
private String educationFlag;
public String educationFlag;
private String familyFlag;
public String familyFlag;
}
......@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
......@@ -18,7 +17,7 @@ import java.io.Serializable;
* @date 2024-06-17 16:08:58
*/
@Data
public class TCompleteMonitorVo extends RowIndex implements Serializable {
public class TCompleteMonitorVo implements Serializable {
/**
* 客户名称
......@@ -78,7 +77,7 @@ public class TCompleteMonitorVo extends RowIndex implements Serializable {
* 信息是否完整
*/
@Length(max = 1, message = "信息是否完整 不能超过1 个字符")
@ExcelAttribute(name = "信息是否完整", maxLength = 1, readConverterExp = "0=否,1=是")
@ExcelAttribute(name = "信息是否完整", maxLength = 1, readConverterExp = "0=是,1=否")
@Schema(description = "信息是否完整")
@ExcelProperty("信息是否完整")
private String isComplete;
......@@ -112,7 +111,7 @@ public class TCompleteMonitorVo extends RowIndex implements Serializable {
* 6月及后入职信息是否完整
*/
@Length(max = 1, message = "6月及后入职信息是否完整 不能超过1 个字符")
@ExcelAttribute(name = "6月及后入职信息是否完整", maxLength = 1, readConverterExp = "0=否,1=是")
@ExcelAttribute(name = "6月及后入职信息是否完整", maxLength = 1, readConverterExp = "0=是,1=否")
@Schema(description = "6月及后入职信息是否完整")
@ExcelProperty("6月及后入职信息是否完整")
private String afterIsComplete;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import lombok.Data;
/**
* 预入职监控导出全量信息
*
* @author hgw
* @date 2024-6-26 11:03:02
*/
@Data
@ColumnWidth(15)
public class TMainExportAllVO {
private static final long serialVersionUID = 1L;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "信息是否完整")
private String field1;
@ExcelProperty(value = "进项目时间")
private String field2;
@ExcelProperty(value = "员工主码")
private String field3;
@ExcelProperty(value = "员工类型")
private String field4;
@ExcelProperty(value = "员工姓名")
private String field5;
@ExcelProperty(value = "身份证号")
private String field6;
@ExcelProperty(value = "性别")
private String field7;
@ExcelProperty(value = "身份证期限")
private String field8;
@ExcelProperty(value = "身份证开始日期")
private String field9;
@ExcelProperty(value = "身份证截止日期")
private String field10;
@ExcelProperty(value = "出生日期")
private String field11;
@ExcelProperty(value = "年龄")
private String field12;
@ExcelProperty(value = "婚姻状况")
private String field13;
@ExcelProperty(value = "民族")
private String field14;
@ExcelProperty(value = "政治面貌")
private String field15;
@ExcelProperty(value = "手机号码")
private String field16;
@ExcelProperty(value = "邮箱")
private String field17;
@ExcelProperty(value = "户籍所在地")
private String field18;
@ExcelProperty(value = "户口性质")
private String field19;
@ExcelProperty(value = "档案所在地")
private String field20;
@ExcelProperty(value = "档案状态")
private String field21;
@ExcelProperty(value = "通信地址")
private String field22;
@ExcelProperty(value = "客户名称")
private String field23;
@ExcelProperty(value = "项目名称")
private String field24;
@ExcelProperty(value = "业务类型")
private String field25;
@ExcelProperty(value = "合同类型")
private String field26;
@ExcelProperty(value = "工时制")
private String field27;
@ExcelProperty(value = "就职岗位")
private String field28;
@ExcelProperty(value = "入职日期")
private String field29;
@ExcelProperty(value = "试用期")
private String field30;
@ExcelProperty(value = "标签")
private String field31;
@ExcelProperty(value = "姓名")
private String field32;
@ExcelProperty(value = "与本人关系")
private String field33;
@ExcelProperty(value = "联系地址")
private String field34;
@ExcelProperty(value = "联系电话")
private String field35;
@ExcelProperty(value = "学校")
private String field36;
@ExcelProperty(value = "专业")
private String field37;
@ExcelProperty(value = "学历")
private String field38;
@ExcelProperty(value = "是否大专及以上")
private String field39;
@ExcelProperty(value = "最高学历")
private String field40;
@ExcelProperty(value = "入学时间")
private String field41;
@ExcelProperty(value = "毕业时间")
private String field42;
// 1主要工作经历
@ExcelProperty(value = "是否为首份工作")
private String field43;
@ExcelProperty(value = "工作单位")
private String field44;
@ExcelProperty(value = "工作岗位")
private String field45;
@ExcelProperty(value = "开始工作日期")
private String field46;
@ExcelProperty(value = "结束工作日期")
private String field47;
// 2主要家庭成员信息
@ExcelProperty(value = "成员姓名")
private String field48;
@ExcelProperty(value = "与本人关系")
private String field49;
@ExcelProperty(value = "手机号码")
private String field50;
// 3职业资格信息
@ExcelProperty(value = "是否有职业资格证书")
private String field51;
@ExcelProperty(value = "申报年度")
private String field52;
@ExcelProperty(value = "职业资格名称")
private String field53;
@ExcelProperty(value = "是否曾被认定为工伤")
private String field54;
@ExcelProperty(value = "是否有职业病")
private String field55;
@ExcelProperty(value = "职业病名称")
private String field56;
@ExcelProperty(value = "是否有传染性疾病")
private String field57;
@ExcelProperty(value = "传染病名称")
private String field58;
@ExcelProperty(value = "是否持有残疾人证明")
private String field59;
@ExcelProperty(value = "伤残病名称")
private String field60;
@ExcelProperty(value = "伤残等级")
private String field61;
@ExcelProperty(value = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String field62;
@ExcelProperty(value = "不良记录描述")
private String field63;
}
......@@ -36,12 +36,6 @@ public class TPreEmpMainSearchVo extends TPreEmpMain {
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import lombok.Data;
/**
* 预入职导出全量信息
*
* @author hgw
* @date 2024-6-24 16:37:28
*/
@Data
@ColumnWidth(15)
public class TPreMainExportAllVO {
private static final long serialVersionUID = 1L;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "状态")
private String field1;
@ExcelProperty(value = "提交时间")
private String field2;
@ExcelProperty(value = "员工主码")
private String field3;
@ExcelProperty(value = "员工类型")
private String field4;
@ExcelProperty(value = "员工姓名")
private String field5;
@ExcelProperty(value = "身份证号")
private String field6;
@ExcelProperty(value = "性别")
private String field7;
@ExcelProperty(value = "身份证期限")
private String field8;
@ExcelProperty(value = "身份证开始日期")
private String field9;
@ExcelProperty(value = "身份证截止日期")
private String field10;
@ExcelProperty(value = "出生日期")
private String field11;
@ExcelProperty(value = "年龄")
private String field12;
@ExcelProperty(value = "婚姻状况")
private String field13;
@ExcelProperty(value = "民族")
private String field14;
@ExcelProperty(value = "政治面貌")
private String field15;
@ExcelProperty(value = "手机号码")
private String field16;
@ExcelProperty(value = "邮箱")
private String field17;
@ExcelProperty(value = "户籍所在地")
private String field18;
@ExcelProperty(value = "户口性质")
private String field19;
@ExcelProperty(value = "档案所在地")
private String field20;
@ExcelProperty(value = "档案状态")
private String field21;
@ExcelProperty(value = "通信地址")
private String field22;
@ExcelProperty(value = "客户名称")
private String field23;
@ExcelProperty(value = "项目名称")
private String field24;
@ExcelProperty(value = "业务类型")
private String field25;
@ExcelProperty(value = "合同类型")
private String field26;
@ExcelProperty(value = "工时制")
private String field27;
@ExcelProperty(value = "就职岗位")
private String field28;
@ExcelProperty(value = "入职日期")
private String field29;
@ExcelProperty(value = "试用期")
private String field30;
@ExcelProperty(value = "标签")
private String field31;
@ExcelProperty(value = "姓名")
private String field32;
@ExcelProperty(value = "与本人关系")
private String field33;
@ExcelProperty(value = "联系地址")
private String field34;
@ExcelProperty(value = "联系电话")
private String field35;
@ExcelProperty(value = "学校")
private String field36;
@ExcelProperty(value = "专业")
private String field37;
@ExcelProperty(value = "学历")
private String field38;
@ExcelProperty(value = "是否大专及以上")
private String field39;
@ExcelProperty(value = "最高学历")
private String field40;
@ExcelProperty(value = "入学时间")
private String field41;
@ExcelProperty(value = "毕业时间")
private String field42;
@ExcelProperty(value = "是否为首份工作")
private String field43;
@ExcelProperty(value = "工作单位")
private String field44;
@ExcelProperty(value = "工作岗位")
private String field45;
@ExcelProperty(value = "开始工作日期")
private String field46;
@ExcelProperty(value = "结束工作日期")
private String field47;
@ExcelProperty(value = "成员姓名")
private String field48;
@ExcelProperty(value = "与本人关系")
private String field49;
@ExcelProperty(value = "手机号码")
private String field50;
@ExcelProperty(value = "是否有职业资格证书")
private String field51;
@ExcelProperty(value = "申报年度")
private String field52;
@ExcelProperty(value = "职业资格名称")
private String field53;
@ExcelProperty(value = "是否曾被认定为工伤")
private String field54;
@ExcelProperty(value = "是否有职业病")
private String field55;
@ExcelProperty(value = "职业病名称")
private String field56;
@ExcelProperty(value = "是否有传染性疾病")
private String field57;
@ExcelProperty(value = "传染病名称")
private String field58;
@ExcelProperty(value = "是否持有残疾人证明")
private String field59;
@ExcelProperty(value = "伤残病名称")
private String field60;
@ExcelProperty(value = "伤残等级")
private String field61;
@ExcelProperty(value = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String field62;
@ExcelProperty(value = "不良记录描述")
private String field63;
}
......@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.impl.FileUploadServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.utils.QrCodeUtil;
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;
......@@ -68,8 +66,8 @@ public class FileUploadController {
}
/**
* @Author fxj
* @Description
* @Author hgw
* @Description 改编自ossUploadFile接口,改变了回传信息——专为预入职微信端使用——忽略了token,其余人慎用
* @Date 13:49 2022/6/17
* @Param
* @return
......@@ -85,7 +83,6 @@ public class FileUploadController {
return fileUploadService.uploadFileReturnAtta(file,filePath,type,domain);
}
/**
* @Author fxj
* @Description
......
......@@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCompleteMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpMainDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
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.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 io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -31,7 +35,24 @@ import javax.servlet.http.HttpServletResponse;
public class TCompleteMonitorController {
private final TCompleteMonitorService tCompleteMonitorService;
private final MenuUtil menuUtil;
/**
* 档案完整度监控管理-全量 批量导出
*
* @author hgw
* @date 2024-6-24 16:01:47
**/
@Operation(description = "导出档案完整度监控管理-全量 权限:archves_tcompletemonitor_export_all")
@PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_export_all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
return tCompleteMonitorService.exportAll(response, searchVo);
}
/**
* 简单分页查询
* @param page 分页对象
......@@ -41,6 +62,8 @@ public class TCompleteMonitorController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TCompleteMonitor>> getTCompleteMonitorPage(Page<TCompleteMonitor> page, TCompleteMonitor tCompleteMonitor) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tCompleteMonitor);
return new R<>(tCompleteMonitorService.getTCompleteMonitorPage(page,tCompleteMonitor));
}
......@@ -93,6 +116,18 @@ public class TCompleteMonitorController {
return R.ok(tCompleteMonitorService.removeById(id));
}
/**
* 通过id查询-主表
*
* @param infoId infoId
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/infoId/{id}")
public R<EmpMainDetailVo> getInfoById(@PathVariable("id") String infoId) {
return tCompleteMonitorService.getInfoById(infoId);
}
/**
* 档案完整度监控 批量导出
* @author huyc
......
......@@ -64,6 +64,17 @@ public class TEmpProfessionalQualificationController {
public R<IPage<TEmpProfessionalQualification>> getTEmpProfessionalQualificationPage(Page page, CertifySearchVo searchVo) {
return R.ok(qualificationService.pageDiy(page, searchVo));
}
/**
* 删除
* @return
*/
@Operation(description = "删除")
@GetMapping("/deleteProfessionalByEmpId" )
public void deleteProfessionalByEmpId(@RequestParam String empId) {
qualificationService.deleteProfessionalByEmpId(empId);
}
/**
* 不分页查询
* @param searchVo 员工职业资格信息表
......
......@@ -20,8 +20,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpMainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.PreEmpMainDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPreEmpMainSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
......@@ -66,7 +66,7 @@ public class TPreEmpMainController {
* @param tPreEmpMain 预入职-主表
* @return
*/
@Operation(description = "简单分页查询")
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TPreEmpMain>> getTPreEmpMainPage(Page<TPreEmpMain> page, TPreEmpMainSearchVo tPreEmpMain) {
YifuUser user = SecurityUtils.getUser();
......@@ -130,7 +130,7 @@ public class TPreEmpMainController {
* @date 2024-6-21 15:25:20
**/
@SneakyThrows
@Operation(description = "预入职批量完善信息hasPermission('archives_tpreempmain-batch-import')")
@Operation(summary = "预入职批量完善信息", description = "预入职批量完善信息hasPermission('archives_tpreempmain-batch-import')")
@SysLog("预入职批量完善信息")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-batch-import')")
......@@ -138,15 +138,41 @@ public class TPreEmpMainController {
return tPreEmpMainService.importDiy(file.getInputStream());
}
/**
* 预入职单个审核
* hgw
* 2024-6-24 11:52:14
*/
@Operation(summary = "预入职单个审核", description = "预入职单个审核status:3审核不通过;4审核通过")
@SysLog("预入职单个审核")
@PostMapping("/doAudit")
public R<String> doAudit(@RequestParam String id, @RequestParam String status, @RequestParam(required = false) String auditRemark) {
return tPreEmpMainService.doAudit(id, status, auditRemark);
}
/**
* 预入职批量审核
* @author hgw
* @date 2024-6-24 12:00:53
**/
@SneakyThrows
@Operation(summary = "预入职批量审核", description = "预入职批量审核hasPermission('archives_tpreempmain-batch-audit');status:3审核不通过;4审核通过")
@SysLog("预入职批量审核")
@PostMapping("/doBatchAudit")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-batch-audit')")
public R<List<ErrorVO>> doBatchAudit(@RequestBody List<String> idList, @RequestParam String status, @RequestParam(required = false) String auditRemark) {
return tPreEmpMainService.doBatchAudit(idList, status, auditRemark);
}
/**
* 草稿预入职
* hgw
* 2024-6-17 17:39:15
*/
@Operation(summary = "草稿预入职", description = "草稿预入职:hasPermission('archives_tpreempmain_draft')")
@Operation(summary = "草稿预入职", description = "草稿预入职:hasPermission('archives_tpreempmain_add')")
@SysLog("草稿预入职")
@PostMapping("/saveDraftPreEmpMain")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain_draft')")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain_add')")
public R<String> saveDraftPreEmpMain(@RequestBody PreEmpMainDetailVo vo) {
return tPreEmpMainService.saveDraftPreEmpMain(vo);
}
......@@ -159,7 +185,7 @@ public class TPreEmpMainController {
@Operation(summary = "保存预入职", description = "保存预入职:hasPermission('archives_tpreempmain_add')")
@SysLog("保存预入职")
@PostMapping("/savePreEmpMain")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain_add')")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain_add')")
public R<String> savePreEmpMain(@RequestBody PreEmpMainDetailVo vo) {
return tPreEmpMainService.savePreEmpMain(vo);
}
......@@ -196,12 +222,30 @@ public class TPreEmpMainController {
* 预入职-主表 批量导出
*
* @author hgw
* @date 2024-06-17 11:31:08
* @date 2024-6-24 16:01:50
**/
@Operation(description = "导出预入职-主表 hasPermission('archives_tpreempmain-export')")
@Operation(summary = "导出预入职-主表", description = "导出预入职-主表 hasPermission('archives_tpreempmain-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export')")
public void export(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tPreEmpMainService.listExport(response, searchVo);
}
/**
* 预入职-全量 批量导出
*
* @author hgw
* @date 2024-6-24 16:01:47
**/
@Operation(summary = "导出预入职-全量", description = "导出预入职-全量 hasPermission('archives_tpreempmain-export-all')")
@PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
return tPreEmpMainService.exportAll(response, searchVo);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMainLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpMainLogService;
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.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 预入职审批记录表
*
* @author hgw
* @date 2024-06-24 14:27:15
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tpreempmainlog")
@Tag(name = "预入职审批记录表管理")
public class TPreEmpMainLogController {
private final TPreEmpMainLogService tPreEmpMainLogService;
/**
* 不分页查询
*
* @return
*/
@Operation(summary = "获取list", description = "获取list")
@PostMapping("/getTPreEmpMainLogList")
public R<List<TPreEmpMainLog>> getTPreEmpMainLogList(@RequestParam String mainId) {
return R.ok(tPreEmpMainLogService.getTPreEmpMainLogList(mainId));
}
}
......@@ -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.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -92,4 +89,19 @@ public interface TCompleteMonitorMapper extends BaseMapper<TCompleteMonitor> {
*/
void deleteMonitorInfoByDeptNo(@Param("deptNo") String deptNo);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCount(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
// 导出详情使用 hgw 2024-6-26 11:05:41
List<TMainExportAllVO> getTEmpMainAllList(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCountOneWork(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListOneWork(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
int getTEmpMainAllCountTwoFamily(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListTwoFamily(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
int getTEmpMainAllCountThreeProfessional(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListThreeProfessional(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
}
......@@ -30,5 +30,5 @@ import org.apache.ibatis.annotations.Param;
*/
@Mapper
public interface TEmpFamilyMapper extends BaseMapper<TEmpFamily> {
void deleteByEmpId(@Param("empId") String empId, @Param("tableName") String tableName);
void deleteByEmpId(@Param("empId") String empId);
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 员工职业资格信息表
......@@ -30,4 +31,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TEmpProfessionalQualificationMapper extends BaseMapper<TEmpProfessionalQualification> {
void deleteProfessionalByEmpId(@Param("empId") String empId);
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 员工工作履历信息表
......@@ -30,4 +31,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TEmpWorkRecordingMapper extends BaseMapper<TEmpWorkRecording> {
void deleteWorkRecordByEmpId(@Param("empId") String empId);
}
......@@ -35,8 +35,10 @@ public interface TPreEmpFamilyMapper extends BaseMapper<TPreEmpFamily> {
/**
* 预入职-员工家庭信息表简单分页查询
*
* @param tPreEmpFamily 预入职-员工家庭信息表
* @return
*/
List<TPreEmpFamily> getTPreEmpFamilyList(@Param("preMainId") String preMainId);
void deleteFamilyByMainId(@Param("preMainId") String preMainId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMainLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 预入职审批记录表
*
* @author hgw
* @date 2024-06-24 14:27:15
*/
@Mapper
public interface TPreEmpMainLogMapper extends BaseMapper<TPreEmpMainLog> {
/**
* 预入职审批记录表简单分页查询
*
* @return
*/
List<TPreEmpMainLog> getTPreEmpMainLogList(@Param("mainIid") String mainIid);
}
......@@ -20,10 +20,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.mapper;
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.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 预入职-主表
*
......@@ -40,6 +45,24 @@ public interface TPreEmpMainMapper extends BaseMapper<TPreEmpMain> {
*/
IPage<TPreEmpMain> getTPreEmpMainPage(Page<TPreEmpMain> page, @Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
int getTPreEmpMainCount(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreEmpMain> getTPreEmpMainList(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
int getTPreEmpMainAllCount(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllList(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCountOneWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTEmpMainAllListOneWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
int getTEmpMainAllCountTwoFamily(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTEmpMainAllListTwoFamily(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
int getTEmpMainAllCountThreeProfessional(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTEmpMainAllListThreeProfessional(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
TPreEmpMain getTPreEmpMainByCardAndDept(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
TPreEmpMain getTPreEmpMainByCardAndDeptNo(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
......
......@@ -35,8 +35,10 @@ public interface TPreEmpProfessionalQualificationMapper extends BaseMapper<TPreE
/**
* 预入职-员工职业资格信息表简单分页查询
*
* @param tPreEmpProfessionalQualification 预入职-员工职业资格信息表
* @return
*/
List<TPreEmpProfessionalQualification> getTPreEmpProfessionalQualificationList(@Param("preMainId") String preMainId);
// 删除
void deleteProfessionalByMainId(@Param("preMainId") String preMainId);
}
......@@ -35,8 +35,9 @@ public interface TPreEmpWorkRecordingMapper extends BaseMapper<TPreEmpWorkRecord
/**
* 预入职-员工工作履历信息表简单分页查询
*
* @param tPreEmpWorkRecording 预入职-员工工作履历信息表
* @return
*/
List<TPreEmpWorkRecording> getTPreEmpWorkRecordingList(@Param("preMainId") String preMainId);
void deleteByMainId(@Param("preMainId") String preMainId);
}
......@@ -5,8 +5,10 @@ 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.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpMainDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
......@@ -24,6 +26,14 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
*/
IPage<TCompleteMonitor> getTCompleteMonitorPage(Page<TCompleteMonitor> page, TCompleteMonitor tCompleteMonitor);
/**
* @Description: 详情
* @Author: huyc
* @Date: 2024/6/28 11:41
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain>
**/
R<EmpMainDetailVo> getInfoById(String id);
/**
* 档案完整度监控导出
* @param searchVo 档案完整度监控
......@@ -50,4 +60,7 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
*/
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo);
// 导出全量
R<String> exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
}
......@@ -51,13 +51,12 @@ public interface TEmpFamilyService extends IService<TEmpFamily> {
/**
* @param empId
* @param tableName
* @Description: 删除档案附属表信息(预入职清空附属信息专用,其余的请慎用)
* @Author: hgw
* @Date: 2024/6/19 18:27
* @return: void
**/
void deleteByEmpIdAndTable(String empId, String tableName);
void deleteByEmpId(String empId);
List<TEmpFamily> getListByEmpId(String empId);
......
......@@ -58,4 +58,13 @@ public interface TEmpProfessionalQualificationService extends IService<TEmpProfe
**/
List<TEmpProfessionalQualification> getListByEmpId(String empId);
/**
* @param empId
* @Description: 删除档案附属表信息(预入职清空附属信息专用,其余的请慎用)
* @Author: hgw
* @Date: 2024/6/19 18:27
* @return: void
**/
void deleteProfessionalByEmpId(String empId);
}
......@@ -58,4 +58,13 @@ public interface TEmpWorkRecordingService extends IService<TEmpWorkRecording> {
**/
List<TEmpWorkRecording> getListByEmpId(String empId);
/**
* @param empId
* @Description: 删除档案附属表信息(预入职清空附属信息专用,其余的请慎用)
* @Author: hgw
* @Date: 2024/6/19 18:27
* @return: void
**/
void deleteWorkRecordByEmpId(String empId);
}
......@@ -35,4 +35,14 @@ public interface TPreEmpFamilyService extends IService<TPreEmpFamily> {
* @return
*/
List<TPreEmpFamily> getTPreEmpFamilyList(String preMainId);
/**
* @param preMainId
* @Description: 先删后加
* @Author: hgw
* @Date: 2024/6/27 16:26
* @return: void
**/
void deleteFamilyByMainId(String preMainId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TPreEmpMainLog;
import java.util.List;
/**
* 预入职审批记录表
*
* @author hgw
* @date 2024-06-24 14:27:15
*/
public interface TPreEmpMainLogService extends IService<TPreEmpMainLog> {
/**
* 预入职审批记录表简单分页查询
*
* @return
*/
List<TPreEmpMainLog> getTPreEmpMainLogList(String mainId);
}
......@@ -21,7 +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.TPreEmpMain;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.PreEmpMainDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPreEmpMainSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
......@@ -72,7 +72,17 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
// 批量完善信息
R<List<ErrorMessage>> importDiy(InputStream inputStream);
// 导出
void listExport(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
// 导出全量
R<String> exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
List<TPreEmpMain> noPageDiy(TPreEmpMainSearchVo searchVo);
// 审核
R<String> doAudit(String id, String status, String auditRemark);
// 批量审核
R<List<ErrorVO>> doBatchAudit(List<String> ids, String status, String auditRemark);
}
......@@ -36,4 +36,13 @@ public interface TPreEmpProfessionalQualificationService extends IService<TPreEm
*/
List<TPreEmpProfessionalQualification> getTPreEmpProfessionalQualificationList(String preMainId);
/**
* @param preMainId
* @Description: 先删后加
* @Author: hgw
* @Date: 2024/6/27 16:26
* @return: void
**/
void deleteProfessionalByMainId(String preMainId);
}
......@@ -35,4 +35,14 @@ public interface TPreEmpWorkRecordingService extends IService<TPreEmpWorkRecordi
* @return
*/
List<TPreEmpWorkRecording> getTPreEmpWorkRecordingList(String preMainId);
/**
* @param preMainId
* @Description: 先删后加
* @Author: hgw
* @Date: 2024/6/27 16:26
* @return: void
**/
void deleteByMainId(String preMainId);
}
......@@ -6,13 +6,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.QrCodeUtil;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -20,6 +24,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@Service
@RequiredArgsConstructor
......@@ -53,7 +60,7 @@ public class FileUploadServiceImpl implements FileUploadService {
key = System.currentTimeMillis() + fileName;
}
if (!Common.checkFile(key)) {
return R.failed("非法上传类型!");
return R.failed("非法上传类型:"+fileName);
}
boolean flag = ossUtil.uploadFileByStream(file.getInputStream(), key, null);
TAttaInfo attaInfo;
......@@ -64,6 +71,19 @@ public class FileUploadServiceImpl implements FileUploadService {
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domain);
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
attaInfo.setCreateBy(user.getId());
attaInfo.setCreateName(user.getNickname());
attaInfo = tAttaInfoService.add(attaInfo);
} catch (Exception e) {
log.error("OSS文件上传异常:" + e.getMessage());
......
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCompleteMonitorMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCompleteMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
/**
* 档案完整度监控
......@@ -43,6 +41,30 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
private final TEmployeeProjectMapper projectMapper;
// 档案相关服务:
// 员工不良记录表
private final TEmpBadRecordService tEmpBadRecordService;
// 员工工作履历信息表
private final TEmpWorkRecordingService tEmpWorkRecordingService;
// 紧急联络人
private final TEmpContactInfoService tEmpContactInfoService;
// 员工伤残信息表
private final TEmpDisabilityInfoService tEmpDisabilityInfoService;
// 员工学历信息表
private final TEmpEducationService tEmpEducationService;
// 员工家庭信息表
private final TEmpFamilyService tEmpFamilyService;
// 人员档案表
private final TEmployeeInfoService tEmployeeInfoService;
// 项目档案表
private final TEmployeeProjectService tEmployeeProjectService;
// 员工职业资格信息表
private final TEmpProfessionalQualificationService tEmpProfessionalQualificationService;
// 附件21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
private final TAttaInfoService tAttaInfoService;
private final OSSUtil ossUtil;
/**
* 档案完整度监控简单分页查询
* @param tCompleteMonitor 档案完整度监控
......@@ -60,7 +82,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
*/
@Override
public void listExport(HttpServletResponse response, TCompleteMonitorSearchVo searchVo){
String fileName = "档案完整度监控批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "档案完整度监控列表" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TCompleteMonitorVo> list = new ArrayList<>();
long count = baseMapper.getExportCount(searchVo);
......@@ -87,7 +109,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控"+index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控列表"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
......@@ -97,7 +119,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控"+index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控列表"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
......@@ -135,8 +157,9 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
}
//批量更新
if (!projectIdList.isEmpty())
if (!projectIdList.isEmpty()) {
projectMapper.batchUpdateEmpProjectCompleteStatus(projectIdList);
}
}
//查询项目维度的信息
......@@ -171,8 +194,9 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
}
//批量更新
if (!projectIdList.isEmpty())
if (!projectIdList.isEmpty()) {
projectMapper.batchUpdateEmpProjectCompleteStatus(projectIdList);
}
}
//删除项目监控表数据
......@@ -202,4 +226,515 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
return false;
}
/**
* 预入职导出全量
*
* @return
*/
@Override
public R<String> exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) {
String name = "档案完整度监控详情";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTEmpMainAllCount(searchVo);
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
return R.failed("数据超过6万条,请联系管理员后端导出!");
}
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"信息是否完整","信息是否完整"}));
headList.add(this.getNewArrayList(new String[]{"进项目时间","进项目时间"}));
String oneTitle = "员工基本信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工主码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证号"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "性别"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证期限"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证开始日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证截止日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "出生日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "年龄"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "婚姻状况"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "民族"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "政治面貌"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "邮箱"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户口性质"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址"}));
oneTitle = "在项信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "客户名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "项目名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "业务类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "合同类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工时制"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "就职岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入职日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "试用期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "标签"}));
oneTitle = "紧急联络人";
headList.add(this.getNewArrayList(new String[]{oneTitle, "姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系地址"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系电话"}));
oneTitle = "最高教育经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "学校"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "专业"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否大专及以上"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "最高学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入学时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "毕业时间"}));
oneTitle = "主要工作经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否为首份工作"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作单位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "开始工作日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "结束工作日期"}));
oneTitle = "主要家庭成员信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "成员姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
oneTitle = "职业资格信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业资格证书"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "申报年度"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业资格名称"}));
oneTitle = "伤残信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否曾被认定为工伤"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
ExcelWriter excelWriter = EasyExcelFactory.write(out).head(headList).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllList(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 1工作经历
count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 2家庭成员
count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 3职业资格
count = baseMapper.getTEmpMainAllCountThreeProfessional(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
return null;
}
/**
* 档案完整度监控详情
* hgw 2024-6-26 11:19:18
*/
/*@Override
public void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) {
String name = "档案完整度监控详情";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TMainExportAllVO> listAll = Lists.newArrayList();
List<TMainExportAllVO> list = Lists.newArrayList();
List<TMainExportAllVO> list1 = Lists.newArrayList();
List<TMainExportAllVO> list2 = Lists.newArrayList();
List<TMainExportAllVO> list3 = Lists.newArrayList();
long count = baseMapper.getTEmpMainAllCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"信息是否完整","信息是否完整"}));
headList.add(this.getNewArrayList(new String[]{"进项目时间","进项目时间"}));
String oneTitle = "员工基本信息";
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工主码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证号"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"性别"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证期限"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证开始日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证截止日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"出生日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"年龄"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"婚姻状况"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"民族"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"政治面貌"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"手机号码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"邮箱"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"户籍所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"户口性质"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"档案所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"档案状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"通信地址"}));
oneTitle = "在项信息";
headList.add(this.getNewArrayList(new String[]{oneTitle,"客户名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"项目名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"业务类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"合同类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"工时制"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"就职岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"入职日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"试用期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"标签"}));
oneTitle = "紧急联络人";
headList.add(this.getNewArrayList(new String[]{oneTitle,"姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"联系地址"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"联系电话"}));
oneTitle = "最高教育经历";
headList.add(this.getNewArrayList(new String[]{oneTitle,"学校"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"专业"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否大专及以上"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"最高学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"入学时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"毕业时间"}));
oneTitle = "主要工作经历";
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否为首份工作"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"工作单位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"工作岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"开始工作日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"结束工作日期"}));
oneTitle = "主要家庭成员信息";
headList.add(this.getNewArrayList(new String[]{oneTitle,"成员姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"手机号码"}));
oneTitle = "职业资格信息";
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否有职业资格证书"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"申报年度"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"职业资格名称"}));
oneTitle = "伤残信息";
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否曾被认定为工伤"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否有职业病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"职业病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否有传染性疾病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"传染病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否持有残疾人证明"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"伤残病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"伤残等级"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle,"不良记录描述"}));
ExcelWriter excelWriter = EasyExcelFactory.write(out).head(headList).build();
int index = 0;
if (count > 100) {
count = 100;
}
if (count > CommonConstants.ZERO_INT) {
int maxCycle = 50;
for (int i = 0; i <= count; i += maxCycle) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(maxCycle);
list = baseMapper.getTEmpMainAllList(searchVo);
if (list !=null && !list.isEmpty()) {
listAll = Lists.newArrayList();
list1 = baseMapper.getTEmpMainAllListOneWork(searchVo);
Map<String, List<TMainExportAllVO>> map1 = new HashMap<>();
Map<String, List<TMainExportAllVO>> map2 = new HashMap<>();
Map<String, List<TMainExportAllVO>> map3 = new HashMap<>();
List<TMainExportAllVO> tempList;
List<TMainExportAllVO> tempList1;
List<TMainExportAllVO> tempList2;
List<TMainExportAllVO> tempList3;
for (TMainExportAllVO vo : list1) {
tempList = map1.get(vo.getField6());
if (tempList == null || tempList.isEmpty()) {
tempList = Lists.newArrayList();
}
tempList.add(vo);
map1.put(vo.getField6(), tempList);
}
list2 = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
for (TMainExportAllVO vo : list2) {
tempList = map2.get(vo.getField6());
if (tempList == null || tempList.isEmpty()) {
tempList = Lists.newArrayList();
}
tempList.add(vo);
map2.put(vo.getField6(), tempList);
}
list3 = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
for (TMainExportAllVO vo : list3) {
tempList = map3.get(vo.getField6());
if (tempList == null || tempList.isEmpty()) {
tempList = Lists.newArrayList();
}
tempList.add(vo);
map3.put(vo.getField6(), tempList);
}
TMainExportAllVO tempVo;
TMainExportAllVO saveVo;
for (TMainExportAllVO vo : list) {
tempList1 = map1.get(vo.getField6());
tempList2 = map2.get(vo.getField6());
tempList3 = map3.get(vo.getField6());
if ((tempList1 != null && tempList1.size()>1)
|| (tempList2 != null && tempList2.size()>1)
|| (tempList3 != null && tempList3.size()>1)) {
int maxSize=1;
if (tempList1 != null) {
maxSize = tempList1.size();
}
if (tempList2 != null && tempList2.size() > maxSize) {
maxSize=tempList2.size();
}
if (tempList3 != null && tempList3.size() > maxSize) {
maxSize=tempList3.size();
}
for (int k=0;k<maxSize;k++) {
if (k == 0) {
saveVo = vo;
} else {
saveVo = null;
}
if (tempList1 != null && tempList1.size()>k) {
if (saveVo == null) {
saveVo = tempList1.get(k);
} else {
tempVo = tempList1.get(k);
saveVo.setField43(tempVo.getField43());
saveVo.setField44(tempVo.getField44());
saveVo.setField45(tempVo.getField45());
saveVo.setField46(tempVo.getField46());
saveVo.setField47(tempVo.getField47());
}
}
if (tempList2 != null && tempList2.size()>k) {
if (saveVo == null) {
saveVo = tempList2.get(k);
} else {
tempVo = tempList2.get(k);
saveVo.setField48(tempVo.getField48());
saveVo.setField49(tempVo.getField49());
saveVo.setField50(tempVo.getField50());
}
}
if (tempList3 != null && tempList3.size()>k) {
if (saveVo == null) {
saveVo = tempList3.get(k);
} else {
tempVo = tempList3.get(k);
saveVo.setField51(tempVo.getField51());
saveVo.setField52(tempVo.getField52());
saveVo.setField53(tempVo.getField53());
}
}
listAll.add(saveVo);
}
}
}
}
if (Common.isNotNull(listAll)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(listAll, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}*/
/**
* @Description: 详情
* @Author: huyc
* @Date: 2024/6/28 11:19
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.vo.EmpMainDetailVo>
**/
@Override
public R<EmpMainDetailVo> getInfoById(String id) {
EmpMainDetailVo vo = new EmpMainDetailVo();
if (id != null) {
// 员工不良记录表
TEmpBadRecord tEmpBadRecord = tEmpBadRecordService.getByEmpId(id);
vo.setTEmpBadRecord(tEmpBadRecord);
// 紧急联络人
TEmpContactInfo tEmpContactInfo = tEmpContactInfoService.getByEmpId(id);
vo.setTEmpContactInfo(tEmpContactInfo);
// 员工伤残信息表
TEmpDisabilityInfo tEmpDisabilityInfo = tEmpDisabilityInfoService.getByEmpId(id);
vo.setTEmpDisabilityInfo(tEmpDisabilityInfo);
// 员工学历信息表
TEmpEducation tEmpEducation = tEmpEducationService.getByEmpId(id);
if (tEmpEducation != null) {
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(tEmpEducation.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tEmpEducation.setAttaList(attaInfoList);
}
vo.setTEmpEducation(tEmpEducation);
// 员工家庭信息表
List<TEmpFamily> tEmpFamily = tEmpFamilyService.getListByEmpId(id);
vo.setTEmpFamilyList(tEmpFamily);
// 人员档案表
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(id);
vo.setTEmployeeInfo(tEmployeeInfo);
// 项目档案表
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getListByEmpId(id,1).get(0);
vo.setTEmployeeProject(tEmployeeProject);
// 员工职业资格信息表
List<TEmpProfessionalQualification> tEmpProfessionalQualificationList = tEmpProfessionalQualificationService.getListByEmpId(id);
if (tEmpProfessionalQualificationList != null) {
List<TAttaInfo> attaInfoList;
for (TEmpProfessionalQualification info : tEmpProfessionalQualificationList) {
attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
info.setAttaList(attaInfoList);
}
}
}
vo.setTEmpProfessionalQualificationList(tEmpProfessionalQualificationList);
// 员工工作履历信息表
List<TEmpWorkRecording> tEmpWorkRecording = tEmpWorkRecordingService.getListByEmpId(id);
vo.setTEmpWorkRecordingList(tEmpWorkRecording);
// 附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
vo.setAttaInfoList(attaInfoList);
return R.ok(vo);
} else {
return R.failed("根据ID,未找到人员档案主表!");
}
}
/**
* @Description: 转化
* @Author: hgw
* @Date: 2024/6/26 11:19
**/
private List<String> getNewArrayList(String[] strArr) {
return Arrays.asList(strArr);
}
}
......@@ -236,8 +236,8 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
}
@Override
public void deleteByEmpIdAndTable(String empId, String tableName) {
baseMapper.deleteByEmpId(empId, tableName);
public void deleteByEmpId(String empId) {
baseMapper.deleteByEmpId(empId);
}
private LambdaQueryWrapper buildQueryWrapper(FamilySearchVO entity){
......
......@@ -65,6 +65,11 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
private final TEmployeeInfoMapper employeeInfoMapper;
@Override
public void deleteProfessionalByEmpId(String empId) {
baseMapper.deleteProfessionalByEmpId(empId);
}
@Override
public R<Boolean> saveDiy(TEmpProfessionalQualification qualification) {
......
......@@ -296,4 +296,9 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
return baseMapper.selectList(Wrappers.<TEmpWorkRecording>query().lambda().eq(TEmpWorkRecording::getEmpId, empId).eq(TEmpWorkRecording::getDeleteFlag, CommonConstants.ZERO_STRING));
}
@Override
public void deleteWorkRecordByEmpId(String empId) {
baseMapper.deleteWorkRecordByEmpId(empId);
}
}
......@@ -36,6 +36,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeContractConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
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.TPreEmpMainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -67,10 +69,7 @@ import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 员工合同
......@@ -96,6 +95,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TEmployeeContractAuditService tEmployeeContractAuditService;
private final TEmployeeLogService tEmployeeLogService;
private final TWorkHandlerInfoService workHandlerInfoService;
private final TPreEmpMainMapper preEmpMainMapper;
private final TPreEmployeeProjectMapper preEmployeeProjectMapper;
@Autowired
private DaprSocialProperties socialProperties;
// 缓存信息
......@@ -1616,6 +1617,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
//签订类型正常签订的时候更新预入职列表
if (EmployeeConstants.SITUATION_ONE.equals(contract.getSituation())) {
//根据项目编码和身份证号查询预入职列表
TPreEmpMain empMain = preEmpMainMapper.selectOne(Wrappers.<TPreEmpMain>query()
.lambda().eq(TPreEmpMain::getEmpIdcard, contract.getEmpIdcard())
.eq(TPreEmpMain::getDeptNo, contract.getDeptNo()));
if (Optional.ofNullable(empMain).isPresent()) {
//查询预入职项目档案表
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(contract.getContractType());
preEmployeeProject.setWorkingHours(contract.getWorkingHours());
preEmployeeProject.setPost(contract.getPost());
preEmployeeProject.setEnjoinDate(DateUtil.stringToDate(contract.getCreateTimeStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
preEmployeeProject.setTryPeriod(contract.getTryPeriod());
preEmployeeProjectMapper.updateById(preEmployeeProject);
}
}
}
} else {
//是否同步终止合同、减项、减档为是的时候 单独写逻辑
if (EmployeeConstants.SITUATION_SEVEN.equals(contract.getSituation())
......
......@@ -2412,6 +2412,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if(empAdd.getHignEducation().equals("硕士")) {
employeeInfo.setHignEducation("7");
}
if(empAdd.getHignEducation().equals("博士")) {
employeeInfo.setHignEducation("8");
}
if(empAdd.getHignEducation().equals("技工")) {
employeeInfo.setHignEducation("9");
}
......@@ -2421,7 +2424,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if(empAdd.getHignEducation().equals("中专")) {
employeeInfo.setHignEducation("11");
}
employeeInfo.setIsCollege(CommonConstants.ONE_INT);
if ("5".equals(employeeInfo.getHignEducation())
|| "6".equals(employeeInfo.getHignEducation())
|| "7".equals(employeeInfo.getHignEducation())
|| "8".equals(employeeInfo.getHignEducation())) {
employeeInfo.setIsCollege(CommonConstants.ONE_INT);
} else {
employeeInfo.setIsCollege(CommonConstants.ZERO_INT);
}
employeeInfo.setStatus(CommonConstants.ZERO_INT);
date = IdCardUtil.getBirthdate(employeeInfo.getEmpIdcard());
if (Common.isNotNull(date)) {
......
......@@ -1436,6 +1436,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
employee.setIsCollege(CommonConstants.ONE_INT);
if (Common.isNotNull(vo.getHighEducation())) {
employee.setHignEducation(vo.getHighEducation());
if ("5".equals(employee.getHignEducation())
|| "6".equals(employee.getHignEducation())
|| "7".equals(employee.getHignEducation())
|| "8".equals(employee.getHignEducation())) {
employee.setIsCollege(CommonConstants.ONE_INT);
} else {
employee.setIsCollege(CommonConstants.ZERO_INT);
}
}
if (Common.isNotNull(vo.getSchoolName())){
employee.setSchool(vo.getSchoolName());
......
......@@ -22,32 +22,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpFamilyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpFamilyService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 预入职-员工家庭信息表
......@@ -67,4 +42,9 @@ public class TPreEmpFamilyServiceImpl extends ServiceImpl<TPreEmpFamilyMapper, T
return baseMapper.getTPreEmpFamilyList(preMainId);
}
@Override
public void deleteFamilyByMainId(String preMainId) {
baseMapper.deleteFamilyByMainId(preMainId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMainLog;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpMainLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 预入职审批记录表
*
* @author hgw
* @date 2024-06-24 14:27:15
*/
@Log4j2
@Service
public class TPreEmpMainLogServiceImpl extends ServiceImpl<TPreEmpMainLogMapper, TPreEmpMainLog> implements TPreEmpMainLogService {
@Override
public List<TPreEmpMainLog> getTPreEmpMainLogList(String mainId) {
return baseMapper.getTPreEmpMainLogList(mainId);
}
}
......@@ -18,12 +18,14 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -33,16 +35,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.PreEmpMainDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPreEmpMainSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPreEmpMainVo;
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.SecurityConstants;
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.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -52,10 +56,7 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.*;
/**
* 预入职-主表
......@@ -86,7 +87,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 预入职-项目档案表
private final TPreEmployeeProjectService tPreEmployeeProjectService;
// 预入职-员工职业资格信息表
private final TPreEmpProfessionalQualificationService tPreEmpProfessionalQualificationService;
private final TPreEmpProfessionalQualificationService tPreEmpProfessionalService;
// 附件21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
private final TAttaInfoService tAttaInfoService;
......@@ -108,12 +109,16 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 预入职-项目档案表
private final TEmployeeProjectService tEmployeeProjectService;
// 预入职-员工职业资格信息表
private final TEmpProfessionalQualificationService tEmpProfessionalQualificationService;
private final TEmpProfessionalQualificationService tEmpProfessionalService;
// 项目
private final TSettleDomainService tSettleDomainService;
// 审核日志
private final TPreEmpMainLogService tPreEmpMainLogService;
private final OSSUtil ossUtil;
private final static String ID = "id";
/**
* 预入职-主表简单分页查询
*
......@@ -138,18 +143,70 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return R.failed("未找到项目信息!");
}
TPreEmpMain main = baseMapper.getTPreEmpMainByCardAndDept(empIdCard, deptId);
// 是否为新建
boolean isNew = false;
TEmployeeInfo employee = null;
String empId = null;
TEmployeeProject project = null;
TEmployeeProject project;
PreEmpMainDetailVo vo = new PreEmpMainDetailVo();
YifuUser user = getNewYifuUser();
if (main != null && CommonConstants.FIVE_STRING.equals(main.getStatus())) {
// 清空信息
if (Common.isNotNull(main.getId())) {
tPreEmpWorkRecordingService.deleteByMainId(main.getId());
tPreEmpProfessionalService.deleteProfessionalByMainId(main.getId());
tAttaInfoService.deleteByDomainId(main.getId());
}
baseMapper.deleteById(main);
main = null;
}
if (main != null) {
// 2024-7-3 17:23:50 倩倩要求放开状态拦截,前端加按钮禁用即可
/*if (CommonConstants.ONE_STRING.equals(main.getStatus())
|| CommonConstants.TWO_STRING.equals(main.getStatus())) {
return R.failed("信息审核中,请耐心等待!");
}
if (CommonConstants.FOUR_STRING.equals(main.getStatus())) {
return R.failed("信息已填写,请勿重复操作!");
}*/
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(main.getId());
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getId())) {
empId = tPreEmployeeInfo.getId();
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
} else {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setEmpName(main.getEmpName());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
}
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(main.getId());
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
vo.setTpreEmployeeProject(tPreEmployeeProject);
} else {
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setEmpName(main.getEmpName());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
tPreEmployeeProject.setBusinessPrimaryType(dept.getBusinessPrimaryType());
tPreEmployeeProject.setBusinessSecondType(dept.getBusinessSecondType());
tPreEmployeeProject.setBusinessThirdType(dept.getBusinessThirdType());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.save(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
} else {
isNew = true;
main = new TPreEmpMain();
main.setEmpIdcard(empIdCard);
main.setDeptId(dept.getId());
......@@ -169,24 +226,62 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
tPreEmpDeclaration = tPreEmpDeclarationService.getTPreEmpDeclarationList();
}
vo.setTPreEmpDeclaration(tPreEmpDeclaration);
vo.setTpreEmpDeclaration(tPreEmpDeclaration);
main.setDeclarationId(tPreEmpDeclaration.getId());
this.save(main);
// 查询档案信息
employee = tEmployeeInfoService.getInfoByIdcard(empIdCard);
TPreEmployeeInfo tPreEmployeeInfo;
TPreEmployeeProject tPreEmployeeProject;
if (employee != null) {
empId = employee.getId();
TPreEmployeeInfo tPreEmployeeInfo = new TPreEmployeeInfo();
BeanUtil.copyProperties(employee, tPreEmployeeInfo);
tPreEmployeeInfo = new TPreEmployeeInfo();
BeanUtil.copyProperties(employee, tPreEmployeeInfo, ID);
tPreEmployeeInfo.setOldId(employee.getId());
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
project = tEmployeeProjectService.getByEmpIdAndDeptId(empIdCard, deptId);
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
project = tEmployeeProjectService.getByEmpIdAndDeptId(empId, deptId);
if (project != null) {
TPreEmployeeProject tPreEmployeeProject = new TPreEmployeeProject();
BeanUtil.copyProperties(project, tPreEmployeeProject);
tPreEmployeeProject = new TPreEmployeeProject();
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
tPreEmployeeProject.setOldId(project.getId());
vo.setTPreEmployeeProject(tPreEmployeeProject);
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
} else {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
tPreEmployeeProject.setBusinessPrimaryType(dept.getBusinessPrimaryType());
tPreEmployeeProject.setBusinessSecondType(dept.getBusinessSecondType());
tPreEmployeeProject.setBusinessThirdType(dept.getBusinessThirdType());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.save(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
}
String id = main.getId();
......@@ -198,7 +293,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(empId)) {
TEmpBadRecord info = tEmpBadRecordService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpBadRecord);
BeanUtil.copyProperties(info, tPreEmpBadRecord, ID);
tPreEmpBadRecord.setEmpId(empId);
tPreEmpBadRecord.setOldId(info.getId());
}
}
......@@ -207,9 +303,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpBadRecord.setProject(dept.getDepartName());
tPreEmpBadRecord.setProjectCode(dept.getDepartNo());
tPreEmpBadRecord.setEmpIdcard(empIdCard);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
tPreEmpBadRecordService.save(tPreEmpBadRecord);
}
vo.setTPreEmpBadRecord(tPreEmpBadRecord);
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = tPreEmpContactInfoService.getTPreEmpContactInfoList(id);
if (tPreEmpContactInfo == null) {
......@@ -217,18 +316,18 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(empId)) {
TEmpContactInfo info = tEmpContactInfoService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpContactInfo);
BeanUtil.copyProperties(info, tPreEmpContactInfo, ID);
tPreEmpContactInfo.setEmpId(empId);
tPreEmpContactInfo.setOldId(info.getId());
}
}
tPreEmpContactInfo.setPreMainId(id);
if (employee != null) {
tPreEmpContactInfo.setEmpName(employee.getEmpName());
}
tPreEmpContactInfo.setEmpIdcard(empIdCard);
tPreEmpContactInfo.setCreateBy(user.getId());
tPreEmpContactInfo.setCreateName(user.getNickname());
tPreEmpContactInfo.setCreateTime(LocalDateTime.now());
tPreEmpContactInfoService.save(tPreEmpContactInfo);
}
vo.setTPreEmpContactInfo(tPreEmpContactInfo);
vo.setTpreEmpContactInfo(tPreEmpContactInfo);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
if (tPreEmpDisabilityInfo == null) {
......@@ -236,7 +335,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(empId)) {
TEmpDisabilityInfo info = tEmpDisabilityInfoService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpDisabilityInfo);
BeanUtil.copyProperties(info, tPreEmpDisabilityInfo, ID);
tPreEmpDisabilityInfo.setEmpId(empId);
tPreEmpDisabilityInfo.setOldId(info.getId());
}
}
......@@ -248,9 +348,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpDisabilityInfo.setEmpCode(employee.getEmpCode());
}
tPreEmpDisabilityInfo.setEmpIdcard(empIdCard);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
tPreEmpDisabilityInfoService.save(tPreEmpDisabilityInfo);
}
vo.setTPreEmpDisabilityInfo(tPreEmpDisabilityInfo);
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation == null) {
......@@ -258,7 +361,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(empId)) {
TEmpEducation info = tEmpEducationService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpEducation);
BeanUtil.copyProperties(info, tPreEmpEducation, ID);
tPreEmpEducation.setEmpId(empId);
tPreEmpEducation.setOldId(info.getId());
// 附件
......@@ -271,7 +375,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
}
tPreEmpEducation.setPreMainId(id);
......@@ -282,12 +385,26 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpEducation.setEmpCode(employee.getEmpCode());
}
tPreEmpEducation.setEmpIdcard(empIdCard);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
tPreEmpEducationService.save(tPreEmpEducation);
} else {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(tPreEmpEducation.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
vo.setTPreEmpEducation(tPreEmpEducation);
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = tPreEmpFamilyService.getTPreEmpFamilyList(id);
if (tPreEmpFamilyList == null) {
if (tPreEmpFamilyList == null || tPreEmpFamilyList.isEmpty()) {
tPreEmpFamilyList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpFamily> infoList = tEmpFamilyService.getListByEmpId(empId);
......@@ -295,7 +412,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmpFamily record;
for (TEmpFamily info : infoList) {
record = new TPreEmpFamily();
BeanUtil.copyProperties(info, record);
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
......@@ -304,34 +422,76 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyList.add(record);
}
tPreEmpFamilyService.saveBatch(tPreEmpFamilyList);
}
}
if (tPreEmpFamilyList.isEmpty()) {
TPreEmpFamily record = new TPreEmpFamily();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyService.save(record);
tPreEmpFamilyList.add(record);
}
}
vo.setTPreEmpFamilyList(tPreEmpFamilyList);
vo.setTpreEmpFamilyList(tPreEmpFamilyList);
// 预入职-人员档案表
if (vo.getTPreEmployeeInfo() == null) {
if (vo.getTpreEmployeeInfo() == null) {
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(id);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
if (tPreEmployeeInfo == null) {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
}
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
}
// 预入职-项目档案表
if (vo.getTPreEmployeeProject() == null) {
if (vo.getTpreEmployeeProject() == null) {
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(id);
vo.setTPreEmployeeProject(tPreEmployeeProject);
if (tPreEmployeeProject == null) {
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.save(tPreEmployeeProject);
}
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalQualificationService.getTPreEmpProfessionalQualificationList(id);
if (tPreEmpProfessionalQualificationList == null) {
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalService.getTPreEmpProfessionalQualificationList(id);
if (tPreEmpProfessionalQualificationList == null || tPreEmpProfessionalQualificationList.isEmpty()) {
tPreEmpProfessionalQualificationList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpProfessionalQualification> infoList = tEmpProfessionalQualificationService.getListByEmpId(empId);
List<TEmpProfessionalQualification> infoList = tEmpProfessionalService.getListByEmpId(empId);
TPreEmpProfessionalQualification record;
if (infoList != null && !infoList.isEmpty()) {
TPreEmpProfessionalQualification record;
for (TEmpProfessionalQualification info : infoList) {
record = new TPreEmpProfessionalQualification();
BeanUtil.copyProperties(info, record);
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
......@@ -350,26 +510,60 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalQualificationList.add(record);
}
tPreEmpProfessionalQualificationService.saveBatch(tPreEmpProfessionalQualificationList);
tPreEmpProfessionalService.saveBatch(tPreEmpProfessionalQualificationList);
}
}
if (tPreEmpProfessionalQualificationList.isEmpty()) {
TPreEmpProfessionalQualification record = new TPreEmpProfessionalQualification();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalService.save(record);
tPreEmpProfessionalQualificationList.add(record);
}
} else {
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualificationList) {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
info.setAttaList(attaInfoList);
}
}
vo.setTPreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
if (tPreEmpWorkRecordingList == null) {
if (tPreEmpWorkRecordingList == null || tPreEmpWorkRecordingList.isEmpty()) {
tPreEmpWorkRecordingList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpWorkRecording> infoList = tEmpWorkRecordingService.getListByEmpId(empId);
TPreEmpWorkRecording record;
if (infoList != null && !infoList.isEmpty()) {
TPreEmpWorkRecording record;
for (TEmpWorkRecording info : infoList) {
record = new TPreEmpWorkRecording();
BeanUtil.copyProperties(info, record);
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
......@@ -378,17 +572,40 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingList.add(record);
}
tPreEmpWorkRecordingService.saveBatch(tPreEmpWorkRecordingList);
}
}
if (tPreEmpWorkRecordingList.isEmpty()) {
TPreEmpWorkRecording record = new TPreEmpWorkRecording();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingService.save(record);
tPreEmpWorkRecordingList.add(record);
}
}
vo.setTPreEmpWorkRecordingList(tPreEmpWorkRecordingList);
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecordingList);
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
if (attaInfoList != null) {
if ((attaInfoList == null || attaInfoList.isEmpty()) && Common.isNotNull(empId)) {
attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(empId);
}
if (attaInfoList != null && !attaInfoList.isEmpty()) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
......@@ -414,10 +631,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
vo.setMain(main);
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = tPreEmpBadRecordService.getTPreEmpBadRecordList(id);
vo.setTPreEmpBadRecord(tPreEmpBadRecord);
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = tPreEmpContactInfoService.getTPreEmpContactInfoList(id);
vo.setTPreEmpContactInfo(tPreEmpContactInfo);
vo.setTpreEmpContactInfo(tPreEmpContactInfo);
// 预入职-员工申明
TPreEmpDeclaration tPreEmpDeclaration;
if (Common.isNotNull(main.getDeclarationId())) {
......@@ -425,10 +642,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
tPreEmpDeclaration = tPreEmpDeclarationService.getTPreEmpDeclarationList();
}
vo.setTPreEmpDeclaration(tPreEmpDeclaration);
vo.setTpreEmpDeclaration(tPreEmpDeclaration);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
vo.setTPreEmpDisabilityInfo(tPreEmpDisabilityInfo);
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation != null) {
......@@ -442,18 +659,18 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
tPreEmpEducation.setAttaList(attaInfoList);
}
vo.setTPreEmpEducation(tPreEmpEducation);
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamily = tPreEmpFamilyService.getTPreEmpFamilyList(id);
vo.setTPreEmpFamilyList(tPreEmpFamily);
vo.setTpreEmpFamilyList(tPreEmpFamily);
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(id);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
// 预入职-项目档案表
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(id);
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalQualificationService.getTPreEmpProfessionalQualificationList(id);
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalService.getTPreEmpProfessionalQualificationList(id);
if (tPreEmpProfessionalQualificationList != null) {
List<TAttaInfo> attaInfoList;
......@@ -470,10 +687,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
vo.setTPreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecording = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
vo.setTPreEmpWorkRecordingList(tPreEmpWorkRecording);
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecording);
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
......@@ -500,8 +717,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
@Override
public R<String> doImproveInformation(PreEmpMainDetailVo vo) {
TPreEmpMain preMain = vo.getMain();
TPreEmployeeInfo tPreEmployee = vo.getTPreEmployeeInfo();
TPreEmployeeProject project = vo.getTPreEmployeeProject();
TPreEmployeeInfo tPreEmployee = vo.getTpreEmployeeInfo();
TPreEmployeeProject project = vo.getTpreEmployeeProject();
if (preMain == null || tPreEmployee == null || project == null ||
Common.isEmpty(preMain.getId()) || Common.isEmpty(tPreEmployee.getId()) || Common.isEmpty(project.getId())) {
return R.failed("请传主表ID与人员ID与项目ID");
......@@ -554,6 +771,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return saveBase(vo, CommonConstants.ONE_STRING);
}
/**
* @Description: 核心保存
* @Author: hgw
......@@ -561,12 +779,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private R<String> saveBase(PreEmpMainDetailVo vo, String status) {
YifuUser user = getNewYifuUser();
TPreEmpMain main = vo.getMain();
if (main != null && Common.isNotNull(main.getEmpIdcard())) {
TPreEmployeeProject tPreEmployeeProject = vo.getTPreEmployeeProject();
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) {
// 转到更新档案去
return updateToEmployeeByPre(vo);
......@@ -575,31 +794,46 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
} else {
main.setStatus(status);
main.setCreateBy(user.getId());
main.setCreateName(user.getNickname());
main.setCreateTime(LocalDateTime.now());
this.saveOrUpdate(main);
String mainId = main.getId();
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTPreEmpBadRecord();
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
tPreEmpBadRecord.setPreMainId(mainId);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTPreEmpContactInfo();
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
if (tPreEmpContactInfo != null) {
tPreEmpContactInfo.setPreMainId(mainId);
tPreEmpContactInfo.setCreateBy(user.getId());
tPreEmpContactInfo.setCreateName(user.getNickname());
tPreEmpContactInfo.setCreateTime(LocalDateTime.now());
tPreEmpContactInfoService.saveOrUpdate(tPreEmpContactInfo);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTPreEmpDisabilityInfo();
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
tPreEmpDisabilityInfo.setPreMainId(mainId);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
tPreEmpDisabilityInfoService.saveOrUpdate(tPreEmpDisabilityInfo);
}
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTPreEmpEducation();
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
if (tPreEmpEducation != null) {
tPreEmpEducation.setPreMainId(mainId);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
tPreEmpEducationService.saveOrUpdate(tPreEmpEducation);
// 附件
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
......@@ -608,21 +842,28 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tAttaInfoService.deleteByDomainId(tPreEmpEducation.getId());
for (TAttaInfo atta : attaList) {
atta.setDomainId(tPreEmpEducation.getId());
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdateBatch(attaList);
}
}
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamily = vo.getTPreEmpFamilyList();
List<TPreEmpFamily> tPreEmpFamily = vo.getTpreEmpFamilyList();
if (tPreEmpFamily != null) {
tPreEmpFamilyService.deleteFamilyByMainId(mainId);
for (TPreEmpFamily info : tPreEmpFamily) {
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tPreEmpFamilyService.saveOrUpdateBatch(tPreEmpFamily);
}
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null) {
if (tPreEmpEducation != null) {
if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
......@@ -635,24 +876,40 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
tPreEmployeeInfo.setIsCollege(CommonConstants.ZERO_INT);
}
tPreEmployeeInfo.setHignEducation(tPreEmpEducation.getEducationName());
}
tPreEmployeeInfo.setSchool(tPreEmpEducation.getSchool());
tPreEmployeeInfo.setMajor(tPreEmpEducation.getMajor());
tPreEmployeeInfo.setAdmissionDate(tPreEmpEducation.getEntryDate());
tPreEmployeeInfo.setGradutionDate(tPreEmpEducation.getGradutionDate());
}
// 生成性别年龄等:
this.setBaseSexInfo(tPreEmployeeInfo);
tPreEmployeeInfo.setPreMainId(mainId);
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
}
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
tPreEmployeeProject.setPreMainId(mainId);
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTPreEmpProfessionalQualificationList();
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualification != null) {
// 先删除后增加
tPreEmpProfessionalService.deleteProfessionalByMainId(mainId);
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
info.setPreMainId(mainId);
tPreEmpProfessionalQualificationService.saveOrUpdate(info);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalService.saveOrUpdate(info);
// 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = info.getAttaList();
......@@ -660,6 +917,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tAttaInfoService.deleteByDomainId(info.getId());
for (TAttaInfo atta : attaList) {
atta.setDomainId(info.getId());
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdateBatch(attaList);
}
......@@ -667,13 +927,31 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTPreEmpWorkRecordingList();
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTpreEmpWorkRecordingList();
if (tPreEmpWorkRecording != null) {
// 先删除后增加
tPreEmpWorkRecordingService.deleteByMainId(mainId);
for (TPreEmpWorkRecording info : tPreEmpWorkRecording) {
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tPreEmpWorkRecordingService.saveOrUpdateBatch(tPreEmpWorkRecording);
}
// 预入职-附件
List<TAttaInfo> attaInfoList = vo.getAttaInfoList();
if (attaInfoList != null) {
// 先删除后增加
tAttaInfoService.deleteByDomainId(mainId);
for (TAttaInfo info : attaInfoList) {
info.setDomainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdateBatch(attaInfoList);
}
}
return R.ok("成功");
} else {
......@@ -681,6 +959,20 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
private YifuUser getNewYifuUser() {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
return user;
}
/**
* @Description: 执行复制到档案的操作
* @Author: hgw
......@@ -689,16 +981,18 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
**/
private R<String> updateToEmployeeByPre(PreEmpMainDetailVo vo) {
YifuUser user = SecurityUtils.getUser();
if (user == null) {
user = getNewYifuUser();
}
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
// 预入职-项目档案表
TPreEmployeeProject tPreEmployeeProject = vo.getTPreEmployeeProject();
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTPreEmpEducation();
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
// 如果档案项目id都没有,则新增。newFlag是true:
boolean newFlag = true;
String empId = null;
String empProjectId = null;
String empIdCard = null;
// 1人员档案
TEmployeeInfo emp = null;
......@@ -711,13 +1005,34 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (dept == null) {
return R.failed("根据项目id,未找到项目!");
}
if (tPreEmployeeInfo != null && tPreEmpEducation != null) {
if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
if ("5".equals(tPreEmpEducation.getEducationName())
|| "6".equals(tPreEmpEducation.getEducationName())
|| "7".equals(tPreEmpEducation.getEducationName())
|| "8".equals(tPreEmpEducation.getEducationName())) {
tPreEmployeeInfo.setIsCollege(CommonConstants.ONE_INT);
} else {
tPreEmployeeInfo.setIsCollege(CommonConstants.ZERO_INT);
}
tPreEmployeeInfo.setHignEducation(tPreEmpEducation.getEducationName());
}
tPreEmployeeInfo.setSchool(tPreEmpEducation.getSchool());
tPreEmployeeInfo.setMajor(tPreEmpEducation.getMajor());
tPreEmployeeInfo.setAdmissionDate(tPreEmpEducation.getEntryDate());
tPreEmployeeInfo.setGradutionDate(tPreEmpEducation.getGradutionDate());
}
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())
&& Common.isNotNull(tPreEmployeeProject.getOldId())) {
newFlag = false;
empId = tPreEmployeeInfo.getOldId();
emp = tEmployeeInfoService.getById(empId);
if (emp != null) {
BeanUtil.copyProperties(tPreEmployeeInfo, emp);
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ID);
if (CommonConstants.ONE_INT == emp.getFileStatus()) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
}
tEmployeeInfoService.updateById(emp);
} else {
emp = this.saveTEmployeeInfo(user, tPreEmployeeInfo);
......@@ -726,29 +1041,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
empIdCard = emp.getEmpIdcard();
project = tEmployeeProjectService.getById(tPreEmployeeProject.getOldId());
if (project != null) {
BeanUtil.copyProperties(tPreEmployeeInfo, project);
tEmployeeInfoService.updateById(emp);
BeanUtil.copyProperties(tPreEmployeeInfo, project, ID);
if (CommonConstants.ONE_INT == project.getProjectStatus()) {
project.setCreateTime(LocalDateTime.now());
project.setDeleteFlag(CommonConstants.STATUS_NORMAL);
project.setProjectStatus(CommonConstants.ZERO_INT);
}
tEmployeeProjectService.updateById(project);
} else {
project = this.saveTEmployeeProject(project, user, tPreEmployeeProject, emp, dept);
}
if (Common.isNotNull(project)) {
empProjectId = project.getId();
this.saveTEmployeeProject(project, user, tPreEmployeeProject, emp, dept);
}
} else {
// 新建档案、项目档案,将档案id赋值,给其他附属信息
if (tPreEmployeeInfo != null) {
if (tPreEmpEducation != null) {
if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
if ("5".equals(tPreEmpEducation.getEducationName())
|| "6".equals(tPreEmpEducation.getEducationName())
|| "7".equals(tPreEmpEducation.getEducationName())
|| "8".equals(tPreEmpEducation.getEducationName())) {
tPreEmployeeInfo.setIsCollege(CommonConstants.ONE_INT);
} else {
tPreEmployeeInfo.setIsCollege(CommonConstants.ZERO_INT);
}
}
}
// 生成性别年龄等:
this.setBaseSexInfo(tPreEmployeeInfo);
......@@ -757,10 +1062,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
empId = emp.getId();
empIdCard = emp.getEmpIdcard();
// 2项目档案
project = this.saveTEmployeeProject(project, user, tPreEmployeeProject, emp, dept);
if (Common.isNotNull(project)) {
empProjectId = project.getId();
}
this.saveTEmployeeProject(project, user, tPreEmployeeProject, emp, dept);
}
}
if (emp == null) {
......@@ -795,10 +1097,26 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmployeeInfoService.updateById(emp);
}
}
BeanUtil.copyProperties(tPreEmpEducation, tEmpEducation);
BeanUtil.copyProperties(tPreEmpEducation, tEmpEducation, ID);
if (Common.isEmpty(tEmpEducation.getEmpCode())) {
tEmpEducation.setEmpCode(emp.getEmpCode());
}
if (Common.isEmpty(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
}
if (Common.isEmpty(tEmpEducation.getCreateTime())) {
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducation.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpEducation.setEmpId(empId);
if (Common.isNotNull(empIdCard)) {
tEmpEducationService.updateEducationToNoByIdCard(empIdCard);
}
if (Common.isNotNull(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducationService.saveOrUpdate(tEmpEducation);
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
......@@ -811,15 +1129,21 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, "id");
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(tEmpEducation.getId());
if (Common.isNotNull(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
}
}
}
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTPreEmpBadRecord();
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
TEmpBadRecord tEmpBadRecord = null;
if (Common.isNotNull(tPreEmpBadRecord.getOldId())) {
......@@ -828,11 +1152,18 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tEmpBadRecord == null) {
tEmpBadRecord = new TEmpBadRecord();
}
BeanUtil.copyProperties(tPreEmpBadRecord, tEmpBadRecord);
BeanUtil.copyProperties(tPreEmpBadRecord, tEmpBadRecord, ID);
tEmpBadRecord.setEmpId(empId);
if (Common.isNotNull(tEmpBadRecord.getCreateBy())) {
tEmpBadRecord.setCreateBy(user.getId());
tEmpBadRecord.setCreateName(user.getNickname());
tEmpBadRecord.setCreateTime(LocalDateTime.now());
}
tEmpBadRecordService.saveOrUpdate(tEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTPreEmpContactInfo();
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
if (tPreEmpContactInfo != null) {
TEmpContactInfo tEmpContactInfo = null;
if (Common.isNotNull(tPreEmpContactInfo.getOldId())) {
......@@ -841,11 +1172,18 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tEmpContactInfo == null) {
tEmpContactInfo = new TEmpContactInfo();
}
BeanUtil.copyProperties(tPreEmpContactInfo, tEmpContactInfo);
BeanUtil.copyProperties(tPreEmpContactInfo, tEmpContactInfo, ID);
tEmpContactInfo.setEmpId(empId);
if (Common.isNotNull(tEmpContactInfo.getCreateBy())) {
tEmpContactInfo.setCreateBy(user.getId());
tEmpContactInfo.setCreateName(user.getNickname());
tEmpContactInfo.setCreateTime(LocalDateTime.now());
}
tEmpContactInfoService.saveOrUpdate(tEmpContactInfo);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTPreEmpDisabilityInfo();
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
TEmpDisabilityInfo tEmpDisabilityInfo = null;
if (Common.isNotNull(tPreEmpDisabilityInfo.getOldId())) {
......@@ -854,40 +1192,71 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tEmpDisabilityInfo == null) {
tEmpDisabilityInfo = new TEmpDisabilityInfo();
}
BeanUtil.copyProperties(tPreEmpDisabilityInfo, tEmpDisabilityInfo);
BeanUtil.copyProperties(tPreEmpDisabilityInfo, tEmpDisabilityInfo, ID);
tEmpDisabilityInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpDisabilityInfo.setEmpId(empId);
if (Common.isEmpty(tEmpDisabilityInfo.getEmpCode())) {
tEmpDisabilityInfo.setEmpCode(emp.getEmpCode());
}
if (Common.isNotNull(tEmpDisabilityInfo.getCreateBy())) {
tEmpDisabilityInfo.setCreateBy(user.getId());
tEmpDisabilityInfo.setCreateName(user.getNickname());
tEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
}
tEmpDisabilityInfoService.saveOrUpdate(tEmpDisabilityInfo);
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTPreEmpFamilyList();
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTpreEmpFamilyList();
if (tPreEmpFamilyList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_emp_family");
List<TEmpFamily> tEmpFamilyList = new ArrayList<>();
tEmpFamilyService.deleteByEmpId(empId);
TEmpFamily tEmpFamily;
for (TPreEmpFamily tPreEmpFamily : tPreEmpFamilyList) {
tEmpFamily = new TEmpFamily();
BeanUtil.copyProperties(tPreEmpFamily, tEmpFamily);
BeanUtil.copyProperties(tPreEmpFamily, tEmpFamily, ID);
tEmpFamily.setEmpId(empId);
tEmpFamily.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpFamily.setEmpCode(emp.getEmpCode());
tEmpFamily.setEmpName(emp.getEmpName());
tEmpFamily.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(tPreEmpFamily.getOldId())) {
tEmpFamily.setId(tPreEmpFamily.getOldId());
}
tEmpFamilyList.add(tEmpFamily);
if (Common.isNotNull(tEmpFamily.getCreateBy())) {
tEmpFamily.setCreateBy(user.getId());
tEmpFamily.setCreateName(user.getNickname());
tEmpFamily.setCreateTime(LocalDateTime.now());
}
tEmpFamilyService.save(tEmpFamily);
}
tEmpFamilyService.saveOrUpdateBatch(tEmpFamilyList);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTPreEmpProfessionalQualificationList();
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualificationList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_pre_emp_professional_qualification");
tEmpProfessionalService.deleteProfessionalByEmpId(empId);
TEmpProfessionalQualification info;
for (TPreEmpProfessionalQualification preInfo : tPreEmpProfessionalQualificationList) {
info = new TEmpProfessionalQualification();
BeanUtil.copyProperties(preInfo, info);
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
}
tEmpProfessionalQualificationService.saveOrUpdate(info);
if (Common.isNotNull(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tEmpProfessionalService.save(info);
if (preInfo.getAttaList() != null && !preInfo.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = preInfo.getAttaList();
if (attaList != null) {
......@@ -898,8 +1267,14 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, "id");
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(info.getId());
if (Common.isNotNull(atta.getCreateBy())) {
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
}
......@@ -907,35 +1282,51 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTPreEmpWorkRecordingList();
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList();
if (tPreEmpWorkRecordingList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_pre_emp_work_recording");
List<TEmpWorkRecording> tEmpWorkRecordingList = new ArrayList<>();
tEmpWorkRecordingService.deleteWorkRecordByEmpId(empId);
TEmpWorkRecording info;
for (TPreEmpWorkRecording preInfo : tPreEmpWorkRecordingList) {
info = new TEmpWorkRecording();
BeanUtil.copyProperties(preInfo, info);
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
tEmpWorkRecordingService.updateById(info);
} else {
tEmpWorkRecordingService.save(info);
}
tEmpWorkRecordingList.add(info);
}
tEmpWorkRecordingService.saveOrUpdateBatch(tEmpWorkRecordingList);
}
// 预入职-附件
List<TAttaInfo> attaList = vo.getAttaInfoList();
if (attaList != null) {
// 先删除其他信息
tAttaInfoService.deleteByDomainId(empProjectId);
tAttaInfoService.deleteByDomainId(empId);
for (TAttaInfo atta : attaList) {
if (Common.isEmpty(atta.getDomainId())) {
atta.setDomainId(empProjectId);
atta.setDomainId(empId);
if (Common.isNotNull(atta.getCreateBy())) {
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
}
}
tAttaInfoService.saveOrUpdateBatch(attaList);
}
return R.ok("保存档案成功!");
return R.ok("成功!");
}
// 2新增或更新项目
......@@ -946,16 +1337,21 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (project == null) {
project = tEmployeeProjectService.getByEmpIdAndDeptIdAndDelete(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
if (project != null) {
project.setCreateTime(LocalDateTime.now());
project.setProjectStatus(CommonConstants.ZERO_INT);
project.setProjectSource(CommonConstants.EIGHT_STRING);
project.setDeleteFlag(CommonConstants.STATUS_NORMAL);
}
} else if (CommonConstants.ONE_INT == project.getProjectStatus()) {
project.setCreateTime(LocalDateTime.now());
project.setProjectStatus(CommonConstants.ZERO_INT);
}
isNew = false;
if (project == null) {
isNew = true;
project = new TEmployeeProject();
}
BeanUtil.copyProperties(tPreEmployeeProject, project);
BeanUtil.copyProperties(tPreEmployeeProject, project, ID);
if (isNew) {
// 新项目档案塞基本属性
this.setNewEmpProjectBaseData(project, emp, dept, user);
......@@ -971,15 +1367,20 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (emp == null) {
emp = tEmployeeInfoService.getInfoByDelete(tPreEmployeeInfo.getEmpIdcard());
if (emp != null) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
emp.setDeleteFlag(CommonConstants.STATUS_NORMAL);
}
} else if (CommonConstants.ONE_INT == emp.getFileStatus()) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
}
boolean isNew = false;
if (emp == null) {
isNew = true;
emp = new TEmployeeInfo();
}
BeanUtil.copyProperties(tPreEmployeeInfo, emp);
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ID);
if (isNew) {
// 新员工塞基本属性
this.setNewEmpBaseData(emp, user);
......@@ -1043,8 +1444,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
insTEmployeePro.setEmpCode(tEmployeeInfo.getEmpCode());
insTEmployeePro.setCreateBy(user.getId());
insTEmployeePro.setEmpName(tEmployeeInfo.getEmpName());
insTEmployeePro.setCreateTime(LocalDateTime.now());
insTEmployeePro.setCreateName(user.getNickname());
insTEmployeePro.setProjectSource(CommonConstants.SIX_STRING);
insTEmployeePro.setProjectSource(CommonConstants.EIGHT_STRING);
insTEmployeePro.setEmpId(tEmployeeInfo.getId());
}
......@@ -1087,10 +1489,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
*/
@Override
public void listExport(HttpServletResponse response, TPreEmpMainSearchVo searchVo) {
String fileName = "预入职-主表批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "预入职导出主表" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreEmpMain> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
long count = baseMapper.getTPreEmpMainCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
......@@ -1098,14 +1500,14 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPreEmpMain.class).build();
ExcelWriter excelWriter = EasyExcelFactory.write(out, TPreEmpMain.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
list = baseMapper.getTPreEmpMainList(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TPreEmpMain> util = new ExcelUtil<>(TPreEmpMain.class);
for (TPreEmpMain vo : list) {
......@@ -1113,17 +1515,16 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("预入职-主表" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("预入职-主表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("预入职-主表" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("预入职-主表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......@@ -1158,21 +1559,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TPreEmpMainSearchVo searchVo) {
LambdaQueryWrapper<TPreEmpMain> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TPreEmpMain::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TPreEmpMainSearchVo entity) {
LambdaQueryWrapper<TPreEmpMain> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TPreEmpMain::getCreateTime, entity.getCreateTimes()[0])
.le(TPreEmpMain::getCreateTime,
entity.getCreateTimes()[1]);
if (ArrayUtil.isNotEmpty(entity.getCreateTimeStart())) {
wrapper.ge(TPreEmpMain::getCreateTime, entity.getCreateTimeStart());
}
if (ArrayUtil.isNotEmpty(entity.getCreateTimeEnd())) {
wrapper.le(TPreEmpMain::getCreateTime, entity.getCreateTimeEnd());
}
if (Common.isNotNull(entity.getStatusArray())) {
wrapper.in(TPreEmpMain::getStatus, entity.getStatusArray());
}
if (Common.isNotNull(entity.getEmpNatureArray())) {
wrapper.in(TPreEmpMain::getEmpNatrue, entity.getEmpNatureArray());
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TPreEmpMain::getCreateName, entity.getCreateName());
......@@ -1194,7 +1593,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TPreEmpMainVo.class, new ReadListener<TPreEmpMainVo>() {
EasyExcelFactory.read(inputStream, TPreEmpMainVo.class, new ReadListener<TPreEmpMainVo>() {
/**
* 单次缓存的数据量
*/
......@@ -1307,4 +1706,581 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
@Override
public R<String> doAudit(String id, String status, String auditRemark) {
if (Common.isEmpty(id) && Common.isEmpty(status)) {
return R.failed("id、status不可为空!");
}
TPreEmpMain preEmpMain = this.getById(id);
if (preEmpMain == null || Common.isEmpty(preEmpMain.getStatus()) || !CommonConstants.TWO_STRING.equals(preEmpMain.getStatus())) {
return R.failed("请确认ID与状态!");
}
if (!CommonConstants.THREE_STRING.equals(status) && !CommonConstants.FOUR_STRING.equals(status)) {
return R.failed("审核状态不对!");
}
if (CommonConstants.THREE_STRING.equals(status) && Common.isEmpty(auditRemark)) {
return R.failed("审核不通过,原因必填!");
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed("未找到登录信息!");
}
preEmpMain.setStatus(status);
preEmpMain.setAuditId(user.getId());
preEmpMain.setAuditRemark(auditRemark);
preEmpMain.setAuditName(user.getNickname());
if (CommonConstants.FOUR_STRING.equals(status)) {
preEmpMain.setAuditTime(new Date());
}
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
auditLog.setAuditName(user.getNickname());
auditLog.setAuditTime(new Date());
auditLog.setAuditRemark(auditRemark);
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
PreEmpMainDetailVo vo = voR.getData();
tPreEmpMainLogService.save(auditLog);
this.updateById(preEmpMain);
if (CommonConstants.FOUR_STRING.equals(status)) {
return updateToEmployeeByPre(vo);
} else {
return R.ok("已审核");
}
} else {
return R.failed("未找到信息,未审核!");
}
}
@Override
public R<List<ErrorVO>> doBatchAudit(List<String> ids, String status, String auditRemark) {
if (Common.isEmpty(ids) && Common.isEmpty(status)) {
return R.failed("id、status不可为空!");
}
if (!CommonConstants.THREE_STRING.equals(status) && !CommonConstants.FOUR_STRING.equals(status)) {
return R.failed("审核状态不对!");
}
if (CommonConstants.THREE_STRING.equals(status) && Common.isEmpty(auditRemark)) {
return R.failed("审核不通过,原因必填!");
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed("未找到登录信息!");
}
List<ErrorVO> returnList = new ArrayList<>();
TPreEmpMain preEmpMain;
ErrorVO errorVo;
int i = 1;
boolean isTrue = true;
for (String id : ids) {
errorVo = new ErrorVO();
errorVo.setResult(CommonConstants.ZERO_INT);
errorVo.setLineNum(i++);
preEmpMain = this.getById(id);
if (preEmpMain == null || Common.isEmpty(preEmpMain.getStatus()) || !CommonConstants.TWO_STRING.equals(preEmpMain.getStatus())) {
errorVo.setErrorInfo("请确认ID与状态!");
returnList.add(errorVo);
isTrue = false;
} else {
errorVo.setResult(CommonConstants.ONE_INT);
errorVo.setMainName(preEmpMain.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + preEmpMain.getDeptNo());
returnList.add(errorVo);
preEmpMain.setStatus(status);
preEmpMain.setAuditId(user.getId());
preEmpMain.setAuditRemark(auditRemark);
preEmpMain.setAuditName(user.getNickname());
if (CommonConstants.FOUR_STRING.equals(status)) {
preEmpMain.setAuditTime(new Date());
}
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
auditLog.setAuditName(user.getNickname());
auditLog.setAuditTime(new Date());
auditLog.setAuditRemark(auditRemark);
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
PreEmpMainDetailVo vo = null;
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
vo = voR.getData();
updateToEmployeeByPre(vo);
this.updateById(preEmpMain);
tPreEmpMainLogService.save(auditLog);
}
}
}
if (isTrue) {
return R.ok(returnList);
} else {
return R.failed(returnList);
}
}
private List<String> getNewArrayList(String[] strArr) {
return Arrays.asList(strArr);
}
/**
* 预入职导出全量
*
* @return
*/
@Override
public R<String> exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo) {
String name = "预入职导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTPreEmpMainAllCount(searchVo);
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
return R.failed("数据超过6万条,请联系管理员后端导出!");
}
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"状态", "状态"}));
headList.add(this.getNewArrayList(new String[]{"提交时间", "提交时间"}));
String oneTitle = "员工基本信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工主码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证号"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "性别"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证期限"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证开始日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证截止日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "出生日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "年龄"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "婚姻状况"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "民族"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "政治面貌"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "邮箱"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户口性质"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址"}));
oneTitle = "在项信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "客户名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "项目名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "业务类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "合同类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工时制"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "就职岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入职日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "试用期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "标签"}));
oneTitle = "紧急联络人";
headList.add(this.getNewArrayList(new String[]{oneTitle, "姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系地址"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系电话"}));
oneTitle = "最高教育经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "学校"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "专业"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否大专及以上"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "最高学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入学时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "毕业时间"}));
oneTitle = "主要工作经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否为首份工作"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作单位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "开始工作日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "结束工作日期"}));
oneTitle = "主要家庭成员信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "成员姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
oneTitle = "职业资格信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业资格证书"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "申报年度"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业资格名称"}));
oneTitle = "伤残信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否曾被认定为工伤"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
ExcelWriter excelWriter = EasyExcelFactory.write(out).head(headList).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPreEmpMainAllList(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 1工作经历
count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 2家庭成员
count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 3职业资格
count = baseMapper.getTEmpMainAllCountThreeProfessional(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
return null;
}
/**
* @Description: 合并单元格
* @Author: hgw
* @Date: 2024/6/27 10:35
* @return: void
**/
private void getHeBingHang(List<TPreMainExportAllVO> list, ExcelWriterSheetBuilder writeSheet) {
OnceAbsoluteMergeStrategy strategy;
int startRow = 0;
int endRow = 0;
boolean preBoo;
boolean afterBoo;
int startRow0 = 0;
int endRow0 = 0;
int startRow1 = 0;
int endRow1 = 0;
int startRow2 = 0;
int endRow2 = 0;
int startRow3 = 0;
int endRow3 = 0;
int startRow4 = 0;
int endRow4 = 0;
int startRow5 = 0;
int endRow5 = 0;
int startRow6 = 0;
int endRow6 = 0;
int startRow7 = 0;
int endRow7 = 0;
int startRow8 = 0;
int endRow8 = 0;
int startRow9 = 0;
int endRow9 = 0;
for (int j = 1; j < list.size() - 1; j++) {
// 0状态
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField1()) && list.get(j).getField1().equals(list.get(j - 1).getField1()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField1()) && list.get(j).getField1().equals(list.get(j + 1).getField1()));
if (preBoo && startRow0 == 0) {
startRow0 = 1 + j;
}
if (!afterBoo && startRow0 > 0) {
endRow0 = 2 + j;
}
if (j == list.size() - 2 && startRow0 > 0) {
endRow0 = 3 + j;
}
if (startRow0 > 0 && endRow0 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow0, endRow0, 0, 0);
writeSheet.registerWriteHandler(strategy);
startRow0 = 0;
endRow0 = 0;
}
// 1提交时间
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField2()) && list.get(j).getField2().equals(list.get(j - 1).getField2()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField2()) && list.get(j).getField2().equals(list.get(j + 1).getField2()));
if (preBoo && startRow1 == 0) {
startRow1 = 1 + j;
}
if (!afterBoo && startRow1 > 0) {
endRow1 = 2 + j;
}
if (j == list.size() - 2 && startRow1 > 0) {
endRow1 = 3 + j;
}
if (startRow1 > 0 && endRow1 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow1, endRow1, 0, 0);
writeSheet.registerWriteHandler(strategy);
startRow1 = 0;
endRow1 = 0;
}
// 1员工基本信息-身份证
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6()));
if (startRow == 0) {
if (preBoo) {
startRow = 1 + j;
} else if (afterBoo) {
startRow = 2 + j;
}
}
if (!afterBoo && startRow > 0) {
endRow = 2 + j;
}
if (j == list.size() - 2 && startRow > 0) {
endRow = 3 + j;
}
if (startRow > 0 && endRow > 0) {
for (int k = 2; k < 22; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow, endRow, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow = 0;
endRow = 0;
}
// 2在项信息-项目名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField24()) && list.get(j).getField24().equals(list.get(j - 1).getField24()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField24()) && list.get(j).getField24().equals(list.get(j + 1).getField24()));
if (startRow2 == 0) {
if (preBoo) {
startRow2 = 1 + j;
} else if (afterBoo) {
startRow2 = 2 + j;
}
}
if (!afterBoo && startRow2 > 0) {
endRow2 = 2 + j;
}
if (j == list.size() - 2 && startRow2 > 0) {
endRow2 = 3 + j;
}
if (startRow2 > 0 && endRow2 > 0) {
for (int k = 22; k < 31; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow2, endRow2, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow2 = 0;
endRow2 = 0;
}
// 3紧急联络人-姓名
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField32()) && list.get(j).getField32().equals(list.get(j - 1).getField32()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField32()) && list.get(j).getField32().equals(list.get(j + 1).getField32()));
if (startRow3 == 0) {
if (preBoo) {
startRow3 = 1 + j;
} else if (afterBoo) {
startRow3 = 2 + j;
}
}
if (!afterBoo && startRow3 > 0) {
endRow3 = 2 + j;
}
if (j == list.size() - 2 && startRow3 > 0) {
endRow3 = 3 + j;
}
if (startRow3 > 0 && endRow3 > 0) {
for (int k = 31; k < 35; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow3, endRow3, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow3 = 0;
endRow3 = 0;
}
// 4最高教育经历-专业
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField37()) && list.get(j).getField37().equals(list.get(j - 1).getField37()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField37()) && list.get(j).getField37().equals(list.get(j + 1).getField37()));
if (preBoo && startRow4 == 0) {
startRow4 = 1 + j;
}
if (!afterBoo && startRow4 > 0) {
endRow4 = 2 + j;
}
if (j == list.size() - 2 && startRow4 > 0) {
endRow4 = 3 + j;
}
if (startRow4 > 0 && endRow4 > 0) {
for (int k = 35; k < 42; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow4, endRow4, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow4 = 0;
endRow4 = 0;
}
// 5主要工作经历-专业
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField44()) && list.get(j).getField44().equals(list.get(j - 1).getField44()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField44()) && list.get(j).getField44().equals(list.get(j + 1).getField44()));
if (preBoo && startRow5 == 0) {
startRow5 = 1 + j;
}
if (!afterBoo && startRow5 > 0) {
endRow5 = 2 + j;
}
if (j == list.size() - 2 && startRow5 > 0) {
endRow5 = 3 + j;
}
if (startRow5 > 0 && endRow5 > 0) {
for (int k = 42; k < 47; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow5, endRow5, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow5 = 0;
endRow5 = 0;
}
// 6主要家庭成员信息-成员姓名
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField47()) && list.get(j).getField47().equals(list.get(j - 1).getField47()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField47()) && list.get(j).getField47().equals(list.get(j + 1).getField47()));
if (preBoo && startRow6 == 0) {
startRow6 = 1 + j;
}
if (!afterBoo && startRow6 > 0) {
endRow6 = 2 + j;
}
if (j == list.size() - 2 && startRow6 > 0) {
endRow6 = 3 + j;
}
if (startRow6 > 0 && endRow6 > 0) {
for (int k = 47; k < 50; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow6, endRow6, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow6 = 0;
endRow6 = 0;
}
// 7职业资格信息-职业资格名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField53()) && list.get(j).getField53().equals(list.get(j - 1).getField53()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField53()) && list.get(j).getField53().equals(list.get(j + 1).getField53()));
if (preBoo && startRow7 == 0) {
startRow7 = 1 + j;
}
if (!afterBoo && startRow7 > 0) {
endRow7 = 2 + j;
}
if (j == list.size() - 2 && startRow7 > 0) {
endRow7 = 3 + j;
}
if (startRow7 > 0 && endRow7 > 0) {
for (int k = 50; k < 53; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow7, endRow7, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow7 = 0;
endRow7 = 0;
}
// 8伤残信息-职业资格名称+传染病名称+伤残病名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField56()) && list.get(j).getField56().equals(list.get(j - 1).getField56()))
&& (Common.isNotNull(list.get(j).getField58()) && list.get(j).getField58().equals(list.get(j - 1).getField58()))
&& (Common.isNotNull(list.get(j).getField60()) && list.get(j).getField60().equals(list.get(j - 1).getField60()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField56()) && list.get(j).getField56().equals(list.get(j + 1).getField56()))
&& (Common.isNotNull(list.get(j).getField58()) && list.get(j).getField58().equals(list.get(j + 1).getField58()))
&& (Common.isNotNull(list.get(j).getField60()) && list.get(j).getField60().equals(list.get(j + 1).getField60()));
if (preBoo && startRow8 == 0) {
startRow8 = 1 + j;
}
if (!afterBoo && startRow8 > 0) {
endRow8 = 2 + j;
}
if (j == list.size() - 2 && startRow8 > 0) {
endRow8 = 3 + j;
}
if (startRow8 > 0 && endRow8 > 0) {
for (int k = 53; k < 62; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow8, endRow8, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow8 = 0;
endRow8 = 0;
}
// 9不良记录
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField63()) && list.get(j).getField63().equals(list.get(j - 1).getField63()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField63()) && list.get(j).getField63().equals(list.get(j + 1).getField63()));
if (preBoo && startRow9 == 0) {
startRow9 = 1 + j;
}
if (!afterBoo && startRow9 > 0) {
endRow9 = 2 + j;
}
if (j == list.size() - 2 && startRow9 > 0) {
endRow9 = 3 + j;
}
if (startRow9 > 0 && endRow9 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow9, endRow9, 62, 62);
writeSheet.registerWriteHandler(strategy);
startRow9 = 0;
endRow9 = 0;
}
}
}
}
......@@ -43,4 +43,9 @@ public class TPreEmpProfessionalQualificationServiceImpl extends ServiceImpl<TPr
public List<TPreEmpProfessionalQualification> getTPreEmpProfessionalQualificationList(String preMainId) {
return baseMapper.getTPreEmpProfessionalQualificationList(preMainId);
}
@Override
public void deleteProfessionalByMainId(String preMainId) {
baseMapper.deleteProfessionalByMainId(preMainId);
}
}
......@@ -22,32 +22,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpWorkRecordingMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpWorkRecordingService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 预入职-员工工作履历信息表
......@@ -67,4 +42,9 @@ public class TPreEmpWorkRecordingServiceImpl extends ServiceImpl<TPreEmpWorkReco
return baseMapper.getTPreEmpWorkRecordingList(preMainId);
}
@Override
public void deleteByMainId(String preMainId) {
baseMapper.deleteByMainId(preMainId);
}
}
......@@ -14,7 +14,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:43306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:43306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#url: jdbc:mysql://119.96.147.6:43306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
......
......@@ -14,7 +14,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.0.222:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.0.222:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
......
......@@ -15,7 +15,7 @@ spring:
username: root
password: yf_zsk
#url: jdbc:mysql://127.0.0.1:3306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:43306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:43306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
......
......@@ -26,7 +26,7 @@ mybatis-plus:
logic-not-delete-value: 0
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置
security:
......@@ -46,6 +46,10 @@ security:
- /fdd/*
- /temployeeinfo/getHcmEmpInfo
- /temployeeinfo/getHcmEmpInfoList
- /tpreempmain/getByCardAndDeptId
- /tpreempmain/saveDraftPreEmpMain
- /tpreempmain/savePreEmpMain
- /fileUpload/uploadFileReturnAtta
......
......@@ -10,6 +10,7 @@
<result property="unitNo" column="UNIT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="deptId" column="DEPT_ID"/>
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
......@@ -45,6 +46,7 @@
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
a.DEPT_ID,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
......@@ -83,6 +85,9 @@
<if test="tCompleteMonitor.afterIsComplete != null and tCompleteMonitor.afterIsComplete.trim() != ''">
AND a.AFTER_IS_COMPLETE = #{tCompleteMonitor.afterIsComplete}
</if>
<if test="tCompleteMonitor.authSql != null and tCompleteMonitor.authSql.trim() != ''">
${tCompleteMonitor.authSql}
</if>
</if>
</sql>
<!--tCompleteMonitor简单分页查询-->
......@@ -141,7 +146,7 @@
b.EMP_PHONE phone,
a.CREATE_TIME inTime,
if(a.IS_COMPLETE = '0','是','否') isComplete,
a.EMP_ID empInfoId,
a.EMP_ID empInfoId
from
t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id
......@@ -151,28 +156,38 @@
<!--生成数据封装-->
<select id="getAllMonitorEmpList" resultMap="tCompleteMonitorMap">
select
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
a.BUSINESS_PRIMARY_TYPE,
,a.BUSINESS_SECOND_TYPE,
,a.BUSINESS_THIRD_TYPE,
count(a.EMP_IDCARD) as INUSE_PERSON_NUM,
if(sum(if(a.PROJECT_STATUS = 0 and a.IS_COMPLETE = '0',0,1)) > 0,1,0) as IS_COMPLETE,
sum(if(a.IS_COMPLETE = '0',0,1)) as INCOMPLETE_NUM,
concat(ROUND((count(a.EMP_IDCARD) - sum(if(a.IS_COMPLETE = '0',0,1)))/count(a.EMP_IDCARD)),'%') as COMPLETE_PER,
sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01',1,0)) as AFTER_EMPLOYMENT,
if(sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01' and a.IS_COMPLETE = '0',0,1)) > 0,1,0) AFTER_IS_COMPLETE,
sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01' and a.IS_COMPLETE = '0',0,1)) as AFTER_INCOMPLETE_NUM,
a.CREATE_NAME as ALERT_USER
b.CUSTOMER_NAME UNIT_NAME,
b.CUSTOMER_NO UNIT_NO,
b.DEPART_NAME DEPT_NAME,
b.DEPART_NO DEPT_NO,
b.id DEPT_ID,
b.BUSINESS_PRIMARY_TYPE,
b.BUSINESS_SECOND_TYPE,
b.BUSINESS_THIRD_TYPE,
ifnull(a.INUSE_PERSON_NUM,0) INUSE_PERSON_NUM,
ifnull(a.IS_COMPLETE,'0') IS_COMPLETE,
ifnull(a.INCOMPLETE_NUM,0) INCOMPLETE_NUM,
ifnull(a.COMPLETE_PER,'0.00%') COMPLETE_PER,
ifnull(a.AFTER_EMPLOYMENT,0) AFTER_EMPLOYMENT,
ifnull(a.AFTER_IS_COMPLETE,'0') AFTER_IS_COMPLETE,
ifnull(a.AFTER_INCOMPLETE_NUM,0) AFTER_INCOMPLETE_NUM,
b.CREATE_USER_NAME as ALERT_USER
from
t_employee_project a
where DELETE_FLAG = '0'
t_settle_domain b
left join (select DEPT_NO,
sum(if(PROJECT_STATUS = 0,1,0)) as INUSE_PERSON_NUM,
if(sum(if((PROJECT_STATUS = 0 and IS_COMPLETE = '0') or PROJECT_STATUS = 1,0,1)) > 0,1,0) as IS_COMPLETE,
sum(if((PROJECT_STATUS = 0 and IS_COMPLETE = '0') or PROJECT_STATUS = 1,0,1)) as INCOMPLETE_NUM,
concat(ROUND((sum(if(PROJECT_STATUS = 0,1,0)) - sum(if((PROJECT_STATUS = 0 and IS_COMPLETE = '0') or PROJECT_STATUS = 1,0,1)))*100/sum(if(PROJECT_STATUS = 0,1,0)),2),'%') as COMPLETE_PER,
sum(if(PROJECT_STATUS = 0 and DATE_FORMAT(CREATE_TIME,'%Y-%m-%d') >= '2024-05-01',1,0)) as AFTER_EMPLOYMENT,
if(sum(if((PROJECT_STATUS = 0 and DATE_FORMAT(CREATE_TIME,'%Y-%m-%d') >= '2024-05-01' and IS_COMPLETE = '0') or '2024-05-01' > DATE_FORMAT(CREATE_TIME,'%Y-%m-%d') or PROJECT_STATUS = 1,0,1)) > 0,1,0) AFTER_IS_COMPLETE,
sum(if(PROJECT_STATUS = 0 and DATE_FORMAT(CREATE_TIME,'%Y-%m-%d') >= '2024-05-01' and IS_COMPLETE = '1',1,0)) as AFTER_INCOMPLETE_NUM
from t_employee_project where DELETE_FLAG = '0' and PROJECT_STATUS = 0 group by DEPT_NO) a on a.DEPT_NO = b.DEPART_NO
where b.DELETE_FLAG = '0'
<if test="deptNo != null and deptNo.trim() != ''">
and a.DEPT_NO = #{deptNo}
and b.DEPART_NO = #{deptNo}
</if>
group by a.DEPT_NO
group by b.DEPART_NO
</select>
......@@ -255,7 +270,7 @@
) e on a.EMP_ID = e.ID
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(TYPE,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '1'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '1' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
......@@ -276,4 +291,228 @@
delete from t_complete_monitor WHERE DEPT_NO = #{deptNo}
</delete>
<!-- 导出详情 -->
<select id="getTEmpMainAllCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--导出统计list-->
<select id="getTEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
if(a.IS_COMPLETE=0,'是','否') field1
,DATE_FORMAT(p.create_time,'%Y-%m-%d') field2,e.EMP_CODE field3,emp_natrue.label field4,e.emp_name field5,e.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,politicalStatus.label field15,e.EMP_PHONE field16,e.EMP_EMAIL field17
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.status=0,'草稿','已审核') field21
,e.CONTACT_ADDRESS field22,p.UNIT_NAME field23,p.DEPT_NAME field24
,concat(p.BUSINESS_PRIMARY_TYPE,'-',ifnull(p.BUSINESS_SECOND_TYPE,''),'-',ifnull(p.BUSINESS_THIRD_TYPE,'')) field25
,eci.contract_name field26 ,workingHours.label field27,eci.POST field28,eci.CONTRACT_START field29
,eci.TRY_PERIOD field30,p.EMP_LABEL field31
,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35
,ee.SCHOOL field36,ee.MAJOR field37,education.label field38,if(e.IS_COLLEGE=0,'否','是') field39
,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56
,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(c.contract_name ORDER BY c.audit_time_last desc),',',1) contract_name
,c.EMP_IDCARD,c.DEPT_NO
,SUBSTRING_INDEX(GROUP_CONCAT(c.CONTRACT_START ORDER BY c.audit_time_last desc),',',1) CONTRACT_START
,SUBSTRING_INDEX(GROUP_CONCAT(c.WORKING_HOURS ORDER BY c.audit_time_last desc),',',1) WORKING_HOURS
,SUBSTRING_INDEX(GROUP_CONCAT(c.POST ORDER BY c.audit_time_last desc),',',1) POST
,SUBSTRING_INDEX(GROUP_CONCAT(c.TRY_PERIOD ORDER BY c.audit_time_last desc),',',1) TRY_PERIOD
from t_employee_contract_info c where c.IN_USE='0' and c.delete_flag = '0' and c.audit_status = '2' GROUP BY c.EMP_IDCARD,c.DEPT_NO
) eci on p.EMP_IDCARD=eci.EMP_IDCARD and p.dept_no=eci.dept_no
left join t_employee_info e on p.EMP_ID=e.id
left join view_sys_dict_item emp_natrue on emp_natrue.value=e.EMP_NATRUE and emp_natrue.type='emp_natrue'
left join view_sys_dict_item educationEmp on educationEmp.value=e.HIGN_EDUCATION and educationEmp.type='education'
left join view_sys_dict_item emp_married on emp_married.value=e.EMP_MARRI_STATUS and emp_married.type='emp_married'
left join view_sys_dict_item nation on nation.value=e.EMP_NATIONAL and nation.type='emp_national'
left join view_sys_dict_item registype on registype.value=e.EMP_REGIS_TYPE and registype.type='emp_registype'
left join view_sys_dict_item politicalStatus on politicalStatus.value=e.POLITICAL_STATUS and politicalStatus.type='emp_political'
left join sys_area pi on pi.id=e.ID_PROVINCE
left join sys_area ci on ci.id=e.ID_CITY
left join sys_area ti on ti.id=e.ID_TOWN
left join sys_area pf on pf.id=e.FILE_PROVINCE
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join view_sys_dict_item workingHours on workingHours.value=eci.WORKING_HOURS and workingHours.type='working_hours'
left join t_emp_contact_info ec on e.id=ec.EMP_ID
left join t_emp_education ee on e.id=ee.EMP_ID and ee.DELETE_FLAG = '0'
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_emp_disability_info ed on e.id=ed.EMP_ID and ed.DELETE_FLAG = '0'
left join t_emp_bad_record eb on e.id=eb.EMP_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_UNIT ORDER BY ee.create_time desc),',',1) WORK_UNIT
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_JOB ORDER BY ee.create_time desc),',',1) WORK_JOB
,SUBSTRING_INDEX(GROUP_CONCAT(ee.START_DATE ORDER BY ee.create_time desc),',',1) START_DATE
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
from t_emp_work_recording ee
GROUP BY ee.EMP_ID
) ew on e.id=ew.EMP_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.FAMILY_NAME ORDER BY ee.create_time desc),',',1) FAMILY_NAME
,SUBSTRING_INDEX(GROUP_CONCAT(ee.RELATIONSHIP_SELF ORDER BY ee.create_time desc),',',1) RELATIONSHIP_SELF
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
from t_emp_family ee
GROUP BY ee.EMP_ID
) ef on e.id=ef.EMP_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.DECLARE_YEAR ORDER BY ee.create_time desc),',',1) DECLARE_YEAR
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
from t_emp_professional_qualification ee
GROUP BY ee.EMP_ID
) ep on e.id=ep.EMP_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</if>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_work_recording ew on e.id=ew.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ew.id is not null and ew.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--导出统计list1主要工作经历-->
<select id="getTEmpMainAllListOneWork" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
e.emp_idcard field6
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_work_recording ew on e.id=ew.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ew.id is not null and ew.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</if>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_family ef on e.id=ef.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--导出统计list2主要家庭成员信息-->
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
e.emp_idcard field6
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_family ef on e.id=ef.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</if>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_professional_qualification ep on e.id=ep.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ep.id is not null and ep.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--导出统计list3职业资格信息-->
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
e.emp_idcard field6
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_professional_qualification ep on e.id=ep.EMP_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ep.id is not null and ep.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</if>
</select>
</mapper>
......@@ -45,6 +45,6 @@
</resultMap>
<delete id="deleteByEmpId">
delete from #{tableName} where EMP_ID = #{empId}
delete from t_emp_family where EMP_ID = #{empId}
</delete>
</mapper>
......@@ -36,13 +36,17 @@
<result property="assessmentUnit" column="ASSESSMENT_UNIT"/>
<result property="declareYear" column="DECLARE_YEAR"/>
<result property="heightIdentification" column="HEIGHT_IDENTIFICATION"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="remark" column="REMARK"/>
<result property="remark" column="REMARK"/>
</resultMap>
<!--删除-->
<delete id="deleteProfessionalByEmpId">
delete from t_emp_professional_qualification where EMP_ID = #{empId}
</delete>
</mapper>
......@@ -46,4 +46,8 @@
<result property="remark" column="REMARK"/>
</resultMap>
<delete id="deleteWorkRecordByEmpId">
delete from t_pre_emp_work_recording where EMP_ID = #{empId}
</delete>
</mapper>
......@@ -123,10 +123,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_bad_record a
<where>
1=1
<include refid="tPreEmpBadRecord_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
......@@ -26,6 +26,7 @@
<resultMap id="tPreEmpContactInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpContactInfo">
<id property="id" column="ID"/>
<result property="preMainId" column="PRE_MAIN_ID"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="relationType" column="RELATION_TYPE"/>
......@@ -41,6 +42,7 @@
<sql id="Base_Column_List">
a.ID,
a.PRE_MAIN_ID,
a.EMP_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.RELATION_TYPE,
......@@ -95,10 +97,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_contact_info a
<where>
1=1
<include refid="tPreEmpContactInfo_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
......@@ -148,10 +148,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_disability_info a
<where>
1=1
<include refid="tPreEmpDisabilityInfo_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
......@@ -163,10 +163,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_education a
<where>
1=1
<include refid="tPreEmpEducation_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
......@@ -133,9 +133,11 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_family a
<where>
1=1
<include refid="tPreEmpFamily_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
</select>
<delete id="deleteFamilyByMainId">
delete from t_pre_emp_family where PRE_MAIN_ID = #{preMainId}
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.yifu.archives.mapper.TPreEmpMainLogMapper">
<resultMap id="tPreEmpMainLogMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMainLog">
<id property="id" column="id"/>
<result property="mainId" column="main_id"/>
<result property="auditId" column="audit_id"/>
<result property="auditName" column="audit_name"/>
<result property="auditTime" column="audit_time"/>
<result property="auditResult" column="audit_result"/>
<result property="auditRemark" column="audit_remark"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.main_id,
a.audit_id,
a.audit_name,
a.audit_time,
a.audit_result,
a.audit_remark
</sql>
<sql id="tPreEmpMainLog_where">
<if test="tPreEmpMainLog != null">
<if test="tPreEmpMainLog.id != null and tPreEmpMainLog.id.trim() != ''">
AND a.id = #{tPreEmpMainLog.id}
</if>
<if test="tPreEmpMainLog.mainId != null and tPreEmpMainLog.mainId.trim() != ''">
AND a.main_id = #{tPreEmpMainLog.mainId}
</if>
<if test="tPreEmpMainLog.auditId != null and tPreEmpMainLog.auditId.trim() != ''">
AND a.audit_id = #{tPreEmpMainLog.auditId}
</if>
<if test="tPreEmpMainLog.auditName != null and tPreEmpMainLog.auditName.trim() != ''">
AND a.audit_name = #{tPreEmpMainLog.auditName}
</if>
<if test="tPreEmpMainLog.auditTime != null">
AND a.audit_time = #{tPreEmpMainLog.auditTime}
</if>
<if test="tPreEmpMainLog.auditResult != null and tPreEmpMainLog.auditResult.trim() != ''">
AND a.audit_result = #{tPreEmpMainLog.auditResult}
</if>
<if test="tPreEmpMainLog.auditRemark != null and tPreEmpMainLog.auditRemark.trim() != ''">
AND a.audit_remark = #{tPreEmpMainLog.auditRemark}
</if>
</if>
</sql>
<!--list-->
<select id="getTPreEmpMainLogList" resultMap="tPreEmpMainLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_main_log a
where main_id = #{mainIid}
</select>
</mapper>
......@@ -40,6 +40,7 @@
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
<result property="businessType" column="BUSINESS_TYPE"/>
<result property="empNatrue" column="EMP_NATRUE"/>
<result property="auditId" column="AUDIT_ID"/>
<result property="auditName" column="AUDIT_NAME"/>
......@@ -69,6 +70,7 @@
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
concat(a.BUSINESS_PRIMARY_TYPE,'-',ifnull(a.BUSINESS_SECOND_TYPE,''),'-',ifnull(a.BUSINESS_THIRD_TYPE,'')) BUSINESS_TYPE,
a.EMP_NATRUE,
a.AUDIT_ID,
a.AUDIT_NAME,
......@@ -86,17 +88,30 @@
<if test="tPreEmpMain.id != null and tPreEmpMain.id.trim() != ''">
AND a.ID = #{tPreEmpMain.id}
</if>
<if test="tPreEmpMain.ids != null and tPreEmpMain.ids.length > 0">
AND a.ID in
<foreach item="idStr" index="index" collection="tPreEmpMain.ids" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tPreEmpMain.status != null and tPreEmpMain.status.trim() != ''">
AND a.STATUS = #{tPreEmpMain.status}
</if>
<if test="tPreEmpMain.statusArray != null and tPreEmpMain.statusArray.length > 0">
AND a.STATUS in
<foreach item="idStr" index="index" collection="tPreEmpMain.statusArray" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tPreEmpMain.empId != null and tPreEmpMain.empId.trim() != ''">
AND a.EMP_ID = #{tPreEmpMain.empId}
</if>
<if test="tPreEmpMain.empName != null and tPreEmpMain.empName.trim() != ''">
AND a.EMP_NAME = #{tPreEmpMain.empName}
AND a.EMP_NAME like concat('%',#{tPreEmpMain.empName},'%')
</if>
<if test="tPreEmpMain.empIdcard != null and tPreEmpMain.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tPreEmpMain.empIdcard}
AND a.EMP_IDCARD like concat('%',#{tPreEmpMain.empIdcard},'%')
</if>
<if test="tPreEmpMain.empPhone != null and tPreEmpMain.empPhone.trim() != ''">
AND a.EMP_PHONE = #{tPreEmpMain.empPhone}
......@@ -108,7 +123,7 @@
AND a.UNIT_ID = #{tPreEmpMain.unitId}
</if>
<if test="tPreEmpMain.unitName != null and tPreEmpMain.unitName.trim() != ''">
AND a.UNIT_NAME = #{tPreEmpMain.unitName}
AND a.UNIT_NAME like concat('%',#{tPreEmpMain.unitName},'%')
</if>
<if test="tPreEmpMain.unitNo != null and tPreEmpMain.unitNo.trim() != ''">
AND a.UNIT_NO = #{tPreEmpMain.unitNo}
......@@ -117,23 +132,29 @@
AND a.DEPT_ID = #{tPreEmpMain.deptId}
</if>
<if test="tPreEmpMain.deptName != null and tPreEmpMain.deptName.trim() != ''">
AND a.DEPT_NAME = #{tPreEmpMain.deptName}
AND a.DEPT_NAME like concat('%',#{tPreEmpMain.deptName},'%')
</if>
<if test="tPreEmpMain.deptNo != null and tPreEmpMain.deptNo.trim() != ''">
AND a.DEPT_NO = #{tPreEmpMain.deptNo}
</if>
<if test="tPreEmpMain.businessPrimaryType != null and tPreEmpMain.businessPrimaryType.trim() != ''">
AND a.BUSINESS_PRIMARY_TYPE = #{tPreEmpMain.businessPrimaryType}
AND a.BUSINESS_PRIMARY_TYPE like concat('%',#{tPreEmpMain.businessPrimaryType},'%')
</if>
<if test="tPreEmpMain.businessSecondType != null and tPreEmpMain.businessSecondType.trim() != ''">
AND a.BUSINESS_SECOND_TYPE = #{tPreEmpMain.businessSecondType}
AND a.BUSINESS_SECOND_TYPE like concat('%',#{tPreEmpMain.businessSecondType},'%')
</if>
<if test="tPreEmpMain.businessThirdType != null and tPreEmpMain.businessThirdType.trim() != ''">
AND a.BUSINESS_THIRD_TYPE = #{tPreEmpMain.businessThirdType}
AND a.BUSINESS_THIRD_TYPE like concat('%',#{tPreEmpMain.businessThirdType},'%')
</if>
<if test="tPreEmpMain.empNatrue != null and tPreEmpMain.empNatrue.trim() != ''">
AND a.EMP_NATRUE = #{tPreEmpMain.empNatrue}
</if>
<if test="tPreEmpMain.empNatureArray != null and tPreEmpMain.empNatureArray.length > 0">
AND a.EMP_NATRUE in
<foreach item="idStr" index="index" collection="tPreEmpMain.empNatureArray" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tPreEmpMain.auditId != null and tPreEmpMain.auditId.trim() != ''">
AND a.AUDIT_ID = #{tPreEmpMain.auditId}
</if>
......@@ -161,6 +182,12 @@
<if test="tPreEmpMain.settleDomain != null and tPreEmpMain.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tPreEmpMain.settleDomain}
</if>
<if test="tPreEmpMain.createTimeStart != null">
AND a.CREATE_TIME >= #{tPreEmpMain.createTimeStart}
</if>
<if test="tPreEmpMain.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tPreEmpMain.createTimeEnd}
</if>
</if>
</sql>
<!--tPreEmpMain简单分页查询-->
......@@ -178,6 +205,284 @@
</if>
</where>
</select>
<select id="getTPreEmpMainCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_pre_emp_main a
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
</select>
<!--list-->
<select id="getTPreEmpMainList" resultMap="tPreEmpMainMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_main a
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</where>
</select>
<select id="getTPreEmpMainAllCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
left join view_sys_dict_item emp_married on emp_married.value=e.EMP_MARRI_STATUS and emp_married.type='emp_married'
left join view_sys_dict_item nation on nation.value=e.EMP_NATIONAL and nation.type='emp_national'
left join view_sys_dict_item registype on registype.value=e.EMP_REGIS_TYPE and registype.type='emp_registype'
left join view_sys_dict_item politicalStatus on politicalStatus.value=e.POLITICAL_STATUS and politicalStatus.type='emp_political'
left join sys_area pi on pi.id=e.ID_PROVINCE
left join sys_area ci on ci.id=e.ID_CITY
left join sys_area ti on ti.id=e.ID_TOWN
left join sys_area pf on pf.id=e.FILE_PROVINCE
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='employee_contract_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
</select>
<!--list-->
<select id="getTPreEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
case a.STATUS when '0' then '草稿' when '1' then '待完善' when '2' then '待审核' when '3' then '审核不通过' when '4' then '审核通过' else '-' end field1
,DATE_FORMAT(a.create_time,'%Y-%m-%d') field2,e.EMP_CODE field3,emp_natrue.label field4,a.emp_name field5,a.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,politicalStatus.label field15,e.EMP_PHONE field16,e.EMP_EMAIL field17
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.status=0,'草稿','已审核') field21
,e.CONTACT_ADDRESS field22,p.UNIT_NAME field23,p.DEPT_NAME field24
,concat(p.BUSINESS_PRIMARY_TYPE,'-',ifnull(p.BUSINESS_SECOND_TYPE,''),'-',ifnull(p.BUSINESS_THIRD_TYPE,'')) field25
,contractType.label field26 ,workingHours.label field27,p.POST field28,p.ENJOIN_DATE field29
,p.TRY_PERIOD field30,p.EMP_LABEL field31
,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35
,ee.SCHOOL field36,ee.MAJOR field37,education.label field38,if(e.IS_COLLEGE=0,'否','是') field39
,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56
,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
left join view_sys_dict_item educationEmp on educationEmp.value=e.HIGN_EDUCATION and educationEmp.type='education'
left join view_sys_dict_item emp_married on emp_married.value=e.EMP_MARRI_STATUS and emp_married.type='emp_married'
left join view_sys_dict_item nation on nation.value=e.EMP_NATIONAL and nation.type='emp_national'
left join view_sys_dict_item registype on registype.value=e.EMP_REGIS_TYPE and registype.type='emp_registype'
left join view_sys_dict_item politicalStatus on politicalStatus.value=e.POLITICAL_STATUS and politicalStatus.type='emp_political'
left join sys_area pi on pi.id=e.ID_PROVINCE
left join sys_area ci on ci.id=e.ID_CITY
left join sys_area ti on ti.id=e.ID_TOWN
left join sys_area pf on pf.id=e.FILE_PROVINCE
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='employee_contract_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_UNIT ORDER BY ee.create_time desc),',',1) WORK_UNIT
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_JOB ORDER BY ee.create_time desc),',',1) WORK_JOB
,SUBSTRING_INDEX(GROUP_CONCAT(ee.START_DATE ORDER BY ee.create_time desc),',',1) START_DATE
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
from t_pre_emp_work_recording ee
GROUP BY ee.PRE_MAIN_ID
) ew on e.id=ew.PRE_MAIN_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.FAMILY_NAME ORDER BY ee.create_time desc),',',1) FAMILY_NAME
,SUBSTRING_INDEX(GROUP_CONCAT(ee.RELATIONSHIP_SELF ORDER BY ee.create_time desc),',',1) RELATIONSHIP_SELF
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
from t_pre_emp_family ee
GROUP BY ee.PRE_MAIN_ID
) ef on e.id=ef.PRE_MAIN_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.DECLARE_YEAR ORDER BY ee.create_time desc),',',1) DECLARE_YEAR
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
from t_pre_emp_professional_qualification ee
GROUP BY ee.PRE_MAIN_ID
) ep on e.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</where>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_work_recording ew on e.id=ew.EMP_ID
<where>
a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
</select>
<!--导出统计list1主要工作经历-->
<select id="getTEmpMainAllListOneWork" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
e.emp_idcard field6
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_work_recording ew on e.id=ew.EMP_ID
<where>
a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_family ef on e.id=ef.EMP_ID
<where>
a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
</select>
<!--导出统计list2主要家庭成员信息-->
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
e.emp_idcard field6
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_family ef on e.id=ef.EMP_ID
<where>
a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<!-- 数量 -->
<select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on e.id=ep.EMP_ID
<where>
a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
</select>
<!--导出统计list3职业资格信息-->
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
e.emp_idcard field6
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on e.id=ep.EMP_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where>
a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
)
<include refid="tPreEmpMain_where"/>
</where>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<!--tPreEmpMain简单分页查询-->
<select id="getTPreEmpMainByCardAndDept" resultMap="tPreEmpMainMap">
SELECT
......
......@@ -143,9 +143,11 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_professional_qualification a
<where>
1=1
<include refid="tPreEmpProfessionalQualification_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
</select>
<delete id="deleteProfessionalByMainId">
delete from t_pre_emp_professional_qualification where PRE_MAIN_ID = #{preMainId}
</delete>
</mapper>
......@@ -143,9 +143,11 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_work_recording a
<where>
1=1
<include refid="tPreEmpWorkRecording_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
</select>
<delete id="deleteByMainId">
delete from t_pre_emp_work_recording where PRE_MAIN_ID = #{preMainId}
</delete>
</mapper>
......@@ -297,10 +297,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_employee_info a
<where>
1=1
<include refid="tPreEmployeeInfo_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
......@@ -288,10 +288,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_employee_project a
<where>
1=1
<include refid="tPreEmployeeProject_where"/>
</where>
where PRE_MAIN_ID = #{preMainId}
limit 1
</select>
</mapper>
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* C端预入职校验身份证与手机号限定调用表
*
* @author hgw
* @date 2024-06-27 14:33:06
*/
@Data
@TableName("t_pre_emp_check_num")
@Schema(description = "C端预入职校验身份证与手机号限定调用表")
public class TPreEmpCheckNum implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 创建日
*/
@ExcelAttribute(name = "创建日", isNotEmpty = true, errorInfo = "创建日不能为空", maxLength = 8)
@NotBlank(message = "创建日不能为空")
@Length(max = 8, message = "创建日不能超过8个字符")
@ExcelProperty("创建日")
@Schema(description = "创建日")
private String createDay;
/**
* 项目id
*/
@ExcelAttribute(name = "项目id", isNotEmpty = true, errorInfo = "项目id不能为空", maxLength = 32)
@NotBlank(message = "项目id不能为空")
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("项目id")
@Schema(description = "项目id")
private String deptId;
/**
* 当日调用API总条数
*/
@ExcelAttribute(name = "当日调用API总条数", isNotEmpty = true, errorInfo = "当日调用API总条数不能为空")
@NotBlank(message = "当日调用API总条数不能为空")
@ExcelProperty("当日调用API总条数")
@Schema(description = "当日调用API总条数")
private Integer apiNum;
/**
* 当日允许调用API总条数
*/
@ExcelAttribute(name = "当日允许调用API总条数", isNotEmpty = true, errorInfo = "当日允许调用API总条数不能为空")
@NotBlank(message = "当日允许调用API总条数不能为空")
@ExcelProperty("当日允许调用API总条数")
@Schema(description = "当日允许调用API总条数")
private Integer canApiNum;
}
......@@ -179,6 +179,19 @@ public class TCheckIdCardController {
return tCheckIdCardService.checkSalaryIdCard(checkList);
}
/**
* @Description: C端预入职校验姓名身份证
* @Author: hgw
* @Date: 2024-6-27 15:49:32
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation(description = "C端预入职校验姓名身份证")
@SysLog("C端预入职校验姓名身份证")
@GetMapping("/checkPreEmpIdCard")
public R<String> checkPreEmpIdCard(@RequestParam String idCard, @RequestParam String name, @RequestParam String deptId) {
return tCheckIdCardService.checkPreEmpIdCard(idCard, name, deptId);
}
/**
* @Description: 批量校验姓名身份证
* @Author: hgw
......
......@@ -184,4 +184,18 @@ public class TCheckMobileController {
public CheckBatchVo checkMobileBatchs(@RequestBody List<String> list) {
return tCheckMobileService.checkMobileBatch(list);
}
/**
* @Description: C端预入职校验手机号
* @Author: hgw
* @Date: 2024-6-27 15:49:32
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation(description = "C端预入职校验手机号")
@SysLog("C端预入职校验手机号")
@GetMapping("/checkPrePhone")
public R<String> checkPrePhone(@RequestParam String phone, @RequestParam String deptId) {
return tCheckMobileService.checkPrePhone(phone, deptId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.check.entity.TPreEmpCheckNum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* C端预入职校验身份证与手机号限定调用表
*
* @author hgw
* @date 2024-06-27 14:33:06
*/
@Mapper
public interface TPreEmpCheckNumMapper extends BaseMapper<TPreEmpCheckNum> {
/**
* C端预入职校验身份证与手机号限定调用表简单查询
* @return
*/
TPreEmpCheckNum getTPreEmpCheckNum(@Param("deptId") String deptId, @Param("createDay") String createDay);
}
......@@ -48,4 +48,12 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> {
TCheckIdCard checkIdCardSingle(TCheckIdCard tCheckIdCard);
R<List<TCheckIdCard>> checkSalaryIdCard(List<TCheckIdCard> checkList);
/**
* @Description: C端预入职校验
* @Author: hgw
* @Date: 2024/6/27 14:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.check.entity.TCheckIdCard>
**/
R<String> checkPreEmpIdCard(String idCard, String name, String deptId);
}
......@@ -44,4 +44,13 @@ public interface TCheckMobileService extends IService<TCheckMobile> {
* @return: com.yifu.cloud.plus.v1.check.vo.CheckBatchVo
**/
CheckBatchVo checkMobileBatch(List<String> list);
/**
* @Description: C端预入职校验手机号使用,其他慎用
* @Author: hgw
* @Date: 2024/6/27 16:04
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> checkPrePhone(String phone, String deptId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.check.entity.TPreEmpCheckNum;
/**
* C端预入职校验身份证与手机号限定调用表
*
* @author hgw
* @date 2024-06-27 14:33:06
*/
public interface TPreEmpCheckNumService extends IService<TPreEmpCheckNum> {
/**
* C端预入职校验身份证与手机号限定调用表简单分页查询
*
* @return
*/
TPreEmpCheckNum getTPreEmpCheckNum(String deptId, String createDay);
}
......@@ -4,15 +4,9 @@ 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.check.entity.TCanCheck;
import com.yifu.cloud.plus.v1.check.entity.TCheckApiNum;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckLock;
import com.yifu.cloud.plus.v1.check.entity.*;
import com.yifu.cloud.plus.v1.check.mapper.TCheckIdCardMapper;
import com.yifu.cloud.plus.v1.check.service.TCanCheckService;
import com.yifu.cloud.plus.v1.check.service.TCheckApiNumService;
import com.yifu.cloud.plus.v1.check.service.TCheckIdCardService;
import com.yifu.cloud.plus.v1.check.service.TCheckLockService;
import com.yifu.cloud.plus.v1.check.service.*;
import com.yifu.cloud.plus.v1.check.utils.ChecksUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -43,6 +37,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
private final TCheckLockService tCheckLockService;
private final TCheckApiNumService tCheckApiNumService;
private final TPreEmpCheckNumService tPreEmpCheckNumService;
private final TCanCheckService canCheckService;
......@@ -326,6 +321,114 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
return returnMap;
}
@Override
public R<String> checkPreEmpIdCard(String idCard, String name, String deptId) {
TCanCheck tCanCheck= canCheckService.getById(1);
boolean canCheck = false;
String nowDay = DateUtil.getThisDay();
if (tCanCheck != null && tCanCheck.getCanCheck() == 1) {
canCheck = true;
TPreEmpCheckNum nowDayNum = tPreEmpCheckNumService.getTPreEmpCheckNum(deptId, nowDay);
if (nowDayNum == null) {
nowDayNum = new TPreEmpCheckNum();
nowDayNum.setCreateDay(nowDay);
nowDayNum.setDeptId(deptId);
nowDayNum.setCanApiNum(1000);
nowDayNum.setApiNum(1);
tPreEmpCheckNumService.save(nowDayNum);
} else {
if (nowDayNum.getApiNum() >= nowDayNum.getCanApiNum()) {
return R.failed("该项目当日总条数:" + nowDayNum.getCanApiNum() + "已到达上限!");
} else {
nowDayNum.setApiNum(nowDayNum.getApiNum() + 1);
tPreEmpCheckNumService.updateById(nowDayNum);
}
}
}
String nowMonth = DateUtil.addMonth(0);
TCheckApiNum nowMonthNum = tCheckApiNumService.getById(nowMonth);
int nowApiNum = tCheckLockService.getApiNumByMonth(nowMonth);
if (nowMonthNum == null) {
TCheckApiNum lastMonth = tCheckApiNumService.getById(DateUtil.addMonth(-1));
int canApiNum = 10000;
if (lastMonth != null && lastMonth.getCanApiNum() != null) {
canApiNum = lastMonth.getCanApiNum();
}
nowMonthNum = new TCheckApiNum();
nowMonthNum.setId(nowMonth);
nowMonthNum.setCanApiNum(canApiNum);
nowMonthNum.setApiNum(0);
tCheckApiNumService.save(nowMonthNum);
} else if (nowApiNum >= nowMonthNum.getCanApiNum()) {
return R.failed("当月总条数:" + nowMonthNum.getCanApiNum() + "已到达上限!");
}
int canApiNum = nowMonthNum.getCanApiNum();
List<String> idCardList = new ArrayList<>();
idCardList.add(idCard);
// 全部(身份证_姓名)
Map<String, TCheckIdCard> returnMap = this.getAllMapByList(idCardList);
// 正确的身份证
Map<String, TCheckIdCard> trueMap = this.getTrueMapByList(idCardList);
TCheckIdCard nowIdCard;
String userId = "1";
try {
if (Common.isNotNull(idCard) && Common.isNotNull(name)) {
nowIdCard = returnMap.get(idCard + CommonConstants.DOWN_LINE_STRING + name);
if (nowIdCard != null && Common.isNotNull(nowIdCard.getIsTrue())) {
if (CommonConstants.ONE_INT == nowIdCard.getIsTrue()) {
return R.ok();
} else {
return R.failed(nowIdCard.getReason());
}
} else {
// 调用对的身份证信息
nowIdCard = trueMap.get(idCard);
if (nowIdCard != null) {
if (nowIdCard.getName().equals(name)) {
return R.ok();
} else {
return R.failed("姓名错误!!");
}
} else {
// 校验姓名身份证规则
if (!regIdCard(idCard)) {
return R.failed("身份证格式有误");
} else if (regEmpName(name)) {
return R.failed("姓名含数字或空格,无法校验");
} else {
// 调用API校验
if (nowApiNum < canApiNum) {
TCheckIdCard c = new TCheckIdCard();
c.setName(name);
c.setIdCard(idCard);
// 安全调用:
this.doSafetyApi(c, canCheck, userId);
if (CommonConstants.ONE_INT == c.getIsTrue()) {
return R.ok();
} else {
return R.failed(c.getReason());
}
} else {
return R.failed("调用创蓝的Api的条数已达上限:" + canApiNum + ",请联系管理员处理!");
}
}
}
}
} else {
return R.failed("姓名身份证不可为空!");
}
} catch (Exception e) {
returnMap.clear();
trueMap.clear();
throw new RuntimeException(e.getMessage() == null ? "校验身份证失败!" : "校验身份证失败:" + e.getMessage());
} finally {
returnMap.clear();
trueMap.clear();
}
}
@Override
public R<List<TCheckIdCard>> checkSalaryIdCard(List<TCheckIdCard> checkList) {
TCanCheck tCanCheck= canCheckService.getById(1);
......
......@@ -18,15 +18,19 @@ package com.yifu.cloud.plus.v1.check.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCanCheck;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.check.entity.TPreEmpCheckNum;
import com.yifu.cloud.plus.v1.check.mapper.TCheckMobileMapper;
import com.yifu.cloud.plus.v1.check.service.TCanCheckService;
import com.yifu.cloud.plus.v1.check.service.TCheckMobileService;
import com.yifu.cloud.plus.v1.check.service.TPreEmpCheckNumService;
import com.yifu.cloud.plus.v1.check.utils.ChecksUtil;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
......@@ -49,6 +53,7 @@ import java.util.stream.Collectors;
public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCheckMobile> implements TCheckMobileService {
private final TCanCheckService canCheckService;
private final TPreEmpCheckNumService tPreEmpCheckNumService;
/**
* @Author fxj 待完善
......@@ -199,6 +204,52 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
checkMobiles(tempList, vo, noMap, noCurlist, backMap);
return vo;
}
@Override
public R<String> checkPrePhone(String phone, String deptId) {
TCanCheck tCanCheck= canCheckService.getById(1);
boolean canCheck = false;
String nowDay = DateUtil.getThisDay();
if (tCanCheck != null && tCanCheck.getCanCheck() == 1) {
canCheck = true;
TPreEmpCheckNum nowDayNum = tPreEmpCheckNumService.getTPreEmpCheckNum(deptId, nowDay);
if (nowDayNum == null) {
nowDayNum = new TPreEmpCheckNum();
nowDayNum.setCreateDay(nowDay);
nowDayNum.setDeptId(deptId);
nowDayNum.setCanApiNum(1000);
nowDayNum.setApiNum(1);
tPreEmpCheckNumService.save(nowDayNum);
} else {
if (nowDayNum.getApiNum() >= nowDayNum.getCanApiNum()) {
return R.failed("该项目当日总条数:" + nowDayNum.getCanApiNum() + "已到达上限!");
} else {
nowDayNum.setApiNum(nowDayNum.getApiNum() + 1);
tPreEmpCheckNumService.updateById(nowDayNum);
}
}
}
synchronized (this) {
R<Map<String, TCheckMobile>> mobileMapR = ChecksUtil.checkMobile(phone, canCheck);
if (Common.isNotNull(mobileMapR) && Common.isNotNull(mobileMapR.getData())) {
Map<String, TCheckMobile> result = mobileMapR.getData();
TCheckMobile mo = result.get(phone);
if (mo != null) {
this.saveOrUpdate(mo);
if (Common.isNotNull(mo.getStatus()) &&
(CommonConstants.ONE_STRING.equals(mo.getStatus())
|| CommonConstants.FOUR_STRING.equals(mo.getStatus())
|| CommonConstants.FIVE_STRING.equals(mo.getStatus()))) {
return R.ok();
} else {
return R.failed(Common.isNotNull(mo.getMessage()) ? mo.getMessage() : "校验错误!");
}
} else {
return R.failed("校验失败");
}
}
}
return R.failed("校验失败!");
}
private void checkMobiles(List<String> list,
CheckBatchVo vo,
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TPreEmpCheckNum;
import com.yifu.cloud.plus.v1.check.mapper.TPreEmpCheckNumMapper;
import com.yifu.cloud.plus.v1.check.service.TPreEmpCheckNumService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* C端预入职校验身份证与手机号限定调用表
*
* @author hgw
* @date 2024-06-27 14:33:06
*/
@Log4j2
@Service
public class TPreEmpCheckNumServiceImpl extends ServiceImpl<TPreEmpCheckNumMapper, TPreEmpCheckNum> implements TPreEmpCheckNumService {
/**
* C端预入职校验身份证与手机号限定调用表简单分页查询
*
* @return
*/
@Override
public TPreEmpCheckNum getTPreEmpCheckNum(String deptId, String createDay) {
return baseMapper.getTPreEmpCheckNum(deptId, createDay);
}
}
......@@ -16,18 +16,6 @@ spring:
password: yf_zsk
url: jdbc:mysql://192.168.1.65:43306/yifu_checks?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
- /checkBankNo/**
# 创蓝云智校验配置
canCheck: true
\ No newline at end of file
......@@ -17,18 +17,5 @@ spring:
password: yf_zsk
url: jdbc:mysql://192.168.0.222:22306/yifu_checks?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
- /checkBankNo/**
# 创蓝云智校验配置
canCheck: true
\ No newline at end of file
......@@ -28,17 +28,4 @@ spring:
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)此属性控制允许连接在池中处于空闲状态的最长时间
maximum-pool-size: 20 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 1800000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
\ No newline at end of file
max-lifetime: 1800000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
\ No newline at end of file
......@@ -27,6 +27,26 @@ mybatis-plus:
configuration:
map-underscore-to-camel-case: true
# spring security 配置
security:
#client:
# client-id: pig
# client-secret: pig
# scope: server
oauth2:
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
ignore: # 通用放行URL,服务个性化,请在对应配置文件覆盖
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
- /checkBankNo/**
- /tcheckidcard/checkPreEmpIdCard
- /tcheckmobile/checkPrePhone
spring:
application:
name: @artifactId@
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.check.mapper.TPreEmpCheckNumMapper">
<resultMap id="tPreEmpCheckNumMap" type="com.yifu.cloud.plus.v1.check.entity.TPreEmpCheckNum">
<id property="id" column="ID"/>
<result property="createDay" column="CREATE_DAY"/>
<result property="deptId" column="DEPT_ID"/>
<result property="apiNum" column="API_NUM"/>
<result property="canApiNum" column="CAN_API_NUM"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.CREATE_DAY,
a.DEPT_ID,
a.API_NUM,
a.CAN_API_NUM
</sql>
<!--tPreEmpCheckNum简单分页查询-->
<select id="getTPreEmpCheckNum" resultMap="tPreEmpCheckNumMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_check_num a
where a.DEPT_ID = #{deptId} and a.CREATE_DAY = #{createDay} limit 1
</select>
</mapper>
......@@ -70,10 +70,10 @@ public class ArchiveTask {
}
public void everyDayCreateComlpeteMonitor() {
log.info("-------------每刷新档案完整监控数据------------");
log.info("-------------每刷新档案完整监控数据------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/tcompletemonitor/inner/createComlpeteMonitor", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每刷新档案完整监控数据-定时任务开始------------");
log.info("-------------每刷新档案完整监控数据-定时任务开始------------");
}
}
\ No newline at end of file
......@@ -125,4 +125,16 @@ public class SocialSoldierYgsAddVo implements Serializable {
private Date graduationTime;
@ExcelProperty(value = "首次至缴纳地时间")
private Date firstPayTime;
// 是否自动提交【社保减员&增员&批量减员&批量增员】 是否自动补充信息【社保增员】 是否上传附件材料【社保减员&增员&批量减员&批量增员】 提示已缴费是否继续申报【社保增员】 是否尝试单条操作【社保批量减员】
@ExcelProperty("是否自动提交【社保减员&增员&批量减员&批量增员】")
private String isAutoSubmit;
@ExcelProperty("是否自动补充信息【社保增员】")
private String isAutoInsert;
@ExcelProperty("是否上传附件材料【社保减员&增员&批量减员&批量增员】")
private String isAutoUpload;
@ExcelProperty("提示已缴费是否继续申报【社保增员】")
private String isDoShenBao;
@ExcelProperty("是否尝试单条操作【社保批量减员】")
private String isDanShenBao;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author hgw
* @Description 社保士兵医生大增加模板
* @Date 2024-6-28 10:19:34
**/
@Data
public class SocialSoldierYsdAddVo implements Serializable {
// 社保id,用于回写
@ExcelIgnore
private String socialId;
@ExcelProperty("派单类型")
private String type;
@ExcelProperty("社保办理状态")
private String socialHandleStatus;
@ExcelProperty("养老状态")
private String pensionHandle;
@ExcelProperty("医疗状态")
private String medicalHandle;
@ExcelProperty("失业状态")
private String unemployHandle;
@ExcelProperty("工伤状态")
private String workInjuryHandle;
@ExcelProperty("生育状态")
private String birthHandle;
@ExcelProperty("大病状态")
private String bigailmentHandle;
@ExcelProperty("员工姓名")
private String empName;
@ExcelProperty("员工身份证")
private String empIdcard;
@ExcelProperty("学历")
private String educationName;
@ExcelProperty("客户名称")
private String belongUnit;
@ExcelProperty("项目名称")
private String settleDomain;
@ExcelProperty("员工类型")
private String empType;
@ExcelProperty("岗位")
private String post;
@ExcelProperty("手机号码")
private String empMobile;
@ExcelProperty("身份证所在地")
private String idCardAddress;
@ExcelProperty("通信地址")
private String contactAddress;
@ExcelProperty("户口性质")
private String empRegisType;
@ExcelProperty("民族")
private String empNational;
@ExcelProperty("工时制")
private String workingHours;
@ExcelProperty("合同年限")
private String contractTerm;
@ExcelProperty("合同起始时间")
private String contractStart;
@ExcelProperty("合同到期时间")
private String contractEnd;
@ExcelProperty("申请人")
private String createUserName;
@ExcelProperty("备案基数")
private String recordBase;
@ExcelProperty("缴纳类型")
private String paymentType;
@ExcelProperty("社保户")
private String socialHouseholdName;
@ExcelProperty("社保缴纳地-省")
private String socialProvince;
@ExcelProperty("社保缴纳地-市")
private String socialCity;
@ExcelProperty("社保缴纳地-县")
private String socialTown;
@ExcelProperty("养老起缴日期")
private String pensionStart;
;
@ExcelProperty("养老基数")
private BigDecimal unitPensionCardinal;
@ExcelProperty("医疗起缴日期")
private String medicalStart;
@ExcelProperty("医疗基数")
private BigDecimal unitMedicalCardinal;
@ExcelProperty("失业起缴日期")
private String unemployStart;
@ExcelProperty("失业基数")
private BigDecimal unitUnemploymentCardinal;
@ExcelProperty("工伤起缴日期")
private String workInjuryStart;
@ExcelProperty("工伤基数")
private BigDecimal unitWorkInjuryCardinal;
@ExcelProperty("生育起缴日期")
private String birthStart;
@ExcelProperty("生育基数")
private BigDecimal unitBirthCardinal;
@ExcelProperty("大病起缴日期")
private String bigailmentStart;
@ExcelProperty("大病缴纳基数")
private BigDecimal unitBigailmentCardinal;
@ExcelProperty("单位大病金额")
private BigDecimal unitBigailmentMoney;
@ExcelProperty("个人大病金额")
private BigDecimal personalBigailmentMoney;
@ExcelProperty("委托备注")
private String socailTrustRemark;
@ExcelProperty("减少原因")
private String reduceReason;
@ExcelProperty("是否已导出")
private String exportSocialFlag;
@ExcelProperty(value = "学校")
private String schoolName;
@ExcelProperty(value = "专业")
private String major;
@ExcelProperty("毕业时间")
private Date graduationTime;
@ExcelProperty(value = "首次至缴纳地时间")
private Date firstPayTime;
// 是否批量操作【医保减员&医保增员】 是否自动顺延月份申报【医保增员】 是否只新增【医保增员】 是否只续保【医保增员】
@ExcelProperty("是否批量操作【医保减员&医保增员】")
private String isBatch;
@ExcelProperty("是否自动顺延月份申报【医保增员】")
private String isAutoMonth;
@ExcelProperty("是否只新增【医保增员】")
private String isAdd;
@ExcelProperty("是否只续保【医保增员】")
private String isXu;
}
......@@ -192,8 +192,7 @@ public class TSocialSoldierController {
@Operation(description = "获取重新办理结果")
@GetMapping("/getReHandle")
public R<String> getReHandle(@RequestParam String parentId) {
tSocialSoldierService.getReHandle(parentId);
return R.ok("正在执行中,请耐心等待!");
return tSocialSoldierService.getReHandle(parentId);
}
/**
......
......@@ -42,23 +42,23 @@ public interface TSocialSoldierMapper extends BaseMapper<TSocialInfo> {
**/
List<SocialSoldierYgsAddVo> getSocialSoldierYgsAddVoList(@Param("idsStr") List<String> idsStr);
/**
* 社保士兵养工失增加模板
* 社保士兵养工失减少模板
* @Author hgw
* @Date 2024-5-10 21:16:41
**/
List<SocialSoldierYgsAddVo> getSocialSoldierYgsReduceVoList(@Param("idsStr") List<String> idsStr);
/**
* 社保士兵养工失增加模板
* 社保士兵医生大增加模板
* @Author hgw
* @Date 2024-5-10 21:16:41
**/
List<SocialSoldierYgsAddVo> getSocialSoldierYsdAddVoList(@Param("idsStr") List<String> idsStr);
List<SocialSoldierYsdAddVo> getSocialSoldierYsdAddVoList(@Param("idsStr") List<String> idsStr);
/**
* 社保士兵养工失增加模板
* 社保士兵医生大减少模板
* @Author hgw
* @Date 2024-5-10 21:16:41
**/
List<SocialSoldierYgsAddVo> getSocialSoldierYsdReduceVoList(@Param("idsStr") List<String> idsStr);
List<SocialSoldierYsdAddVo> getSocialSoldierYsdReduceVoList(@Param("idsStr") List<String> idsStr);
/**
* 社保士兵养工失审核模板
......
......@@ -105,24 +105,30 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
* @Date: 2024/5/23 17:59
* @return: org.springframework.web.multipart.MultipartFile
**/
public MultipartFile getFile(List<SocialSoldierYgsAddVo> list, int type) {
public MultipartFile getFileYgs(List<SocialSoldierYgsAddVo> list) {
if (list != null) {
String fileName = "soldierFile" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
String fileName = "soldierFileYgs" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
ExcelWriter excelWriter = EasyExcelFactory.write(fileName).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("社保明细").head(SocialSoldierYgsAddVo.class).build();
excelWriter.write(list, writeSheet);
if (type == 2) {
List<SocialSoldierSetVo> setList = new ArrayList<>();
SocialSoldierSetVo vo = new SocialSoldierSetVo();
vo.setIsAutoSubmit("是");
vo.setIsAutoInsert("否");
vo.setIsAutoUpload("否");
vo.setIsDoShenBao("否");
setList.add(vo);
WriteSheet writeSheet2 = EasyExcelFactory.writerSheet("功能设置").head(SocialSoldierSetVo.class).build();
excelWriter.write(setList, writeSheet2);
}
File file = new File(fileName);
excelWriter.finish();
return getMultipartFile(file);
}
return null;
}
/**
* @Description: 组装社保与医保的文件流
* @Author: hgw
* @Date: 2024/5/23 17:59
* @return: org.springframework.web.multipart.MultipartFile
**/
public MultipartFile getFileYsd(List<SocialSoldierYsdAddVo> list) {
if (list != null) {
String fileName = "soldierFileYsd" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
ExcelWriter excelWriter = EasyExcelFactory.write(fileName).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("医保明细").head(SocialSoldierYsdAddVo.class).build();
excelWriter.write(list, writeSheet);
File file = new File(fileName);
excelWriter.finish();
return getMultipartFile(file);
......@@ -169,7 +175,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFile(ygsAddlist, 1);
MultipartFile file = this.getFileYgs(ygsAddlist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "社保增员");
}
......@@ -184,37 +190,37 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFile(ygsReducelist, 2);
MultipartFile file = this.getFileYgs(ygsReducelist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "社保减员");
}
}
// 医生大新增列表
List<SocialSoldierYgsAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
List<SocialSoldierYsdAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYgsAddVo vo : ysdAddlist) {
for (SocialSoldierYsdAddVo vo : ysdAddlist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFile(ysdAddlist, 3);
MultipartFile file = this.getFileYsd(ysdAddlist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "医保增员");
}
}
// 医生大减少列表
List<SocialSoldierYgsAddVo> ysdReducelist = baseMapper.getSocialSoldierYsdReduceVoList(dispatchIdList);
List<SocialSoldierYsdAddVo> ysdReducelist = baseMapper.getSocialSoldierYsdReduceVoList(dispatchIdList);
if (ysdReducelist != null && !ysdReducelist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYgsAddVo vo : ysdReducelist) {
for (SocialSoldierYsdAddVo vo : ysdReducelist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFile(ysdReducelist, 4);
MultipartFile file = this.getFileYsd(ysdReducelist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "医保减员");
}
......
......@@ -94,14 +94,10 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
@Async
public R<String> getReHandle(String parentId) {
TAutoPaymentInfo mainAuto = tAutoPaymentInfoService.getById(parentId);
if (mainAuto == null || Common.isEmpty(mainAuto.getId())) {
return R.failed("未找到主表");
} else {
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
tAutoPaymentInfoService.updateById(mainAuto);
}
// 3:实缴1日常申报导出;4:实缴2单位个人缴费信息查询;5:实缴3单位缴费明细查询
int type = 7;
......@@ -116,18 +112,55 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
String addIdOTwo = null;
String addIdThree = null;
String addIdSix = null;
// 是否已完成,如果已完成重新复核,需要再次推送:
boolean isDone = true;
int taskNum = 0;
if (addIdOneTask != null && Common.isNotNull(addIdOneTask.getId())) {
addIdOne = addIdOneTask.getAddId();
if (Common.isNotNull(addIdOneTask.getDataStatus()) && CommonConstants.ZERO_STRING.equals(addIdOneTask.getDataStatus())) {
isDone = false;
}
if (Common.isNotNull(addIdOne)) {
taskNum++;
}
}
if (addIdTwoTask != null && Common.isNotNull(addIdTwoTask.getId())) {
addIdOTwo = addIdTwoTask.getAddId();
if (Common.isNotNull(addIdTwoTask.getDataStatus()) && CommonConstants.ZERO_STRING.equals(addIdTwoTask.getDataStatus())) {
isDone = false;
}
if (Common.isNotNull(addIdOTwo)) {
taskNum++;
}
}
if (addIdThreeTask != null && Common.isNotNull(addIdThreeTask.getId())) {
addIdThree = addIdThreeTask.getAddId();
if (Common.isNotNull(addIdThreeTask.getDataStatus()) && CommonConstants.ZERO_STRING.equals(addIdThreeTask.getDataStatus())) {
isDone = false;
}
if (Common.isNotNull(addIdThree)) {
taskNum++;
}
}
if (addIdSixTask != null && Common.isNotNull(addIdSixTask.getId())) {
addIdSix = addIdSixTask.getAddId();
if (Common.isNotNull(addIdSixTask.getDataStatus()) && CommonConstants.ZERO_STRING.equals(addIdSixTask.getDataStatus())) {
isDone = false;
}
if (Common.isNotNull(addIdSix)) {
taskNum++;
}
}
if (isDone || taskNum == 0) {
return R.failed("请先推送!");
}
R<String> failed = doReCoreLazy(parentId, mainAuto, addIdOneTask, addIdTwoTask, addIdThreeTask, addIdSixTask, addIdOne, addIdOTwo, addIdThree, addIdSix);
if (failed != null) return failed;
return R.ok("正在执行中,请耐心等待!");
}
@Async
public R<String> doReCoreLazy(String parentId, TAutoPaymentInfo mainAuto, TSocialSoldierShenBaoTask addIdOneTask, TSocialSoldierShenBaoTask addIdTwoTask, TSocialSoldierShenBaoTask addIdThreeTask, TSocialSoldierShenBaoTask addIdSixTask, String addIdOne, String addIdOTwo, String addIdThree, String addIdSix) {
HttpURLConnection conn;
InputStream inRiChang = null;
InputStream inRenYuan = null;
......@@ -141,6 +174,9 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
if (Common.isNotNull(resultFile) || Common.isNotNull(resultFileTwo)
|| Common.isNotNull(resultFileThree) || Common.isNotNull(resultFileFour)) {
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
tAutoPaymentInfoService.updateById(mainAuto);
// 获取需要更新的标记文件:
List<TAutoPaymentDetail> detailList = tAutoPaymentDetailService.getListByParentId(parentId);
if (detailList == null || detailList.isEmpty()) {
......@@ -304,6 +340,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_STRING);
}
tAutoPaymentInfoService.updateById(mainAuto);
return R.ok("成功!");
}
} catch (Exception e) {
e.printStackTrace();
......@@ -328,7 +365,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
} else {
return R.failed("未找到推送任务,请先推送!");
}
return R.ok();
return null;
}
/**
......@@ -1119,7 +1156,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
// 复核使用的
oldDetail = oldMap.get(detailPerson.getCertNum() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getInsuranceType());
+ detailPerson.getInsuranceType() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getPayMonth());
if (oldDetail != null) {
detailPerson.setId(oldDetail.getId());
voList.add(detailPerson);
......
......@@ -593,8 +593,8 @@
a.YGS_ADD_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id is null and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')),0 ,1) YGS_OVER_DUE_FLAG
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
......@@ -614,8 +614,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YSD_ADD_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.MEDICAL_END_DATE) or ( sd.id is null and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')),0 ,1) YSD_OVER_DUE_FLAG
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
......@@ -635,8 +635,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YGS_ADD_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YGS_ADD_ID is not null and d.AUTO_FLAG='0'
......@@ -653,8 +653,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YSD_ADD_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YSD_ADD_ID is not null and d.AUTO_FLAG='0'
......
......@@ -24,7 +24,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierMapper">
<!-- 社保士兵基本查询-->
<sql id="getSocialSoldierBase" >
<sql id="getSocialSoldierBaseOne" >
SELECT
s.id as socialId,
if(a.TYPE='0','派增','派减') type,
......@@ -79,6 +79,11 @@
a.MAJOR major,
a.FIRST_PAY_TIME graduationTime,
a.GRADUATION_TIME firstPayTime
</sql>
<!-- 社保士兵基本查询-->
<sql id="getSocialSoldierBaseTwo" >
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -101,7 +106,9 @@
<!-- 社保士兵养工失增加模板-->
<select id="getSocialSoldierYgsAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo">
<include refid="getSocialSoldierBase"/>
<include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','2','3')
and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '0' or
......@@ -133,7 +140,9 @@
<!-- 社保士兵养工失减少模板-->
<select id="getSocialSoldierYgsReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo">
<include refid="getSocialSoldierBase"/>
<include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','2','3')
and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '5' or
......@@ -145,8 +154,10 @@
</select>
<!-- 社保士兵医生大增加模板-->
<select id="getSocialSoldierYsdAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo">
<include refid="getSocialSoldierBase"/>
<select id="getSocialSoldierYsdAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '0' or
......@@ -158,8 +169,10 @@
</select>
<!-- 社保士兵医生大减少模板-->
<select id="getSocialSoldierYsdReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo">
<include refid="getSocialSoldierBase"/>
<select id="getSocialSoldierYsdReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '5' or
......
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