Commit 01e068ba authored by hongguangwu's avatar hongguangwu

人员档案相关

parent b356c823
...@@ -22,7 +22,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -22,7 +22,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime; import java.time.LocalDate;
/** /**
* 员工学历信息表 * 员工学历信息表
...@@ -36,114 +36,114 @@ import java.time.LocalDateTime; ...@@ -36,114 +36,114 @@ import java.time.LocalDateTime;
@Schema(description = "员工学历信息表") @Schema(description = "员工学历信息表")
public class TEmpEducation extends BaseEntity { public class TEmpEducation extends BaseEntity {
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键") @Schema(description = "主键")
private String id; private String id;
/** /**
* 员工ID * 员工ID
*/ */
@Schema(description ="员工ID") @Schema(description = "员工ID")
private String empId; private String empId;
/** /**
* 员工姓名 * 员工姓名
*/ */
@Schema(description ="员工姓名") @Schema(description = "员工姓名")
private String empName; private String empName;
/** /**
* 员工编码 * 员工编码
*/ */
@Schema(description ="员工编码") @Schema(description = "员工编码")
private String empCode; private String empCode;
/** /**
* 身份证号 * 身份证号
*/ */
@Schema(description ="身份证号") @Schema(description = "身份证号")
private String empIdcard; private String empIdcard;
/** /**
* 入学时间 * 入学时间
*/ */
@Schema(description ="入学时间") @Schema(description = "入学时间")
private LocalDateTime entryDate; private LocalDate entryDate;
/** /**
* 学历名称 * 学历名称
*/ */
@Schema(description ="学历名称") @Schema(description = "学历名称")
private String educationName; private String educationName;
/** /**
* 结业日期 * 结业日期
*/ */
@Schema(description ="结业日期") @Schema(description = "结业日期")
private LocalDateTime gradutionDate; private LocalDate gradutionDate;
/** /**
* 学校名称 * 学校名称
*/ */
@Schema(description ="学校名称") @Schema(description = "学校名称")
private String school; private String school;
/** /**
* 学制类型 * 学制类型
*/ */
@Schema(description ="学制类型") @Schema(description = "学制类型")
private String educationSystem; private String educationSystem;
/** /**
* 最高学历标识0是/1否 * 最高学历标识0是/1否
*/ */
@Schema(description ="最高学历标识0是/1否") @Schema(description = "最高学历标识0是/1否")
private String highIdentification; private String highIdentification;
/** /**
* 学历类型:全日制、自考、函授等 * 学历类型:全日制、自考、函授等
*/ */
@Schema(description ="学历类型:全日制、自考、函授等") @Schema(description = "学历类型:全日制、自考、函授等")
private String type; private String type;
/** /**
* 院系名称 * 院系名称
*/ */
@Schema(description ="院系名称") @Schema(description = "院系名称")
private String collageSystem; private String collageSystem;
/** /**
* 是否删除 0未删除/1删除 * 是否删除 0未删除/1删除
*/ */
@TableLogic @TableLogic
@Schema(description ="是否删除 0未删除/1删除") @Schema(description = "是否删除 0未删除/1删除")
private String deleteFlag; private String deleteFlag;
/** /**
* 派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废 * 派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废
*/ */
@Schema(description ="派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废") @Schema(description = "派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废")
private String dispatchFlag; private String dispatchFlag;
/** /**
* 证书名称 * 证书名称
*/ */
@Schema(description ="证书名称") @Schema(description = "证书名称")
private String certificationName; private String certificationName;
/** /**
* 备注 * 备注
*/ */
@Schema(description ="备注") @Schema(description = "备注")
private String remark; private String remark;
/** /**
* 专业 * 专业
*/ */
@Schema(description ="专业") @Schema(description = "专业")
private String major; private String major;
......
...@@ -7,6 +7,7 @@ import lombok.Data; ...@@ -7,6 +7,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -42,7 +43,7 @@ public class EmpEducationExcelVO implements Serializable { ...@@ -42,7 +43,7 @@ public class EmpEducationExcelVO implements Serializable {
@NotNull(message = "入学时间不可为空") @NotNull(message = "入学时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("YYYY-MM-dd")
@ExcelProperty(value ="入学时间") @ExcelProperty(value ="入学时间")
private LocalDateTime entryDate; private LocalDate entryDate;
/** /**
* 结业日期 * 结业日期
...@@ -50,7 +51,7 @@ public class EmpEducationExcelVO implements Serializable { ...@@ -50,7 +51,7 @@ public class EmpEducationExcelVO implements Serializable {
@NotNull(message = "毕业时间不可为空") @NotNull(message = "毕业时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("YYYY-MM-dd")
@ExcelProperty(value ="毕业时间") @ExcelProperty(value ="毕业时间")
private LocalDateTime gradutionDate; private LocalDate gradutionDate;
/** /**
* 学历名称 * 学历名称
......
...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat; ...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -29,7 +30,7 @@ public class EmpEducationUpdateExcelVo extends EmpEducationExcelVO{ ...@@ -29,7 +30,7 @@ public class EmpEducationUpdateExcelVo extends EmpEducationExcelVO{
@NotNull(message = "入学时间不可为空") @NotNull(message = "入学时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("YYYY-MM-dd")
@ExcelProperty(value ="入学时间") @ExcelProperty(value ="入学时间")
private LocalDateTime entryDate; private LocalDate entryDate;
/** /**
* 结业日期 * 结业日期
...@@ -37,7 +38,7 @@ public class EmpEducationUpdateExcelVo extends EmpEducationExcelVO{ ...@@ -37,7 +38,7 @@ public class EmpEducationUpdateExcelVo extends EmpEducationExcelVO{
@NotNull(message = "毕业时间不可为空") @NotNull(message = "毕业时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("YYYY-MM-dd")
@ExcelProperty(value ="毕业时间") @ExcelProperty(value ="毕业时间")
private LocalDateTime gradutionDate; private LocalDate gradutionDate;
/** /**
* 学历名称 * 学历名称
......
/*
* 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.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import lombok.Data;
import java.io.Serializable;
/**
* 档案更新记录需要的信息
*
* @author huyc
* @date 2022-06-20 17:54:40
*/
@Data
public class EmployeeNewOldVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 变更前的档案
*/
private TEmployeeInfo oldEmployee;
/**
* 变更后的档案
*/
private TEmployeeInfo newEmployee;
}
...@@ -231,12 +231,12 @@ public class TEmployeeInfoController { ...@@ -231,12 +231,12 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42 * @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
@Operation(summary = "通过ids删除人员档案表", description = "通过ids删除人员档案表") @Operation(summary = "通过ids批量删除人员档案表", description = "通过ids批量删除人员档案表")
@SysLog("通过ids删除人员档案表") @SysLog("通过ids批量删除人员档案表")
@GetMapping("/batchDeleteEmployee") @GetMapping("/batchDeleteEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_del')") @PreAuthorize("@pms.hasPermission('temployeeinfo_batch_del')")
public R<String> batchDeleteEmployee(@RequestParam String ids) { public R<List<ErrorMessage>> batchDeleteEmployee(@RequestParam String ids) {
return tEmployeeInfoService.deleteEmployee(ids); return tEmployeeInfoService.batchDeleteEmployee(ids);
} }
/** /**
...@@ -254,6 +254,37 @@ public class TEmployeeInfoController { ...@@ -254,6 +254,37 @@ public class TEmployeeInfoController {
return tEmployeeInfoService.minusEmployee(id); return tEmployeeInfoService.minusEmployee(id);
} }
/**
* @param ids
* @Description: 通过ids批量减档人员档案表
* @Author: hgw
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "通过ids批量减档人员档案表", description = "通过ids批量减档人员档案表")
@SysLog("通过ids批量减档人员档案表")
@GetMapping("/batchMinusEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_minus')")
public R<List<ErrorMessage>> batchMinusEmployee(@RequestParam String ids) {
return tEmployeeInfoService.batchMinusEmployee(ids);
}
/**
* @param id 离职档案id
* @param projectIds 需要复项的项目ids
* @Description: 档案复档
* @Author: hgw
* @Date: 2022/6/23 17:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "档案复档", description = "档案复档 projectIds:项目档案ids")
@SysLog("档案复档")
@GetMapping("/restoreEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_restore')")
public R<String> restoreEmployee(@RequestParam String id, String projectIds) {
return tEmployeeInfoService.restoreEmployee(id, projectIds);
}
/** /**
* @param excelList * @param excelList
* @param bindingResult * @param bindingResult
......
...@@ -93,15 +93,42 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -93,15 +93,42 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
**/ **/
R<String> deleteEmployee(String id); R<String> deleteEmployee(String id);
/**
* @param ids
* @Description: 批量删除
* @Author: hgw
* @Date: 2022/6/23 16:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<List<ErrorMessage>> batchDeleteEmployee(String ids);
/** /**
* @param id * @param id
* @Description: 减 * @Description: 减
* @Author: hgw * @Author: hgw
* @Date: 2022/6/21 19:50 * @Date: 2022/6/21 19:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
R<String> minusEmployee(String id); R<String> minusEmployee(String id);
/**
* @param id
* @Description: 恢复档案
* @Author: hgw
* @Date: 2022/6/23 17:31
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> restoreEmployee(String id, String projectIds);
/**
* @param ids
* @Description: 批量减档
* @Author: hgw
* @Date: 2022/6/23 17:12
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/
R<List<ErrorMessage>> batchMinusEmployee(String ids);
/** /**
* @param employeeInfo 档案信息 * @param employeeInfo 档案信息
* @param fileSource 人员档案来源(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬) * @param fileSource 人员档案来源(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
......
...@@ -274,11 +274,11 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -274,11 +274,11 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
TEmpEducation exist = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda() TEmpEducation exist = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEducationName,education.getEducationName()) .eq(TEmpEducation::getEducationName,education.getEducationName())
.eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING) .eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmpEducation::getEmpIdcard,education.getEducationName()) .eq(TEmpEducation::getEmpIdcard,education.getEmpIdcard())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exist)){ if (Common.isNotNull(exist)){
exist.setHighIdentification(education.getHighIdentification()); exist.setHighIdentification(education.getHighIdentification());
exist.setSchool(education.getType()); exist.setSchool(education.getSchool());
exist.setMajor(education.getMajor()); exist.setMajor(education.getMajor());
exist.setEntryDate(education.getEntryDate()); exist.setEntryDate(education.getEntryDate());
exist.setGradutionDate(education.getGradutionDate()); exist.setGradutionDate(education.getGradutionDate());
......
...@@ -24,14 +24,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -24,14 +24,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard; import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile; import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
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.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.TEmployeeInfoService; 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.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpFamilyExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpFamilyExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeNewOldVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO;
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;
...@@ -45,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; ...@@ -45,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.C;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
...@@ -69,6 +74,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -69,6 +74,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TEmployeeProjectService tEmployeeProjectService; private final TEmployeeProjectService tEmployeeProjectService;
private final DaprCheckProperties daprCheckProperties; private final DaprCheckProperties daprCheckProperties;
private final DaprUpmsProperties daprUpmsProperties; private final DaprUpmsProperties daprUpmsProperties;
private final TEmployeeLogService tEmployeeLogService;
private final TEmpEducationService tEmpEducationService;
@Override @Override
public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) { public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) {
...@@ -128,10 +135,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -128,10 +135,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
@Override @Override
public R<Boolean> updateEmployee(TEmployeeInfo employeeInfo) { public R<Boolean> updateEmployee(TEmployeeInfo employeeInfo) {
// TODO-更新学历-房 if (Common.isEmpty(employeeInfo) || Common.isEmpty(employeeInfo.getId())) {
return R.failed("请传ID");
}
TEmployeeInfo old = this.getById(employeeInfo.getId());
if (old == null || Common.isEmpty(old.getId())) {
return R.failed("根据id未找到档案!" + employeeInfo.getId());
}
// TODO - 记录变更日志 // 更新学历-房
TEmpEducation education = new TEmpEducation();
this.doUpdateEducationCore(education, employeeInfo);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], old.getId(),"", old, employeeInfo);
return R.ok(this.updateById(employeeInfo)); return R.ok(this.updateById(employeeInfo));
} }
...@@ -139,8 +156,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -139,8 +156,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
public R<String> deleteEmployee(String id) { public R<String> deleteEmployee(String id) {
TEmployeeInfo employee = this.getById(id); TEmployeeInfo employee = this.getById(id);
if (employee != null) { if (employee != null) {
if (employee.getStatus() != CommonConstants.ZERO_INT) { if (employee.getContractStatus() != CommonConstants.ZERO_INT) {
return R.failed("非草稿状态,无法删除!"); return R.failed("合同状态非初始,无法删除!");
}
if (employee.getInsuranceStatus() != CommonConstants.ZERO_INT) {
return R.failed("商险状态非初始,无法删除!");
}
if (employee.getSocialStatus() != CommonConstants.ZERO_INT) {
return R.failed("社保状态非初始,无法删除!");
}
if (employee.getFundStatus() != CommonConstants.ZERO_INT) {
return R.failed("公积金状态非初始,无法删除!");
}
if (employee.getSalaryStatus() != CommonConstants.ZERO_INT) {
return R.failed("工资状态非初始,无法删除!");
} }
employee.setDeleteFlag(CommonConstants.STATUS_DEL); employee.setDeleteFlag(CommonConstants.STATUS_DEL);
// 获取项目档案,传参1,不过滤项目状态 // 获取项目档案,传参1,不过滤项目状态
...@@ -158,6 +187,140 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -158,6 +187,140 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
@Override
public R<List<ErrorMessage>> batchDeleteEmployee(String ids) {
if (Common.isEmpty(ids)) {
return R.failed("请选择!");
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
String[] idArr = ids.split(",");
TEmployeeInfo employee;
String id;
List<TEmployeeInfo> canDeleteList = new ArrayList<>();
Set<String> errorMsg;
for (int i = 0; i<idArr.length; i++) {
errorMsg = new HashSet<>();
id = idArr[i];
employee = this.getById(id);
if (employee != null) {
if (employee.getContractStatus() != CommonConstants.ZERO_INT) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:合同状态非初始,无法删除");
}
if (employee.getInsuranceStatus() != CommonConstants.ZERO_INT) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:商险状态非初始,无法删除");
}
if (employee.getSocialStatus() != CommonConstants.ZERO_INT) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:社保状态非初始,无法删除");
}
if (employee.getFundStatus() != CommonConstants.ZERO_INT) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:公积金状态非初始,无法删除");
}
if (employee.getSalaryStatus() != CommonConstants.ZERO_INT) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:工资状态非初始,无法删除");
}
// 数据合法情况
if (!CollUtil.isEmpty(errorMsg)) {
// 数据不合法
errorMessageList.add(new ErrorMessage((i + 1L), errorMsg));
} else {
canDeleteList.add(employee);
}
} else {
errorMessageList.add(new ErrorMessage((i + 1L), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
} else {
List<TEmployeeProject> projectList;
for (TEmployeeInfo employeeInfo : canDeleteList) {
employeeInfo.setDeleteFlag(CommonConstants.STATUS_DEL);
// 获取项目档案,传参1,不过滤项目状态
projectList = tEmployeeProjectService.getListByEmpId(employeeInfo.getId(), CommonConstants.ONE_INT);
if (projectList != null && !projectList.isEmpty()) {
for (TEmployeeProject project : projectList) {
project.setDeleteFlag(CommonConstants.STATUS_DEL);
}
tEmployeeProjectService.updateBatchById(projectList);
}
this.updateById(employeeInfo);
}
return R.ok();
}
}
@Override
public R<String> restoreEmployee(String id, String projectIds) {
TEmployeeInfo employee = this.getById(id);
if (employee != null) {
if (employee.getFileStatus() != CommonConstants.ONE_INT) {
return R.failed("该人员已不在离职档案中!");
}
TEmployeeInfo old = this.getById(id);
if (Common.isNotNull(projectIds)) {
String[] idArr = projectIds.split(",");
// 获取项目档案,传参1,不过滤项目状态
List<TEmployeeProject> projectList = tEmployeeProjectService.getListByEmpId(id, CommonConstants.ONE_INT);
if (projectList != null && !projectList.isEmpty()) {
for (String pid : idArr) {
for (TEmployeeProject project : projectList) {
if (project.getId().equals(pid)) {
project.setProjectStatus(CommonConstants.ZERO_INT);
tEmployeeProjectService.updateById(project);
}
}
}
}
}
employee.setFileStatus(CommonConstants.ZERO_INT);
this.updateById(employee);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], old.getId(),"", old, employee);
return R.ok("已复档");
} else {
return R.failed("未找到离职档案信息");
}
}
@Override
public R<List<ErrorMessage>> batchMinusEmployee(String ids) {
if (Common.isEmpty(ids)) {
return R.failed("请选择!");
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
String[] idArr = ids.split(",");
TEmployeeInfo employee;
String id;
List<TEmployeeInfo> canDeleteList = new ArrayList<>();
Set<String> errorMsg;
List<TEmployeeProject> projectList;
for (int i = 0; i<idArr.length; i++) {
errorMsg = new HashSet<>();
id = idArr[i];
employee = this.getById(id);
if (employee != null) {
projectList = tEmployeeProjectService.getListByEmpId(id, CommonConstants.ZERO_INT);
if (projectList != null && !projectList.isEmpty()) {
errorMsg.add("身份证【"+employee.getEmpIdcard()+"】的人员:还有【" + projectList.size() + "】条项目未减项,请先去减项");
errorMessageList.add(new ErrorMessage((i + 1L), errorMsg));
} else {
employee.setFileStatus(CommonConstants.ONE_INT);
canDeleteList.add(employee);
}
} else {
errorMessageList.add(new ErrorMessage((i + 1L), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
} else {
this.updateBatchById(canDeleteList);
return R.ok();
}
}
@Override @Override
public R<String> minusEmployee(String id) { public R<String> minusEmployee(String id) {
TEmployeeInfo employee = this.getById(id); TEmployeeInfo employee = this.getById(id);
...@@ -165,7 +328,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -165,7 +328,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 获取项目档案,传参0,过滤项目状态 // 获取项目档案,传参0,过滤项目状态
List<TEmployeeProject> projectList = tEmployeeProjectService.getListByEmpId(id, CommonConstants.ZERO_INT); List<TEmployeeProject> projectList = tEmployeeProjectService.getListByEmpId(id, CommonConstants.ZERO_INT);
if (projectList != null && !projectList.isEmpty()) { if (projectList != null && !projectList.isEmpty()) {
return R.failed("还有[" + projectList + "]条项目未减项,请先去减项!"); return R.failed("还有【" + projectList.size() + "】条项目未减项,请先去减项!");
} }
employee.setFileStatus(CommonConstants.ONE_INT); employee.setFileStatus(CommonConstants.ONE_INT);
this.updateById(employee); this.updateById(employee);
...@@ -183,8 +346,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -183,8 +346,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
R<TEmployeeInfo> checks = this.saveNewEmpLoyee(employeeInfo, CommonConstants.dingleDigitStrArray[4]); R<TEmployeeInfo> checks = this.saveNewEmpLoyee(employeeInfo, CommonConstants.dingleDigitStrArray[4]);
if (checks != null && checks.getCode() != CommonConstants.SUCCESS) return R.failed(checks.getMsg()); if (checks != null && checks.getCode() != CommonConstants.SUCCESS) return R.failed(checks.getMsg());
// TODO-新建项目-胡雨辰 // 新建项目-雨辰
// TODO-新建学历-房 tEmployeeProjectService.saveEmployeeProjectInfo(employeeInfo);
// 新建学历-房
TEmpEducation education = new TEmpEducation();
this.doUpdateEducationCore(education, employeeInfo);
return R.ok(); return R.ok();
} }
...@@ -588,10 +755,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -588,10 +755,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} else { } else {
// 仅更新自己与学历即可 // 仅更新自己与学历即可
this.updateBatchById(saveList); this.updateBatchById(saveList);
// TODO - 更新学历
// TODO - 记录变更日志
// 更新学历-房
this.saveOrUpdateEducation(saveList);
} }
return R.ok(); return R.ok();
} }
...@@ -620,6 +786,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -620,6 +786,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* @return: void * @return: void
**/ **/
private void saveOrUpdateData(List<TEmployeeInfo> saveList) { private void saveOrUpdateData(List<TEmployeeInfo> saveList) {
TEmpEducation education;
for (TEmployeeInfo employeeInfo : saveList) { for (TEmployeeInfo employeeInfo : saveList) {
// 新增档案 // 新增档案
if (Common.isEmpty(employeeInfo.getId())) { if (Common.isEmpty(employeeInfo.getId())) {
...@@ -628,11 +795,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -628,11 +795,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employeeInfo.setEmpCode(this.getCode()); employeeInfo.setEmpCode(this.getCode());
} }
this.save(employeeInfo); this.save(employeeInfo);
// TODO-新增项目档案 // 新增项目档案
tEmployeeProjectService.saveEmployeeProjectInfo(employeeInfo);
// TODO-新增学历
// 更新学历-房
education = new TEmpEducation();
this.doUpdateEducationCore(education, employeeInfo);
} else { } else {
// 复档复项 // 复档复项
employeeInfo.setFileStatus(CommonConstants.ZERO_INT); employeeInfo.setFileStatus(CommonConstants.ZERO_INT);
...@@ -720,10 +888,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -720,10 +888,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
EmployeeVO excel; EmployeeVO excel;
// 需要保存的档案信息 // 需要保存的档案信息
TEmployeeInfo saveEmp; TEmployeeInfo saveEmp;
// 原先的档案信息
TEmployeeInfo oldEmp;
// 已存在的档案 // 已存在的档案
TEmployeeInfo existEmp; TEmployeeInfo existEmp;
// 存储可保存的档案信息 // 存储可保存的档案信息
List<TEmployeeInfo> saveList = new ArrayList<>(); List<TEmployeeInfo> saveList = new ArrayList<>();
// 新老档案vo
EmployeeNewOldVO newOld;
// 新老档案List
List<EmployeeNewOldVO> updateList = new ArrayList<>();
// 调用字典服务,渲染字典值 // 调用字典服务,渲染字典值
R<Map<String, Map<String, String>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() R<Map<String, Map<String, String>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
...@@ -756,7 +930,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -756,7 +930,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 调用区域服务,渲染区域值 // 调用区域服务,渲染区域值
R<Map<String, String>> areaR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() R<Map<String, String>> areaR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN); , "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN);
Map<String, String> areaMap = new HashMap<>(); Map<String, String> areaMap;
if (areaR == null ) { if (areaR == null ) {
return R.failed("获取区域失败!"); return R.failed("获取区域失败!");
} else { } else {
...@@ -778,6 +952,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -778,6 +952,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (saveEmp.getFileStatus() == CommonConstants.ZERO_INT) { if (saveEmp.getFileStatus() == CommonConstants.ZERO_INT) {
// 可以更新 // 可以更新
oldEmp = existEmpMap.get(excel.getEmpIdcard());
// 校验身份证实名 // 校验身份证实名
if (Common.isNotNull(excel.getEmpName())) { if (Common.isNotNull(excel.getEmpName())) {
saveEmp.setEmpName(excel.getEmpName()); saveEmp.setEmpName(excel.getEmpName());
...@@ -925,6 +1101,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -925,6 +1101,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp.setRemark(excel.getRemark()); saveEmp.setRemark(excel.getRemark());
} }
// 更新时,不需要更新其余信息 // 更新时,不需要更新其余信息
newOld = new EmployeeNewOldVO();
newOld.setNewEmployee(saveEmp);
newOld.setOldEmployee(oldEmp);
updateList.add(newOld);
saveList.add(saveEmp); saveList.add(saveEmp);
} else if (saveEmp.getFileStatus() == CommonConstants.ONE_INT) { } else if (saveEmp.getFileStatus() == CommonConstants.ONE_INT) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_IDCARD_LEAVE_EXISTING, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_IDCARD_LEAVE_EXISTING, excel.getEmpIdcard()));
...@@ -943,7 +1123,38 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -943,7 +1123,38 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return R.failed(errorMessageList); return R.failed(errorMessageList);
} else { } else {
this.saveOrUpdateData(saveList); this.saveOrUpdateData(saveList);
// 更新学历-房
this.saveOrUpdateEducation(saveList);
// 记录变更日志
for (EmployeeNewOldVO newOldInfo : updateList) {
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0]
, newOldInfo.getOldEmployee().getId(),""
, newOldInfo.getOldEmployee(), newOldInfo.getNewEmployee());
}
} }
return R.ok(); return R.ok();
} }
// 更新学历-房
private void saveOrUpdateEducation(List<TEmployeeInfo> saveList) {
TEmpEducation education;
for (TEmployeeInfo employeeInfo : saveList) {
education = new TEmpEducation();
this.doUpdateEducationCore(education, employeeInfo);
}
}
// 更新学历-核心
private void doUpdateEducationCore(TEmpEducation education, TEmployeeInfo employeeInfo) {
education.setEmpIdcard(employeeInfo.getEmpIdcard());
education.setEducationName(employeeInfo.getHignEducation());
education.setHighIdentification(CommonConstants.ZERO_STRING);
education.setSchool(employeeInfo.getSchool());
education.setMajor(employeeInfo.getMajor());
education.setEntryDate(employeeInfo.getAdmissionDate());
education.setGradutionDate(employeeInfo.getGradutionDate());
tEmpEducationService.insertEducationOfEmp(education);
}
} }
...@@ -540,7 +540,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -540,7 +540,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public void saveEmployeeProjectInfo(TEmployeeInfo employeeInfo) { public void saveEmployeeProjectInfo(TEmployeeInfo employeeInfo) {
TEmployeeProject tEmployeeProject = new TEmployeeProject(); TEmployeeProject tEmployeeProject = new TEmployeeProject();
tEmployeeProject.setEmpId(employeeInfo.getId()); tEmployeeProject.setEmpId(employeeInfo.getId());
tEmployeeProject.setEmpCode(this.getCode()); tEmployeeProject.setEmpCode(employeeInfo.getEmpCode());
tEmployeeProject.setEmpNatrue(employeeInfo.getEmpNatrue()); tEmployeeProject.setEmpNatrue(employeeInfo.getEmpNatrue());
tEmployeeProject.setEmpName(employeeInfo.getEmpName()); tEmployeeProject.setEmpName(employeeInfo.getEmpName());
tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard()); tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard());
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
AND a.EMP_CODE = #{tEmployeeInfo.empCode} AND a.EMP_CODE = #{tEmployeeInfo.empCode}
</if> </if>
<if test="tEmployeeInfo.empNatrue != null and tEmployeeInfo.empNatrue.trim() != ''"> <if test="tEmployeeInfo.empNatrue != null and tEmployeeInfo.empNatrue.trim() != ''">
AND a.EMP_NATRUE = #{tEmployeeInfo.empNatrue} AND a.EMP_NATRUE in in concat('(',${tEmployeeInfo.empNatrue},')')
</if> </if>
<if test="tEmployeeInfo.empName != null and tEmployeeInfo.empName.trim() != ''"> <if test="tEmployeeInfo.empName != null and tEmployeeInfo.empName.trim() != ''">
AND a.EMP_NAME = #{tEmployeeInfo.empName} AND a.EMP_NAME = #{tEmployeeInfo.empName}
...@@ -247,16 +247,16 @@ ...@@ -247,16 +247,16 @@
</if> </if>
</if> </if>
<if test="tEmployeeInfo.contractStatus != null"> <if test="tEmployeeInfo.contractStatus != null">
AND a.CONTRACT_STATUS = #{tEmployeeInfo.contractStatus} AND a.CONTRACT_STATUS in concat('(',${tEmployeeInfo.contractStatus},')')
</if> </if>
<if test="tEmployeeInfo.insuranceStatus != null"> <if test="tEmployeeInfo.insuranceStatus != null">
AND a.INSURANCE_STATUS = #{tEmployeeInfo.insuranceStatus} AND a.INSURANCE_STATUS in concat('(',${tEmployeeInfo.insuranceStatus},')')
</if> </if>
<if test="tEmployeeInfo.socialStatus != null"> <if test="tEmployeeInfo.socialStatus != null">
AND a.SOCIAL_STATUS = #{tEmployeeInfo.socialStatus} AND a.SOCIAL_STATUS in concat('(',${tEmployeeInfo.socialStatus},')')
</if> </if>
<if test="tEmployeeInfo.fundStatus != null"> <if test="tEmployeeInfo.fundStatus != null">
AND a.FUND_STATUS = #{tEmployeeInfo.fundStatus} AND a.FUND_STATUS in concat('(',${tEmployeeInfo.fundStatus},')')
</if> </if>
<if test="tEmployeeInfo.salaryStatus != null"> <if test="tEmployeeInfo.salaryStatus != null">
AND a.SALARY_STATUS = #{tEmployeeInfo.salaryStatus} AND a.SALARY_STATUS = #{tEmployeeInfo.salaryStatus}
......
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