Commit 9fb36c4b authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.6.6' into MVP1.6.6

parents 1dcc7af4 e605149b
...@@ -249,7 +249,8 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -249,7 +249,8 @@ public class TEmployeeContractInfo extends BaseEntity {
private String settleDomain; private String settleDomain;
/** /**
* 员工类型 * 员工类型_
* 其实是:合同类型。hgw 2024-7-9 11:45:59 验证
*/ */
@ExcelAttribute(name = "员工类型", errorInfo = "员工类型不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.PERSONNEL_TYPE) @ExcelAttribute(name = "员工类型", errorInfo = "员工类型不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
@TableField(exist = false) @TableField(exist = false)
......
...@@ -13,6 +13,7 @@ import lombok.Data; ...@@ -13,6 +13,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
/** /**
* @Author fxj * @Author fxj
...@@ -203,4 +204,10 @@ public class EmpProjectDispatchVo implements Serializable { ...@@ -203,4 +204,10 @@ public class EmpProjectDispatchVo implements Serializable {
*/ */
@Schema(description ="是否更新岗位信息") @Schema(description ="是否更新岗位信息")
private Boolean postUpdate; private Boolean postUpdate;
/**
* 入职日期
*/
@Schema(description ="入职日期")
private LocalDate enjoinDate;
} }
...@@ -37,8 +37,6 @@ public class TCompleteMonitorFlagVo implements Serializable { ...@@ -37,8 +37,6 @@ public class TCompleteMonitorFlagVo implements Serializable {
public Integer fileProvince; public Integer fileProvince;
public Integer fileCity;
public Integer isCollege; public Integer isCollege;
public String hignEducation; public String hignEducation;
......
...@@ -79,8 +79,8 @@ public class FileUploadController { ...@@ -79,8 +79,8 @@ public class FileUploadController {
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" + "\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t") "\t")
@PostMapping(value = "/uploadFileReturnAtta") @PostMapping(value = "/uploadFileReturnAtta")
public R<TAttaInfo> uploadFileReturnAtta(@RequestBody MultipartFile file, String filePath, Integer type, String domain) throws IOException { public R<TAttaInfo> uploadFileReturnAtta(@RequestBody MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
return fileUploadService.uploadFileReturnAtta(file,filePath,type,domain); return fileUploadService.uploadFileReturnAtta(file,filePath,type,domainId);
} }
/** /**
......
...@@ -47,10 +47,10 @@ public class TCompleteMonitorController { ...@@ -47,10 +47,10 @@ public class TCompleteMonitorController {
@Operation(description = "导出档案完整度监控管理-全量 权限:archves_tcompletemonitor_export_all") @Operation(description = "导出档案完整度监控管理-全量 权限:archves_tcompletemonitor_export_all")
@PostMapping("/exportAll") @PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_export_all')") //@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_export_all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) { public void exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
return tCompleteMonitorService.exportAll(response, searchVo); tCompleteMonitorService.exportAll(response, searchVo);
} }
/** /**
...@@ -119,13 +119,13 @@ public class TCompleteMonitorController { ...@@ -119,13 +119,13 @@ public class TCompleteMonitorController {
/** /**
* 通过id查询-主表 * 通过id查询-主表
* *
* @param infoId infoId * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/infoId/{id}") @GetMapping("/infoId")
public R<EmpMainDetailVo> getInfoById(@PathVariable("id") String infoId) { public R<EmpMainDetailVo> getInfoById(String id, String deptId) {
return tCompleteMonitorService.getInfoById(infoId); return tCompleteMonitorService.getInfoById(id, deptId);
} }
/** /**
......
...@@ -242,10 +242,10 @@ public class TPreEmpMainController { ...@@ -242,10 +242,10 @@ public class TPreEmpMainController {
@Operation(summary = "导出预入职-全量", description = "导出预入职-全量 hasPermission('archives_tpreempmain-export-all')") @Operation(summary = "导出预入职-全量", description = "导出预入职-全量 hasPermission('archives_tpreempmain-export-all')")
@PostMapping("/exportAll") @PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')") //@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) { public void exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
return tPreEmpMainService.exportAll(response, searchVo); tPreEmpMainService.exportAll(response, searchVo);
} }
} }
...@@ -37,5 +37,5 @@ public interface TPreEmpMainLogMapper extends BaseMapper<TPreEmpMainLog> { ...@@ -37,5 +37,5 @@ public interface TPreEmpMainLogMapper extends BaseMapper<TPreEmpMainLog> {
* *
* @return * @return
*/ */
List<TPreEmpMainLog> getTPreEmpMainLogList(@Param("mainIid") String mainIid); List<TPreEmpMainLog> getTPreEmpMainLogList(@Param("mainId") String mainId);
} }
...@@ -17,7 +17,7 @@ public interface FileUploadService { ...@@ -17,7 +17,7 @@ public interface FileUploadService {
R<FileVo> uploadImg(MultipartFile file, String filePath, Integer type, String domain) throws IOException; R<FileVo> uploadImg(MultipartFile file, String filePath, Integer type, String domain) throws IOException;
R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domain) throws IOException; R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException;
R<FileVo> createQrCode(String domainId, String url, String name); R<FileVo> createQrCode(String domainId, String url, String name);
} }
...@@ -32,7 +32,7 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> { ...@@ -32,7 +32,7 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
* @Date: 2024/6/28 11:41 * @Date: 2024/6/28 11:41
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain>
**/ **/
R<EmpMainDetailVo> getInfoById(String id); R<EmpMainDetailVo> getInfoById(String id,String deptId);
/** /**
* 档案完整度监控导出 * 档案完整度监控导出
...@@ -61,6 +61,6 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> { ...@@ -61,6 +61,6 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo); IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo);
// 导出全量 // 导出全量
R<String> exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo); void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
} }
...@@ -75,7 +75,7 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> { ...@@ -75,7 +75,7 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
// 导出 // 导出
void listExport(HttpServletResponse response, TPreEmpMainSearchVo searchVo); void listExport(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
// 导出全量 // 导出全量
R<String> exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo); void exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
List<TPreEmpMain> noPageDiy(TPreEmpMainSearchVo searchVo); List<TPreEmpMain> noPageDiy(TPreEmpMainSearchVo searchVo);
......
...@@ -40,7 +40,7 @@ public class FileUploadServiceImpl implements FileUploadService { ...@@ -40,7 +40,7 @@ public class FileUploadServiceImpl implements FileUploadService {
private final QrCodeUtil codeUtil; private final QrCodeUtil codeUtil;
@Override @Override
public R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domain) throws IOException { public R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
if (null == file) { if (null == file) {
return R.failed("文件删除异常,请重新上传!"); return R.failed("文件删除异常,请重新上传!");
} }
...@@ -70,7 +70,7 @@ public class FileUploadServiceImpl implements FileUploadService { ...@@ -70,7 +70,7 @@ public class FileUploadServiceImpl implements FileUploadService {
attaInfo = initUnitAttaForInsert(fileName, key, file.getSize()); attaInfo = initUnitAttaForInsert(fileName, key, file.getSize());
attaInfo.setRelationType(String.valueOf(type)); attaInfo.setRelationType(String.valueOf(type));
try { try {
attaInfo.setDomainId(domain); attaInfo.setDomainId(domainId);
Set<String> dbAuthsSet = new HashSet<>(); Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils Collection<? extends GrantedAuthority> authorities = AuthorityUtils
......
...@@ -233,197 +233,11 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -233,197 +233,11 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
* @return * @return
*/ */
@Override @Override
public R<String> exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) {
String name = "档案完整度监控详情";
String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTEmpMainAllCount(searchVo);
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
return R.failed("数据超过6万条,请联系管理员后端导出!");
}
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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 2家庭成员
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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
// 3职业资格
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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
excelWriter.write(list, writeSheet.build());
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);
}
}
return null;
}
/**
* 档案完整度监控详情
* hgw 2024-6-26 11:19:18
*/
/*@Override
public void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) { public void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo) {
String name = "档案完整度监控详情"; String name = "档案完整度监控详情";
String fileName = name + DateUtil.getThisTime() + ".xlsx"; String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TMainExportAllVO> listAll = Lists.newArrayList();
List<TMainExportAllVO> list = Lists.newArrayList(); List<TMainExportAllVO> list = Lists.newArrayList();
List<TMainExportAllVO> list1 = Lists.newArrayList();
List<TMainExportAllVO> list2 = Lists.newArrayList();
List<TMainExportAllVO> list3 = Lists.newArrayList();
long count = baseMapper.getTEmpMainAllCount(searchVo); long count = baseMapper.getTEmpMainAllCount(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
...@@ -431,209 +245,165 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -431,209 +245,165 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 ExcelWriter excelWriter = null;
List<List<String>> headList = Lists.newArrayList(); if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
headList.add(this.getNewArrayList(new String[]{"信息是否完整","信息是否完整"})); List<List<String>> strList = new ArrayList<>();
headList.add(this.getNewArrayList(new String[]{"进项目时间","进项目时间"})); strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!"}));
String oneTitle = "员工基本信息"; List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工主码"})); headList.add(this.getNewArrayList(new String[]{"提示"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工类型"})); EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
headList.add(this.getNewArrayList(new String[]{oneTitle,"员工姓名"})); } else {
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证号"})); // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
headList.add(this.getNewArrayList(new String[]{oneTitle,"性别"})); List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证期限"})); headList.add(this.getNewArrayList(new String[]{"信息是否完整", "信息是否完整"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证开始日期"})); headList.add(this.getNewArrayList(new String[]{"进项目时间", "进项目时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle,"身份证截止日期"})); 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, "户口性质"}));
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, "客户名称"}));
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,"学历"})); 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 = "主要工作经历"; 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,"与本人关系"})); 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 = "伤残信息"; 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,"伤残等级"})); 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, "职业病名称"}));
ExcelWriter excelWriter = EasyExcelFactory.write(out).head(headList).build(); headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
int index = 0; headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
if (count > 100) { headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
count = 100; headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
} headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
if (count > CommonConstants.ZERO_INT) { headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
int maxCycle = 50; oneTitle = "不良记录";
for (int i = 0; i <= count; i += maxCycle) { headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
// 获取实际记录 excelWriter = EasyExcelFactory.write(out).head(headList).build();
searchVo.setLimitStart(i); int index = 0;
searchVo.setLimitEnd(maxCycle); if (count > CommonConstants.ZERO_INT) {
list = baseMapper.getTEmpMainAllList(searchVo); for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
if (list !=null && !list.isEmpty()) { // 获取实际记录
listAll = Lists.newArrayList(); searchVo.setLimitStart(i);
list1 = baseMapper.getTEmpMainAllListOneWork(searchVo); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
Map<String, List<TMainExportAllVO>> map1 = new HashMap<>(); list = baseMapper.getTEmpMainAllList(searchVo);
Map<String, List<TMainExportAllVO>> map2 = new HashMap<>(); if (Common.isNotNull(list)) {
Map<String, List<TMainExportAllVO>> map3 = new HashMap<>(); ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index);
List<TMainExportAllVO> tempList; excelWriter.write(list, writeSheet.build());
List<TMainExportAllVO> tempList1; index++;
List<TMainExportAllVO> tempList2;
List<TMainExportAllVO> tempList3;
for (TMainExportAllVO vo : list1) {
tempList = map1.get(vo.getField6());
if (tempList == null || tempList.isEmpty()) {
tempList = Lists.newArrayList();
}
tempList.add(vo);
map1.put(vo.getField6(), tempList);
} }
list2 = baseMapper.getTEmpMainAllListTwoFamily(searchVo); if (Common.isNotNull(list)) {
for (TMainExportAllVO vo : list2) { list.clear();
tempList = map2.get(vo.getField6());
if (tempList == null || tempList.isEmpty()) {
tempList = Lists.newArrayList();
}
tempList.add(vo);
map2.put(vo.getField6(), tempList);
} }
list3 = baseMapper.getTEmpMainAllListThreeProfessional(searchVo); }
for (TMainExportAllVO vo : list3) { // 1工作经历
tempList = map3.get(vo.getField6()); count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
if (tempList == null || tempList.isEmpty()) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
tempList = Lists.newArrayList(); // 获取实际记录
} searchVo.setLimitStart(i);
tempList.add(vo); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
map3.put(vo.getField6(), tempList); list = baseMapper.getTEmpMainAllListOneWork(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index);
excelWriter.write(list, writeSheet.build());
index++;
} }
TMainExportAllVO tempVo; if (Common.isNotNull(list)) {
TMainExportAllVO saveVo; list.clear();
for (TMainExportAllVO vo : list) {
tempList1 = map1.get(vo.getField6());
tempList2 = map2.get(vo.getField6());
tempList3 = map3.get(vo.getField6());
if ((tempList1 != null && tempList1.size()>1)
|| (tempList2 != null && tempList2.size()>1)
|| (tempList3 != null && tempList3.size()>1)) {
int maxSize=1;
if (tempList1 != null) {
maxSize = tempList1.size();
}
if (tempList2 != null && tempList2.size() > maxSize) {
maxSize=tempList2.size();
}
if (tempList3 != null && tempList3.size() > maxSize) {
maxSize=tempList3.size();
}
for (int k=0;k<maxSize;k++) {
if (k == 0) {
saveVo = vo;
} else {
saveVo = null;
}
if (tempList1 != null && tempList1.size()>k) {
if (saveVo == null) {
saveVo = tempList1.get(k);
} else {
tempVo = tempList1.get(k);
saveVo.setField43(tempVo.getField43());
saveVo.setField44(tempVo.getField44());
saveVo.setField45(tempVo.getField45());
saveVo.setField46(tempVo.getField46());
saveVo.setField47(tempVo.getField47());
}
}
if (tempList2 != null && tempList2.size()>k) {
if (saveVo == null) {
saveVo = tempList2.get(k);
} else {
tempVo = tempList2.get(k);
saveVo.setField48(tempVo.getField48());
saveVo.setField49(tempVo.getField49());
saveVo.setField50(tempVo.getField50());
}
}
if (tempList3 != null && tempList3.size()>k) {
if (saveVo == null) {
saveVo = tempList3.get(k);
} else {
tempVo = tempList3.get(k);
saveVo.setField51(tempVo.getField51());
saveVo.setField52(tempVo.getField52());
saveVo.setField53(tempVo.getField53());
}
}
listAll.add(saveVo);
}
}
} }
} }
// 2家庭成员
if (Common.isNotNull(listAll)) { count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build(); for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
excelWriter.write(listAll, writeSheet); // 获取实际记录
index++; searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmpMainAllListTwoFamily(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
} }
if (Common.isNotNull(list)) { // 3职业资格
list.clear(); 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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
excelWriter.write(list, writeSheet.build());
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();
} }
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(name + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
} }
out.flush(); out.flush();
excelWriter.finish(); if (excelWriter != null) {
excelWriter.finish();
}
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
} finally { } finally {
...@@ -645,7 +415,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -645,7 +415,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
log.error("执行异常", e); log.error("执行异常", e);
} }
} }
}*/ }
/** /**
* @Description: 详情 * @Description: 详情
...@@ -654,7 +424,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -654,7 +424,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.vo.EmpMainDetailVo> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.vo.EmpMainDetailVo>
**/ **/
@Override @Override
public R<EmpMainDetailVo> getInfoById(String id) { public R<EmpMainDetailVo> getInfoById(String id,String deptId) {
EmpMainDetailVo vo = new EmpMainDetailVo(); EmpMainDetailVo vo = new EmpMainDetailVo();
if (id != null) { if (id != null) {
// 员工不良记录表 // 员工不良记录表
...@@ -687,7 +457,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -687,7 +457,7 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(id); TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(id);
vo.setTEmployeeInfo(tEmployeeInfo); vo.setTEmployeeInfo(tEmployeeInfo);
// 项目档案表 // 项目档案表
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getListByEmpId(id,1).get(0); TEmployeeProject tEmployeeProject = tEmployeeProjectService.getByEmpIdAndDeptId(id,deptId);
vo.setTEmployeeProject(tEmployeeProject); vo.setTEmployeeProject(tEmployeeProject);
// 员工职业资格信息表 // 员工职业资格信息表
List<TEmpProfessionalQualification> tEmpProfessionalQualificationList = tEmpProfessionalQualificationService.getListByEmpId(id); List<TEmpProfessionalQualification> tEmpProfessionalQualificationList = tEmpProfessionalQualificationService.getListByEmpId(id);
......
...@@ -69,6 +69,7 @@ import java.lang.reflect.Field; ...@@ -69,6 +69,7 @@ import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*; import java.util.*;
/** /**
...@@ -739,8 +740,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -739,8 +740,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT) .eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
String tempStr = null;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contractInfo.getContractName())){
tempStr = entry.getKey();
break;
}
}
if (tEmployeeProject != null) { if (tEmployeeProject != null) {
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT); tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
//签订类型正常签订的时候更新项目档案信息
if (EmployeeConstants.SITUATION_ONE.equals(contractInfo.getSituation())) {
tEmployeeProject.setContractType(null == tempStr? "":tempStr);
tEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
tEmployeeProject.setPost(contractInfo.getPost());
tEmployeeProject.setEnjoinDate(contractInfo.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
tEmployeeProject.setTryPeriod(contractInfo.getTryPeriod());
}
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.updateById(tEmployeeProject);
} }
// 更新档案、项目合同状态为(1在用) // 更新档案、项目合同状态为(1在用)
...@@ -760,7 +779,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -760,7 +779,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query() TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId())); .lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) { if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(contractInfo.getContractType()); preEmployeeProject.setContractType(null == tempStr? "":tempStr);
preEmployeeProject.setWorkingHours(contractInfo.getWorkingHours()); preEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
preEmployeeProject.setPost(contractInfo.getPost()); preEmployeeProject.setPost(contractInfo.getPost());
preEmployeeProject.setEnjoinDate(contractInfo.getContractStart()); preEmployeeProject.setEnjoinDate(contractInfo.getContractStart());
...@@ -1597,6 +1616,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1597,6 +1616,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
List<TEmployeeContractInfo> contractInfoList; List<TEmployeeContractInfo> contractInfoList;
List<TEmployeeContractInfo> contractInfoListZt; List<TEmployeeContractInfo> contractInfoListZt;
TWorkHandlerInfo handlerInfo; TWorkHandlerInfo handlerInfo;
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
for (TEmployeeContractInfo contract : contractInfos) { for (TEmployeeContractInfo contract : contractInfos) {
i++; i++;
if (contract.getAuditStatus() != CommonConstants.ONE_INT) { if (contract.getAuditStatus() != CommonConstants.ONE_INT) {
...@@ -1621,6 +1645,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1621,6 +1645,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now()); tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
// 更新档案、项目合同状态为(1可用) // 更新档案、项目合同状态为(1可用)
String tempStr = null;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contract.getContractName())){
tempStr = entry.getKey();
break;
}
}
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query() tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpId, contract.getEmpId()) .lambda().eq(TEmployeeProject::getEmpId, contract.getEmpId())
.eq(TEmployeeProject::getDeptId, contract.getSettleDomain()) .eq(TEmployeeProject::getDeptId, contract.getSettleDomain())
...@@ -1629,6 +1660,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1629,6 +1660,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (tEmployeeProject != null) { if (tEmployeeProject != null) {
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT); tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
//签订类型正常签订的时候更新项目档案信息
if (EmployeeConstants.SITUATION_ONE.equals(contract.getSituation())) {
tEmployeeProject.setContractType(null == tempStr? "":tempStr);
tEmployeeProject.setWorkingHours(contract.getWorkingHours());
tEmployeeProject.setPost(contract.getPost());
tEmployeeProject.setEnjoinDate(contract.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
tEmployeeProject.setTryPeriod(contract.getTryPeriod());
}
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.updateById(tEmployeeProject);
} }
// 更新档案、项目合同状态为(1在用) // 更新档案、项目合同状态为(1在用)
...@@ -1648,7 +1687,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1648,7 +1687,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query() TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId())); .lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) { if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(contract.getContractType()); preEmployeeProject.setContractType(null == tempStr? "":tempStr);
preEmployeeProject.setWorkingHours(contract.getWorkingHours()); preEmployeeProject.setWorkingHours(contract.getWorkingHours());
preEmployeeProject.setPost(contract.getPost()); preEmployeeProject.setPost(contract.getPost());
preEmployeeProject.setEnjoinDate(contract.getContractStart()); preEmployeeProject.setEnjoinDate(contract.getContractStart());
......
...@@ -468,6 +468,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -468,6 +468,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tPreEmployeeProject == null) { if (tPreEmployeeProject == null) {
tPreEmployeeProject = new TPreEmployeeProject(); tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard()); tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
tPreEmployeeProject.setBusinessPrimaryType(dept.getBusinessPrimaryType());
tPreEmployeeProject.setBusinessSecondType(dept.getBusinessSecondType());
tPreEmployeeProject.setBusinessThirdType(dept.getBusinessThirdType());
tPreEmployeeProject.setDeptId(main.getDeptId()); tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName()); tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo()); tPreEmployeeProject.setDeptNo(main.getDeptNo());
...@@ -780,7 +786,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -780,7 +786,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private R<String> saveBase(PreEmpMainDetailVo vo, String status) { private R<String> saveBase(PreEmpMainDetailVo vo, String status) {
YifuUser user = getNewYifuUser(); YifuUser user = getNewYifuUser();
TPreEmpMain main = vo.getMain(); TPreEmpMain main = vo.getMain();
if (main != null && Common.isNotNull(main.getEmpIdcard())) { String idCard = main.getEmpIdcard();
if (main != null && Common.isNotNull(idCard)) {
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject(); TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) { if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表 // 预入职-人员档案表
...@@ -840,12 +847,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -840,12 +847,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (attaList != null) { if (attaList != null) {
tAttaInfoService.deleteByDomainId(tPreEmpEducation.getId()); tAttaInfoService.deleteByDomainId(tPreEmpEducation.getId());
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(tPreEmpEducation.getId()); atta.setDomainId(tPreEmpEducation.getId());
atta.setCreateBy(user.getId()); atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname()); atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now()); atta.setCreateTime(LocalDateTime.now());
} }
tAttaInfoService.saveOrUpdateBatch(attaList); tAttaInfoService.saveBatch(attaList);
} }
} }
} }
...@@ -854,6 +862,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -854,6 +862,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (tPreEmpFamily != null) { if (tPreEmpFamily != null) {
tPreEmpFamilyService.deleteFamilyByMainId(mainId); tPreEmpFamilyService.deleteFamilyByMainId(mainId);
for (TPreEmpFamily info : tPreEmpFamily) { for (TPreEmpFamily info : tPreEmpFamily) {
info.setEmpIdcard(idCard);
info.setPreMainId(mainId); info.setPreMainId(mainId);
info.setCreateBy(user.getId()); info.setCreateBy(user.getId());
info.setCreateName(user.getNickname()); info.setCreateName(user.getNickname());
...@@ -904,6 +913,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -904,6 +913,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 先删除后增加 // 先删除后增加
tPreEmpProfessionalService.deleteProfessionalByMainId(mainId); tPreEmpProfessionalService.deleteProfessionalByMainId(mainId);
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) { for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
info.setEmpIdcard(idCard);
info.setPreMainId(mainId); info.setPreMainId(mainId);
info.setCreateBy(user.getId()); info.setCreateBy(user.getId());
info.setCreateName(user.getNickname()); info.setCreateName(user.getNickname());
...@@ -915,12 +925,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -915,12 +925,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (attaList != null) { if (attaList != null) {
tAttaInfoService.deleteByDomainId(info.getId()); tAttaInfoService.deleteByDomainId(info.getId());
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(info.getId()); atta.setDomainId(info.getId());
atta.setCreateBy(user.getId()); atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname()); atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now()); atta.setCreateTime(LocalDateTime.now());
} }
tAttaInfoService.saveOrUpdateBatch(attaList); tAttaInfoService.saveBatch(attaList);
} }
} }
} }
...@@ -931,6 +942,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -931,6 +942,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 先删除后增加 // 先删除后增加
tPreEmpWorkRecordingService.deleteByMainId(mainId); tPreEmpWorkRecordingService.deleteByMainId(mainId);
for (TPreEmpWorkRecording info : tPreEmpWorkRecording) { for (TPreEmpWorkRecording info : tPreEmpWorkRecording) {
info.setEmpIdcard(idCard);
info.setPreMainId(mainId); info.setPreMainId(mainId);
info.setCreateBy(user.getId()); info.setCreateBy(user.getId());
info.setCreateName(user.getNickname()); info.setCreateName(user.getNickname());
...@@ -944,12 +956,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -944,12 +956,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 先删除后增加 // 先删除后增加
tAttaInfoService.deleteByDomainId(mainId); tAttaInfoService.deleteByDomainId(mainId);
for (TAttaInfo info : attaInfoList) { for (TAttaInfo info : attaInfoList) {
info.setId(null);
info.setDomainId(mainId); info.setDomainId(mainId);
info.setCreateBy(user.getId()); info.setCreateBy(user.getId());
info.setCreateName(user.getNickname()); info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now()); info.setCreateTime(LocalDateTime.now());
} }
tAttaInfoService.saveOrUpdateBatch(attaInfoList); tAttaInfoService.saveBatch(attaInfoList);
} }
} }
return R.ok("成功"); return R.ok("成功");
...@@ -990,7 +1003,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -990,7 +1003,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 预入职-员工学历信息表 // 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation(); TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
// 如果档案项目id都没有,则新增。newFlag是true: // 如果档案项目id都没有,则新增。newFlag是true:
boolean newFlag = true;
String empId = null; String empId = null;
String empIdCard = null; String empIdCard = null;
// 1人员档案 // 1人员档案
...@@ -1023,7 +1035,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1023,7 +1035,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId()) if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())
&& Common.isNotNull(tPreEmployeeProject.getOldId())) { && Common.isNotNull(tPreEmployeeProject.getOldId())) {
newFlag = false;
empId = tPreEmployeeInfo.getOldId(); empId = tPreEmployeeInfo.getOldId();
emp = tEmployeeInfoService.getById(empId); emp = tEmployeeInfoService.getById(empId);
if (emp != null) { if (emp != null) {
...@@ -1122,9 +1133,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1122,9 +1133,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList(); List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) { if (attaList != null) {
String attaId = tPreEmpEducation.getOldId(); String attaId = tPreEmpEducation.getOldId();
if (!newFlag) { tAttaInfoService.deleteByDomainId(attaId);
tAttaInfoService.deleteByDomainId(attaId);
}
TAttaInfo newEmpAtta; TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo(); newEmpAtta = new TAttaInfo();
...@@ -1237,9 +1246,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1237,9 +1246,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
// 预入职-员工职业资格信息表 // 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList(); List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList();
// 先删除其他信息
tEmpProfessionalService.deleteProfessionalByEmpId(empId);
if (tPreEmpProfessionalQualificationList != null) { if (tPreEmpProfessionalQualificationList != null) {
// 先删除其他信息
tEmpProfessionalService.deleteProfessionalByEmpId(empId);
TEmpProfessionalQualification info; TEmpProfessionalQualification info;
for (TPreEmpProfessionalQualification preInfo : tPreEmpProfessionalQualificationList) { for (TPreEmpProfessionalQualification preInfo : tPreEmpProfessionalQualificationList) {
info = new TEmpProfessionalQualification(); info = new TEmpProfessionalQualification();
...@@ -1263,9 +1272,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1263,9 +1272,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = preInfo.getAttaList(); List<TAttaInfo> attaList = preInfo.getAttaList();
if (attaList != null) { if (attaList != null) {
String attaId = preInfo.getOldId(); String attaId = preInfo.getOldId();
if (!newFlag) { tAttaInfoService.deleteByDomainId(attaId);
tAttaInfoService.deleteByDomainId(attaId);
}
TAttaInfo newEmpAtta; TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo(); newEmpAtta = new TAttaInfo();
...@@ -1285,9 +1292,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1285,9 +1292,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
// 预入职-员工工作履历信息表 // 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList(); List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList();
// 先删除其他信息
tEmpWorkRecordingService.deleteWorkRecordByEmpId(empId);
if (tPreEmpWorkRecordingList != null) { if (tPreEmpWorkRecordingList != null) {
// 先删除其他信息
tEmpWorkRecordingService.deleteWorkRecordByEmpId(empId);
TEmpWorkRecording info; TEmpWorkRecording info;
for (TPreEmpWorkRecording preInfo : tPreEmpWorkRecordingList) { for (TPreEmpWorkRecording preInfo : tPreEmpWorkRecordingList) {
info = new TEmpWorkRecording(); info = new TEmpWorkRecording();
...@@ -1305,10 +1312,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1305,10 +1312,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
if (Common.isNotNull(preInfo.getOldId())) { if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId()); info.setId(preInfo.getOldId());
tEmpWorkRecordingService.updateById(info);
} else {
tEmpWorkRecordingService.save(info);
} }
tEmpWorkRecordingService.save(info);
} }
} }
// 预入职-附件 // 预入职-附件
...@@ -1327,7 +1332,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1327,7 +1332,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
attaEmp.setCreateTime(LocalDateTime.now()); attaEmp.setCreateTime(LocalDateTime.now());
attaEmpList.add(attaEmp); attaEmpList.add(attaEmp);
} }
tAttaInfoService.saveOrUpdateBatch(attaList);
tAttaInfoService.saveBatch(attaEmpList); tAttaInfoService.saveBatch(attaEmpList);
} }
return R.ok("成功!"); return R.ok("成功!");
...@@ -1825,9 +1829,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1825,9 +1829,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) { if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去 // 转到更新档案去
vo = voR.getData(); vo = voR.getData();
updateToEmployeeByPre(vo);
this.updateById(preEmpMain); this.updateById(preEmpMain);
tPreEmpMainLogService.save(auditLog); tPreEmpMainLogService.save(auditLog);
if (CommonConstants.FOUR_STRING.equals(status)) {
updateToEmployeeByPre(vo);
}
} }
} }
} }
...@@ -1848,168 +1854,174 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1848,168 +1854,174 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return * @return
*/ */
@Override @Override
public R<String> exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo) { public void exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo) {
String name = "预入职导出全量"; String name = "预入职导出全量";
String fileName = name + DateUtil.getThisTime() + ".xlsx"; String fileName = name + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TPreMainExportAllVO> list = Lists.newArrayList(); List<TPreMainExportAllVO> list = Lists.newArrayList();
long count = baseMapper.getTPreEmpMainAllCount(searchVo); long count = baseMapper.getTPreEmpMainAllCount(searchVo);
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
return R.failed("数据超过6万条,请联系管理员后端导出!");
}
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 ExcelWriter excelWriter = null;
List<List<String>> headList = Lists.newArrayList(); if (count > CommonConstants.EXCEL_EXPORT_LIMIT) {
headList.add(this.getNewArrayList(new String[]{"状态", "状态"})); List<List<String>> strList = new ArrayList<>();
headList.add(this.getNewArrayList(new String[]{"提交时间", "提交时间"})); strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!!"}));
String oneTitle = "员工基本信息"; List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工主码"})); headList.add(this.getNewArrayList(new String[]{"提示"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工类型"})); EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
headList.add(this.getNewArrayList(new String[]{oneTitle, "员工姓名"})); } else {
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证号"})); // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
headList.add(this.getNewArrayList(new String[]{oneTitle, "性别"})); List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证期限"})); headList.add(this.getNewArrayList(new String[]{"状态", "状态"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证开始日期"})); headList.add(this.getNewArrayList(new String[]{"提交时间", "提交时间"}));
headList.add(this.getNewArrayList(new String[]{oneTitle, "身份证截止日期"})); 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, "户口性质"}));
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, "客户名称"}));
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, "学历"})); 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 = "主要工作经历"; 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, "与本人关系"})); 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 = "伤残信息"; 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, "伤残等级"})); 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, "职业病名称"}));
ExcelWriter excelWriter = EasyExcelFactory.write(out).head(headList).build(); headList.add(this.getNewArrayList(new String[]{oneTitle, "是否有传染性疾病"}));
int index = 0; headList.add(this.getNewArrayList(new String[]{oneTitle, "传染病名称"}));
if (count > CommonConstants.ZERO_INT) { headList.add(this.getNewArrayList(new String[]{oneTitle, "是否持有残疾人证明"}));
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残病名称"}));
// 获取实际记录 headList.add(this.getNewArrayList(new String[]{oneTitle, "伤残等级"}));
searchVo.setLimitStart(i); headList.add(this.getNewArrayList(new String[]{oneTitle, "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"}));
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); oneTitle = "不良记录";
list = baseMapper.getTPreEmpMainAllList(searchVo); headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
if (Common.isNotNull(list)) { excelWriter = EasyExcelFactory.write(out).head(headList).build();
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index); int index = 0;
excelWriter.write(list, writeSheet.build()); if (count > CommonConstants.ZERO_INT) {
index++; for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
} // 获取实际记录
if (Common.isNotNull(list)) { searchVo.setLimitStart(i);
list.clear(); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPreEmpMainAllList(searchVo);
if (Common.isNotNull(list)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet(name + index);
excelWriter.write(list, writeSheet.build());
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
} }
}
// 1工作经历 // 1工作经历
count = baseMapper.getTEmpMainAllCountOneWork(searchVo); count = baseMapper.getTEmpMainAllCountOneWork(searchVo);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index); ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("工作经历" + index);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
list.clear(); list.clear();
}
} }
} // 2家庭成员
// 2家庭成员 count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo);
count = baseMapper.getTEmpMainAllCountTwoFamily(searchVo); for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { // 获取实际记录
// 获取实际记录 searchVo.setLimitStart(i);
searchVo.setLimitStart(i); 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)) { ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index);
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("家庭成员" + index); excelWriter.write(list, writeSheet.build());
excelWriter.write(list, writeSheet.build()); index++;
index++; }
if (Common.isNotNull(list)) {
list.clear();
}
} }
if (Common.isNotNull(list)) { // 3职业资格
list.clear(); 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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
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职业资格 if (Common.isNotNull(list)) {
count = baseMapper.getTEmpMainAllCountThreeProfessional(searchVo); list.clear();
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)) {
ExcelWriterSheetBuilder writeSheet = EasyExcelFactory.writerSheet("职业资格" + index);
excelWriter.write(list, writeSheet.build());
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(); out.flush();
excelWriter.finish(); excelWriter.finish();
...@@ -2024,7 +2036,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2024,7 +2036,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
log.error("执行异常", e); log.error("执行异常", e);
} }
} }
return null;
} }
} }
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
from from
t_employee_project a t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id left join t_employee_info b on a.EMP_ID = b.id
where a.DELETE_FLAG = '0' and a.dept_no = #{deptNo} where a.DELETE_FLAG = '0' and a.project_status = 0 and a.dept_no = #{deptNo} order by a.CREATE_TIME desc
</select> </select>
<!--生成数据封装--> <!--生成数据封装-->
...@@ -205,7 +205,6 @@ ...@@ -205,7 +205,6 @@
e.EMP_PHONE empPhone, e.EMP_PHONE empPhone,
e.EMP_REGIS_TYPE empRegisType, e.EMP_REGIS_TYPE empRegisType,
e.FILE_PROVINCE fileProvince, e.FILE_PROVINCE fileProvince,
e.FILE_CITY fileCity,
e.IS_COLLEGE isCollege, e.IS_COLLEGE isCollege,
e.HIGN_EDUCATION hignEducation, e.HIGN_EDUCATION hignEducation,
e.SCHOOL, e.SCHOOL,
...@@ -229,7 +228,7 @@ ...@@ -229,7 +228,7 @@
d.id as contactInfoId, d.id as contactInfoId,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,1) != 1 and ifnull(f.INFECTIOUS_DISEASE_FLAG,1) != 1 and ifnull(f.DISABILITY_FLAG,1) != 1 and ifnull(f.OTHER_FLAG,1) != 1,'1',null) as disabilityFlag, if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,'6') != '6' and ifnull(f.INFECTIOUS_DISEASE_FLAG,'6') != '6' and ifnull(f.DISABILITY_FLAG,'6') != '6' and ifnull(f.OTHER_FLAG,'6') != '6','1',null) as disabilityFlag,
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag, if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
...@@ -252,7 +251,6 @@ ...@@ -252,7 +251,6 @@
ee.EMP_PHONE, ee.EMP_PHONE,
ee.EMP_REGIS_TYPE, ee.EMP_REGIS_TYPE,
ee.FILE_PROVINCE, ee.FILE_PROVINCE,
ee.FILE_CITY,
ee.IS_COLLEGE, ee.IS_COLLEGE,
ee.HIGN_EDUCATION, ee.HIGN_EDUCATION,
ee.SCHOOL, ee.SCHOOL,
...@@ -272,8 +270,8 @@ ...@@ -272,8 +270,8 @@
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '1' left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '0'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '1' group by EMP_ID) g on a.EMP_ID = g.EMP_ID left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '0' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0
<if test="deptNo != null and deptNo.trim() != ''"> <if test="deptNo != null and deptNo.trim() != ''">
and a.DEPT_NO = #{deptNo} and a.DEPT_NO = #{deptNo}
...@@ -308,11 +306,11 @@ ...@@ -308,11 +306,11 @@
<!--导出统计list--> <!--导出统计list-->
<select id="getTEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO"> <select id="getTEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT SELECT
if(a.IS_COMPLETE=0,'是','否') field1 if(p.IS_COMPLETE=0,'是','否') field1
,DATE_FORMAT(p.create_time,'%Y-%m-%d') field2,e.EMP_CODE field3,emp_natrue.label field4,e.emp_name field5,e.emp_idcard field6 ,DATE_FORMAT(p.create_time,'%Y-%m-%d') 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.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 ,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30','长期','固定')) field8 ,e.VALIDITY_START field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14 ,if(e.VALIDITY_END > '2999-12-30','长期',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 ,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(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.status=0,'草稿','已审核') field21 ,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.status=0,'草稿','已审核') field21
...@@ -325,12 +323,12 @@ ...@@ -325,12 +323,12 @@
,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42 ,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,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.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
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50 ,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(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,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63 ,ed.DISABILITY_NAME field60,disability_grade.label field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join ( left join (
...@@ -362,6 +360,7 @@ ...@@ -362,6 +360,7 @@
left join t_emp_education ee on e.id=ee.EMP_ID and ee.DELETE_FLAG = '0' left join t_emp_education ee on e.id=ee.EMP_ID and ee.DELETE_FLAG = '0'
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education' left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_emp_disability_info ed on e.id=ed.EMP_ID and ed.DELETE_FLAG = '0' left join t_emp_disability_info ed on e.id=ed.EMP_ID and ed.DELETE_FLAG = '0'
left join view_sys_dict_item disability_grade on disability_grade.value=ed.DISABILITY_LEVEL and disability_grade.type='disability_grade'
left join t_emp_bad_record eb on e.id=eb.EMP_ID left join t_emp_bad_record eb on e.id=eb.EMP_ID
left join ( left join (
select select
...@@ -382,6 +381,7 @@ ...@@ -382,6 +381,7 @@
from t_emp_family ee from t_emp_family ee
GROUP BY ee.EMP_ID GROUP BY ee.EMP_ID
) ef on e.id=ef.EMP_ID ) ef on e.id=ef.EMP_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
left join ( left join (
select select
SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID
...@@ -405,17 +405,22 @@ ...@@ -405,17 +405,22 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
SELECT SELECT
count(1) count(1) from (
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO 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 t_employee_info e on p.EMP_ID=e.id
left join t_emp_work_recording ew on e.id=ew.EMP_ID left join t_emp_work_recording ew on e.id=ew.EMP_ID
<where> <where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ew.id is not null and ew.DELETE_FLAG = '0' and EXISTS ( p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ew.id is not null and ew.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where
ea.emp_id=ew.emp_id
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ew.id
) a
</select> </select>
<!--导出统计list1主要工作经历--> <!--导出统计list1主要工作经历-->
...@@ -433,6 +438,7 @@ ...@@ -433,6 +438,7 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ew.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null"> <if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null"> <if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd} limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
...@@ -443,7 +449,9 @@ ...@@ -443,7 +449,9 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer">
SELECT SELECT
count(1) count(1) from (
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO 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 t_employee_info e on p.EMP_ID=e.id
...@@ -454,22 +462,25 @@ ...@@ -454,22 +462,25 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ef.id ) a
</select> </select>
<!--导出统计list2主要家庭成员信息--> <!--导出统计list2主要家庭成员信息-->
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO"> <select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50 ,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO 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 t_employee_info e on p.EMP_ID=e.id
left join t_emp_family ef on e.id=ef.EMP_ID left join t_emp_family ef on e.id=ef.EMP_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
<where> <where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS ( p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ef.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null"> <if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null"> <if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd} limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
...@@ -480,7 +491,9 @@ ...@@ -480,7 +491,9 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer">
SELECT SELECT
count(1) count(1) from (
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO 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 t_employee_info e on p.EMP_ID=e.id
...@@ -491,6 +504,7 @@ ...@@ -491,6 +504,7 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ep.id ) a
</select> </select>
<!--导出统计list3职业资格信息--> <!--导出统计list3职业资格信息-->
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO"> <select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
...@@ -508,6 +522,7 @@ ...@@ -508,6 +522,7 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ep.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null"> <if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null"> <if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd} limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
......
...@@ -48,6 +48,6 @@ ...@@ -48,6 +48,6 @@
</resultMap> </resultMap>
<delete id="deleteWorkRecordByEmpId"> <delete id="deleteWorkRecordByEmpId">
delete from t_pre_emp_work_recording where EMP_ID = #{empId} delete from t_emp_work_recording where EMP_ID = #{empId}
</delete> </delete>
</mapper> </mapper>
...@@ -71,6 +71,6 @@ ...@@ -71,6 +71,6 @@
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_pre_emp_main_log a FROM t_pre_emp_main_log a
where main_id = #{mainIid} where main_id = #{mainId}
</select> </select>
</mapper> </mapper>
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
</if> </if>
</if> </if>
</where> </where>
order by a.create_time desc
</select> </select>
<select id="getTPreEmpMainCount" resultType="java.lang.Integer"> <select id="getTPreEmpMainCount" resultType="java.lang.Integer">
...@@ -287,8 +288,8 @@ ...@@ -287,8 +288,8 @@
case a.STATUS when '0' then '草稿' when '1' then '待完善' when '2' then '待审核' when '3' then '审核不通过' when '4' then '审核通过' else '-' end field1 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') field2,e.EMP_CODE field3,emp_natrue.label field4,a.emp_name field5,a.emp_idcard field6 ,DATE_FORMAT(a.create_time,'%Y-%m-%d') field2,e.EMP_CODE field3,emp_natrue.label 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
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9 ,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30','长期','固定')) field8 ,e.VALIDITY_START field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14 ,if(e.VALIDITY_END > '2999-12-30','长期',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 ,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(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.status=0,'草稿','已审核') field21 ,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.status=0,'草稿','已审核') field21
...@@ -301,12 +302,12 @@ ...@@ -301,12 +302,12 @@
,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42 ,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,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.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
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50 ,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(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,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63 ,ed.DISABILITY_NAME field60,disability_grade.label 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 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_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
...@@ -322,7 +323,7 @@ ...@@ -322,7 +323,7 @@
left join sys_area cf on cf.id=e.FILE_CITY left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN 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 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 contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='personnel_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours' 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_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
...@@ -336,7 +337,7 @@ ...@@ -336,7 +337,7 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE ,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
from t_pre_emp_work_recording ee from t_pre_emp_work_recording ee
GROUP BY ee.PRE_MAIN_ID GROUP BY ee.PRE_MAIN_ID
) ew on e.id=ew.PRE_MAIN_ID ) ew on a.id=ew.PRE_MAIN_ID
left join ( left join (
select select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
...@@ -345,7 +346,8 @@ ...@@ -345,7 +346,8 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL ,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
from t_pre_emp_family ee from t_pre_emp_family ee
GROUP BY ee.PRE_MAIN_ID GROUP BY ee.PRE_MAIN_ID
) ef on e.id=ef.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 ( left join (
select select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
...@@ -353,10 +355,11 @@ ...@@ -353,10 +355,11 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE ,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
from t_pre_emp_professional_qualification ee from t_pre_emp_professional_qualification ee
GROUP BY ee.PRE_MAIN_ID GROUP BY ee.PRE_MAIN_ID
) ep on e.id=ep.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 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'
...@@ -381,10 +384,10 @@ ...@@ -381,10 +384,10 @@
count(1) count(1)
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_emp_work_recording ew on e.id=ew.EMP_ID left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
<where> <where>
a.STATUS != '5' and ew.id is not null and EXISTS ( a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_work_recording a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ew.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
...@@ -397,13 +400,14 @@ ...@@ -397,13 +400,14 @@
,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.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
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_emp_work_recording ew on e.id=ew.EMP_ID left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
<where> <where>
a.STATUS != '5' and ew.id is not null and EXISTS ( a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_work_recording a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ew.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
ORDER BY a.emp_idcard DESC
<if test="tPreEmpMain != null"> <if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null"> <if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd} limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
...@@ -417,10 +421,10 @@ ...@@ -417,10 +421,10 @@
count(1) count(1)
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_emp_family ef on e.id=ef.EMP_ID left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
<where> <where>
a.STATUS != '5' and ef.id is not null and EXISTS ( a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
...@@ -429,16 +433,18 @@ ...@@ -429,16 +433,18 @@
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO"> <select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50 ,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50
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_emp_family ef on e.id=ef.EMP_ID left join t_pre_emp_family 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'
<where> <where>
a.STATUS != '5' and ef.id is not null and EXISTS ( a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
ORDER BY a.emp_idcard DESC
<if test="tPreEmpMain != null"> <if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null"> <if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd} limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
...@@ -452,10 +458,10 @@ ...@@ -452,10 +458,10 @@
count(1) count(1)
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_emp_professional_qualification ep on e.id=ep.EMP_ID left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
<where> <where>
a.STATUS != '5' and ep.id is not null and EXISTS ( a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
...@@ -467,14 +473,15 @@ ...@@ -467,14 +473,15 @@
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53 ,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
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_emp_professional_qualification ep on e.id=ep.EMP_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 view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where> <where>
a.STATUS != '5' and ep.id is not null and EXISTS ( a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD
) )
<include refid="tPreEmpMain_where"/> <include refid="tPreEmpMain_where"/>
</where> </where>
ORDER BY a.emp_idcard DESC
<if test="tPreEmpMain != null"> <if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null"> <if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd} limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
......
spring.ldap.urls=ldap://192.168.1.65:389 spring.ldap.urls=ldap://192.168.0.240:389
spring.ldap.username=cn=admin,dc=worfu,dc=com spring.ldap.username=cn=admin,dc=worfu,dc=com
spring.ldap.password=yifu123456! spring.ldap.password=Yifu123ABC!
spring.ldap.base=dc=worfu,dc=com spring.ldap.base=dc=worfu,dc=com
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 款项认领差额费导入
*
* @author huyc
* @date 2024-07-04 14:54:40
*/
@Data
@ColumnWidth(30)
public class ClaimInfotVO extends RowIndex implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目编码
*/
@NotNull(message = "项目编码不能为空")
@ExcelAttribute(name = "项目编码",isNotEmpty = true, errorInfo = "项目编码不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目编码")
private String deptNo;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目名称")
private String deptName;
/**
* 调整金额
*/
@NotNull(message = "调整金额不能为空")
@ExcelAttribute(name = "调整金额",isNotEmpty = true, errorInfo = "调整金额不能为空", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="调整金额")
private BigDecimal money;
}
package com.yifu.cloud.plus.v1.ekp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 款项认领差额费导入
*
* @author huyc
* @date 2024-07-04 14:54:40
*/
@Data
@ColumnWidth(30)
public class ClaimRebackInfotVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 款项认领明细单号
*/
@ExcelAttribute(name = "款项认领明细单号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="款项认领明细单号")
private String claimNo;
@ExcelAttribute(name = "项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目编码")
private String deptNo;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目名称")
private String deptName;
/**
* 认领金额
*/
@ExcelAttribute(name = "认领金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="认领金额")
private BigDecimal claimMoney;
/**
* 核销金额
*/
@ExcelAttribute(name = "核销金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="核销金额")
private BigDecimal cancelMoney;
/**
* 剩余金额
*/
@NotNull(message = "剩余金额")
@ExcelAttribute(name = "剩余金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="剩余金额")
private BigDecimal surMoney;
/**
* 调整金额
*/
@NotNull(message = "调整金额")
@ExcelAttribute(name = "调整金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="调整金额")
private BigDecimal adjustMoney;
/**
* 剩余金额调整为
*/
@NotNull(message = "剩余金额调整为")
@ExcelAttribute(name = "剩余金额调整为")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="剩余金额调整为")
private BigDecimal afterAdjustMoney;
/**
* 入账日期
*/
@NotNull(message = "入账日期")
@ExcelAttribute(name = "入账日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="入账日期")
private Date claimTime;
/**
* 异常说明
*/
@NotNull(message = "异常说明")
@ExcelAttribute(name = "异常说明")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="异常说明")
private String errorInfo;
}
package com.yifu.cloud.plus.v1.ekp.controller; package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; 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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
...@@ -39,4 +48,22 @@ public class TEkpSalaryInfoController { ...@@ -39,4 +48,22 @@ public class TEkpSalaryInfoController {
public Boolean pushSalaryInfoToEkp(@RequestBody List<EkpSalaryParam> unPushList) { public Boolean pushSalaryInfoToEkp(@RequestBody List<EkpSalaryParam> unPushList) {
return salaryInfoService.pushSalaryInfoToEkp(unPushList); return salaryInfoService.pushSalaryInfoToEkp(unPushList);
} }
/**
* 差额费导入
*
* @author huyc
* @date 2024-7-4
**/
@SneakyThrows
@Operation(description = "差额费导入")
@SysLog("差额费导入")
@PostMapping("/importClaimInfo")
public R<List<ErrorMessage>> importClaimInfo(@RequestBody MultipartFile file) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
return salaryInfoService.importClaimInfo(file.getInputStream());
}
} }
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -31,4 +32,19 @@ public interface EkpSalaryInfoMapper extends BaseMapper<EkpSalaryInfo> { ...@@ -31,4 +32,19 @@ public interface EkpSalaryInfoMapper extends BaseMapper<EkpSalaryInfo> {
* @return * @return
*/ */
EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth); EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth);
/**
* 根据项目编码查询款项认领明细
* @param
* @return
*/
ClaimRebackInfotVO getClaimInfoByDeptNo(@Param("deptNo") String deptNo,@Param("flag") String flag);
/**
* 根据项目编码查询款项认领明细
* @param
* @return
*/
List<ClaimRebackInfotVO> getClaimBigInfoByDeptNoAndUser(@Param("deptNo") String deptNo);
} }
...@@ -2,9 +2,12 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -2,9 +2,12 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.util.List; import java.util.List;
/** /**
...@@ -18,4 +21,6 @@ public interface EkpSalaryInfoService extends IService<EkpSalaryInfo> { ...@@ -18,4 +21,6 @@ public interface EkpSalaryInfoService extends IService<EkpSalaryInfo> {
@Transactional @Transactional
// @ShardingTransactionType(TransactionType.BASE) // @ShardingTransactionType(TransactionType.BASE)
Boolean pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList); Boolean pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList);
R<List<ErrorMessage>> importClaimInfo(InputStream inputStream);
} }
package com.yifu.cloud.plus.v1.ekp.service.impl; package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSalaryInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpSalaryInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
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.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -248,6 +254,128 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -248,6 +254,128 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
+ "_" + salaryInfo.getFd_3b10afe8c70742()); + "_" + salaryInfo.getFd_3b10afe8c70742());
} }
@Override
public R<List<ErrorMessage>> importClaimInfo(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<ClaimInfotVO> util1 = new ExcelUtil<>(ClaimInfotVO.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, ClaimInfotVO.class, new ReadListener<ClaimInfotVO>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT1;
/**
*临时存储
*/
private List<ClaimInfotVO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(ClaimInfotVO data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importListAdd(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
/**
* 差额费导入
* @param excelVOList
* @param errorMessageList
* @author huyc
* @date 2024-07-04 14:52:16
*/
@Transactional
public void importListAdd(List<ClaimInfotVO> excelVOList, List<ErrorMessage> errorMessageList) {
ClaimInfotVO excel;
String deptNo;
String deptName;
BigDecimal money;
ClaimRebackInfotVO info;
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
deptNo = excel.getDeptNo();
money = excel.getMoney();
deptName = excel.getDeptName();
ClaimRebackInfotVO backInfo = new ClaimRebackInfotVO();
//先找到彭超创建的款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"1");
//
if (money.compareTo(BigDecimal.ZERO) > 0) {
//调整金额大于零的先找到彭超创建的款项认领明细直接加
if (Optional.ofNullable(info).isPresent()) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
//找到除了彭超之外的最早的一条款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"2");
if (Optional.ofNullable(info).isPresent()) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
backInfo.setDeptName(deptName);
backInfo.setDeptNo(deptNo);
backInfo.setAdjustMoney(money);
backInfo.setErrorInfo("未找到该项目对应的款项认领明细");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(),backInfo));
}
}
} else {
//调整金额小于零的先找到剩余金额大于零的彭超创建的款项认领明细去扣减
info = baseMapper.getClaimInfoByDeptNo(deptNo,"3");
if (Optional.ofNullable(info).isPresent()) {
if (BigDecimalUtils.safeAdd(info.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
}
} else {
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
}
}
}
}
/** /**
* @Description: 推送ekp时更改日期格式 * @Description: 推送ekp时更改日期格式
* @Author: huyc * @Author: huyc
...@@ -258,4 +386,31 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -258,4 +386,31 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
return sb.toString(); return sb.toString();
} }
public void subSwitch(String deptNo,ClaimRebackInfotVO backInfo,List<ErrorMessage>errorMessageList,
BigDecimal money,String deptName,ClaimInfotVO excel) {
List<ClaimRebackInfotVO> infoList = baseMapper.getClaimBigInfoByDeptNoAndUser(deptNo);
if (Optional.ofNullable(infoList).isPresent()) {
for (ClaimRebackInfotVO subInfo : infoList) {
//分批去减去金额
if (BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) {
subInfo.setAdjustMoney(money);
subInfo.setAfterAdjustMoney(BigDecimalUtils.safeSubtract(subInfo.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
break;
} else {
subInfo.setAdjustMoney(subInfo.getSurMoney());
subInfo.setAfterAdjustMoney(BigDecimal.ZERO);
money = BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
}
}
}
if (BigDecimal.ZERO.compareTo(money) > 0 ) {
backInfo.setDeptNo(deptNo);
backInfo.setDeptName(deptName);
backInfo.setAdjustMoney(money);
backInfo.setErrorInfo("项目编码及剩余仍需扣除金额:" + money.toString());
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(),backInfo));
}
}
} }
...@@ -150,4 +150,48 @@ ...@@ -150,4 +150,48 @@
where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month} where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month}
</select> </select>
<!--根据项目编码和申请人查询款项认领明细-->
<select id="getClaimInfoByDeptNo" resultType="com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO">
select
fd_3afb4689209aa2 deptNo,
fd_3afb468b23b0e2 deptName,
fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime
from
ekp_94b6cd1535e4b34865c8
where
fd_3afb4689209aa2 = #{deptNo}
<if test="flag != null and flag == 3">
and fd_3afb46d05d19ec > 0
</if>
<if test="flag != null and (flag == 1 or flag == 3)">
and fd_3b2a70e26f520a = '1817fbe83899f5f34c1ee9b463bbf9c1'
</if>
order by fd_3b5f41db9fb154 asc
<if test="flag != null">
limit 1
</if>
</select>
<!--根据项目编码和申请人查询款项认领明细-->
<select id="getClaimBigInfoByDeptNoAndUser" resultType="com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO">
select
fd_3afb4689209aa2 deptNo,
fd_3afb468b23b0e2 deptName,
fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime
from
ekp_94b6cd1535e4b34865c8
where
fd_3afb4689209aa2 = #{deptNo}
and fd_3afb46d05d19ec > 0
order by fd_3b5f41db9fb154 asc
</select>
</mapper> </mapper>
...@@ -135,4 +135,6 @@ public class SocialSoldierYsdAddVo implements Serializable { ...@@ -135,4 +135,6 @@ public class SocialSoldierYsdAddVo implements Serializable {
private String isAdd; private String isAdd;
@ExcelProperty("是否只续保【医保增员】") @ExcelProperty("是否只续保【医保增员】")
private String isXu; private String isXu;
@ExcelProperty("提示已缴费是否继续申报【医保增员】")
private String isShen;
} }
...@@ -86,6 +86,7 @@ import java.io.InputStream; ...@@ -86,6 +86,7 @@ import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -2119,6 +2120,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2119,6 +2120,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project.setPost(excel.getPost()); project.setPost(excel.getPost());
project.setWorkingHours(excel.getWorkingHours()); project.setWorkingHours(excel.getWorkingHours());
project.setTryPeriod(excel.getTryPeriod()); project.setTryPeriod(excel.getTryPeriod());
project.setEnjoinDate(null != excel.getContractStart() ? excel.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
if (Common.isNotNull(socialSet)){ if (Common.isNotNull(socialSet)){
project.setSocialProvince(socialSet.getProvince()); project.setSocialProvince(socialSet.getProvince());
project.setSocialCity(socialSet.getCity()); project.setSocialCity(socialSet.getCity());
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<!-- 社保士兵医生大增加模板--> <!-- 社保士兵医生大增加模板-->
<select id="getSocialSoldierYsdAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo"> <select id="getSocialSoldierYsdAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and ( and (
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<!-- 社保士兵医生大减少模板--> <!-- 社保士兵医生大减少模板-->
<select id="getSocialSoldierYsdReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo"> <select id="getSocialSoldierYsdReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and ( and (
......
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