Commit 33c46411 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 7e88f405 a790d468
...@@ -29,8 +29,6 @@ import org.hibernate.validator.constraints.Length; ...@@ -29,8 +29,6 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -47,68 +45,83 @@ public class EmployeeContractExportVO implements Serializable { ...@@ -47,68 +45,83 @@ public class EmployeeContractExportVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Schema(description = "申请编号") @Schema(description = "申请编号")
@ExcelProperty("申请编号")
private String applyNo; private String applyNo;
@ExcelProperty("员工编码")
@Length(max = 32, message = "员工编码不能超过32个字符") @Length(max = 32, message = "员工编码不能超过32个字符")
@ExcelAttribute(name = "员工编码", isNotEmpty = true, errorInfo = "员工编码不能为空", maxLength = 32) @ExcelAttribute(name = "员工编码", isNotEmpty = true, errorInfo = "员工编码不能为空", maxLength = 32)
@Schema(description = "员工编码", name = "empNo") @Schema(description = "员工编码", name = "empNo")
private String empNo; private String empNo;
@ExcelProperty("员工姓名")
@Length(max = 32, message = "员工姓名不能超过32个字符") @Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 32, needExport = true) @ExcelAttribute(name = "员工姓名", maxLength = 32, needExport = true)
@Schema(description = "员工姓名", name = "empName") @Schema(description = "员工姓名", name = "empName")
private String empName; private String empName;
@ExcelProperty("身份证号")
@Length(max = 32, message = "身份证号不能超过32个字符") @Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelAttribute(name = "身份证号", maxLength = 32, isIdCard = true, needExport = true) @ExcelAttribute(name = "身份证号", maxLength = 32, isIdCard = true, needExport = true)
@Schema(description = "身份证号", name = "empIdcard") @Schema(description = "身份证号", name = "empIdcard")
private String empIdcard; private String empIdcard;
@ExcelProperty("合同起始日期")
@NotBlank(message = "合同起始日期不能为空") @NotBlank(message = "合同起始日期不能为空")
@ExcelAttribute(name = "合同起始日期", isNotEmpty = true, errorInfo = "合同起始日期不能为空") @ExcelAttribute(name = "合同起始日期", isNotEmpty = true, errorInfo = "合同起始日期不能为空")
@Schema(description = "合同起始日期", name = "contractStart") @Schema(description = "合同起始日期", name = "contractStart")
private LocalDate contractStart; private String contractStart;
@ExcelProperty("合同截止日期")
@ExcelAttribute(name = "合同截止日期", needExport = true) @ExcelAttribute(name = "合同截止日期", needExport = true)
@Schema(description = "合同截止日期", name = "contractEnd") @Schema(description = "合同截止日期", name = "contractEnd")
private LocalDate contractEnd; private String contractEnd;
@ExcelProperty("档案-省")
@ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "") @ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "")
@Schema(description = "档案-省", name = "fileProvince") @Schema(description = "档案-省", name = "fileProvince")
private String fileProvince; private String fileProvince;
@ExcelProperty("档案-市")
@ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince") @ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince")
@Schema(description = "档案-市", name = "fileCity") @Schema(description = "档案-市", name = "fileCity")
private String fileCity; private String fileCity;
@ExcelProperty("档案-县")
@ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity") @ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity")
@Schema(description = "档案-县", name = "fileTown") @Schema(description = "档案-县", name = "fileTown")
private String fileTown; private String fileTown;
@ExcelProperty("项目名称")
@Length(max = 128, message = "项目名称不能超过128个字符") @Length(max = 128, message = "项目名称不能超过128个字符")
@ExcelAttribute(name = "项目名称", maxLength = 128) @ExcelAttribute(name = "项目名称", maxLength = 128)
@Schema(description = "项目名称", name = "subjectDepart") @Schema(description = "项目名称", name = "subjectDepart")
private String subjectDepart; private String subjectDepart;
@ExcelProperty("项目编码")
@Schema(description = "项目编码") @Schema(description = "项目编码")
private String deptNo; private String deptNo;
@ExcelAttribute(name = "员工类型", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE) @ExcelProperty("员工类型")
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型(字典值,0外包1派遣2代理)") @Schema(description = "员工类型(字典值,0外包1派遣2代理)")
private String empNatrue; private String empNatrue;
@ExcelProperty("合同类型")
@NotBlank(message = "合同类型不能为空") @NotBlank(message = "合同类型不能为空")
@Length(max = 32, message = "合同类型不能超过32个字符") @Length(max = 32, message = "合同类型不能超过32个字符")
@ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true) @ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true)
@Schema(description = "合同类型", name = "contractName") @Schema(description = "合同类型", name = "contractName")
private String contractName; private String contractName;
@ExcelProperty("申请编号")
@NotBlank(message = "业务细分不能为空") @NotBlank(message = "业务细分不能为空")
@Length(max = 32, message = "业务细分不能超过32个字符") @Length(max = 32, message = "业务细分不能超过32个字符")
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true) @ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
@Schema(description = "业务细分", name = "contractName") @Schema(description = "业务细分", name = "contractName")
private String contractSubName; private String contractSubName;
@ExcelProperty("签订类型")
@NotBlank(message = "签订类型不能为空") @NotBlank(message = "签订类型不能为空")
@Length(max = 1, message = "签订类型不能超过1个字符") @Length(max = 1, message = "签订类型不能超过1个字符")
@ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订类型不能为空", maxLength = 100, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE) @ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订类型不能为空", maxLength = 100, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE)
...@@ -121,34 +134,41 @@ public class EmployeeContractExportVO implements Serializable { ...@@ -121,34 +134,41 @@ public class EmployeeContractExportVO implements Serializable {
* 1 固定期限 * 1 固定期限
* 2 无固定期限 * 2 无固定期限
*/ */
@ExcelProperty("签订期限")
@NotBlank(message = "签订期限不能为空") @NotBlank(message = "签订期限不能为空")
@Length(max = 32, message = "签订期限不能超过32个字符") @Length(max = 32, message = "签订期限不能超过32个字符")
@ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true) @ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Schema(description = "签订期限", name = "contractType") @Schema(description = "签订期限", name = "contractType")
private String contractType; private String contractType;
@ExcelProperty("合同甲方")
@ExcelAttribute(name = "合同甲方") @ExcelAttribute(name = "合同甲方")
@Schema(description = "合同甲方") @Schema(description = "合同甲方")
@Size(max = 50, message = "合同甲方不可超过50位") @Size(max = 50, message = "合同甲方不可超过50位")
private String contractParty; private String contractParty;
@ExcelProperty("客户名称")
@Length(max = 128, message = "客户名称不能超过128个字符") @Length(max = 128, message = "客户名称不能超过128个字符")
@ExcelAttribute(name = "客户名称", maxLength = 128) @ExcelAttribute(name = "客户名称", maxLength = 128)
@Schema(description = "客户名称", name = "subjectUnit") @Schema(description = "客户名称", name = "subjectUnit")
private String subjectUnit; private String subjectUnit;
@ExcelProperty("审核状态")
@ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过") @ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过")
@Schema(description = "审核状态") @Schema(description = "审核状态")
private String auditStatus; private String auditStatus;
@ExcelProperty("合同状态")
@ExcelAttribute(name = "合同状态", readConverterExp = "0=可用,1=不可用") @ExcelAttribute(name = "合同状态", readConverterExp = "0=可用,1=不可用")
@Schema(description = "合同状态", name = "inUse") @Schema(description = "合同状态", name = "inUse")
private String inUse; private String inUse;
@ExcelProperty("附件状态")
@ExcelAttribute(name = "附件状态") @ExcelAttribute(name = "附件状态")
@Schema(description = "附件状态", name = "isFile") @Schema(description = "附件状态", name = "isFile")
private String files; private String files;
@ExcelProperty("归档状态")
@ExcelAttribute(name = "归档状态", readConverterExp = "0=已归档,1=未归档") @ExcelAttribute(name = "归档状态", readConverterExp = "0=已归档,1=未归档")
@Schema(description = "归档状态", name = "isFile") @Schema(description = "归档状态", name = "isFile")
private String isFile; private String isFile;
...@@ -158,7 +178,7 @@ public class EmployeeContractExportVO implements Serializable { ...@@ -158,7 +178,7 @@ public class EmployeeContractExportVO implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private String createTime;
@ExcelProperty("累计签订次数") @ExcelProperty("累计签订次数")
private String createNum; private String createNum;
......
...@@ -30,11 +30,13 @@ import com.yifu.cloud.plus.v1.yifu.archives.Constants.EmployeeContractConstants; ...@@ -30,11 +30,13 @@ 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.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; 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.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractUpdateVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -656,21 +658,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -656,21 +658,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i); excel = excelVOList.get(i);
// 存储 // 存储
insertExcel(excel, errorMessageList); this.insertExcel(excel, errorMessageList);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
} }
} }
private ErrorMessage checkRes(EmployeeContractVO excel, List<TEmployeeContractInfo> list) {
// 检查添加是否已经存在
boolean match = list.stream().anyMatch(info -> excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) {
return new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING));
}
return null;
}
/** /**
* 插入excel education * 插入excel education
*/ */
...@@ -694,9 +685,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -694,9 +685,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
insert.setSettleDomain(project.getDeptId()); insert.setSettleDomain(project.getDeptId());
// 核心保存 // 核心保存
R<List<ErrorMessage>> info = this.setBaseInfo(insert); R<List<ErrorMessage>> info = this.setBaseInfo(insert);
if (info.getCode() != CommonConstants.SUCCESS) { errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getMsg()));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getMsg()));
}
} }
} catch (Exception e) { } catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage()); log.error("员工合同保存异常:" + e.getMessage());
...@@ -725,7 +714,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -725,7 +714,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(contractInfo.getExportFields()) EasyExcel.write(out, EmployeeContractExportVO.class).includeColumnFiledNames(contractInfo.getExportFields())
.sheet("员工合同").doWrite(list); .sheet("员工合同").doWrite(list);
out.flush(); out.flush();
} catch (Exception e) { } catch (Exception e) {
...@@ -764,7 +753,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -764,7 +753,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(contractInfo.getExportFields()) EasyExcel.write(out, EmployeeContractExportVO.class).includeColumnFiledNames(contractInfo.getExportFields())
.sheet("员工合同[合并]").doWrite(list); .sheet("员工合同[合并]").doWrite(list);
out.flush(); out.flush();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -147,12 +147,20 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -147,12 +147,20 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)); .eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tEmployeeInfo)) { if (Common.isNotNull(tEmployeeInfo)) {
String empNO = getEmpNo(tEmployeeProject.getDeptNo()); String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO); tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId()); tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]); tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject); this.save(tEmployeeProject);
if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
}else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
}
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT); tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfoMapper.updateById(tEmployeeInfo);
return R.ok(); return R.ok();
...@@ -754,6 +762,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -754,6 +762,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (num == CommonConstants.ONE_INT) { if (num == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT); tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
} }
if (CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
}else if (CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
}
updateList.add(tEmployeeInfo); updateList.add(tEmployeeInfo);
// 记录变更日志 // 记录变更日志
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId()); TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
......
...@@ -170,13 +170,14 @@ public class ExcelUtil <T> implements Serializable { ...@@ -170,13 +170,14 @@ public class ExcelUtil <T> implements Serializable {
} }
} }
// 默认字典获取不到 去 缓存获取 // 默认字典获取不到 去 缓存获取
if (Common.isEmpty(tempValue)){ if (Common.isEmpty(tempValue) && Common.isNotNull(attr.dataType())){
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(attr.dataType()); Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(attr.dataType());
boolean flag = true; if (dicObj != null) {
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(value.trim())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(value.trim())) {
tempValue = entry.getValue(); tempValue = entry.getValue();
break; break;
}
} }
} }
} }
......
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