Commit 7ca4071f authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化

parent 79047829
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data; import lombok.Data;
...@@ -36,150 +37,155 @@ public class TPreMainExportAllVO { ...@@ -36,150 +37,155 @@ public class TPreMainExportAllVO {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "提交时间")
@TableField(exist = false)
@ExcelAttribute(name = "ID")
private String mainId;
@ExcelAttribute(needExport = true, name = "提交时间")
private String field2; private String field2;
@ExcelAttribute(name = "状态") @ExcelAttribute(needExport = true, name = "状态")
private String field1; private String field1;
@ExcelAttribute(name = "审核人") @ExcelAttribute(needExport = true, name = "审核人")
private String field64; private String field64;
@ExcelAttribute(name = "审核通过时间") @ExcelAttribute(needExport = true, name = "审核通过时间")
private String field65; private String field65;
@ExcelAttribute(name = "员工主码") @ExcelAttribute(needExport = true, name = "员工主码")
private String field3; private String field3;
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE) @ExcelAttribute(needExport = true, name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
private String field4; private String field4;
@ExcelAttribute(name = "员工姓名") @ExcelAttribute(needExport = true, name = "员工姓名")
private String field5; private String field5;
@ExcelAttribute(name = "身份证号") @ExcelAttribute(needExport = true, name = "身份证号")
private String field6; private String field6;
@ExcelAttribute(name = "性别") @ExcelAttribute(needExport = true, name = "性别")
private String field7; private String field7;
@ExcelAttribute(name = "身份证期限") @ExcelAttribute(needExport = true, name = "身份证期限")
private String field8; private String field8;
@ExcelAttribute(name = "身份证开始日期") @ExcelAttribute(needExport = true, name = "身份证开始日期")
private String field9; private String field9;
@ExcelAttribute(name = "身份证截止日期") @ExcelAttribute(needExport = true, name = "身份证截止日期")
private String field10; private String field10;
@ExcelAttribute(name = "出生日期") @ExcelAttribute(needExport = true, name = "出生日期")
private String field11; private String field11;
@ExcelAttribute(name = "年龄") @ExcelAttribute(needExport = true, name = "年龄")
private String field12; private String field12;
@ExcelAttribute(name = "婚姻状况", isDataId = true, dataType = ExcelAttributeConstants.EMP_MARRIED) @ExcelAttribute(needExport = true, name = "婚姻状况", isDataId = true, dataType = ExcelAttributeConstants.EMP_MARRIED)
private String field13; private String field13;
@ExcelAttribute(name = "民族", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATIONAL) @ExcelAttribute(needExport = true, name = "民族", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATIONAL)
private String field14; private String field14;
@ExcelAttribute(name = "政治面貌", isDataId = true, dataType = ExcelAttributeConstants.EMP_POLITICAL) @ExcelAttribute(needExport = true, name = "政治面貌", isDataId = true, dataType = ExcelAttributeConstants.EMP_POLITICAL)
private String field15; private String field15;
@ExcelAttribute(name = "手机号码") @ExcelAttribute(needExport = true, name = "手机号码")
private String field16; private String field16;
@ExcelAttribute(name = "邮箱") @ExcelAttribute(needExport = true, name = "邮箱")
private String field17; private String field17;
@ExcelAttribute(name = "户籍所在地-省", isArea = true) @ExcelAttribute(needExport = true, name = "户籍所在地-省", isArea = true)
private String field18; private String field18;
@ExcelAttribute(name = "户籍所在地-市", isArea = true, parentField = "field18") @ExcelAttribute(needExport = true, name = "户籍所在地-市", isArea = true, parentField = "field18")
private String field69; private String field69;
@ExcelAttribute(name = "户籍所在地-区/县", isArea = true, parentField = "field69") @ExcelAttribute(needExport = true, name = "户籍所在地-区/县", isArea = true, parentField = "field69")
private String field70; private String field70;
@ExcelAttribute(name = "户口性质", isDataId = true, dataType = ExcelAttributeConstants.EMP_REGISTYPE) @ExcelAttribute(needExport = true, name = "户口性质", isDataId = true, dataType = ExcelAttributeConstants.EMP_REGISTYPE)
private String field19; private String field19;
@ExcelAttribute(name = "档案所在地-省", isArea = true) @ExcelAttribute(needExport = true, name = "档案所在地-省", isArea = true)
private String field20; private String field20;
@ExcelAttribute(name = "档案所在地-市", isArea = true, parentField = "field20") @ExcelAttribute(needExport = true, name = "档案所在地-市", isArea = true, parentField = "field20")
private String field71; private String field71;
@ExcelAttribute(name = "档案所在地-区/县", isArea = true, parentField = "field71") @ExcelAttribute(needExport = true, name = "档案所在地-区/县", isArea = true, parentField = "field71")
private String field72; private String field72;
@ExcelAttribute(name = "档案状态") @ExcelAttribute(needExport = true, name = "档案状态")
private String field21; private String field21;
@ExcelAttribute(name = "通信地址-省", isArea = true) @ExcelAttribute(needExport = true, name = "通信地址-省", isArea = true)
private String field66; private String field66;
@ExcelAttribute(name = "通信地址-市", isArea = true, parentField = "field66") @ExcelAttribute(needExport = true, name = "通信地址-市", isArea = true, parentField = "field66")
private String field67; private String field67;
@ExcelAttribute(name = "通信地址-区/县", isArea = true, parentField = "field67") @ExcelAttribute(needExport = true, name = "通信地址-区/县", isArea = true, parentField = "field67")
private String field68; private String field68;
@ExcelAttribute(name = "通信地址-详细地址") @ExcelAttribute(needExport = true, name = "通信地址-详细地址")
private String field22; private String field22;
@ExcelAttribute(name = "客户名称") @ExcelAttribute(needExport = true, name = "客户名称")
private String field23; private String field23;
@ExcelAttribute(name = "项目名称") @ExcelAttribute(needExport = true, name = "项目名称")
private String field24; private String field24;
@ExcelAttribute(name = "业务类型") @ExcelAttribute(needExport = true, name = "业务类型")
private String field25; private String field25;
@ExcelAttribute(name = "合同类型", isDataId = true, dataType = ExcelAttributeConstants.PERSONNEL_TYPE) @ExcelAttribute(needExport = true, name = "合同类型", isDataId = true, dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
private String field26; private String field26;
@ExcelAttribute(name = "工时制", isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS) @ExcelAttribute(needExport = true, name = "工时制", isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
private String field27; private String field27;
@ExcelAttribute(name = "就职岗位") @ExcelAttribute(needExport = true, name = "就职岗位")
private String field28; private String field28;
@ExcelAttribute(name = "入职日期") @ExcelAttribute(needExport = true, name = "入职日期")
private String field29; private String field29;
@ExcelAttribute(name = "试用期") @ExcelAttribute(needExport = true, name = "试用期")
private String field30; private String field30;
@ExcelAttribute(name = "标签") @ExcelAttribute(needExport = true, name = "标签")
private String field31; private String field31;
@ExcelAttribute(name = "姓名") @ExcelAttribute(needExport = true, name = "姓名")
private String field32; private String field32;
@ExcelAttribute(name = "与本人关系") @ExcelAttribute(needExport = true, name = "与本人关系")
private String field33; private String field33;
@ExcelAttribute(name = "联系地址") @ExcelAttribute(needExport = true, name = "联系地址")
private String field34; private String field34;
@ExcelAttribute(name = "联系电话") @ExcelAttribute(needExport = true, name = "联系电话")
private String field35; private String field35;
@ExcelAttribute(name = "学校") @ExcelAttribute(needExport = true, name = "学校")
private String field36; private String field36;
@ExcelAttribute(name = "专业") @ExcelAttribute(needExport = true, name = "专业")
private String field37; private String field37;
@ExcelAttribute(name = "学历") @ExcelAttribute(needExport = true, name = "学历", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION)
private String field38; private String field38;
@ExcelAttribute(name = "是否大专及以上") @ExcelAttribute(needExport = true, name = "是否大专及以上")
private String field39; private String field39;
@ExcelAttribute(name = "最高学历", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION) @ExcelAttribute(needExport = true, name = "最高学历", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION)
private String field40; private String field40;
@ExcelAttribute(name = "入学时间") @ExcelAttribute(needExport = true, name = "入学时间")
private String field41; private String field41;
@ExcelAttribute(name = "毕业时间") @ExcelAttribute(needExport = true, name = "毕业时间")
private String field42; private String field42;
@ExcelAttribute(name = "是否为首份工作") @ExcelAttribute(needExport = true, name = "是否为首份工作")
private String field43; private String field43;
@ExcelAttribute(name = "工作单位") @ExcelAttribute(needExport = true, name = "工作单位")
private String field44; private String field44;
@ExcelAttribute(name = "工作岗位") @ExcelAttribute(needExport = true, name = "工作岗位")
private String field45; private String field45;
@ExcelAttribute(name = "开始工作日期") @ExcelAttribute(needExport = true, name = "开始工作日期")
private String field46; private String field46;
@ExcelAttribute(name = "结束工作日期") @ExcelAttribute(needExport = true, name = "结束工作日期")
private String field47; private String field47;
@ExcelAttribute(name = "成员姓名") @ExcelAttribute(needExport = true, name = "成员姓名")
private String field48; private String field48;
@ExcelAttribute(name = "与本人关系") @ExcelAttribute(needExport = true, name = "家庭与本人关系", isDataId = true,dataType = ExcelAttributeConstants.FAMILY_RELATION)
private String field49; private String field49;
@ExcelAttribute(name = "手机号码") @ExcelAttribute(needExport = true, name = "家庭手机号码")
private String field50; private String field50;
@ExcelAttribute(name = "是否有职业资格证书") @ExcelAttribute(needExport = true, name = "是否有职业资格证书")
private String field51; private String field51;
@ExcelAttribute(name = "申报年度") @ExcelAttribute(needExport = true, name = "申报年度")
private String field52; private String field52;
@ExcelAttribute(name = "职业资格名称") @ExcelAttribute(needExport = true, name = "职业资格名称", isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE)
private String field53; private String field53;
@ExcelAttribute(name = "是否曾被认定为工伤") @ExcelAttribute(needExport = true, name = "是否曾被认定为工伤")
private String field54; private String field54;
@ExcelAttribute(name = "是否有职业病") @ExcelAttribute(needExport = true, name = "是否有职业病")
private String field55; private String field55;
@ExcelAttribute(name = "职业病名称") @ExcelAttribute(needExport = true, name = "职业病名称")
private String field56; private String field56;
@ExcelAttribute(name = "是否有传染性疾病") @ExcelAttribute(needExport = true, name = "是否有传染性疾病")
private String field57; private String field57;
@ExcelAttribute(name = "传染病名称") @ExcelAttribute(needExport = true, name = "传染病名称")
private String field58; private String field58;
@ExcelAttribute(name = "是否持有残疾人证明") @ExcelAttribute(needExport = true, name = "是否持有残疾人证明")
private String field59; private String field59;
@ExcelAttribute(name = "伤残病名称") @ExcelAttribute(needExport = true, name = "伤残病名称")
private String field60; private String field60;
@ExcelAttribute(name = "伤残等级") @ExcelAttribute(needExport = true, name = "伤残等级", isDataId = true, dataType = ExcelAttributeConstants.DISABILITY_GRADE)
private String field61; private String field61;
@ExcelAttribute(name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种") @ExcelAttribute(needExport = true, name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String field62; private String field62;
@ExcelAttribute(name = "不良记录描述") @ExcelAttribute(needExport = true, name = "不良记录描述")
private String field63; private String field63;
......
...@@ -52,6 +52,9 @@ public interface TPreEmpMainMapper extends BaseMapper<TPreEmpMain> { ...@@ -52,6 +52,9 @@ public interface TPreEmpMainMapper extends BaseMapper<TPreEmpMain> {
int getTPreEmpMainAllCount(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain); int getTPreEmpMainAllCount(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllList(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain); List<TPreMainExportAllVO> getTPreEmpMainAllList(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByFamily(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByProfessional(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
// 导出详情使用 hgw 2024-6-26 11:05:41 // 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCountOneWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain); int getTEmpMainAllCountOneWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
......
...@@ -3351,7 +3351,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -3351,7 +3351,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(shuValue)) { if (Common.isNotNull(shuValue)) {
shuValue = shuValue.trim(); shuValue = shuValue.trim();
//校验字段是否符合要求 返回错误信息 //校验字段是否符合要求 返回错误信息
dictValue = DiyExcelImportUtil.validateUtil(shuValue, attr, errorFormat, dictMap, parentAreaMap, shuName, curVo != null, startDateMap); dictValue = DiyExcelImportUtil.validateUtil(shuValue, attr, errorFormat, dictMap, parentAreaMap, shuName, false, startDateMap);
//校验字段是否符合要求2 开户行 //校验字段是否符合要求2 开户行
if (curVo == null && "bankName".equals(shuName) && bankMap.get(shuValue) == null) { if (curVo == null && "bankName".equals(shuName) && bankMap.get(shuValue) == null) {
errorFormat.append(attr.name()).append("_不符合财务要求,请查薪资配置;"); errorFormat.append(attr.name()).append("_不符合财务要求,请查薪资配置;");
...@@ -3733,7 +3733,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -3733,7 +3733,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return new R<>(CommonConstants.TWO_INT, null, errorList); return new R<>(CommonConstants.TWO_INT, null, errorList);
} }
} else { } else {
return R.failed("未识别到表格内容行!请检查表格!"); return R.failed("识别到表头下存在空白行,若非空白表,请删除空白行再导入!");
} }
} }
......
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
...@@ -56,6 +57,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; ...@@ -56,6 +57,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TBankNameMapVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TBankNameMapVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoImportLogVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
...@@ -1542,6 +1544,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1542,6 +1544,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isEmpty(tEmpEducation.getEmpCode())) { if (Common.isEmpty(tEmpEducation.getEmpCode())) {
tEmpEducation.setEmpCode(emp.getEmpCode()); tEmpEducation.setEmpCode(emp.getEmpCode());
} }
if (Common.isEmpty(tEmpEducation.getEmpName())) {
tEmpEducation.setEmpName(emp.getEmpName());
}
if (Common.isEmpty(tEmpEducation.getCreateTime())) { if (Common.isEmpty(tEmpEducation.getCreateTime())) {
tEmpEducation.setCreateTime(LocalDateTime.now()); tEmpEducation.setCreateTime(LocalDateTime.now());
} }
...@@ -1636,6 +1641,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1636,6 +1641,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isEmpty(tEmpDisabilityInfo.getEmpCode())) { if (Common.isEmpty(tEmpDisabilityInfo.getEmpCode())) {
tEmpDisabilityInfo.setEmpCode(emp.getEmpCode()); tEmpDisabilityInfo.setEmpCode(emp.getEmpCode());
} }
if (Common.isEmpty(tEmpDisabilityInfo.getEmpName())) {
tEmpDisabilityInfo.setEmpName(emp.getEmpName());
}
if (Common.isEmpty(tEmpDisabilityInfo.getCreateBy())) { if (Common.isEmpty(tEmpDisabilityInfo.getCreateBy())) {
tEmpDisabilityInfo.setCreateBy(user.getId()); tEmpDisabilityInfo.setCreateBy(user.getId());
...@@ -2475,19 +2483,66 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2475,19 +2483,66 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
int index = 1; int index = 1;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
ExcelUtil<TPreMainExportAllVO> util = new ExcelUtil<>(TPreMainExportAllVO.class); ExcelUtil<TPreMainExportAllVO> util = new ExcelUtil<>(TPreMainExportAllVO.class);
//int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT; //int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT
int limitNum = 1000; int limitNum = 1000;
ExcelWriterSheetBuilder writeSheet; 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) { for (int i = 0; i <= count; i += limitNum) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(limitNum); searchVo.setLimitEnd(limitNum);
list = baseMapper.getTPreEmpMainAllList(searchVo); 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);
}
}
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
for (TPreMainExportAllVO vo : 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); writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
...@@ -2505,7 +2560,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2505,7 +2560,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListOneWork(searchVo); list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("工作经历" + index); writeSheet = EasyExcelFactory.writerSheet("工作经历" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
...@@ -2522,7 +2577,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2522,7 +2577,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo); list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index); writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
...@@ -2539,7 +2594,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2539,7 +2594,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo); list = baseMapper.getTEmpMainAllListThreeProfessional(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("职业资格" + index); writeSheet = EasyExcelFactory.writerSheet("职业资格" + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
...@@ -2573,6 +2628,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2573,6 +2628,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
} }
private Set<String> getExportFieldNameDetailByClass(Class<?> clazz) {
Set<String> exportfieldsName = new HashSet<>();
Field[] fields = clazz.getDeclaredFields();
ExcelAttribute annotation;
for (Field field : fields) {
annotation = field.getAnnotation(ExcelAttribute.class);
if (annotation != null && Common.isNotNull(annotation.name()) && annotation.needExport()) {
exportfieldsName.add(field.getName());
}
}
return exportfieldsName;
}
/** /**
* @param file 文件流 * @param file 文件流
* @Description: 导入预入职 * @Description: 导入预入职
...@@ -3446,7 +3514,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3446,7 +3514,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return R.ok(); return R.ok();
} }
} else { } else {
return R.failed("未识别到表格内容行!请检查表格!"); return R.failed("识别到表头下存在空白行,若非空白表,请删除空白行再导入!");
} }
} }
......
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
<!--list--> <!--list-->
<select id="getTPreEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO"> <select id="getTPreEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT SELECT
case a.STATUS when '0' then '草稿' when '1' then '待完善' when '2' then '待审核' when '3' then '审核不通过' when '4' then '审核通过' else '-' end field1 a.id mainId,case a.STATUS when '0' then '草稿' when '1' then '待完善' when '2' then '待审核' when '3' then '审核不通过' when '4' then '审核通过' else '-' end field1
,DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') field2,if(a.STATUS in ('3','4'),a.AUDIT_NAME,'') field64,if(a.STATUS in ('3','4'),DATE_FORMAT(a.AUDIT_TIME,'%Y-%m-%d %H:%i:%s'),'') field65 ,DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') field2,if(a.STATUS in ('3','4'),a.AUDIT_NAME,'') field64,if(a.STATUS in ('3','4'),DATE_FORMAT(a.AUDIT_TIME,'%Y-%m-%d %H:%i:%s'),'') field65
,e.EMP_CODE field3,a.emp_Natrue field4,a.emp_name field5,a.emp_idcard field6 ,e.EMP_CODE field3,a.emp_Natrue field4,a.emp_name field5,a.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7 ,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
...@@ -308,54 +308,19 @@ ...@@ -308,54 +308,19 @@
,p.CONTRACT_TYPE field26 ,p.WORKING_HOURS field27,p.POST field28,p.ENJOIN_DATE field29 ,p.CONTRACT_TYPE field26 ,p.WORKING_HOURS field27,p.POST field28,p.ENJOIN_DATE field29
,p.TRY_PERIOD field30,p.EMP_LABEL field31 ,p.TRY_PERIOD field30,p.EMP_LABEL field31
,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35 ,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35
,ee.SCHOOL field36,ee.MAJOR field37,education.label field38,if(e.IS_COLLEGE=0,'否','是') field39 ,ee.SCHOOL field36,ee.MAJOR field37,ee.EDUCATION_NAME field38,if(e.IS_COLLEGE=0,'否','是') field39
,e.HIGN_EDUCATION field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42 ,e.HIGN_EDUCATION field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47 ,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51
,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56 ,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56
,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59 ,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,disability_grade.label field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63 ,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_pre_emp_main a FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID 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 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 (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_UNIT ORDER BY ee.create_time desc),',',1) WORK_UNIT
,SUBSTRING_INDEX(GROUP_CONCAT(ee.WORK_JOB ORDER BY ee.create_time desc),',',1) WORK_JOB
,SUBSTRING_INDEX(GROUP_CONCAT(ee.START_DATE ORDER BY ee.create_time desc),',',1) START_DATE
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
from t_pre_emp_work_recording ee
GROUP BY ee.PRE_MAIN_ID
) ew on a.id=ew.PRE_MAIN_ID
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.FAMILY_NAME ORDER BY ee.create_time desc),',',1) FAMILY_NAME
,SUBSTRING_INDEX(GROUP_CONCAT(ee.RELATIONSHIP_SELF ORDER BY ee.create_time desc),',',1) RELATIONSHIP_SELF
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
from t_pre_emp_family ee
GROUP BY ee.PRE_MAIN_ID
) ef on a.id=ef.PRE_MAIN_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
,SUBSTRING_INDEX(GROUP_CONCAT(ee.DECLARE_YEAR ORDER BY ee.create_time desc),',',1) DECLARE_YEAR
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
from t_pre_emp_professional_qualification ee
GROUP BY ee.PRE_MAIN_ID
) 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_disability_info ed on a.id=ed.PRE_MAIN_ID
left join view_sys_dict_item disability_grade on disability_grade.value=ed.DISABILITY_LEVEL and disability_grade.type='disability_grade'
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
<where> <where>
a.STATUS != '5' a.STATUS != '5'
...@@ -373,6 +338,68 @@ ...@@ -373,6 +338,68 @@
</where> </where>
</select> </select>
<select id="getTPreEmpMainAllListByWork" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
ee.PRE_MAIN_ID mainId,ee.WORK_UNIT field44,ee.WORK_JOB field45,ee.START_DATE field46,ee.END_DATE field47
from t_pre_emp_main a join t_pre_emp_work_recording ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<select id="getTPreEmpMainAllListByFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
a.id mainId,ee.FAMILY_NAME field48,ee.RELATIONSHIP_SELF field49,ee.CONTRACT_TEL field50
FROM t_pre_emp_main a join t_pre_emp_family ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<select id="getTPreEmpMainAllListByProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
a.id mainId,ee.DECLARE_YEAR field52,ee.QUALIFICATION_TYPE field53
FROM t_pre_emp_main a join t_pre_emp_professional_qualification ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
......
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