Commit 0fcaa995 authored by hongguangwu's avatar hongguangwu

合同优化-待提交

parent 8544c851
......@@ -78,17 +78,17 @@ public class EmployeeContractExportVO implements Serializable {
private String contractEnd;
@ExcelProperty("档案-省")
@ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "")
@ExcelAttribute(name = "档案-省", maxLength = 32, isArea = true)
@Schema(description = "档案-省", name = "fileProvince")
private String fileProvince;
@ExcelProperty("档案-市")
@ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince")
@ExcelAttribute(name = "档案-市", maxLength = 32, isArea = true, parentField = "fileProvince")
@Schema(description = "档案-市", name = "fileCity")
private String fileCity;
@ExcelProperty("档案-县")
@ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity")
@ExcelAttribute(name = "档案-县", maxLength = 32, isArea = true, parentField = "fileCity")
@Schema(description = "档案-县", name = "fileTown")
private String fileTown;
......@@ -114,7 +114,7 @@ public class EmployeeContractExportVO implements Serializable {
@Schema(description = "合同类型", name = "contractName")
private String contractName;
@ExcelProperty("申请编号")
@ExcelProperty("业务细分")
@NotBlank(message = "业务细分不能为空")
@Length(max = 32, message = "业务细分不能超过32个字符")
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
......
......@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setEmpNatrue(tEmployeeProject.getEmpNatrue());
tEmployeeContractInfo.setEmpIdcard(tEmployeeInfo.getEmpIdcard());
tEmployeeContractInfo.setEmpName(tEmployeeInfo.getEmpName());
tEmployeeContractInfo.setEmpNo(tEmployeeInfo.getEmpCode());
tEmployeeContractInfo.setEmpNo(tEmployeeProject.getEmpNo());
if (Common.isEmpty(tEmployeeContractInfo.getCreateBy())) {
tEmployeeContractInfo.setCreateBy(null == user ? "" : user.getId());
tEmployeeContractInfo.setCreateName(null == user ? "" : user.getNickname());
......@@ -792,7 +792,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo);
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExport(contractInfo);
ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
......@@ -830,7 +830,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
@Override
public void exportContractInfoHistory(TEmployeeContractInfo contractInfo, HttpServletResponse response) {
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出[合并]" + DateUtil.getThisTime() + ".xlsx";
String fileName = "员工合同批量导出【合并历史】" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo);
ServletOutputStream out = null;
......@@ -848,7 +848,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeContractExportVO.class).includeColumnFiledNames(contractInfo.getExportFields())
.sheet("员工合同[合并]").doWrite(list);
.sheet("员工合同【合并历史】").doWrite(list);
out.flush();
} catch (Exception e) {
log.error(EmployeeConstants.CONCART_ALL_EXPORT_EXCEPTION, e);
......
......@@ -206,6 +206,12 @@
</sql>
<sql id="tEmployeeContractInfo_where">
<if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tEmployeeContractInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''">
AND a.ID = #{tEmployeeContractInfo.id}
</if>
......
......@@ -1162,6 +1162,34 @@ public class DateUtil {
return sdf.format(date);
}
/**
* @param date
* @param patten
* @Description: 按指定格式返回
* @Author: hgw
* @Date: 2022/7/19 17:10
* @return: java.lang.String
**/
public static String formatDatePatten(Date date, String patten) {
if (Common.isEmpty(patten)) {
patten = DATETIME_YYYYMM;
}
SimpleDateFormat sdf = new SimpleDateFormat(patten);
return sdf.format(date);
}
/**
* @param date
* @Description: 按指定格式返回int
* @Author: hgw
* @Date: 2022/7/19 17:13
* @return: java.lang.Integer
**/
public static Integer formatDateInt(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_YYYYMM);
return Integer.parseInt(sdf.format(date));
}
/**
* @param mnt 增减月份的 值
* @param yearMonth 202101
......@@ -1440,7 +1468,6 @@ public class DateUtil {
* @Date: 2020/12/21
* @Description: 获取上个月
* @return: java.lang.String
* @see com.yifu.cloud.v1.common.core.util
**/
public static String getLastMonth(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM);
......@@ -1459,7 +1486,6 @@ public class DateUtil {
* @Date: 2020/12/21
* @Description: 获取上n个月
* @return: java.lang.String
* @see com.yifu.cloud.v1.common.core.util
**/
public static String getLastXMonth(int month){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM);
......
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