Commit 9b1b3181 authored by fangxinjiang's avatar fangxinjiang

人员花名册

parent 95e01019
......@@ -153,7 +153,7 @@ public class TPersonnelRosterExportVo{
/**
* 性别
*/
@ExcelAttribute(name = "性别", maxLength = 10,isDataId = true,readConverterExp = "1=男,2=女")
@ExcelAttribute(name = "性别", maxLength = 10)
@Length(max = 10, message = "性别不能超过10个字符")
@ExcelProperty("性别")
@Schema(description = "性别")
......@@ -162,13 +162,11 @@ public class TPersonnelRosterExportVo{
/**
* 出生日期
*/
@DateTimeFormat("yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@ExcelAttribute(name = "出生日期", isDate = true)
@ExcelProperty("出生日期")
@Schema(description = "出生日期")
@HeadFontStyle(fontHeightInPoints = 11)
private Date empBirthDate;
private String empBirthDate;
/**
* 年龄
*/
......
......@@ -28,12 +28,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPersonnelRosterMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPersonnelRosterService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
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.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
......@@ -97,22 +95,22 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TPersonnelRosterExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
ExcelUtil<TPersonnelRosterExportVo> util;
WriteSheet writeSheet;
WriteSheet writeSheet;
HashMap<String,String> userMap = new HashMap<>();
ExcelUtil<TPersonnelRosterExportVo> util = new ExcelUtil<>(TPersonnelRosterExportVo.class);
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
redisLabelMap.putAll(userMap);
Map<String,String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典type
ExcelWriter excelWriter = EasyExcel.write(out, TPersonnelRosterExportVo.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)).build();
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(TPersonnelRosterExportVo.class);
for (TPersonnelRosterExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet(""+index).build();
excelWriter.write(list,writeSheet);
......@@ -124,7 +122,7 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(""+index).build();
writeSheet = EasyExcel.writerSheet(""+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
......
......@@ -371,9 +371,61 @@
<!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02-->
<select id="noPageDiy" resultMap="tPersonnelRosterExportMap">
select
<include refid="Base_Column_List"/>
from t_personnel_roster a
SELECT
a.ID,
a.CUSTOMER_NAME,
a.DEPART_NAME,
a.DEPART_NO,
a.BUSINESS_PRIMARY,
a.BUSINESS_SECOND,
a.BUSINESS_THIRD,
a.LABEL,
a.BUSINESS_TYPE,
a.BU_BELONG,
a.EMP_TYPE,
a.EMP_NAME,
CASE WHEN a.EMP_SEX=1 THEN "男" WHEN a.EMP_SEX=2 THEN "女" ELSE "" END as "EMP_SEX",
a.EMP_BIRTH_DATE,
a.EMP_AGE,
a.EMP_IDCARD,
a.BANK_NO,
a.BANK_NAME,
a1.AREA_NAME as "BANK_PROVINCE",
a1.AREA_NAME as "BANK_CITY",
a.BANK_NAME_SUB,
a.EMP_PHONE,
a6.AREA_NAME as "EMP_PROVINCE",
a7.AREA_NAME as "EMP_CITY",
a8.AREA_NAME as "EMP_TOWN",
a3.AREA_NAME as "SOCIAL_PROVINCE",
a4.AREA_NAME as "SOCIAL_CITY",
a5.AREA_NAME as "SOCIAL_TOWN",
a.CONTRACT_APPLY_NO,
a.CONTRACT_START,
a.CONTRACT_END,
a.CONTRACT_TYPE,
a.BUSINESS_DETAIL,
a.SIGN_TYPE,
a.SIGN_TERM,
a.CONTRACT_PARTY_A,
a.CONTRACT_POST,
a.CONTRACT_TASK_TIME,
a.CONTRACT_CODE,
a.CONTRACT_CREATER,
a.CONTRACT_CREATE_TIME,
a.DATA_CREATE_MONTH,
a.SETTLE_DOMAIN
FROM
t_personnel_roster a
LEFT JOIN sys_area a1 on a1.id=a.BANK_PROVINCE
LEFT JOIN sys_area a2 on a2.id=a.BANK_CITY
LEFT JOIN sys_area a3 on a3.id=a.SOCIAL_PROVINCE
LEFT JOIN sys_area a4 on a4.id=a.SOCIAL_CITY
LEFT JOIN sys_area a5 on a5.id=a.SOCIAL_TOWN
LEFT JOIN sys_area a6 on a6.id=a.EMP_PROVINCE
LEFT JOIN sys_area a7 on a7.id=a.EMP_CITY
LEFT JOIN sys_area a8 on a8.id=a.EMP_TOWN
<where>
1=1
<include refid="tPersonnelRoster_where"/>
......
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