Commit 5a81ed5c authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关导出

parent 8605730b
......@@ -173,6 +173,14 @@ public class TPreEmpMain extends BaseEntity {
@ExcelProperty("业务类型三级分类")
@Schema(description = "业务类型三级分类")
private String businessThirdType;
/**
* 业务类型汇总
*/
@ExcelAttribute(name = "业务类型汇总")
@ExcelProperty("业务类型汇总")
@Schema(description = "业务类型汇总")
@TableField
private String businessType;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
......
/*
* 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.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import lombok.Data;
/**
* 预入职监控导出全量信息
*
* @author hgw
* @date 2024-6-26 11:03:02
*/
@Data
@ColumnWidth(15)
public class TMainExportAllVO {
private static final long serialVersionUID = 1L;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "信息是否完整")
private String field1;
@ExcelProperty(value = "进项目时间")
private String field2;
@ExcelProperty(value = "员工主码")
private String field3;
@ExcelProperty(value = "员工类型")
private String field4;
@ExcelProperty(value = "员工姓名")
private String field5;
@ExcelProperty(value = "身份证号")
private String field6;
@ExcelProperty(value = "性别")
private String field7;
@ExcelProperty(value = "身份证期限")
private String field8;
@ExcelProperty(value = "身份证开始日期")
private String field9;
@ExcelProperty(value = "身份证截止日期")
private String field10;
@ExcelProperty(value = "出生日期")
private String field11;
@ExcelProperty(value = "年龄")
private String field12;
@ExcelProperty(value = "婚姻状况")
private String field13;
@ExcelProperty(value = "民族")
private String field14;
@ExcelProperty(value = "政治面貌")
private String field15;
@ExcelProperty(value = "手机号码")
private String field16;
@ExcelProperty(value = "邮箱")
private String field17;
@ExcelProperty(value = "户籍所在地")
private String field18;
@ExcelProperty(value = "户口性质")
private String field19;
@ExcelProperty(value = "档案所在地")
private String field20;
@ExcelProperty(value = "档案状态")
private String field21;
@ExcelProperty(value = "通信地址")
private String field22;
@ExcelProperty(value = "客户名称")
private String field23;
@ExcelProperty(value = "项目名称")
private String field24;
@ExcelProperty(value = "业务类型")
private String field25;
@ExcelProperty(value = "合同类型")
private String field26;
@ExcelProperty(value = "工时制")
private String field27;
@ExcelProperty(value = "就职岗位")
private String field28;
@ExcelProperty(value = "入职日期")
private String field29;
@ExcelProperty(value = "试用期")
private String field30;
@ExcelProperty(value = "标签")
private String field31;
@ExcelProperty(value = "姓名")
private String field32;
@ExcelProperty(value = "与本人关系")
private String field33;
@ExcelProperty(value = "联系地址")
private String field34;
@ExcelProperty(value = "联系电话")
private String field35;
@ExcelProperty(value = "学校")
private String field36;
@ExcelProperty(value = "专业")
private String field37;
@ExcelProperty(value = "学历")
private String field38;
@ExcelProperty(value = "是否大专及以上")
private String field39;
@ExcelProperty(value = "最高学历")
private String field40;
@ExcelProperty(value = "入学时间")
private String field41;
@ExcelProperty(value = "毕业时间")
private String field42;
@ExcelProperty(value = "是否为首份工作")
private String field43;
@ExcelProperty(value = "工作单位")
private String field44;
@ExcelProperty(value = "工作岗位")
private String field45;
@ExcelProperty(value = "开始工作日期")
private String field46;
@ExcelProperty(value = "结束工作日期")
private String field47;
@ExcelProperty(value = "成员姓名")
private String field48;
@ExcelProperty(value = "与本人关系")
private String field49;
@ExcelProperty(value = "手机号码")
private String field50;
@ExcelProperty(value = "是否有职业资格证书")
private String field51;
@ExcelProperty(value = "申报年度")
private String field52;
@ExcelProperty(value = "职业资格名称")
private String field53;
@ExcelProperty(value = "是否曾被认定为工伤")
private String field54;
@ExcelProperty(value = "是否有职业病")
private String field55;
@ExcelProperty(value = "职业病名称")
private String field56;
@ExcelProperty(value = "是否有传染性疾病")
private String field57;
@ExcelProperty(value = "传染病名称")
private String field58;
@ExcelProperty(value = "是否持有残疾人证明")
private String field59;
@ExcelProperty(value = "伤残病名称")
private String field60;
@ExcelProperty(value = "伤残等级")
private String field61;
@ExcelProperty(value = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String field62;
@ExcelProperty(value = "不良记录描述")
private String field63;
}
......@@ -37,6 +37,21 @@ public class TCompleteMonitorController {
private final MenuUtil menuUtil;
/**
* 档案完整度监控管理-全量 批量导出
*
* @author hgw
* @date 2024-6-24 16:01:47
**/
@Operation(summary = "导出档案完整度监控管理-全量", description = "导出档案完整度监控管理-全量 权限:archives_monitor-export-all")
@PostMapping("/exportAll")
@PreAuthorize("@pms.hasPermission('archives_monitor-export-all')")
public void exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tCompleteMonitorService.exportAll(response, searchVo);
}
/**
* 简单分页查询
* @param page 分页对象
......
......@@ -228,6 +228,8 @@ public class TPreEmpMainController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export')")
public void export(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tPreEmpMainService.listExport(response, searchVo);
}
......@@ -239,8 +241,10 @@ public class TPreEmpMainController {
**/
@Operation(summary = "导出预入职-全量", description = "导出预入职-全量 hasPermission('archives_tpreempmain-export-all')")
@PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
public void exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tPreEmpMainService.exportAll(response, searchVo);
}
......
......@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -92,4 +89,9 @@ public interface TCompleteMonitorMapper extends BaseMapper<TCompleteMonitor> {
*/
void deleteMonitorInfoByDeptNo(@Param("deptNo") String deptNo);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCount(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
// 导出详情使用 hgw 2024-6-26 11:05:41
List<TMainExportAllVO> getTEmpMainAllList(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
}
......@@ -50,4 +50,7 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
*/
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo);
// 导出全量
void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -10,16 +11,14 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
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.TCompleteMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -28,6 +27,7 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
......@@ -202,4 +202,144 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
}
return false;
}
/**
* 档案完整度监控导出全量
* hgw 2024-6-26 11:19:18
*/
@Override
public void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) {
String name = "档案完整度监控导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTEmpMainAllCount(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));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
List<List<String>> headList = Lists.newArrayList();
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,"通信地址"}));
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 excelWriter = EasyExcelFactory.write(out).head(headList).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
index++;
}
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();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
/**
* @Description: 转化
* @Author: hgw
* @Date: 2024/6/26 11:19
**/
private List<String> getNewArrayList(String[] strArr) {
return Arrays.asList(strArr);
}
}
......@@ -18,7 +18,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -41,7 +40,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.netty.util.internal.StringUtil;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
......@@ -53,7 +51,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
......@@ -924,6 +921,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
emp = tEmployeeInfoService.getById(empId);
if (emp != null) {
BeanUtil.copyProperties(tPreEmployeeInfo, emp);
if (CommonConstants.ONE_INT == emp.getFileStatus()) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
}
tEmployeeInfoService.updateById(emp);
} else {
emp = this.saveTEmployeeInfo(user, tPreEmployeeInfo);
......@@ -933,7 +934,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
project = tEmployeeProjectService.getById(tPreEmployeeProject.getOldId());
if (project != null) {
BeanUtil.copyProperties(tPreEmployeeInfo, project);
tEmployeeInfoService.updateById(emp);
if (CommonConstants.ONE_INT == project.getProjectStatus()) {
project.setCreateTime(LocalDateTime.now());
project.setDeleteFlag(CommonConstants.STATUS_NORMAL);
project.setProjectStatus(CommonConstants.ZERO_INT);
}
tEmployeeProjectService.updateById(project);
} else {
project = this.saveTEmployeeProject(project, user, tPreEmployeeProject, emp, dept);
}
......@@ -1152,9 +1158,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (project == null) {
project = tEmployeeProjectService.getByEmpIdAndDeptIdAndDelete(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
if (project != null) {
project.setCreateTime(LocalDateTime.now());
project.setProjectStatus(CommonConstants.ZERO_INT);
project.setDeleteFlag(CommonConstants.STATUS_NORMAL);
}
} else if (CommonConstants.ONE_INT == project.getProjectStatus()) {
project.setCreateTime(LocalDateTime.now());
project.setProjectStatus(CommonConstants.ZERO_INT);
}
isNew = false;
if (project == null) {
......@@ -1177,8 +1187,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (emp == null) {
emp = tEmployeeInfoService.getInfoByDelete(tPreEmployeeInfo.getEmpIdcard());
if (emp != null) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
emp.setDeleteFlag(CommonConstants.STATUS_NORMAL);
}
} else if (CommonConstants.ONE_INT == emp.getFileStatus()) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
}
boolean isNew = false;
if (emp == null) {
......@@ -1593,7 +1608,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
preEmpMain.setAuditRemark(auditRemark);
preEmpMain.setAuditName(user.getNickname());
preEmpMain.setAuditTime(new Date());
this.updateById(preEmpMain);
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
......@@ -1602,7 +1617,16 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
auditLog.setAuditRemark(auditRemark);
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
tPreEmpMainLogService.save(auditLog);
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
PreEmpMainDetailVo vo = null;
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
vo = voR.getData();
updateToEmployeeByPre(vo);
this.updateById(preEmpMain);
tPreEmpMainLogService.save(auditLog);
}
}
}
if (isTrue) {
......@@ -1613,11 +1637,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
private List<String> getNewArrayList(String[] strArr) {
List<String> aList = Lists.newArrayList();
for (String str : strArr) {
aList.add(str);
}
return aList;
return Arrays.asList(strArr);
}
/**
......@@ -1627,7 +1647,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
*/
@Override
public void exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo) {
String fileName = "预入职导出全量" + DateUtil.getThisTime() + ".xlsx";
String name = "预入职导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTPreEmpMainAllCount(searchVo);
......@@ -1720,7 +1741,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPreEmpMainAllList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("预入职导出全量" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
index++;
}
......@@ -1729,7 +1750,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("预入职导出全量" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......
......@@ -282,4 +282,102 @@
delete from t_complete_monitor WHERE DEPT_NO = #{deptNo}
</delete>
<!-- 导出详情 -->
<select id="getTEmpMainAllCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join view_sys_dict_item emp_natrue on emp_natrue.value=e.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 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_emp_contact_info ec on e.id=ec.EMP_ID
left join t_emp_education ee on e.id=ee.EMP_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_emp_work_recording ew on e.id=ew.EMP_ID
left join t_emp_family ef on e.id=ef.EMP_ID
left join t_emp_professional_qualification ep on e.id=ep.EMP_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_emp_disability_info ed on e.id=ed.EMP_ID
left join t_emp_bad_record eb on e.id=eb.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--导出统计list-->
<select id="getTEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
if(a.IS_COMPLETE=0,'是','否') field1
,p.create_time field2,e.EMP_CODE field3,emp_natrue.label field4,e.emp_name field5,e.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,politicalStatus.label field15,e.EMP_PHONE field16,e.EMP_EMAIL field17
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.FILE_STATUS=0,'正常','已减档') field21
,e.CONTACT_ADDRESS field22,p.UNIT_NAME field23,p.DEPT_NAME field24
,concat(p.BUSINESS_PRIMARY_TYPE,'-',ifnull(p.BUSINESS_SECOND_TYPE,''),'-',ifnull(p.BUSINESS_THIRD_TYPE,'')) field25
,contractType.label field26 ,workingHours.label field27,p.POST field28,p.ENJOIN_DATE field29
,p.TRY_PERIOD field30,p.EMP_LABEL field31
,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
,if(ee.HIGH_IDENTIFICATION=0,'是','否') field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG=0,'是','否') field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,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.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join view_sys_dict_item emp_natrue on emp_natrue.value=e.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 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_emp_contact_info ec on e.id=ec.EMP_ID
left join t_emp_education ee on e.id=ee.EMP_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_emp_work_recording ew on e.id=ew.EMP_ID
left join t_emp_family ef on e.id=ef.EMP_ID
left join t_emp_professional_qualification ep on e.id=ep.EMP_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_emp_disability_info ed on e.id=ed.EMP_ID
left join t_emp_bad_record eb on e.id=eb.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</if>
</select>
</mapper>
......@@ -40,6 +40,7 @@
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
<result property="businessType" column="BUSINESS_TYPE"/>
<result property="empNatrue" column="EMP_NATRUE"/>
<result property="auditId" column="AUDIT_ID"/>
<result property="auditName" column="AUDIT_NAME"/>
......@@ -69,6 +70,7 @@
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
concat(a.BUSINESS_PRIMARY_TYPE,'-',ifnull(a.BUSINESS_SECOND_TYPE,''),'-',ifnull(a.BUSINESS_THIRD_TYPE,'')) BUSINESS_TYPE,
a.EMP_NATRUE,
a.AUDIT_ID,
a.AUDIT_NAME,
......@@ -244,6 +246,30 @@
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"/>
......@@ -267,7 +293,7 @@
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.FILE_STATUS=0,'正常','已减档') field21
,e.CONTACT_ADDRESS field22,p.UNIT_NAME field23,p.DEPT_NAME field24
,concat(p.BUSINESS_PRIMARY_TYPE,'-',p.BUSINESS_SECOND_TYPE,'-',p.BUSINESS_THIRD_TYPE) field25
,concat(p.BUSINESS_PRIMARY_TYPE,'-',ifnull(p.BUSINESS_SECOND_TYPE,''),'-',ifnull(p.BUSINESS_THIRD_TYPE,'')) field25
,contractType.label field26 ,workingHours.label field27,p.POST field28,p.ENJOIN_DATE field29
,p.TRY_PERIOD field30,p.EMP_LABEL field31
,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35
......
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