Commit a1a8e758 authored by fangxinjiang's avatar fangxinjiang

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

parents db51ea9b a9c7f27b
...@@ -163,4 +163,9 @@ public class ArchivesConstants { ...@@ -163,4 +163,9 @@ public class ArchivesConstants {
* 合同之前 * 合同之前
**/ **/
public static final String CONTRACT_CREATE_TYPE="合同之后"; public static final String CONTRACT_CREATE_TYPE="合同之后";
public static final String CONTRACT_CHECK_CONSTANTS_IDCARD_1="身份证";
public static final String CONTRACT_CHECK_CONSTANTS_IDCARD_2=" | 身份证";
public static final String CONTRACT_CHECK_CONSTANTS_NO="合同申请编号:";
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import lombok.Data;
import java.io.Serializable;
/**
* 人员档案表excel导出对应的实体
*
* @author hgw
* @date 2022-6-24 15:15:24
*/
@Data
@ColumnWidth(10)
public class EmployeeContractCheckVO extends RowIndex implements Serializable {
private static final long serialVersionUID = 1L;
@ColumnWidth(20)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "身份证号")
private String empIdcard;
}
...@@ -197,7 +197,7 @@ public class TEmpContractAlertController { ...@@ -197,7 +197,7 @@ public class TEmpContractAlertController {
* 获取反馈日志详情 * 获取反馈日志详情
* *
* @author wzb * @author wzb
* @param id * @param applyNo
* @return {@link R} * @return {@link R}
*/ */
@Operation(summary = "获取反馈日志详情", description = "获取反馈日志详情") @Operation(summary = "获取反馈日志详情", description = "获取反馈日志详情")
...@@ -223,4 +223,17 @@ public class TEmpContractAlertController { ...@@ -223,4 +223,17 @@ public class TEmpContractAlertController {
} }
/**
* 员工合同续签原因排查
*
* @author fxj
* @date 2023-09-01 17:31:05
**/
@SneakyThrows
@Operation(description = "员工合同续签原因排查")
@SysLog("员工合同续签原因排查")
@PostMapping("/importListAdd")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tEmpContractAlertService.importDiy(file.getInputStream());
}
} }
...@@ -66,4 +66,6 @@ public interface TEmpContractAlertService extends IService<TEmpContractAlert> { ...@@ -66,4 +66,6 @@ public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
**/ **/
R<List<EmpContractAlertUpdateVO>> batchUpdate(InputStream inputStream); R<List<EmpContractAlertUpdateVO>> batchUpdate(InputStream inputStream);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
} }
...@@ -39,6 +39,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService; ...@@ -39,6 +39,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeFeedBackAllVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeFeedBackAllVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAlertUpdateVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAlertUpdateVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractCheckVO;
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.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -68,7 +69,7 @@ import java.util.*; ...@@ -68,7 +69,7 @@ import java.util.*;
@Service @Service
public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertMapper, TEmpContractAlert> implements TEmpContractAlertService { public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertMapper, TEmpContractAlert> implements TEmpContractAlertService {
private final TEmployeeContractInfoMapper contractInfoMapper; private final TEmployeeContractInfoMapper contractInfoMapper;
private final TEmployeeInfoMapper employeeInfoMapper; private final TEmployeeInfoMapper employeeInfoMapper;
...@@ -82,32 +83,32 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -82,32 +83,32 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) { public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
wrapper.isNotNull(TEmpContractAlert::getId); wrapper.isNotNull(TEmpContractAlert::getId);
if (Common.isNotNull(searchVo.getContractEndStart())){ if (Common.isNotNull(searchVo.getContractEndStart())) {
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart()); wrapper.ge(TEmpContractAlert::getContractEnd, searchVo.getContractEndStart());
} }
if (Common.isNotNull(searchVo.getContractEndEnd())){ if (Common.isNotNull(searchVo.getContractEndEnd())) {
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd()); wrapper.le(TEmpContractAlert::getContractEnd, searchVo.getContractEndEnd());
} }
if (Common.isNotNull(searchVo.getAuthSql())) { if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql() + " order by CREATE_TIME desc"); wrapper.last(searchVo.getAuthSql() + " order by CREATE_TIME desc");
} else { } else {
wrapper.orderByDesc(BaseEntity::getCreateTime); wrapper.orderByDesc(BaseEntity::getCreateTime);
} }
return baseMapper.selectPage(page,wrapper); return baseMapper.selectPage(page, wrapper);
} }
@Override @Override
public List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo) { public List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)) {
wrapper.in(TEmpContractAlert::getId,idList); wrapper.in(TEmpContractAlert::getId, idList);
} }
if (Common.isNotNull(searchVo.getContractEndStart())){ if (Common.isNotNull(searchVo.getContractEndStart())) {
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart()); wrapper.ge(TEmpContractAlert::getContractEnd, searchVo.getContractEndStart());
} }
if (Common.isNotNull(searchVo.getContractEndEnd())){ if (Common.isNotNull(searchVo.getContractEndEnd())) {
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd()); wrapper.le(TEmpContractAlert::getContractEnd, searchVo.getContractEndEnd());
} }
if (Common.isNotNull(searchVo.getAuthSql())) { if (Common.isNotNull(searchVo.getAuthSql())) {
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) { if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) {
...@@ -121,14 +122,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -121,14 +122,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private long noPageCountDiy(ContractAlertSearchVo searchVo) { private long noPageCountDiy(ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)) {
wrapper.in(TEmpContractAlert::getId,idList); wrapper.in(TEmpContractAlert::getId, idList);
} }
if (Common.isNotNull(searchVo.getContractEndStart())){ if (Common.isNotNull(searchVo.getContractEndStart())) {
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart()); wrapper.ge(TEmpContractAlert::getContractEnd, searchVo.getContractEndStart());
} }
if (Common.isNotNull(searchVo.getContractEndEnd())){ if (Common.isNotNull(searchVo.getContractEndEnd())) {
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd()); wrapper.le(TEmpContractAlert::getContractEnd, searchVo.getContractEndEnd());
} }
if (Common.isNotNull(searchVo.getAuthSql())) { if (Common.isNotNull(searchVo.getAuthSql())) {
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) { if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) {
...@@ -136,8 +137,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -136,8 +137,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
} }
wrapper.last(searchVo.getAuthSql()); wrapper.last(searchVo.getAuthSql());
} }
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() >= 0){ if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() >= 0) {
wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd()); wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
} }
return baseMapper.selectCount(wrapper); return baseMapper.selectCount(wrapper);
} }
...@@ -152,11 +153,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -152,11 +153,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
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,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT){ if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<TEmpContractAlert> util; ExcelUtil<TEmpContractAlert> util;
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
...@@ -164,35 +165,35 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -164,35 +165,35 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = listDiy(searchVo); list = listDiy(searchVo);
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
util = new ExcelUtil<>(TEmpContractAlert.class); util = new ExcelUtil<>(TEmpContractAlert.class);
for (TEmpContractAlert vo:list){ for (TEmpContractAlert vo : list) {
util.convertEntity(vo,null,null,null); util.convertEntity(vo, null, null, null);
} }
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build(); writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD + index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT; i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
excelWriter.finish(); excelWriter.finish();
}else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build(); WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD + index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list, writeSheet);
excelWriter.finish(); excelWriter.finish();
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
out.flush(); out.flush();
}catch (Exception e){ } catch (Exception e) {
log.error("执行异常" ,e); log.error("执行异常", e);
}finally { } finally {
try { try {
if (null != out) { if (null != out) {
out.close(); out.close();
...@@ -203,55 +204,55 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -203,55 +204,55 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
} }
} }
private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0]) wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0])
.le(TEmpContractAlert::getCreateTime, .le(TEmpContractAlert::getCreateTime,
entity.getCreateTimes()[1]); entity.getCreateTimes()[1]);
} }
if (Common.isNotNull(entity.getEmpName())){ if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TEmpContractAlert::getEmpName,entity.getEmpName()); wrapper.eq(TEmpContractAlert::getEmpName, entity.getEmpName());
} }
if (Common.isNotNull(entity.getEmpIdcard())){ if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TEmpContractAlert::getEmpIdcard,entity.getEmpIdcard()); wrapper.eq(TEmpContractAlert::getEmpIdcard, entity.getEmpIdcard());
} }
if (Common.isNotNull(entity.getProject())){ if (Common.isNotNull(entity.getProject())) {
wrapper.eq(TEmpContractAlert::getProject,entity.getProject()); wrapper.eq(TEmpContractAlert::getProject, entity.getProject());
} }
if (Common.isNotNull(entity.getProjectNo())){ if (Common.isNotNull(entity.getProjectNo())) {
wrapper.eq(TEmpContractAlert::getProjectNo,entity.getProjectNo()); wrapper.eq(TEmpContractAlert::getProjectNo, entity.getProjectNo());
} }
if (Common.isNotNull(entity.getEmpType())){ if (Common.isNotNull(entity.getEmpType())) {
wrapper.eq(TEmpContractAlert::getEmpType,entity.getEmpType()); wrapper.eq(TEmpContractAlert::getEmpType, entity.getEmpType());
} }
if (Common.isNotNull(entity.getContractType())){ if (Common.isNotNull(entity.getContractType())) {
wrapper.eq(TEmpContractAlert::getContractType,entity.getContractType()); wrapper.eq(TEmpContractAlert::getContractType, entity.getContractType());
} }
if (Common.isNotNull(entity.getContractTerm())){ if (Common.isNotNull(entity.getContractTerm())) {
wrapper.eq(TEmpContractAlert::getContractTerm,entity.getContractTerm()); wrapper.eq(TEmpContractAlert::getContractTerm, entity.getContractTerm());
} }
if (Common.isNotNull(entity.getFileProvince())){ if (Common.isNotNull(entity.getFileProvince())) {
wrapper.eq(TEmpContractAlert::getFileProvince,entity.getFileProvince()); wrapper.eq(TEmpContractAlert::getFileProvince, entity.getFileProvince());
} }
if (Common.isNotNull(entity.getFileCity())){ if (Common.isNotNull(entity.getFileCity())) {
wrapper.eq(TEmpContractAlert::getFileCity,entity.getFileCity()); wrapper.eq(TEmpContractAlert::getFileCity, entity.getFileCity());
} }
if (Common.isNotNull(entity.getFileTown())){ if (Common.isNotNull(entity.getFileTown())) {
wrapper.eq(TEmpContractAlert::getFileTown,entity.getFileTown()); wrapper.eq(TEmpContractAlert::getFileTown, entity.getFileTown());
} }
if (Common.isNotNull(entity.getAlertPerson())){ if (Common.isNotNull(entity.getAlertPerson())) {
wrapper.eq(TEmpContractAlert::getAlertPerson,entity.getAlertPerson()); wrapper.eq(TEmpContractAlert::getAlertPerson, entity.getAlertPerson());
} }
if (Common.isNotNull(entity.getDueFlag())){ if (Common.isNotNull(entity.getDueFlag())) {
wrapper.eq(TEmpContractAlert::getDueFlag,entity.getDueFlag()); wrapper.eq(TEmpContractAlert::getDueFlag, entity.getDueFlag());
} }
if (Common.isNotNull(entity.getHandleStatus())){ if (Common.isNotNull(entity.getHandleStatus())) {
wrapper.eq(TEmpContractAlert::getHandleStatus,entity.getHandleStatus()); wrapper.eq(TEmpContractAlert::getHandleStatus, entity.getHandleStatus());
} }
if (Common.isNotNull(entity.getDaysDue())){ if (Common.isNotNull(entity.getDaysDue())) {
wrapper.eq(TEmpContractAlert::getDaysDue,entity.getDaysDue()); wrapper.eq(TEmpContractAlert::getDaysDue, entity.getDaysDue());
} }
if (Common.isNotNull(entity.getUnitId())) { if (Common.isNotNull(entity.getUnitId())) {
wrapper.eq(TEmpContractAlert::getUnitId, entity.getUnitId()); wrapper.eq(TEmpContractAlert::getUnitId, entity.getUnitId());
...@@ -262,13 +263,15 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -262,13 +263,15 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(entity.getUnitNo())) { if (Common.isNotNull(entity.getUnitNo())) {
wrapper.eq(TEmpContractAlert::getUnitNo, entity.getUnitNo()); wrapper.eq(TEmpContractAlert::getUnitNo, entity.getUnitNo());
} }
if (Common.isNotNull(entity.getIsFeedback())){ if (Common.isNotNull(entity.getIsFeedback())) {
wrapper.eq(TEmpContractAlert::getIsFeedback,entity.getIsFeedback()); wrapper.eq(TEmpContractAlert::getIsFeedback, entity.getIsFeedback());
} }
return wrapper; return wrapper;
} }
/** /**
* 定时任务生成合同续签代码信息 * 定时任务生成合同续签代码信息
*
* @return R<List> * @return R<List>
* @Author FXJ * @Author FXJ
* @Date 2022-07-4 * @Date 2022-07-4
...@@ -321,12 +324,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -321,12 +324,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
} }
private void initExistMap(Map<String, TEmpContractAlert> existMap) { private void initExistMap(Map<String, TEmpContractAlert> existMap) {
List<TEmpContractAlert> exists = baseMapper.selectList(Wrappers.<TEmpContractAlert>query()); List<TEmpContractAlert> exists = baseMapper.selectList(Wrappers.<TEmpContractAlert>query());
if (Common.isNotNull(exists)){ if (Common.isNotNull(exists)) {
for (TEmpContractAlert alert:exists){ for (TEmpContractAlert alert : exists) {
existMap.put(alert.getContractId(),alert); existMap.put(alert.getContractId(), alert);
} }
} }
} }
...@@ -336,44 +338,44 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -336,44 +338,44 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
Map<String, TEmpContractAlert> alertMap, Map<String, TEmpContractAlert> alertMap,
Map<String, TEmpContractAlert> existMap) { Map<String, TEmpContractAlert> existMap) {
TEmployeeInfo employeeInfo = employeeInfoMapper.selectById(contract.getEmpId()); TEmployeeInfo employeeInfo = employeeInfoMapper.selectById(contract.getEmpId());
if (Common.isNotNull(employeeInfo)){ if (Common.isNotNull(employeeInfo)) {
TEmployeeProject project = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject project = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard,employeeInfo.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, employeeInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ZERO_STRING) .eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getDeptNo,contract.getDeptNo()) .eq(TEmployeeProject::getDeptNo, contract.getDeptNo())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(project) if (Common.isNotNull(project)
&& ((Common.isNotNull(project.getProjectStatus()) && ((Common.isNotNull(project.getProjectStatus())
&& project.getProjectStatus().intValue()== CommonConstants.ONE_INT) && project.getProjectStatus().intValue() == CommonConstants.ONE_INT)
|| ( || (
!CommonConstants.ZERO_STRING.equals(project.getEmpNatrue()) !CommonConstants.ZERO_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.ONE_STRING.equals(project.getEmpNatrue()) && !CommonConstants.ONE_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.THREE_STRING.equals(project.getEmpNatrue())) && !CommonConstants.THREE_STRING.equals(project.getEmpNatrue()))
)){ )) {
return; return;
} }
if (Common.isEmpty(project)){ if (Common.isEmpty(project)) {
return; return;
} }
}else { } else {
return; return;
} }
TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+contract.getDeptNo()); TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contract.getDeptNo());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的 // 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if (Common.isNotNull(alert) if (Common.isNotNull(alert)
&& Common.isNotNull(alert.getAuditTime()) && Common.isNotNull(alert.getAuditTime())
&& Common.isNotNull(contract.getAuditTimeLast()) && Common.isNotNull(contract.getAuditTimeLast())
&& alert.getAuditTime().after(LocalDateTimeUtils.convertLDTToDate(contract.getAuditTimeLast()))){ && alert.getAuditTime().after(LocalDateTimeUtils.convertLDTToDate(contract.getAuditTimeLast()))) {
return; return;
} }
TEmpContractAlert exist = null; TEmpContractAlert exist = null;
if (Common.isNotNull(contract)){ if (Common.isNotNull(contract)) {
exist = existMap.get(contract.getId()); exist = existMap.get(contract.getId());
} }
alert = new TEmpContractAlert(); alert = new TEmpContractAlert();
if (Common.isNotNull(exist) && Common.isNotNull(exist.getFirstAlertTime())){ if (Common.isNotNull(exist) && Common.isNotNull(exist.getFirstAlertTime())) {
alert.setFirstAlertTime(exist.getFirstAlertTime()); alert.setFirstAlertTime(exist.getFirstAlertTime());
}else { } else {
alert.setFirstAlertTime(new Date()); alert.setFirstAlertTime(new Date());
} }
FeedBackDetail feedBackDetail1 = feedbackDetailMapper.findByApplyNo(contract.getApplyNo()); FeedBackDetail feedBackDetail1 = feedbackDetailMapper.findByApplyNo(contract.getApplyNo());
...@@ -406,38 +408,39 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -406,38 +408,39 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setContractStart(contract.getContractStart()); alert.setContractStart(contract.getContractStart());
alert.setContractEnd(contract.getContractEnd()); alert.setContractEnd(contract.getContractEnd());
alert.setAuditTime(LocalDateTimeUtils.convertLDTToDate(contract.getAuditTimeLast())); alert.setAuditTime(LocalDateTimeUtils.convertLDTToDate(contract.getAuditTimeLast()));
if (Common.isNotNull(contract.getFileProvince())){ if (Common.isNotNull(contract.getFileProvince())) {
alert.setFileProvince(Integer.toString(contract.getFileProvince())); alert.setFileProvince(Integer.toString(contract.getFileProvince()));
} }
if (Common.isNotNull(contract.getFileCity())){ if (Common.isNotNull(contract.getFileCity())) {
alert.setFileCity(Integer.toString(contract.getFileCity())); alert.setFileCity(Integer.toString(contract.getFileCity()));
} }
if (Common.isNotNull(contract.getFileTown())){ if (Common.isNotNull(contract.getFileTown())) {
alert.setFileTown(Integer.toString(contract.getFileTown())); alert.setFileTown(Integer.toString(contract.getFileTown()));
} }
alert.setEmpType(contract.getEmpNatrue()); alert.setEmpType(contract.getEmpNatrue());
alert.setContractType(contract.getContractName()); alert.setContractType(contract.getContractName());
alert.setContractTerm(contract.getContractType()); alert.setContractTerm(contract.getContractType());
if (Common.isNotNull(alert.getContractEnd())){ if (Common.isNotNull(alert.getContractEnd())) {
if (Common.isNotNull(contract.getContractEnd()) && DateUtil.daysBetween(alert.getContractEnd(),nowDate) > 0){ if (Common.isNotNull(contract.getContractEnd()) && DateUtil.daysBetween(alert.getContractEnd(), nowDate) > 0) {
alert.setDaysOver(DateUtil.daysBetween(alert.getContractEnd(),nowDate)); alert.setDaysOver(DateUtil.daysBetween(alert.getContractEnd(), nowDate));
alert.setDueFlag(CommonConstants.ONE_STRING); alert.setDueFlag(CommonConstants.ONE_STRING);
alert.setDaysDue(null); alert.setDaysDue(null);
}else { } else {
alert.setDaysDue(DateUtil.daysBetween(nowDate,alert.getContractEnd())); alert.setDaysDue(DateUtil.daysBetween(nowDate, alert.getContractEnd()));
alert.setDueFlag(CommonConstants.ZERO_STRING); alert.setDueFlag(CommonConstants.ZERO_STRING);
alert.setDaysOver(null); alert.setDaysOver(null);
} }
} }
alert.setHandleStatus(CommonConstants.ZERO_STRING); alert.setHandleStatus(CommonConstants.ZERO_STRING);
alertMap.put(alert.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+alert.getProjectNo(),alert); alertMap.put(alert.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + alert.getProjectNo(), alert);
} }
@Transactional(rollbackFor = {Exception.class}) @Transactional(rollbackFor = {Exception.class})
@Override @Override
public boolean changeFeedBackAll(ChangeFeedBackAllVo changeFeedBackAllVo) { public boolean changeFeedBackAll(ChangeFeedBackAllVo changeFeedBackAllVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
FeedBackDetail feedbackDetail; FeedBackDetail feedbackDetail;
List<FeedBackDetail> details = new ArrayList<>(); List<FeedBackDetail> details = new ArrayList<>();
for (int i = 0; i < changeFeedBackAllVo.getIds().length; i++) { for (int i = 0; i < changeFeedBackAllVo.getIds().length; i++) {
feedbackDetail = new FeedBackDetail(); feedbackDetail = new FeedBackDetail();
feedbackDetail.setFeedbackPerson(user.getNickname()); feedbackDetail.setFeedbackPerson(user.getNickname());
...@@ -448,13 +451,13 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -448,13 +451,13 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
feedbackDetail.setIsFeedback(CommonConstants.ONE_INT); feedbackDetail.setIsFeedback(CommonConstants.ONE_INT);
details.add(feedbackDetail); details.add(feedbackDetail);
} }
if (Common.isNotEmpty(details)){ if (Common.isNotEmpty(details)) {
feedBackDetailService.saveBatch(details); feedBackDetailService.saveBatch(details);
} }
changeFeedBackAllVo.setIsFeedback(CommonConstants.ONE_INTEGER); changeFeedBackAllVo.setIsFeedback(CommonConstants.ONE_INTEGER);
changeFeedBackAllVo.setFeedbackPerson(user.getNickname()); changeFeedBackAllVo.setFeedbackPerson(user.getNickname());
changeFeedBackAllVo.setFeedbackTime(DateTime.now()); changeFeedBackAllVo.setFeedbackTime(DateTime.now());
return baseMapper.changeFeedBackAll(changeFeedBackAllVo); return baseMapper.changeFeedBackAll(changeFeedBackAllVo);
} }
@Override @Override
...@@ -473,14 +476,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -473,14 +476,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
public R<List<EmpContractAlertUpdateVO>> batchUpdate(InputStream inputStream) { public R<List<EmpContractAlertUpdateVO>> batchUpdate(InputStream inputStream) {
List<EmpContractAlertUpdateVO> errorMessageList = new ArrayList<>(); List<EmpContractAlertUpdateVO> errorMessageList = new ArrayList<>();
ExcelUtil<EmpContractAlertUpdateVO> util1 = new ExcelUtil<>(EmpContractAlertUpdateVO.class); ExcelUtil<EmpContractAlertUpdateVO> util1 = new ExcelUtil<>(EmpContractAlertUpdateVO.class);
Map<String,String> reasonMap = new HashMap<>(); Map<String, String> reasonMap = new HashMap<>();
reasonMap.put("已确定待续签","已经和客户单位或员工沟通好,因时间或地点原因未能签订的"); reasonMap.put("已确定待续签", "已经和客户单位或员工沟通好,因时间或地点原因未能签订的");
reasonMap.put("未确定是否续签","因客户单位原因,暂时不能确定是否与员工继续签订劳动合同;"); reasonMap.put("未确定是否续签", "因客户单位原因,暂时不能确定是否与员工继续签订劳动合同;");
reasonMap.put("商务合同未签","业务部门未进行商务合同的续签"); reasonMap.put("商务合同未签", "业务部门未进行商务合同的续签");
reasonMap.put("已签待更新","已完成劳动合同续签未进行人力云系统更新的"); reasonMap.put("已签待更新", "已完成劳动合同续签未进行人力云系统更新的");
reasonMap.put("离职/退休/待派减","经确定离职、退休的员工,等待人力云系统派单减少"); reasonMap.put("离职/退休/待派减", "经确定离职、退休的员工,等待人力云系统派单减少");
reasonMap.put("产假/工伤/病假","因产假、工伤、病假原因暂时无法正常续签的"); reasonMap.put("产假/工伤/病假", "因产假、工伤、病假原因暂时无法正常续签的");
reasonMap.put("其他","其他原因,添加具体原因备注"); reasonMap.put("其他", "其他原因,添加具体原因备注");
// 写法2: // 写法2:
// 匿名内部类 不用额外写一个DemoDataListener // 匿名内部类 不用额外写一个DemoDataListener
...@@ -608,4 +611,180 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -608,4 +611,180 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
} }
} }
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmployeeContractCheckVO> util1 = new ExcelUtil<>(EmployeeContractCheckVO.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, EmployeeContractCheckVO.class, new ReadListener<EmployeeContractCheckVO>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<EmployeeContractCheckVO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(EmployeeContractCheckVO 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());
importTCompanyInfo(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);
}
private void importTCompanyInfo(List<EmployeeContractCheckVO> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
String res;
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeContractCheckVO excel = excelVOList.get(i);
// 业务逻辑实现
res = check(excel);
// 插入
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), res, null, excel.getEmpIdcard()));
}
}
private void initCheckInfo(Map<String, String> map, String mapTemp, TEmployeeContractInfo vo, String errorInfo) {
mapTemp = (mapTemp == null ? ArchivesConstants.CONTRACT_CHECK_CONSTANTS_IDCARD_1 : mapTemp
+ ArchivesConstants.CONTRACT_CHECK_CONSTANTS_IDCARD_2) + vo.getEmpIdcard()
+ ArchivesConstants.CONTRACT_CHECK_CONSTANTS_NO + vo.getApplyNo() + errorInfo;
map.put(vo.getEmpIdcard(), mapTemp);
}
/**
* 插入excel bad record
*/
private String check(EmployeeContractCheckVO excel) {
// 获取合同为在档、员工类型为“0外包”、“1派遣”、最近一次合同审核通过、过期或离过期还有3个月的数据
List<TEmployeeContractInfo> exitist = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(exitist)) {
return excel.getEmpIdcard() + ":未找到审核通过的在用合同信息";
}
Map<String, String> map = new HashMap<>();
String temp = null;
String temp2;
String mapTemp = CommonConstants.EMPTY_STRING;
for (TEmployeeContractInfo vo : exitist) {
mapTemp = map.get(vo.getEmpIdcard());
if (baseMapper.selectCount(Wrappers.<TEmpContractAlert>query().lambda()
.eq(TEmpContractAlert::getEmpIdcard, vo.getEmpIdcard())
.eq(TEmpContractAlert::getProjectNo, vo.getDeptNo())) > 0) {
initCheckInfo(map,mapTemp,vo," 已存在合同续签提醒");
continue;
}
if ("续签".equals(vo.getSituation()) || "终止".equals(vo.getSituation())) {
initCheckInfo(map,mapTemp,vo," 续签、终止类型的合同不提示");
continue;
}
if (Common.isNotNull(vo.getAuditStatus()) && vo.getAuditStatus().intValue() != 2) {
initCheckInfo(map,mapTemp,vo," 合同审核不通过");
continue;
}
if (CommonConstants.ONE_STRING.equals(vo.getIsObsolete())) {
initCheckInfo(map,mapTemp,vo," 合同已作废---IsObsolete=1 为作废");
continue;
}
if (!CommonConstants.ONE_STRING.equals(vo.getContractType())) {
initCheckInfo(map,mapTemp,vo," 签订期限不为‘固定期限");
continue;
}
if (!CommonConstants.ZERO_STRING.equals(vo.getWorkFlag())) {
initCheckInfo(map,mapTemp,vo," 合同状态 非在职");
continue;
}
if (!vo.getContractEnd().before(DateUtil.dateIncreaseByDay(
DateUtil.dateIncreaseByMonth(DateUtil.getCurrentDateTime(),
CommonConstants.dingleDigitIntArray[3]), CommonConstants.dingleDigitIntArray[1]))) {
initCheckInfo(map,mapTemp,vo," 未到期");
continue;
}
temp2 = check2(vo);
if (Common.isNotNull(temp2)) {
initCheckInfo(map,mapTemp,vo,temp2);
continue;
} else {
initCheckInfo(map,mapTemp,vo,":");
continue;
}
}
if (!Common.isEmpty(mapTemp)) {
return mapTemp;
}
return excel.getEmpIdcard() + ":条件符合未生成代码提醒";
}
private String check2(TEmployeeContractInfo contract) {
TEmployeeInfo employeeInfo = employeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeInfo::getEmpIdcard, contract.getEmpIdcard()).last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(employeeInfo)) {
TEmployeeProject project = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, employeeInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getDeptNo, contract.getDeptNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(project)) {
if ((Common.isNotNull(project.getProjectStatus())
&& project.getProjectStatus().intValue() == CommonConstants.ONE_INT)) {
return "对应身份证的项目档案已减项";
}
if ((!CommonConstants.ZERO_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.ONE_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.THREE_STRING.equals(project.getEmpNatrue()))
) {
return "对应身份证的项目档案员工类型 非外包、派遣、内部员工";
}
}
if (Common.isEmpty(project)) {
return "无合同对应项目编码的的在用项目档案 或 存在多个在用合同";
}
} else {
return "无对应身份证在用档案信息";
}
return null;
}
} }
...@@ -145,4 +145,16 @@ public class SysMenu extends BaseEntity { ...@@ -145,4 +145,16 @@ public class SysMenu extends BaseEntity {
*/ */
@Schema(description = "是否开关(0开、1关)") @Schema(description = "是否开关(0开、1关)")
private String isOpen; private String isOpen;
/**
* 表名,用来先查结果集
*/
@Schema(description = "表名,用来先查结果集")
private String tableName;
/**
* 查询字段维度,如果fdId超长,则使用本字段
*/
@Schema(description = "查询字段维度,如果fdId超长,则使用本字段")
private String queryFields;
} }
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="isOpen" column="IS_OPEN"/> <result property="isOpen" column="IS_OPEN"/>
<result property="tableName" column="TABLE_NAME"/>
<result property="queryFields" column="QUERY_FIELDS"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -49,7 +51,9 @@ ...@@ -49,7 +51,9 @@
a.DEPT_ID, a.DEPT_ID,
a.IS_OPEN, a.IS_OPEN,
a.VIEW_ID, a.VIEW_ID,
a.CREATE_TIME a.CREATE_TIME,
a.TABLE_NAME,
a.QUERY_FIELDS
</sql> </sql>
<sql id="sysMenu_where"> <sql id="sysMenu_where">
<if test="sysMenu != null"> <if test="sysMenu != null">
......
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