Commit fac2f7ef authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化

parent 01bc6528
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
/**
* 薪资导入、删除锁定表(锁定后不可导入删除,除非清理掉数据)
*
* @author hgw
* @date 2024-10-24 15:22:51
*/
@Data
@TableName("t_archives_export_limit")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "档案导出限定表(限定后不可导出,除非清理掉数据或等10分钟)")
public class TArchivesExportLimit extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("id")
private String id;
/**
* 删除标志:0未删除;1已删除(1代表已完成导出,释放了锁)
*/
@ExcelAttribute(name = "删除标志:0未删除;1已删除(1代表已完成导出,释放了锁)", isNotEmpty = true, errorInfo = "删除标志:0未删除;1已删除(1代表已完成导入或删除,释放了锁)不能为空")
@NotBlank(message = "删除标志:0未删除;1已删除(1代表已完成导出,释放了锁)不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("删除标志:0未删除;1已删除(1代表已完成导出,释放了锁)")
private Integer deleteFlag;
/**
* 类型:1预入职导出;2完整度监控导出
*/
@ExcelAttribute(name = "类型", isNotEmpty = true, errorInfo = "类型:1预入职导出;2完整度监控导出不能为空")
@NotBlank(message = "类型:1预入职导出;2完整度监控导出不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("类型:1预入职导出;2完整度监控导出")
private Integer type;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TArchivesExportLimit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 薪资导入、删除锁定表(锁定后不可导入删除,除非清理掉数据)
*
* @author hgw
* @date 2024-10-24 15:59:09
*/
@Mapper
public interface TArchivesExportLimitMapper extends BaseMapper<TArchivesExportLimit> {
/**
* 查询是否有锁
*/
List<TArchivesExportLimit> getLimitList(@Param("tArchivesExportLimit") TArchivesExportLimit tArchivesExportLimit);
}
......@@ -3409,6 +3409,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMust.append("有银行卡号则员工姓名必填;");
}
}
// 联动必填校验:
if (Common.isNotNull(detail.getFileProvince()) && Common.isEmpty(detail.getFileCity())) {
errorMust.append("档案所在地-省、市联动必填;");
}
if (Common.isNotNull(detail.getContactProvince()) && (Common.isEmpty(detail.getContactCity()) || Common.isEmpty(detail.getContactTown()))) {
errorMust.append("通信地址-省、市、区/县联动必填;");
}
if (Common.isNotNull(detail.getRelationProvince()) && (Common.isEmpty(detail.getRelationCity()) || Common.isEmpty(detail.getRelationTown()))) {
errorMust.append("联系地址-省、市、区/县联动必填;");
}
if (Common.isNotNull(detail.getFileProvince()) && Common.isEmpty(detail.getFileCity())) {
errorMust.append("开户省、市联动必填;");
}
// 手机号码
if (Common.isNotNull(detail.getEmpPhone())) {
mobileList.add(detail.getEmpPhone());
......
......@@ -37,6 +37,7 @@ import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper;
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;
......@@ -151,6 +152,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 导入批量校验身份证、卡号、手机号
private final DaprCheckProperties checkProperties;
private final TArchivesExportLimitMapper tArchivesExportLimitMapper;
private final OSSUtil ossUtil;
private static final String ID = "id";
......@@ -1529,6 +1532,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TEmpEducation tEmpEducation = null;
if (Common.isNotNull(tPreEmpEducation.getOldId())) {
tEmpEducation = tEmpEducationService.getById(tPreEmpEducation.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpEducation = tEmpEducationService.getByEmpId(empId);
}
if (tEmpEducation == null) {
tEmpEducation = new TEmpEducation();
......@@ -1588,6 +1594,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TEmpBadRecord tEmpBadRecord = null;
if (Common.isNotNull(tPreEmpBadRecord.getOldId())) {
tEmpBadRecord = tEmpBadRecordService.getById(tPreEmpBadRecord.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpBadRecord = tEmpBadRecordService.getByEmpId(empId);
}
if (tEmpBadRecord == null) {
tEmpBadRecord = new TEmpBadRecord();
......@@ -1608,6 +1617,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TEmpContactInfo tEmpContactInfo = null;
if (Common.isNotNull(tPreEmpContactInfo.getOldId())) {
tEmpContactInfo = tEmpContactInfoService.getById(tPreEmpContactInfo.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpContactInfo = tEmpContactInfoService.getByEmpId(empId);
}
if (tEmpContactInfo == null) {
tEmpContactInfo = new TEmpContactInfo();
......@@ -1631,6 +1643,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TEmpDisabilityInfo tEmpDisabilityInfo = null;
if (Common.isNotNull(tPreEmpDisabilityInfo.getOldId())) {
tEmpDisabilityInfo = tEmpDisabilityInfoService.getById(tPreEmpDisabilityInfo.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpDisabilityInfo = tEmpDisabilityInfoService.getByEmpId(empId);
}
if (tEmpDisabilityInfo == null) {
tEmpDisabilityInfo = new TEmpDisabilityInfo();
......@@ -2376,254 +2391,278 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
*/
@Override
public void exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo) {
String name = "预入职导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTPreEmpMainAllCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
ExcelWriter excelWriter = null;
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
List<List<String>> strList = new ArrayList<>();
strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!!"}));
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提示"}));
EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
} else {
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提交时间", "提交时间"}));
headList.add(this.getNewArrayList(new String[]{"状态", "状态"}));
headList.add(this.getNewArrayList(new String[]{"审核人", "审核人"}));
headList.add(this.getNewArrayList(new String[]{"审核时间", "审核时间"}));
String oneTitle = "员工基本信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工主码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证号"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "性别"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证期限"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证开始日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证截止日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "出生日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "年龄"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "婚姻状况"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "民族"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "政治面貌"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "邮箱"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户口性质"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-详细地址"}));
oneTitle = "在项信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "客户名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "项目名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "业务类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "合同类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工时制"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "就职岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入职日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "试用期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "标签"}));
oneTitle = "紧急联络人";
headList.add(this.getNewArrayList(new String[]{oneTitle, "姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系地址"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系电话"}));
oneTitle = "最高教育经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "学校"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "专业"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否大专及以上"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "最高学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入学时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "毕业时间"}));
oneTitle = "主要工作经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否为首份工作"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作单位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "开始工作日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "结束工作日期"}));
oneTitle = "主要家庭成员信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "成员姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
oneTitle = "职业资格信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业资格证书"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "申报年度"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业资格名称"}));
oneTitle = "伤残信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否曾被认定为工伤"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build();
int index = 1;
if (count > CommonConstants.ZERO_INT) {
ExcelUtil<TPreMainExportAllVO> util = new ExcelUtil<>(TPreMainExportAllVO.class);
//int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT
int limitNum = 1000;
ExcelWriterSheetBuilder writeSheet;
List<TPreMainExportAllVO> listWork;
Map<String, TPreMainExportAllVO> mapWork;
List<TPreMainExportAllVO> listFamily;
Map<String, TPreMainExportAllVO> mapFamily;
List<TPreMainExportAllVO> listProfessional;
Map<String, TPreMainExportAllVO> mapProfessional;
TPreMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TPreMainExportAllVO.class);
for (int i = 0; i <= count; i += limitNum) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(limitNum);
list = baseMapper.getTPreEmpMainAllList(searchVo);
listWork = baseMapper.getTPreEmpMainAllListByWork(searchVo);
listFamily = baseMapper.getTPreEmpMainAllListByFamily(searchVo);
listProfessional = baseMapper.getTPreEmpMainAllListByProfessional(searchVo);
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listWork != null && !listWork.isEmpty()) {
for (TPreMainExportAllVO vo : listWork){
mapWork.putIfAbsent(vo.getMainId(), vo);
}
}
if (listFamily != null && !listFamily.isEmpty()) {
for (TPreMainExportAllVO vo : listFamily){
mapFamily.putIfAbsent(vo.getMainId(), vo);
}
}
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TPreMainExportAllVO vo : listProfessional){
mapProfessional.putIfAbsent(vo.getMainId(), vo);
YifuUser user = SecurityUtils.getUser();
if (user != null) {
TArchivesExportLimit exportLimit = new TArchivesExportLimit();
exportLimit.setCreateBy(user.getId());
exportLimit.setType(CommonConstants.ONE_INT);
List<TArchivesExportLimit> limitList = tArchivesExportLimitMapper.getLimitList(exportLimit);
String name = "预入职导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTPreEmpMainAllCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
ExcelWriter excelWriter = null;
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
List<List<String>> strList = new ArrayList<>();
strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!!"}));
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提示"}));
EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
} else if (limitList != null && limitList.size() > 2) {
List<List<String>> strList = new ArrayList<>();
strList.add(this.getNewArrayList(new String[]{"多人正在导出,请耐心等待10分钟后再导出!"}));
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提示"}));
EasyExcelFactory.write(out).head(headList).sheet("多人正在导出").doWrite(strList);
} else {
exportLimit.setDeleteFlag(CommonConstants.ZERO_INT);
exportLimit.setCreateName(user.getNickname());
exportLimit.setCreateTime(LocalDateTime.now());
tArchivesExportLimitMapper.insert(exportLimit);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提交时间", "提交时间"}));
headList.add(this.getNewArrayList(new String[]{"状态", "状态"}));
headList.add(this.getNewArrayList(new String[]{"审核人", "审核人"}));
headList.add(this.getNewArrayList(new String[]{"审核时间", "审核时间"}));
String oneTitle = "员工基本信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工主码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证号"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "性别"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证期限"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证开始日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证截止日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "出生日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "年龄"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "婚姻状况"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "民族"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "政治面貌"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "邮箱"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户籍所在地-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "户口性质"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案所在地-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "档案状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-省"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-市"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-区/县"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "通信地址-详细地址"}));
oneTitle = "在项信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "客户名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "项目名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "业务类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "合同类型"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工时制"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "就职岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入职日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "试用期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "标签"}));
oneTitle = "紧急联络人";
headList.add(this.getNewArrayList(new String[]{oneTitle, "姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系地址"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "联系电话"}));
oneTitle = "最高教育经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "学校"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "专业"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否大专及以上"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "最高学历"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "入学时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "毕业时间"}));
oneTitle = "主要工作经历";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否为首份工作"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作单位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "工作岗位"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "开始工作日期"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "结束工作日期"}));
oneTitle = "主要家庭成员信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "成员姓名"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "与本人关系"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "手机号码"}));
oneTitle = "职业资格信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业资格证书"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "申报年度"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业资格名称"}));
oneTitle = "伤残信息";
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否曾被认定为工伤"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有职业病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "职业病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build();
int index = 1;
if (count > CommonConstants.ZERO_INT) {
ExcelUtil<TPreMainExportAllVO> util = new ExcelUtil<>(TPreMainExportAllVO.class);
//int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT
int limitNum = 10000;
ExcelWriterSheetBuilder writeSheet;
List<TPreMainExportAllVO> listWork;
Map<String, TPreMainExportAllVO> mapWork;
List<TPreMainExportAllVO> listFamily;
Map<String, TPreMainExportAllVO> mapFamily;
List<TPreMainExportAllVO> listProfessional;
Map<String, TPreMainExportAllVO> mapProfessional;
TPreMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TPreMainExportAllVO.class);
for (int i = 0; i <= count; i += limitNum) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(limitNum);
list = baseMapper.getTPreEmpMainAllList(searchVo);
listWork = baseMapper.getTPreEmpMainAllListByWork(searchVo);
listFamily = baseMapper.getTPreEmpMainAllListByFamily(searchVo);
listProfessional = baseMapper.getTPreEmpMainAllListByProfessional(searchVo);
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listWork != null && !listWork.isEmpty()) {
for (TPreMainExportAllVO vo : listWork) {
mapWork.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (Common.isNotNull(list)){
for (TPreMainExportAllVO vo : list){
temp = mapWork.get(vo.getMainId());
if (temp != null) {
vo.setField44(temp.getField44());
vo.setField45(temp.getField45());
vo.setField46(temp.getField46());
vo.setField47(temp.getField47());
if (listFamily != null && !listFamily.isEmpty()) {
for (TPreMainExportAllVO vo : listFamily) {
mapFamily.putIfAbsent(vo.getMainId(), vo);
}
temp = mapFamily.get(vo.getMainId());
if (temp != null) {
vo.setField48(temp.getField48());
vo.setField49(temp.getField49());
vo.setField50(temp.getField50());
}
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TPreMainExportAllVO vo : listProfessional) {
mapProfessional.putIfAbsent(vo.getMainId(), vo);
}
temp = mapProfessional.get(vo.getMainId());
if (temp != null) {
vo.setField52(temp.getField52());
vo.setField53(temp.getField53());
}
if (Common.isNotNull(list)) {
for (TPreMainExportAllVO vo : list) {
temp = mapWork.get(vo.getMainId());
if (temp != null) {
vo.setField44(temp.getField44());
vo.setField45(temp.getField45());
vo.setField46(temp.getField46());
vo.setField47(temp.getField47());
}
temp = mapFamily.get(vo.getMainId());
if (temp != null) {
vo.setField48(temp.getField48());
vo.setField49(temp.getField49());
vo.setField50(temp.getField50());
}
temp = mapProfessional.get(vo.getMainId());
if (temp != null) {
vo.setField52(temp.getField52());
vo.setField53(temp.getField53());
}
util.convertEntity(vo, null, null, null);
}
util.convertEntity(vo,null,null,null);
writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 1工作经历
index = 1;
count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("工作经历" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
// 1工作经历
index = 1;
count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("工作经历" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
}
// 2家庭成员
index = 1;
count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
// 2家庭成员
index = 1;
count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
if (Common.isNotNull(list)) {
list.clear();
// 3职业资格
index = 1;
count = baseMapper.getTEmpMainAllCountThreeProfessional(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("职业资格" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
// 3职业资格
index = 1;
count = baseMapper.getTEmpMainAllCountThreeProfessional(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("职业资格" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
if (Common.isNotNull(list)) {
list.clear();
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
out.flush();
if (excelWriter != null) {
excelWriter.finish();
}
}
out.flush();
if (excelWriter != null) {
excelWriter.finish();
}
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
// 结束后将状态更新为已导出
exportLimit.setDeleteFlag(CommonConstants.ONE_INT);
exportLimit.setUpdateBy(user.getNickname());
exportLimit.setUpdateTime(LocalDateTime.now());
tArchivesExportLimitMapper.updateById(exportLimit);
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper">
<resultMap id="tArchivesExportLimitMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TArchivesExportLimit">
<id property="id" column="id"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="type" column="type"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a
.
id
,
a.type,
a.delete_flag,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tArchivesExportLimit_where">
<if test="tArchivesExportLimit != null">
<if test="tArchivesExportLimit.id != null and tArchivesExportLimit.id.trim() != ''">
AND a.id = #{tArchivesExportLimit.id}
</if>
<if test="tArchivesExportLimit.createBy != null and tArchivesExportLimit.createBy.trim() != ''">
AND a.CREATE_BY = #{tArchivesExportLimit.createBy}
</if>
<if test="tArchivesExportLimit.type != null">
AND a.type = #{tArchivesExportLimit.type}
</if>
</if>
</sql>
<!--tArchivesExportLimit查询-->
<select id="getLimitList" resultMap="tArchivesExportLimitMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_archives_export_limit a
<where>
a.DELETE_FLAG = 0 and a.create_time > DATE_SUB(NOW(),INTERVAL 10 MINUTE)
<include refid="tArchivesExportLimit_where"/>
</where>
</select>
</mapper>
......@@ -255,30 +255,6 @@
SELECT
count(1)
FROM t_pre_emp_main a
/*left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
left join view_sys_dict_item emp_married on emp_married.value=e.EMP_MARRI_STATUS and emp_married.type='emp_married'
left join view_sys_dict_item nation on nation.value=e.EMP_NATIONAL and nation.type='emp_national'
left join view_sys_dict_item registype on registype.value=e.EMP_REGIS_TYPE and registype.type='emp_registype'
left join view_sys_dict_item politicalStatus on politicalStatus.value=e.POLITICAL_STATUS and politicalStatus.type='emp_political'
left join sys_area pi on pi.id=e.ID_PROVINCE
left join sys_area ci on ci.id=e.ID_CITY
left join sys_area ti on ti.id=e.ID_TOWN
left join sys_area pf on pf.id=e.FILE_PROVINCE
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='employee_contract_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID*/
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_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