Commit a7077194 authored by hongguangwu's avatar hongguangwu

优化人员档案

parent 5979f248
...@@ -311,28 +311,28 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -311,28 +311,28 @@ public class TEmployeeInfo extends BaseEntity {
/** /**
* 减档操作人姓名 * 减档操作人姓名
*/ */
@Schema(description = "离职操作姓名") @Schema(description = "减档人")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private String leaveUserName; private String leaveUserName;
/** /**
* 离职时间 * 离职时间
*/ */
@Schema(description = "离职时间") @Schema(description = "减档时间")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private Date leaveTime; private Date leaveTime;
/** /**
* 离职原因 * 离职原因
*/ */
@Schema(description = "离职原因") @Schema(description = "减档原因")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private String leaveReason; private String leaveReason;
/** /**
* 离职备注 * 离职备注
*/ */
@Schema(description = "离职备注") @Schema(description = "减档备注")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private String leaveRemark; private String leaveRemark;
......
...@@ -189,7 +189,7 @@ public class EmployeeExportVO extends BaseEntity { ...@@ -189,7 +189,7 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "近3个月发薪") @ExcelProperty(value = "近3个月发薪")
private String salaryStatus; private String salaryStatus;
@ExcelProperty(value = "减档操作人") @ExcelProperty(value = "减档人")
private String leaveUserName; private String leaveUserName;
@ExcelProperty(value = "减档时间") @ExcelProperty(value = "减档时间")
......
...@@ -215,6 +215,7 @@ public class EmployeeVO extends RowIndex implements Serializable { ...@@ -215,6 +215,7 @@ public class EmployeeVO extends RowIndex implements Serializable {
* 通信地址 * 通信地址
*/ */
@Schema(description = "通信地址") @Schema(description = "通信地址")
@ExcelProperty(value = "通信地址")
private String contactAddress; private String contactAddress;
} }
...@@ -28,6 +28,7 @@ public class EmployeeConstants { ...@@ -28,6 +28,7 @@ public class EmployeeConstants {
public static final String ID_CITY_MUST = "更新户籍县,户籍市必填"; public static final String ID_CITY_MUST = "更新户籍县,户籍市必填";
public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填"; public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填";
public static final String FILE_CITY_MUST = "更新档案县,档案市必填"; public static final String FILE_CITY_MUST = "更新档案县,档案市必填";
public static final String DEPT_NO_ERROR = "项目编码错误";
/** /**
* 无数据可更新 * 无数据可更新
......
...@@ -24,6 +24,7 @@ import com.alibaba.excel.read.listener.ReadListener; ...@@ -24,6 +24,7 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
...@@ -33,11 +34,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants; ...@@ -33,11 +34,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -86,6 +85,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -86,6 +85,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final DaprUpmsProperties daprUpmsProperties; private final DaprUpmsProperties daprUpmsProperties;
private final TEmployeeLogService tEmployeeLogService; private final TEmployeeLogService tEmployeeLogService;
private final TEmpEducationService tEmpEducationService; private final TEmpEducationService tEmpEducationService;
private final TSettleDomainService tSettleDomainService;
@Override @Override
public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) { public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) {
...@@ -794,6 +794,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -794,6 +794,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(errorMessageList)) { if (Common.isNotNull(errorMessageList)) {
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(), errorMessage)); errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(), errorMessage));
} }
// 获取身份证、手机号列表,批量查询档案 // 获取身份证、手机号列表,批量查询档案
List<String> idCardList = new ArrayList<>(); List<String> idCardList = new ArrayList<>();
List<String> phoneList = new ArrayList<>(); List<String> phoneList = new ArrayList<>();
...@@ -801,6 +802,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -801,6 +802,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
String idCard; String idCard;
// 个性化校验逻辑 // 个性化校验逻辑
Set<String> errorMsg; Set<String> errorMsg;
List<String> deptNoList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
// 判空 // 判空
...@@ -822,12 +824,31 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -822,12 +824,31 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(excelVOList.get(i).getEmpPhone())) { if (Common.isNotNull(excelVOList.get(i).getEmpPhone())) {
phoneList.add(excelVOList.get(i).getEmpPhone()); phoneList.add(excelVOList.get(i).getEmpPhone());
} }
if (Common.isNotNull(excelVOList.get(i).getDeptNo())) {
deptNoList.add(excelVOList.get(i).getDeptNo());
}
// 数据合法情况 // 数据合法情况
if (!CollUtil.isEmpty(errorMsg)) { if (!CollUtil.isEmpty(errorMsg)) {
// 数据不合法 // 数据不合法
errorMessageList.add(new ErrorMessage((i + 2L), errorMsg)); errorMessageList.add(new ErrorMessage((i + 2L), errorMsg));
} }
} }
List<TSettleDomain> deptList = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag, CommonConstants.STATUS_NORMAL)
.in(TSettleDomain::getDepartNo, deptNoList)
);
Map<String, Integer> deptMap = new HashMap<>();
if (deptList == null || deptList.isEmpty()) {
return R.failed("根据项目编码未找到项目!");
} else {
for (TSettleDomain dept : deptList) {
deptMap.put(dept.getDepartNo(), CommonConstants.ONE_INT);
}
}
// 查找档案库 // 查找档案库
Map<String, TEmployeeInfo> existEmpMap = new HashMap<>(); Map<String, TEmployeeInfo> existEmpMap = new HashMap<>();
Map<String, TEmployeeInfo> existPhoneMap = new HashMap<>(); Map<String, TEmployeeInfo> existPhoneMap = new HashMap<>();
...@@ -901,6 +922,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -901,6 +922,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp = new TEmployeeInfo(); saveEmp = new TEmployeeInfo();
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
excel = excelVOList.get(i); excel = excelVOList.get(i);
if (deptMap.get(excel.getDeptNo()) == null) {
errorMsg.add(EmployeeConstants.DEPT_NO_ERROR);
}
existEmp = existEmpMap.get(excel.getEmpIdcard()); existEmp = existEmpMap.get(excel.getEmpIdcard());
// 档案存在 // 档案存在
if (existEmp != null) { if (existEmp != null) {
...@@ -1832,6 +1857,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1832,6 +1857,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo : list) {
util.convertEntity(vo, null, null, null);
}
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
......
...@@ -549,6 +549,7 @@ ...@@ -549,6 +549,7 @@
,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO ,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO
,a.LEAVE_TIME ,a.LEAVE_TIME
,a.LEAVE_USER ,a.LEAVE_USER
,a.LEAVE_USER_NAME
,a.LEAVE_REASON ,a.LEAVE_REASON
from t_employee_info a from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID left join t_employee_project b on a.id = b.EMP_ID
......
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