Commit 0ac2012c authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关_导出优化

parent 5dd18334
......@@ -12,6 +12,7 @@ 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.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ExcelStyle;
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.*;
......@@ -26,7 +27,9 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 档案完整度监控
......@@ -327,7 +330,9 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).head(headList).build();
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......
......@@ -34,6 +34,7 @@ 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.utils.ExcelStyle;
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;
......@@ -1197,7 +1198,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmpContactInfo.setCreateName(user.getNickname());
tEmpContactInfo.setCreateTime(LocalDateTime.now());
}
if (Common.isEmpty(tEmpContactInfo.getEmpIdcard()) && Common.isNotNull(emp)){
if (Common.isEmpty(tEmpContactInfo.getEmpIdcard()) && Common.isNotNull(emp)) {
tEmpContactInfo.setEmpIdcard(emp.getEmpIdcard());
}
tEmpContactInfoService.saveOrUpdate(tEmpContactInfo);
......@@ -1368,7 +1369,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
isNew = true;
project = new TEmployeeProject();
}
String[] ignoreProperties = new String[]{"id","status"};
String[] ignoreProperties = new String[]{"id", "status"};
if (Common.isEmpty(tPreEmployeeProject.getWorkingHours())) {
tPreEmployeeProject.setWorkingHours("");
}
......@@ -1966,7 +1967,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).head(headList).build();
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......
/**
* Copyright © 2017yifu. All rights reserved.
*
* @Title: NumberToCN.java
* @Prject: wanxin_hr
* @Package: com.yifu.util
* @Description: TODO
* @author: Administrator
* @date: 2017年5月8日 下午6:45:01
* @version: V1.0
*/
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import java.math.BigDecimal;
/**
* @Author: wangan
* @Date: 2019/8/9
* @Description: 金额转换金额大写, 从老hr复制过
* @return:
**/
public class ExcelStyle {
/**
* @param
* @Description: 设置倩倩审美下的excel样式
* @Author: hgw
* @Date: 2024/7/9 20:30
* @return: com.alibaba.excel.write.style.HorizontalCellStyleStrategy
**/
public static HorizontalCellStyleStrategy getNormalStype () {
// 表头——单元格样式对象
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
headWriteCellStyle.setWrapped(false);
// 背景设置为白色,也可设置为其他颜色
headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
// 设置表头字体
WriteFont headWriteFont = new WriteFont();
// 设置字体大小为12
headWriteFont.setFontHeightInPoints((short)12);
// 设置加粗
headWriteFont.setBold(true);
// 把字体对象设置到单元格样式对象中
headWriteCellStyle.setWriteFont(headWriteFont);
//设置表头居中
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// 内容——单元格样式对象
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setWrapped(false);
// 背景设置为白色,也可设置为其他颜色
contentWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
// 设置表头字体
WriteFont contentWriteFont = new WriteFont();
// 设置字体大小为12
contentWriteFont.setFontHeightInPoints((short)11);
// 把字体对象设置到单元格样式对象中
contentWriteCellStyle.setWriteFont(contentWriteFont);
//设置表头居中
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
return horizontalCellStyleStrategy;
}
}
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