Commit ed12c975 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent a5e4688e
......@@ -17,14 +17,15 @@
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.Past;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
......@@ -68,13 +69,13 @@ public class EmployeeProjectExportVO{
* 身份证有效期起
*/
@ExcelProperty(value = "身份证开始日期")
private LocalDate validityStart;
private Date validityStart;
/**
* 身份证有效期止
*/
@ExcelProperty(value = "身份证截止日期")
private LocalDate validityEnd;
private Date validityEnd;
/**
* 婚姻状况
......@@ -188,12 +189,14 @@ public class EmployeeProjectExportVO{
* 入学时间
*/
@ExcelProperty(value = "入学时间")
@DateTimeFormat("yyyy-MM-dd")
private LocalDateTime admissionDate;
/**
* 毕业时间
*/
@ExcelProperty(value = "毕业时间")
@DateTimeFormat("yyyy-MM-dd")
private LocalDateTime gradutionDate;
/**
......@@ -233,6 +236,7 @@ public class EmployeeProjectExportVO{
* 创建时间
*/
@ExcelProperty(value = "人员档案创建时间")
@DateTimeFormat("yyyy-MM-dd")
private LocalDateTime proCreateTime;
......@@ -285,7 +289,7 @@ public class EmployeeProjectExportVO{
*/
@ExcelProperty(value ="入职日期")
@Past
private LocalDate enjoinDate;
private Date enjoinDate;
/**
* 试用期(单位月)
......@@ -400,6 +404,7 @@ public class EmployeeProjectExportVO{
* 项目档案创建时间
*/
@ExcelProperty(value ="项目档案创建时间")
@DateTimeFormat("yyyy-MM-dd")
private LocalDateTime createTime;
private List<String> idList;
......
......@@ -19,6 +19,7 @@ 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.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -79,7 +80,7 @@ public class TEmpChangeInfoVO implements Serializable {
* 划转起始月
*/
@ExcelProperty(value ="划转起始月")
@ExcelAttribute(name = "划转起始月",maxLength = 6,isInteger = true)
@ExcelAttribute(name = "划转起始月",maxLength = 6, errorInfo = "划转起始月不能超过6位",isInteger = true)
private String changeStartMonth;
}
......@@ -35,6 +35,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult;
import java.util.*;
import java.util.regex.Pattern;
/**
* 档案划转日志表
......@@ -54,6 +55,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
private final TEmployeeLogServiceImpl tEmployeeLogService;
public static final Pattern PATTERN = Pattern.compile("^[-\\+]?[\\d]*$");
/**
* @Author huyc
* @Description 档案划转
......@@ -116,6 +119,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i);
if (Common.isNotNull(excel.getChangeStartMonth()) && excel.getChangeStartMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
errorMsg.add("第" + (i + 2) + "行划转起始月长度不能超过6位");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月长度不能超过6位"));
}
if (!PATTERN.matcher(excel.getChangeStartMonth()).matches()) {
errorMsg.add("第" + (i + 2) + "行划转起始月格式错误");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月格式错误"));
}
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add("第" + (i + 2) + "行划转起始月不能为空");
......
......@@ -778,7 +778,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public void listExportProject(HttpServletResponse response, EmployeeProjectExportVO projectDTO, String idstr, List<String> exportFields) {
String fileName = "项目档案批量导出" + LocalDateTime.now() + ".xlsx";
String fileName = "项目档案批量导出" + DateUtil.getThisTime() + ".xlsx";
// 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<String>();
for (String exportField : exportFields) {
......@@ -804,7 +804,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFiledNames(includeColumnFiledNames).sheet("项目档案")
.doWrite(list);
......
......@@ -74,6 +74,9 @@
<if test="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if test="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND b.EMP_NO like = #{tElecEmployeeInfo.empNo}
</if>
<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
......
......@@ -220,6 +220,7 @@
a.STATUS,
a.CREATE_NAME,
a.CREATE_TIME,
b.EMP_EMAIL,
b.EMP_NATRUE AS PROEMP_NATRUE
</sql>
......
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