Commit 5a836f7a authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关_先删后加

parent 2fddaa3c
......@@ -182,13 +182,15 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
**/
TEmployeeProject getByEmpIdAndDeptId(String empId, String deptId);
TEmployeeProject getByEmpIdCardAndDeptId(String empIdCard, String deptId);
/**
* @Description: 获取已减项或已删除的项目档案信息
* @Author: hgw
* @Date: 2024/6/19 15:00
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
**/
TEmployeeProject getByEmpIdAndDeptIdAndDelete(String empId, String deptId);
TEmployeeProject getByEmpIdCardAndDeptIdAndDelete(String empIdCard, String deptId);
R<Map<String, String>> getProjectByIdCard(String empIdCard);
......
......@@ -1340,17 +1340,31 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
@Override
public TEmployeeProject getByEmpIdAndDeptIdAndDelete(String empId, String deptId) {
public TEmployeeProject getByEmpIdCardAndDeptId(String empIdCard, String deptId) {
TEmployeeProject employeeProject = null;
if (Common.isNotNull(empId) && Common.isNotNull(deptId)) {
if (Common.isEmpty(empIdCard) || Common.isEmpty(deptId)) {
return employeeProject;
}
employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, empIdCard)
.eq(TEmployeeProject::getDeptId, deptId)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
return employeeProject;
}
@Override
public TEmployeeProject getByEmpIdCardAndDeptIdAndDelete(String empIdCard, String deptId) {
TEmployeeProject employeeProject = null;
if (Common.isNotNull(empIdCard) && Common.isNotNull(deptId)) {
employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpId, empId)
.eq(TEmployeeProject::getEmpIdcard, empIdCard)
.eq(TEmployeeProject::getDeptId, deptId)
.ne(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.ne(TEmployeeProject::getProjectStatus, CommonConstants.ONE_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
if (employeeProject == null) {
employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpId, empId)
.eq(TEmployeeProject::getEmpIdcard, empIdCard)
.eq(TEmployeeProject::getDeptId, deptId)
.last(CommonConstants.LAST_ONE_SQL));
}
......
......@@ -25,7 +25,6 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -160,12 +159,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
if (main != null) {
// 2024-7-3 17:23:50 倩倩要求放开状态拦截,前端加按钮禁用即可
/*if (CommonConstants.ONE_STRING.equals(main.getStatus())
|| CommonConstants.TWO_STRING.equals(main.getStatus())) {
return R.failed("信息审核中,请耐心等待!");
/* (CommonConstants.ONE_STRING.equals(main.getStatus())
|| CommonConstants.TWO_STRING.equals(main.getStatus()))
return R.failed("信息审核中,请耐心等待!")
}
if (CommonConstants.FOUR_STRING.equals(main.getStatus())) {
return R.failed("信息已填写,请勿重复操作!");
(CommonConstants.FOUR_STRING.equals(main.getStatus()))
return R.failed("信息已填写,请勿重复操作!")
}*/
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(main.getId());
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getId())) {
......@@ -244,7 +243,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
project = tEmployeeProjectService.getByEmpIdAndDeptId(empId, deptId);
project = tEmployeeProjectService.getByEmpIdCardAndDeptId(empIdCard, deptId);
if (project != null) {
tPreEmployeeProject = new TPreEmployeeProject();
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
......@@ -1333,9 +1332,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private TEmployeeProject saveTEmployeeProject(TEmployeeProject project, YifuUser user, TPreEmployeeProject tPreEmployeeProject, TEmployeeInfo emp, TSettleDomain dept) {
boolean isNew;
if (Common.isNotNull(tPreEmployeeProject.getEmpIdcard()) && Common.isNotNull(tPreEmployeeProject.getDeptId())) {
project = tEmployeeProjectService.getByEmpIdAndDeptId(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
project = tEmployeeProjectService.getByEmpIdCardAndDeptId(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
if (project == null) {
project = tEmployeeProjectService.getByEmpIdAndDeptIdAndDelete(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
project = tEmployeeProjectService.getByEmpIdCardAndDeptIdAndDelete(tPreEmployeeProject.getEmpIdcard(), tPreEmployeeProject.getDeptId());
if (project != null) {
project.setCreateTime(LocalDateTime.now());
project.setProjectStatus(CommonConstants.ZERO_INT);
......@@ -1559,7 +1558,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return baseMapper.selectList(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TPreEmpMainSearchVo entity) {
private LambdaQueryWrapper<TPreEmpMain> buildQueryWrapper(TPreEmpMainSearchVo entity) {
LambdaQueryWrapper<TPreEmpMain> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimeStart())) {
wrapper.ge(TPreEmpMain::getCreateTime, entity.getCreateTimeStart());
......@@ -2016,271 +2015,4 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return null;
}
/**
* @Description: 合并单元格
* @Author: hgw
* @Date: 2024/6/27 10:35
* @return: void
**/
private void getHeBingHang(List<TPreMainExportAllVO> list, ExcelWriterSheetBuilder writeSheet) {
OnceAbsoluteMergeStrategy strategy;
int startRow = 0;
int endRow = 0;
boolean preBoo;
boolean afterBoo;
int startRow0 = 0;
int endRow0 = 0;
int startRow1 = 0;
int endRow1 = 0;
int startRow2 = 0;
int endRow2 = 0;
int startRow3 = 0;
int endRow3 = 0;
int startRow4 = 0;
int endRow4 = 0;
int startRow5 = 0;
int endRow5 = 0;
int startRow6 = 0;
int endRow6 = 0;
int startRow7 = 0;
int endRow7 = 0;
int startRow8 = 0;
int endRow8 = 0;
int startRow9 = 0;
int endRow9 = 0;
for (int j = 1; j < list.size() - 1; j++) {
// 0状态
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField1()) && list.get(j).getField1().equals(list.get(j - 1).getField1()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField1()) && list.get(j).getField1().equals(list.get(j + 1).getField1()));
if (preBoo && startRow0 == 0) {
startRow0 = 1 + j;
}
if (!afterBoo && startRow0 > 0) {
endRow0 = 2 + j;
}
if (j == list.size() - 2 && startRow0 > 0) {
endRow0 = 3 + j;
}
if (startRow0 > 0 && endRow0 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow0, endRow0, 0, 0);
writeSheet.registerWriteHandler(strategy);
startRow0 = 0;
endRow0 = 0;
}
// 1提交时间
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField2()) && list.get(j).getField2().equals(list.get(j - 1).getField2()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField2()) && list.get(j).getField2().equals(list.get(j + 1).getField2()));
if (preBoo && startRow1 == 0) {
startRow1 = 1 + j;
}
if (!afterBoo && startRow1 > 0) {
endRow1 = 2 + j;
}
if (j == list.size() - 2 && startRow1 > 0) {
endRow1 = 3 + j;
}
if (startRow1 > 0 && endRow1 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow1, endRow1, 0, 0);
writeSheet.registerWriteHandler(strategy);
startRow1 = 0;
endRow1 = 0;
}
// 1员工基本信息-身份证
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6()));
if (startRow == 0) {
if (preBoo) {
startRow = 1 + j;
} else if (afterBoo) {
startRow = 2 + j;
}
}
if (!afterBoo && startRow > 0) {
endRow = 2 + j;
}
if (j == list.size() - 2 && startRow > 0) {
endRow = 3 + j;
}
if (startRow > 0 && endRow > 0) {
for (int k = 2; k < 22; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow, endRow, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow = 0;
endRow = 0;
}
// 2在项信息-项目名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField24()) && list.get(j).getField24().equals(list.get(j - 1).getField24()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField24()) && list.get(j).getField24().equals(list.get(j + 1).getField24()));
if (startRow2 == 0) {
if (preBoo) {
startRow2 = 1 + j;
} else if (afterBoo) {
startRow2 = 2 + j;
}
}
if (!afterBoo && startRow2 > 0) {
endRow2 = 2 + j;
}
if (j == list.size() - 2 && startRow2 > 0) {
endRow2 = 3 + j;
}
if (startRow2 > 0 && endRow2 > 0) {
for (int k = 22; k < 31; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow2, endRow2, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow2 = 0;
endRow2 = 0;
}
// 3紧急联络人-姓名
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField32()) && list.get(j).getField32().equals(list.get(j - 1).getField32()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField32()) && list.get(j).getField32().equals(list.get(j + 1).getField32()));
if (startRow3 == 0) {
if (preBoo) {
startRow3 = 1 + j;
} else if (afterBoo) {
startRow3 = 2 + j;
}
}
if (!afterBoo && startRow3 > 0) {
endRow3 = 2 + j;
}
if (j == list.size() - 2 && startRow3 > 0) {
endRow3 = 3 + j;
}
if (startRow3 > 0 && endRow3 > 0) {
for (int k = 31; k < 35; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow3, endRow3, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow3 = 0;
endRow3 = 0;
}
// 4最高教育经历-专业
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField37()) && list.get(j).getField37().equals(list.get(j - 1).getField37()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField37()) && list.get(j).getField37().equals(list.get(j + 1).getField37()));
if (preBoo && startRow4 == 0) {
startRow4 = 1 + j;
}
if (!afterBoo && startRow4 > 0) {
endRow4 = 2 + j;
}
if (j == list.size() - 2 && startRow4 > 0) {
endRow4 = 3 + j;
}
if (startRow4 > 0 && endRow4 > 0) {
for (int k = 35; k < 42; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow4, endRow4, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow4 = 0;
endRow4 = 0;
}
// 5主要工作经历-专业
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField44()) && list.get(j).getField44().equals(list.get(j - 1).getField44()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField44()) && list.get(j).getField44().equals(list.get(j + 1).getField44()));
if (preBoo && startRow5 == 0) {
startRow5 = 1 + j;
}
if (!afterBoo && startRow5 > 0) {
endRow5 = 2 + j;
}
if (j == list.size() - 2 && startRow5 > 0) {
endRow5 = 3 + j;
}
if (startRow5 > 0 && endRow5 > 0) {
for (int k = 42; k < 47; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow5, endRow5, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow5 = 0;
endRow5 = 0;
}
// 6主要家庭成员信息-成员姓名
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField47()) && list.get(j).getField47().equals(list.get(j - 1).getField47()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField47()) && list.get(j).getField47().equals(list.get(j + 1).getField47()));
if (preBoo && startRow6 == 0) {
startRow6 = 1 + j;
}
if (!afterBoo && startRow6 > 0) {
endRow6 = 2 + j;
}
if (j == list.size() - 2 && startRow6 > 0) {
endRow6 = 3 + j;
}
if (startRow6 > 0 && endRow6 > 0) {
for (int k = 47; k < 50; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow6, endRow6, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow6 = 0;
endRow6 = 0;
}
// 7职业资格信息-职业资格名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField53()) && list.get(j).getField53().equals(list.get(j - 1).getField53()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField53()) && list.get(j).getField53().equals(list.get(j + 1).getField53()));
if (preBoo && startRow7 == 0) {
startRow7 = 1 + j;
}
if (!afterBoo && startRow7 > 0) {
endRow7 = 2 + j;
}
if (j == list.size() - 2 && startRow7 > 0) {
endRow7 = 3 + j;
}
if (startRow7 > 0 && endRow7 > 0) {
for (int k = 50; k < 53; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow7, endRow7, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow7 = 0;
endRow7 = 0;
}
// 8伤残信息-职业资格名称+传染病名称+伤残病名称
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField56()) && list.get(j).getField56().equals(list.get(j - 1).getField56()))
&& (Common.isNotNull(list.get(j).getField58()) && list.get(j).getField58().equals(list.get(j - 1).getField58()))
&& (Common.isNotNull(list.get(j).getField60()) && list.get(j).getField60().equals(list.get(j - 1).getField60()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField56()) && list.get(j).getField56().equals(list.get(j + 1).getField56()))
&& (Common.isNotNull(list.get(j).getField58()) && list.get(j).getField58().equals(list.get(j + 1).getField58()))
&& (Common.isNotNull(list.get(j).getField60()) && list.get(j).getField60().equals(list.get(j + 1).getField60()));
if (preBoo && startRow8 == 0) {
startRow8 = 1 + j;
}
if (!afterBoo && startRow8 > 0) {
endRow8 = 2 + j;
}
if (j == list.size() - 2 && startRow8 > 0) {
endRow8 = 3 + j;
}
if (startRow8 > 0 && endRow8 > 0) {
for (int k = 53; k < 62; k++) {
strategy = new OnceAbsoluteMergeStrategy(startRow8, endRow8, k, k);
writeSheet.registerWriteHandler(strategy);
}
startRow8 = 0;
endRow8 = 0;
}
// 9不良记录
preBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j - 1).getField6())) && (Common.isNotNull(list.get(j).getField63()) && list.get(j).getField63().equals(list.get(j - 1).getField63()));
afterBoo = (Common.isNotNull(list.get(j).getField6()) && list.get(j).getField6().equals(list.get(j + 1).getField6())) && (Common.isNotNull(list.get(j).getField63()) && list.get(j).getField63().equals(list.get(j + 1).getField63()));
if (preBoo && startRow9 == 0) {
startRow9 = 1 + j;
}
if (!afterBoo && startRow9 > 0) {
endRow9 = 2 + j;
}
if (j == list.size() - 2 && startRow9 > 0) {
endRow9 = 3 + j;
}
if (startRow9 > 0 && endRow9 > 0) {
strategy = new OnceAbsoluteMergeStrategy(startRow9, endRow9, 62, 62);
writeSheet.registerWriteHandler(strategy);
startRow9 = 0;
endRow9 = 0;
}
}
}
}
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