Commit 4d7fa256 authored by chenyuxi's avatar chenyuxi

feat: 预入职里的批量更新

parent bf4067b2
......@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -97,6 +99,27 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "毕业时间", isDate = true, pattern = "entryDate")
private String gradutionDate;
// 1.9.7:主要工作经历(t_emp_work_recording)
@ExcelAttribute(name = "是否为首份工作", isDataId = true, readConverterExp = "0=否,1=是")
private String isFirstWork;
@ExcelAttribute(name = "工作单位", maxLength = 100)
private String workUnit;
@ExcelAttribute(name = "工作岗位", maxLength = 100)
private String workJob;
@ExcelAttribute(name = "开始工作日期", isDate = true, dateFormat = LocalDateTimeUtils.DATE_TIME_PATTERN_DEFAULT)
private String startDate;
@ExcelAttribute(name = "结束工作日期", isDate = true, pattern = "startDate", dateFormat = LocalDateTimeUtils.DATE_TIME_PATTERN_DEFAULT)
private String endDate;
// 1.9.7:主要家庭成员信息(t_emp_family)
@ExcelAttribute(name = "家庭成员姓名", maxLength = 20)
private String familyName;
@ExcelAttribute(name = "家庭成员与本人关系", isDataId = true,dataType = ExcelAttributeConstants.FAMILY_RELATION, maxLength = 32)
private String relationshipSelf;
@ExcelAttribute(name = "手机号码(家庭成员)", isPhone = true, maxLength = 32)
private String contractTel;
// 紧急联系人
// private TPreEmpContactInfo tpreEmpContactInfo
// 紧急联系人姓名 与本人关系 联系地址-省 联系地址-市 联系地址-区/县 联系地址-详细地址 手机号码(紧急联系人)
......@@ -129,6 +152,37 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "计税月份", isDate = true, dateFormat = "yyyyMM", maxLength = 6)
private String taxMonth;
@ExcelAttribute(name = "是否有不良记录", isDataId = true, readConverterExp = "0=是,1=否")
private String badRecordFlag;
@ExcelAttribute(name = "是否有职业资格证书", isDataId = true, readConverterExp = "0=是,1=否")
private String haveQualification;
// 1.9.7: 职业资格信息
@ExcelAttribute(name = "申报年度", isDate = true, dateFormat = "yyyy", maxLength = 32)
private String declareYear;
@ExcelAttribute(name = "职业资格名称", isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE, maxLength = 32)
private String qualificationType;
// 1.9.7: 伤残信息(t_emp_disability_info)
@ExcelAttribute(name = "是否曾被认定为工伤", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String injuryIdentification;
@ExcelAttribute(name = "是否有职业病", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String occupationalDiseaseFlag;
@ExcelAttribute(name = "职业病名称", maxLength = 50)
private String occupationalDisease;
@ExcelAttribute(name = "是否有传染性疾病", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String infectiousDiseaseFlag;
@ExcelAttribute(name = "传染病名称", maxLength = 50)
private String infectiousName;
@ExcelAttribute(name = "是否被劳动能力鉴定委员会鉴定为具有伤残等级", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String disabilityFlag;
@ExcelAttribute(name = "伤残病名称", maxLength = 50)
private String disabilityName;
@ExcelAttribute(name = "伤残等级",isDataId = true, dataType = ExcelAttributeConstants.DISABILITY_GRADE, maxLength = 32)
private String disabilityLevel;
@ExcelAttribute(name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String otherFlag;
// 字典值起始
@ExcelAttribute(name = "员工类型-值")
private String empNatrueValue;
......@@ -187,11 +241,32 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "身份证截止日期-值")
private Date validityEndValue;
@ExcelAttribute(name = "是否有不良记录", isDataId = true, readConverterExp = "0=是,1=否")
private String badRecordFlag;
@ExcelAttribute(name = "开始工作日期-值")
private LocalDateTime startDateValue;
@ExcelAttribute(name = "结束工作日期-值")
private LocalDateTime endDateValue;
@ExcelAttribute(name = "与本人关系")
private String relationshipSelfValue;
@ExcelAttribute(name = "申报年度")
private String declareYearValue;
@ExcelAttribute(name = "职业资格名称")
private String qualificationTypeValue;
@ExcelAttribute(name = "是否曾被认定为工伤")
private String injuryIdentificationValue;
@ExcelAttribute(name = "是否有职业病")
private String occupationalDiseaseFlagValue;
@ExcelAttribute(name = "是否有传染性疾病")
private String infectiousDiseaseFlagValue;
@ExcelAttribute(name = "是否被劳动能力鉴定委员会鉴定为具有伤残等级")
private String disabilityFlagValue;
@ExcelAttribute(name = "伤残等级")
private String disabilityLevelValue;
@ExcelAttribute(name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String otherFlagValue;
@ExcelAttribute(name = "是否有职业资格证书", isDataId = true, readConverterExp = "0=是,1=否")
private String haveQualification;
// 字典值结束
@TableField(exist = false)
......
......@@ -17,6 +17,7 @@ import java.io.InputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -771,6 +772,9 @@ public class DiyExcelImportUtil implements Serializable {
setStringField(field, cellValueStr, entity);
} else if (Date.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
setDateField(field, cellValueStr, entity);
} else if (LocalDateTime.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
// 1.9.7: 加时间格式转化
setDateTimeField(field, cellValueStr, entity);
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
setIntegerField(field, cellValueStr, entity);
} else {
......@@ -784,6 +788,9 @@ public class DiyExcelImportUtil implements Serializable {
field.set(entity, cellValueStr);
} else if (Date.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
setDateField(field, cellValueStr, entity);
} else if (LocalDateTime.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
// 1.9.7: 加时间格式转化
setDateTimeField(field, cellValueStr, entity);
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
setIntegerField(field, cellValueStr, entity);
} else {
......@@ -817,6 +824,17 @@ public class DiyExcelImportUtil implements Serializable {
field.set(entity, DateUtil.stringDateFormat(cellValueStr.trim(), patten));
}
public static <T> void setDateTimeField(Field field, String cellValueStr, T entity) throws IllegalAccessException {
String patten = DateUtil.ISO_DATE_FORMAT;
if (cellValueStr.contains("-")) {
patten = DateUtil.ISO_EXPANDED_DATE_FORMAT;
} else if (cellValueStr.contains("/")) {
patten = DateUtil.DATETIME_PATTERN_XIEGANG;
}
String pattenTime = patten+" 00:00:00";
field.set(entity, LocalDateTimeUtils.formatTime(cellValueStr.trim(), pattenTime));
}
public static <T> void setIntegerField(Field field, String cellValueStr, T entity) throws IllegalAccessException {
if ("否".equals(cellValueStr)) {
field.set(entity, 0);
......
......@@ -396,18 +396,26 @@
<select id="getAllUserPageWhere" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser">
select u.* from
(SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
and nickname LIKE #{usernameLike}
</if>
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
and phone = #{query.nameOrPhone}
</if>
(
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
and nickname LIKE #{usernameLike}
</if>
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
and username LIKE #{usernameLike}
</if>
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
and phone = #{query.nameOrPhone}
</if>
) u
ORDER BY u.create_time DESC
</select>
......
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