Commit b1848be2 authored by 刘斌's avatar 刘斌

fix: 初始化基础信息,增加离职管理

parent ef3bb2d0
package com.anplus.hr.config;
import java.time.LocalDate;
import java.time.Period;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 工龄工具类 - 使用字符串分割方法
* 支持工龄字符串与总月数之间的转换
*/
public class SeniorityUtils {
// 默认日期格式
private static final DateTimeFormatter DEFAULT_DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 常量定义
private static final String YEAR_KEYWORD = "年";
private static final String MONTH_KEYWORD = "个月";
private static final String MONTH_SHORT_KEYWORD = "月";
/**
* 将工龄字符串解析为总月数
* 支持格式: "3年5个月", "3年5月", "5个月", "3年" 等
*/
public static int parseSeniorityToMonths(String seniorityStr) {
if (seniorityStr == null || seniorityStr.trim().isEmpty()) {
return 0;
}
String normalized = seniorityStr.trim();
int years = 0;
int months = 0;
try {
// 检查是否包含年份
if (normalized.contains(YEAR_KEYWORD)) {
// 分割年份和月份部分
String[] yearParts = normalized.split(YEAR_KEYWORD, 2);
// 解析年份
years = extractNumber(yearParts[0]);
// 如果有月份部分
if (yearParts.length > 1 && !yearParts[1].trim().isEmpty()) {
months = extractMonthValue(yearParts[1]);
}
} else {
// 只有月份的情况
months = extractMonthValue(normalized);
}
// 验证数据合理性
validateSeniority(years, months);
} catch (Exception e) {
throw new IllegalArgumentException("无法解析工龄字符串: '" + seniorityStr + "'", e);
}
return years * 12 + months;
}
/**
* 从包含月份信息的字符串中提取月份数值
*/
private static int extractMonthValue(String monthStr) {
String str = monthStr.trim();
// 移除月份关键词
if (str.contains(MONTH_KEYWORD)) {
str = str.replace(MONTH_KEYWORD, "");
} else if (str.contains(MONTH_SHORT_KEYWORD)) {
str = str.replace(MONTH_SHORT_KEYWORD, "");
}
// 提取数字
return extractNumber(str);
}
/**
* 从字符串中提取第一个连续的数字
*/
private static int extractNumber(String str) {
if (str == null || str.trim().isEmpty()) {
return 0;
}
String cleaned = str.trim();
StringBuilder numberBuilder = new StringBuilder();
boolean foundDigit = false;
for (char c : cleaned.toCharArray()) {
if (Character.isDigit(c)) {
numberBuilder.append(c);
foundDigit = true;
} else if (foundDigit) {
// 遇到非数字字符且已经找到数字,停止提取
break;
}
}
if (numberBuilder.length() == 0) {
return 0;
}
try {
return Integer.parseInt(numberBuilder.toString());
} catch (NumberFormatException e) {
throw new IllegalArgumentException("无法解析数字: '" + str + "'");
}
}
/**
* 验证工龄数据的合理性
*/
private static void validateSeniority(int years, int months) {
if (years < 0) {
throw new IllegalArgumentException("工龄年份不能为负数: " + years);
}
if (months < 0) {
throw new IllegalArgumentException("工龄月份不能为负数: " + months);
}
if (months >= 12) {
throw new IllegalArgumentException("工龄月份不能大于等于12: " + months);
}
}
/**
* 将总月数格式化为工龄字符串
* 例如: 41个月 -> "3年5个月"
*/
public static String formatMonthsToSeniority(int totalMonths) {
return formatMonthsToSeniority(totalMonths, true);
}
/**
* 将总月数格式化为工龄字符串
* @param totalMonths 总月数
* @param includeZeroMonths 当月数为0时是否显示 (true: "3年", false: "3年0个月")
* @return 格式化的工龄字符串
*/
public static String formatMonthsToSeniority(int totalMonths, boolean includeZeroMonths) {
if (totalMonths < 0) {
throw new IllegalArgumentException("总月数不能为负数: " + totalMonths);
}
int years = totalMonths / 12;
int months = totalMonths % 12;
return buildSeniorityString(years, months, includeZeroMonths);
}
/**
* 构建工龄字符串
*/
private static String buildSeniorityString(int years, int months, boolean includeZeroMonths) {
List<String> parts = new ArrayList<>();
if (years > 0) {
parts.add(years + YEAR_KEYWORD);
}
if (months > 0 || (includeZeroMonths && years == 0)) {
parts.add(months + MONTH_KEYWORD);
} else if (months == 0 && !includeZeroMonths && years == 0) {
// 当总月数为0且不包含0个月时,返回"0个月"
parts.add("0" + MONTH_KEYWORD);
}
if (parts.isEmpty()) {
return "0" + MONTH_KEYWORD;
}
return String.join("", parts);
}
/**
* 将总月数格式化为简化的工龄字符串
* 例如: 41个月 -> "3年5月" (不使用"个月")
*/
public static String formatMonthsToShortSeniority(int totalMonths) {
if (totalMonths < 0) {
throw new IllegalArgumentException("总月数不能为负数: " + totalMonths);
}
int years = totalMonths / 12;
int months = totalMonths % 12;
List<String> parts = new ArrayList<>();
if (years > 0) {
parts.add(years + YEAR_KEYWORD);
}
if (months > 0 || (years == 0 && months == 0)) {
parts.add(months + MONTH_SHORT_KEYWORD);
}
return String.join("", parts);
}
/**
* 解析工龄字符串为年、月数组 [years, months]
*/
public static int[] parseSeniorityToArray(String seniorityStr) {
int totalMonths = parseSeniorityToMonths(seniorityStr);
return new int[]{totalMonths / 12, totalMonths % 12};
}
/**
* 验证工龄字符串格式是否有效
*/
public static boolean isValidSeniorityFormat(String seniorityStr) {
if (seniorityStr == null || seniorityStr.trim().isEmpty()) {
return false;
}
try {
parseSeniorityToMonths(seniorityStr);
return true;
} catch (Exception e) {
return false;
}
}
/**
* 获取工龄的详细描述
* 例如: 41个月 -> "3年5个月(共41个月)"
*/
public static String getDetailedDescription(int totalMonths) {
String seniority = formatMonthsToSeniority(totalMonths);
return String.format("%s(共%d个月)", seniority, totalMonths);
}
/**
* 比较两个工龄字符串的大小
* @return 负数: seniority1 < seniority2, 0: 相等, 正数: seniority1 > seniority2
*/
public static int compareSeniority(String seniority1, String seniority2) {
int months1 = parseSeniorityToMonths(seniority1);
int months2 = parseSeniorityToMonths(seniority2);
return Integer.compare(months1, months2);
}
/**
* 计算两个工龄之间的差异(以月为单位)
*/
public static int calculateDifference(String seniority1, String seniority2) {
int months1 = parseSeniorityToMonths(seniority1);
int months2 = parseSeniorityToMonths(seniority2);
return Math.abs(months1 - months2);
}
/**
* 添加工龄
* @param baseSeniority 基础工龄字符串
* @param yearsToAdd 要添加的年数
* @param monthsToAdd 要添加的月数
* @return 新的工龄字符串
*/
public static String addToSeniority(String baseSeniority, int yearsToAdd, int monthsToAdd) {
int baseMonths = parseSeniorityToMonths(baseSeniority);
int totalMonths = baseMonths + yearsToAdd * 12 + monthsToAdd;
if (totalMonths < 0) {
throw new IllegalArgumentException("添加工龄后结果不能为负数");
}
return formatMonthsToSeniority(totalMonths);
}
/**
* 计算工龄(截止到当前日期)
* @param employmentDate 入职日期
* @return 工龄字符串,如 "3年5个月"
*/
public static String calculateSeniority(LocalDate employmentDate) {
return calculateSeniority(employmentDate, LocalDate.now());
}
/**
* 计算工龄(指定截止日期)
* @param employmentDate 入职日期
* @param endDate 截止日期
* @return 工龄字符串,如 "3年5个月"
*/
public static String calculateSeniority(LocalDate employmentDate, LocalDate endDate) {
Objects.requireNonNull(employmentDate, "入职日期不能为null");
Objects.requireNonNull(endDate, "截止日期不能为null");
if (employmentDate.isAfter(endDate)) {
return "0个月"; // 入职日期在截止日期之后,工龄为0
}
Period period = Period.between(employmentDate, endDate);
int years = period.getYears();
int months = period.getMonths();
return formatSeniority(years, months);
}
/**
* 计算工龄并返回总月数(截止到当前日期)
* @param employmentDate 入职日期
* @return 总月数
*/
public static int calculateTotalMonths(LocalDate employmentDate) {
return calculateTotalMonths(employmentDate, LocalDate.now());
}
/**
* 计算工龄并返回总月数(指定截止日期)
* @param employmentDate 入职日期
* @param endDate 截止日期
* @return 总月数
*/
public static int calculateTotalMonths(LocalDate employmentDate, LocalDate endDate) {
Objects.requireNonNull(employmentDate, "入职日期不能为null");
Objects.requireNonNull(endDate, "截止日期不能为null");
if (employmentDate.isAfter(endDate)) {
return 0; // 入职日期在截止日期之后,工龄为0
}
Period period = Period.between(employmentDate, endDate);
int years = period.getYears();
int months = period.getMonths();
return years * 12 + months;
}
/**
* 格式化工龄
* @param years 年数
* @param months 月数
* @return 格式化的工龄字符串
*/
private static String formatSeniority(int years, int months) {
if (years == 0 && months == 0) {
return "0个月";
}
StringBuilder sb = new StringBuilder();
if (years > 0) {
sb.append(years).append("年");
}
if (months > 0 || (years == 0 && months == 0)) {
sb.append(months).append("个月");
}
return sb.toString();
}
}
package com.anplus.hr.constant;
/**
* @author 刘斌
* @date 2025/11/17 17:14
*/
public interface EmployeeChangeLogTypeConstant {
String Entry = "1";
String Resign = "2";
String Transfer = "3";
String Regularization = "4";
String RenewalContract = "5";
}
package com.anplus.hr.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author 刘斌
* @date 2025/11/17 10:59
*/
@Getter
@AllArgsConstructor
public enum HrAgeGroupEnum {
UNDER_24("1", "24岁以下", 24),
AGE_25_TO_34("2", "25-34岁", 34),
AGE_35_TO_44("3", "35-44岁", 44),
OVER_45("4", "45岁以上", 200);
private final String code;
private final String name;
private final int ageLimit;
public static HrAgeGroupEnum getByAge(Integer age) {
if (age == null || age <= 0) {
return null;
}
for (HrAgeGroupEnum value : values()) {
if (age <= value.getAgeLimit()) {
return value;
}
}
return OVER_45;
}
}
...@@ -45,4 +45,39 @@ public interface HrConstant { ...@@ -45,4 +45,39 @@ public interface HrConstant {
* 员工用工形式 * 员工用工形式
*/ */
String HR_EMPLOYMENT_FORM = "hr_employment_form"; String HR_EMPLOYMENT_FORM = "hr_employment_form";
/**
* 员工职级
*/
String HR_JOB_LEVEL = "hr_job_level";
/**
* 员工岗位类型
*/
String HR_POSITION_TYPE = "hr_position_type";
/**
* 员工序列
*/
String HR_SEQUENCE = "hr_sequence";
/**
* 员工学历分类
*/
String HR_EDUCATION_CATEGORY = "hr_education_category";
/**
* 员工合同形式
*/
String HR_CONTRACT_FORM = "hr_contract_form";
/**
* 通用是否
*/
String SYS_YES_NO = "sys_yes_no";
/**
* 员工离职类型
*/
String HR_RESIGNATION_TYPE = "hr_resignation_type";
} }
package com.anplus.hr.constant;
/**
* @author 刘斌
* @date 2025/11/18 14:38
*/
public interface HrEmployeeConstants {
/**
* 员工类型-转正员工
*/
String EMPLOYEE_TYPE_REGULAR = "1";
/**
* 用工形式-正式工
*/
String EMPLOYMENT_FORM_REGULAR = "1";
/**
* 合同形式-新签
*/
String CONTRACT_FORM_NEW = "1";
}
...@@ -6,15 +6,63 @@ package com.anplus.hr.constant; ...@@ -6,15 +6,63 @@ package com.anplus.hr.constant;
*/ */
public interface HrFlowTypeConstant { public interface HrFlowTypeConstant {
String Entry = "1"; /**
* 入职
*/
String ENTRY = "1";
/**
* 离职
*/
String RESIGN = "2"; String RESIGN = "2";
/**
* 调配/异动
*/
String TRANSFER = "3"; String TRANSFER = "3";
/**
* 转正
*/
String REGULARIZATION = "4";
/**
* 续签
*/
String RENEWAL_CONTRACT = "5";
/**
* 部门调整
*/
String DEPT = "6";
/**
* 入职流程编码
*/
String ENTRY_CODE = "hrEntryFlow"; String ENTRY_CODE = "hrEntryFlow";
/**
* 离职流程编码
*/
String RESIGN_CODE = "hrResignFlow"; String RESIGN_CODE = "hrResignFlow";
/**
* 调配流程编码
*/
String TRANSFER_CODE = "hrTransferFlow"; String TRANSFER_CODE = "hrTransferFlow";
/**
* 转正流程编码
*/
String REGULARIZATION_CODE = "hrRegularizationFlow";
/**
* 续签流程编码
*/
String RENEWAL_CONTRACT_CODE = "renewalContractFlow";
/**
* 部门调整流程编码
*/
String DEPT_CODE = "hrDeptFlow";
} }
package com.anplus.hr.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author 刘斌
* @date 2025/11/17 20:26
*/
@Getter
@AllArgsConstructor
public enum HrResignYearsOfServiceTypeEnum {
PROBATION_PERIOD("1", "试用期内", 6),
UNDER_THREE_YEARS("2", "入职3年内", 36),
OVER_THREE_YEARS("3", "入职3年以上", 1200);
private final String code;
private final String name;
private final int monthsLimit;
public static HrResignYearsOfServiceTypeEnum getByTotalMonths(Integer totalMonths) {
if (totalMonths == null || totalMonths <= 0) {
return null;
}
for (HrResignYearsOfServiceTypeEnum value : values()) {
if (totalMonths < value.monthsLimit) {
return value;
}
}
return null;
}
}
package com.anplus.hr.constant;
/**
* @author 刘斌
* @date 2025/11/17 20:43
*/
public interface HrResignationTypeConstant {
// 主动离职
String HAND_IN_WORK = "1";
// 被动离职
String FIRED = "2";
// 试用期未转正
String PROBATION_NOT_PASSED = "3";
}
package com.anplus.hr.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author 刘斌
* @date 2025/11/19 11:17
* 员工生命周期状态
* 用于报表统计
*/
@Getter
@AllArgsConstructor
public enum HrStatusEnum {
/**
* 草稿
*/
DRAFT(0, "草稿"),
/**
* 已入职
*/
ENTRY(1, "已入职"),
/**
* 已转正
*/
REGULARIZATION(2, "已转正"),
// TRANSFER(2, "已完成"),
// RENEWAL_CONTRACT(2, "已完成"),
/**
* 已离职
*/
RESIGN(8, "已离职");
/**
* 状态
*/
private final Integer status;
/**
* 描述
*/
private final String desc;
private static final Map<Integer, HrStatusEnum> STATUS_MAP = Arrays.stream(HrStatusEnum.values())
.collect(Collectors.toConcurrentMap(HrStatusEnum::getStatus, Function.identity()));
}
package com.anplus.hr.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author 刘斌
* @date 2025/11/17 11:12
*/
@Getter
@AllArgsConstructor
public enum HrYearsOfServiceSegmentEnum {
UNDER_TWO("1", "<2年", 24),
TWO_TO_FIVE("2", "≥2年<5年", 60),
FIVE_TO_TEN("3", "≥5年<10年", 120),
OVER_TEN("4", "≥10年以上", 1200);
private final String code;
private final String name;
private final int monthsLimit;
public static HrYearsOfServiceSegmentEnum getByTotalMonths(Integer totalMonths) {
if (totalMonths == null || totalMonths <= 0) {
return null;
}
for (HrYearsOfServiceSegmentEnum value : values()) {
if (totalMonths < value.monthsLimit) {
return value;
}
}
return null;
}
}
package com.anplus.hr.controller;
import java.util.List;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.binfast.common.core.constant.BusinessType;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup;
import top.binfast.common.core.util.ResponseUtils;
import top.binfast.common.excel.annotion.ExcelExport;
import top.binfast.common.log.annotation.PinSysLog;
import com.anplus.hr.domain.params.EmployeeChangeLogListParam;
import com.anplus.hr.domain.params.EmployeeChangeLogParam;
import com.anplus.hr.domain.vo.EmployeeChangeLogVo;
import com.anplus.hr.service.EmployeeChangeLogServ;
/**
* 员工异动记录
*
* @author LiuBin
* @date 2025-11-17
*/
@Validated
@RestController
@RequestMapping("/employee/changeLog")
public class EmployeeChangeLogCtrl {
@Resource
private EmployeeChangeLogServ employeeChangeLogServ;
/**
* 查询员工异动记录列表
*/
@SaCheckPermission("employee:changeLog:list")
@GetMapping("/page")
public PageResponse<EmployeeChangeLogVo> pageList(EmployeeChangeLogListParam param) {
return employeeChangeLogServ.queryPageList(param);
}
/**
* 导出员工异动记录列表
*/
@ExcelExport
@SaCheckPermission("employee:changeLog:export")
@PinSysLog(value = "员工异动记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public List<EmployeeChangeLogVo> export(EmployeeChangeLogListParam param) {
return employeeChangeLogServ.queryList(param);
}
/**
* 获取员工异动记录详细信息
*
* @param id 主键
*/
@SaCheckPermission("employee:changeLog:query")
@GetMapping("/{id}")
public SingleResponse<EmployeeChangeLogVo> getDetail(@PathVariable @Min(1)
Long id) {
return SingleResponse.of(employeeChangeLogServ.queryById(id));
}
/**
* 新增员工异动记录
*/
@SaCheckPermission("employee:changeLog:add")
@PinSysLog(value = "员工异动记录", businessType = BusinessType.INSERT)
@PostMapping()
public Response add(@Validated(AddGroup.class) @RequestBody EmployeeChangeLogParam param) {
return ResponseUtils.ofResult(employeeChangeLogServ.insertByParam(param));
}
/**
* 修改员工异动记录
*/
@SaCheckPermission("employee:changeLog:edit")
@PinSysLog(value = "员工异动记录", businessType = BusinessType.UPDATE)
@PutMapping()
public Response edit(@Validated(EditGroup.class) @RequestBody EmployeeChangeLogParam param) {
return ResponseUtils.ofResult(employeeChangeLogServ.updateByParam(param));
}
/**
* 删除员工异动记录
*
* @param ids 主键串
*/
@SaCheckPermission("employee:changeLog:remove")
@PinSysLog(value = "员工异动记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public Response remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return ResponseUtils.ofResult(employeeChangeLogServ.delByIds(List.of(ids)));
}
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.alibaba.cola.dto.Response; ...@@ -6,6 +6,7 @@ import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse; import com.alibaba.cola.dto.SingleResponse;
import com.anplus.hr.domain.params.*; import com.anplus.hr.domain.params.*;
import com.anplus.hr.domain.vo.EmployeeInfoImportVo; import com.anplus.hr.domain.vo.EmployeeInfoImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoResignImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoVo; import com.anplus.hr.domain.vo.EmployeeInfoVo;
import com.anplus.hr.service.EmployeeInfoServ; import com.anplus.hr.service.EmployeeInfoServ;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
...@@ -21,6 +22,7 @@ import top.binfast.common.core.validate.AddGroup; ...@@ -21,6 +22,7 @@ import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup; import top.binfast.common.core.validate.EditGroup;
import top.binfast.common.excel.annotion.ExcelExport; import top.binfast.common.excel.annotion.ExcelExport;
import top.binfast.common.excel.annotion.ExcelStream; import top.binfast.common.excel.annotion.ExcelStream;
import top.binfast.common.idempotent.annotation.NoRepeatSubmit;
import top.binfast.common.log.annotation.PinSysLog; import top.binfast.common.log.annotation.PinSysLog;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -54,30 +56,42 @@ public class EmployeeInfoCtrl { ...@@ -54,30 +56,42 @@ public class EmployeeInfoCtrl {
/** /**
* 导出员工信息列表 * 导出员工信息列表
*/ */
@ExcelExport(template = "导出简历模板.xlsx", fill = true) @ExcelExport
@NoRepeatSubmit(interval = 60_000)
@SaCheckPermission("employee:info:export")
@PinSysLog(value = "员工信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public List<EmployeeInfoVo> export(EmployeeInfoListParam param) {
return employeeInfoServ.queryList(param);
}
/**
* 导出员工信息列表
*/
@ExcelExport(template = "简历模板.xlsx", fill = true)
@SaCheckPermission("employee:info:export") @SaCheckPermission("employee:info:export")
@PinSysLog(value = "员工信息", businessType = BusinessType.EXPORT) @PinSysLog(value = "员工信息", businessType = BusinessType.EXPORT)
@PostMapping("/export/{id}") @PostMapping("/export/{id}")
public List<EmployeeInfoVo> export(@PathVariable Long id) { public List<EmployeeInfoVo> export(@PathVariable Long id) {
EmployeeInfoVo vo = employeeInfoServ.infoDetail(id); EmployeeInfoVo vo = employeeInfoServ.infoDetail(id);
vo.setOnDuty("1".equals(vo.getEmployeeType()) ? "在职" : "离职");
return List.of(vo); return List.of(vo);
} }
/** /**
* 导入员工信息列表 * 导入员工信息列表
*/ */
// @NoRepeatSubmit(interval = 60_000)
@PinSysLog(value = "系统用户", businessType = BusinessType.IMPORT) @PinSysLog(value = "系统用户", businessType = BusinessType.IMPORT)
@SaCheckPermission("employee:info:import") @SaCheckPermission("employee:info:import")
@PostMapping(value = "/excel/import") @PostMapping(value = "/excel/import")
public Response importWithOptions(@ExcelStream(headRowNumber = 2) Stream<EmployeeInfoImportVo> stream, @RequestPart("file") MultipartFile file) { public Response importEmployees(@ExcelStream(headRowNumber = 2) Stream<EmployeeInfoImportVo> stream, @RequestPart("file") MultipartFile file) {
return employeeInfoServ.importEmployeeList(stream, file); return employeeInfoServ.importEmployeeList(stream, file);
} }
/** /**
* 获取导入模板 * 获取导入模板
*/ */
@ExcelExport(template = "模板.xlsx", fill = true) @ExcelExport(template = "在职模板.xlsx", fill = true)
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public List<EmployeeInfoImportVo> importTemplate() { public List<EmployeeInfoImportVo> importTemplate() {
return new ArrayList<>(); return new ArrayList<>();
...@@ -112,6 +126,7 @@ public class EmployeeInfoCtrl { ...@@ -112,6 +126,7 @@ public class EmployeeInfoCtrl {
/** /**
* 新增员工信息 * 新增员工信息
*/ */
@NoRepeatSubmit
@SaCheckPermission("employee:info:add") @SaCheckPermission("employee:info:add")
@PinSysLog(value = "员工信息", businessType = BusinessType.INSERT) @PinSysLog(value = "员工信息", businessType = BusinessType.INSERT)
@PostMapping() @PostMapping()
...@@ -122,6 +137,7 @@ public class EmployeeInfoCtrl { ...@@ -122,6 +137,7 @@ public class EmployeeInfoCtrl {
/** /**
* 修改员工信息 * 修改员工信息
*/ */
@NoRepeatSubmit
@SaCheckPermission("employee:info:edit") @SaCheckPermission("employee:info:edit")
@PinSysLog(value = "员工信息", businessType = BusinessType.UPDATE) @PinSysLog(value = "员工信息", businessType = BusinessType.UPDATE)
@PutMapping() @PutMapping()
...@@ -132,6 +148,7 @@ public class EmployeeInfoCtrl { ...@@ -132,6 +148,7 @@ public class EmployeeInfoCtrl {
/** /**
* 申请入职 * 申请入职
*/ */
@NoRepeatSubmit(interval = 60_000)
@SaCheckPermission("employee:info:add") @SaCheckPermission("employee:info:add")
@PinSysLog(value = "员工信息-入职申请", businessType = BusinessType.UPDATE) @PinSysLog(value = "员工信息-入职申请", businessType = BusinessType.UPDATE)
@PostMapping("/applyEntry") @PostMapping("/applyEntry")
...@@ -142,6 +159,7 @@ public class EmployeeInfoCtrl { ...@@ -142,6 +159,7 @@ public class EmployeeInfoCtrl {
/** /**
* 申请调职 * 申请调职
*/ */
@NoRepeatSubmit(interval = 60_000)
@SaCheckPermission("employee:info:edit") @SaCheckPermission("employee:info:edit")
@PinSysLog(value = "员工信息-调职申请", businessType = BusinessType.UPDATE) @PinSysLog(value = "员工信息-调职申请", businessType = BusinessType.UPDATE)
@PostMapping("/applyTransfer") @PostMapping("/applyTransfer")
...@@ -152,6 +170,7 @@ public class EmployeeInfoCtrl { ...@@ -152,6 +170,7 @@ public class EmployeeInfoCtrl {
/** /**
* 申请离职 * 申请离职
*/ */
@NoRepeatSubmit(interval = 60_000)
@SaCheckPermission("employee:info:resign") @SaCheckPermission("employee:info:resign")
@PinSysLog(value = "员工信息-离职申请", businessType = BusinessType.UPDATE) @PinSysLog(value = "员工信息-离职申请", businessType = BusinessType.UPDATE)
@PostMapping("/applyResign") @PostMapping("/applyResign")
...@@ -164,6 +183,7 @@ public class EmployeeInfoCtrl { ...@@ -164,6 +183,7 @@ public class EmployeeInfoCtrl {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@NoRepeatSubmit
@SaCheckPermission("employee:info:remove") @SaCheckPermission("employee:info:remove")
@PinSysLog(value = "员工信息", businessType = BusinessType.DELETE) @PinSysLog(value = "员工信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
......
package com.anplus.hr.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.anplus.hr.domain.params.EmployeeInfoListParam;
import com.anplus.hr.domain.vo.EmployeeInfoResignImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoResignVo;
import com.anplus.hr.service.EmployeeInfoResignServ;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.Min;
import org.dromara.core.trans.anno.TransMethodResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import top.binfast.common.core.constant.BusinessType;
import top.binfast.common.excel.annotion.ExcelExport;
import top.binfast.common.excel.annotion.ExcelStream;
import top.binfast.common.idempotent.annotation.NoRepeatSubmit;
import top.binfast.common.log.annotation.PinSysLog;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
/**
* @author 刘斌
* @date 2025/11/13 20:40
*/
@Validated
@RestController
@RequestMapping("/employee/info/resign")
public class EmployeeInfoResignCtrl {
@Resource
private EmployeeInfoResignServ employeeInfoResignServ;
/**
* 查询员工信息列表
*/
@TransMethodResult
@SaCheckPermission("employee:infoResign:list")
@GetMapping("/page")
public PageResponse<EmployeeInfoResignVo> pageList(EmployeeInfoListParam param) {
return employeeInfoResignServ.queryPageList(param);
}
/**
* 导出员工信息列表
*/
@ExcelExport
@NoRepeatSubmit(interval = 60_000)
@SaCheckPermission("employee:infoResign:export")
@PinSysLog(value = "离职员工信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public List<EmployeeInfoResignVo> export(EmployeeInfoListParam param) {
return employeeInfoResignServ.queryList(param);
}
/**
* 导入员工信息列表
*/
// @NoRepeatSubmit(interval = 60_000)
@PinSysLog(value = "离职员工导入", businessType = BusinessType.IMPORT)
@SaCheckPermission("employee:infoResign:import")
@PostMapping(value = "/excel/import")
public Response importWithOptions(@ExcelStream(headRowNumber = 2) Stream<EmployeeInfoResignImportVo> stream, @RequestPart("file") MultipartFile file) {
return employeeInfoResignServ.importEmployeeResignList(stream, file);
}
/**
* 获取导入模板
*/
@ExcelExport(template = "离职模板.xlsx", fill = true)
@PostMapping("/importTemplate")
public List<EmployeeInfoResignImportVo> importTemplate() {
return new ArrayList<>();
}
/**
* 展示员工信息详细信息
*
* @param id 主键
*/
@TransMethodResult
@SaCheckPermission("employee:infoResign:query")
@GetMapping("/detail/{id}")
public SingleResponse<EmployeeInfoResignVo> infoDetail(@PathVariable @Min(1)
Long id) {
return SingleResponse.of(employeeInfoResignServ.infoDetail(id));
}
}
package com.anplus.hr.domain;
import top.binfast.common.mybatis.bean.model.TenantModel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serial;
/**
* 员工异动记录对象 employee_change_log
*
* @author LiuBin
* @date 2025-11-17
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@TableName("employee_change_log")
public class EmployeeChangeLog extends TenantModel {
@Serial
private static final long serialVersionUID = 1L;
/**
* 异动类型
*/
private String type;
/**
* 板块
*/
private String plate;
/**
* 部门ID
*/
private Long deptId;
/**
* 员工ID
*/
private Long employeeId;
/**
* 异动时间
*/
private LocalDate changeDate;
/**
* 离职类型 1.主动离职 2.被动离职
*/
private String resignType;
/**
* 离职工龄类型
*/
private String resignYearsOfServiceType;
}
package com.anplus.hr.domain; package com.anplus.hr.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import top.binfast.common.mybatis.bean.model.BaseModel; import top.binfast.common.mybatis.bean.model.TenantModel;
import java.io.Serial; import java.io.Serial;
import java.time.LocalDate; import java.time.LocalDate;
...@@ -13,13 +14,13 @@ import java.time.LocalDate; ...@@ -13,13 +14,13 @@ import java.time.LocalDate;
* 员工信息对象 employee_info * 员工信息对象 employee_info
* *
* @author LiuBin * @author LiuBin
* @date 2025-10-28 * @date 2025-11-13
*/ */
@Getter @Getter
@Setter @Setter
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("employee_info") @TableName("employee_info")
public class EmployeeInfo extends BaseModel { public class EmployeeInfo extends TenantModel {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -29,11 +30,6 @@ public class EmployeeInfo extends BaseModel { ...@@ -29,11 +30,6 @@ public class EmployeeInfo extends BaseModel {
*/ */
private String plate; private String plate;
/**
* 项目
*/
private String project;
/** /**
* 一级部门 * 一级部门
*/ */
...@@ -45,29 +41,39 @@ public class EmployeeInfo extends BaseModel { ...@@ -45,29 +41,39 @@ public class EmployeeInfo extends BaseModel {
private String secondLevelDepartment; private String secondLevelDepartment;
/** /**
* 部门id * 三级部门
*/
private String thirdLevelDepartment;
/**
* 部门ID
*/ */
private Long deptId; private Long deptId;
/** /**
* 工号 * 工号
*/ */
private String employeeId; private String employeeNo;
/** /**
* 职级 * 职级
*/ */
private String jobLevel; private Integer jobLevel;
/** /**
* 岗位 * 岗位类型
*/ */
private String position; private String positionType;
/** /**
* 职务 * 序列
*/ */
private String post; private String sequence;
/**
* 主岗位
*/
private String position;
/** /**
* 姓名 * 姓名
...@@ -80,9 +86,9 @@ public class EmployeeInfo extends BaseModel { ...@@ -80,9 +86,9 @@ public class EmployeeInfo extends BaseModel {
private String gender; private String gender;
/** /**
* 简历图片 * 头像OSS_ID
*/ */
private String resumeImage; private Long ossId;
/** /**
* 身份证号码 * 身份证号码
...@@ -104,6 +110,36 @@ public class EmployeeInfo extends BaseModel { ...@@ -104,6 +110,36 @@ public class EmployeeInfo extends BaseModel {
*/ */
private String ageGroup; private String ageGroup;
/**
* 兼职板块
*/
private String partTimePlate;
/**
* 兼职一级部门
*/
private String partTimeFirstDept;
/**
* 兼职二级部门
*/
private String partTimeSecondDept;
/**
* 兼职三级部门
*/
private String partTimeThirdDept;
/**
* 兼职部门ID
*/
private Long partDeptId;
/**
* 兼职岗位
*/
private String partTimePosition;
/** /**
* 籍贯 * 籍贯
*/ */
...@@ -164,35 +200,70 @@ public class EmployeeInfo extends BaseModel { ...@@ -164,35 +200,70 @@ public class EmployeeInfo extends BaseModel {
*/ */
private String yearsOfService; private String yearsOfService;
/**
* 工龄总月数
*/
private Integer yearsOfServiceMonths;
/** /**
* 工龄段 * 工龄段
*/ */
private String yearsOfServiceSegment; private String yearsOfServiceSegment;
/** /**
* 学历 * 全日制学历
*/
private String fulltimeEducation;
/**
* 全日制毕业院校
*/
private String fulltimeSchool;
/**
* 全日制专业
*/ */
private String education; private String fulltimeMajor;
/** /**
* 学位 * 全日制毕业日期
*/ */
private String degree; private LocalDate fulltimeGraduationDate;
/** /**
* 毕业时间 * 全日制学位
*/ */
private LocalDate graduationDate; private String fulltimeDegree;
/** /**
* 专业 * 非全日制学历
*/ */
private String major; private String nonFulltimeEducation;
/** /**
* 毕业院校 * 非全日制毕业院校
*/ */
private String graduateSchool; private String nonFulltimeSchool;
/**
* 非全日制专业
*/
private String nonFulltimeMajor;
/**
* 非全日制毕业日期
*/
private LocalDate nonFulltimeGraduationDate;
/**
* 非全日制学位
*/
private String nonFulltimeDegree;
/**
* 学历分类
*/
private String educationCategory;
/** /**
* 员工类型 * 员工类型
...@@ -205,15 +276,30 @@ public class EmployeeInfo extends BaseModel { ...@@ -205,15 +276,30 @@ public class EmployeeInfo extends BaseModel {
private String professionalTitle; private String professionalTitle;
/** /**
* 简历 * 证书情况
*/
private String certificateStatus;
/**
* 外部个人履历
*/
private String externalResume;
/**
* 内部个人履历
*/ */
private String resume; private String internalResume;
/** /**
* 用工形式 * 用工形式
*/ */
private String employmentForm; private String employmentForm;
/**
* 合同形式
*/
private String contractForm;
/** /**
* 劳动合同期限 * 劳动合同期限
*/ */
...@@ -244,26 +330,101 @@ public class EmployeeInfo extends BaseModel { ...@@ -244,26 +330,101 @@ public class EmployeeInfo extends BaseModel {
*/ */
private String contractEntity; private String contractEntity;
/**
* 社保主体
*/
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
private String hasProvidentFundPaid;
/**
* 试用期(月数)
*/
private Integer probationPeriod;
/** /**
* 转正时间 * 转正时间
*/ */
private LocalDate regularizationDate; private LocalDate regularizationDate;
/** /**
* 异动情况 * 奖励情况
*/ */
private String transferStatus; private String rewardStatus;
/** /**
* 奖惩情况 * 处罚情况
*/ */
private String rewardPunishmentStatus; private String punishmentStatus;
/** /**
* 备注 * 备注
*/ */
private String remarks; private String remarks;
/**
* 办公电话
*/
private String officePhone;
/**
* 短线
*/
private String shortLine;
/**
* 银行卡号
*/
private String bankCardNumber;
/**
* 开户行
*/
private String bankName;
/**
* 公司内是否有亲属关系
*/
private String hasRelativeInCompany;
/**
* 亲属姓名
*/
private String relativeName;
/**
* 介绍人
*/
private String introducer;
/**
* 工资发放地
*/
private String salaryLocation;
/**
* 绩效比例
*/
private String performanceRatio;
/**
* 离职类型
*/
private String resignationType;
/** /**
* 离职时间 * 离职时间
*/ */
...@@ -275,7 +436,17 @@ public class EmployeeInfo extends BaseModel { ...@@ -275,7 +436,17 @@ public class EmployeeInfo extends BaseModel {
private String resignationReason; private String resignationReason;
/** /**
* 离职审批状态 * 最后结薪日
*/
private LocalDate finalPayDate;
/**
* 员工状态
*/
private Integer status;
/**
* 离职申请状态
*/ */
private Integer resignationApplyStatus; private Integer resignationApplyStatus;
...@@ -285,9 +456,24 @@ public class EmployeeInfo extends BaseModel { ...@@ -285,9 +456,24 @@ public class EmployeeInfo extends BaseModel {
private Integer entryApplyStatus; private Integer entryApplyStatus;
/** /**
* 调配申请审批状态 * 调配申请状态
*/ */
private Integer transferApplyStatus; private Integer transferApplyStatus;
/**
* 转正申请状态
*/
private Integer regularApplyStatus;
/**
* 续签合同申请状态
*/
private Integer renewalApplyStatus;
/**
* 照片
*/
@TableField(exist = false)
private String photo;
} }
package com.anplus.hr.domain.params;
import lombok.Getter;
import lombok.Setter;
import top.binfast.common.core.bean.params.PageQueryParam;
import java.util.HashMap;
import java.util.Map;
import java.time.LocalDateTime;
/**
* 员工异动记录分页对象 employee_change_log
*
* @author LiuBin
* @date 2025-11-17
*/
@Getter
@Setter
public class EmployeeChangeLogListParam extends PageQueryParam {
/**
* 异动类型
*/
private String type;
/**
* 板块
*/
private String plate;
/**
* 部门ID
*/
private Long deptId;
/**
* 员工ID
*/
private Long employeeId;
/**
* 异动时间
*/
private LocalDateTime changeDate;
/**
* 离职类型
*/
private String resignType;
/**
* 离职工龄类型
*/
private String resignYearsOfServiceType;
private Map<String, Object> params = new HashMap<>();
}
package com.anplus.hr.domain.params;
import cn.idev.excel.annotation.ExcelProperty;
import com.anplus.hr.domain.EmployeeChangeLog;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.time.LocalDateTime;;
/**
* 员工异动记录业务对象 employee_change_log
*
* @author LiuBin
* @date 2025-11-17
*/
@Data
@AutoMapper(target = EmployeeChangeLog.class, reverseConvertGenerate = false)
public class EmployeeChangeLogParam {
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long id;
/**
* 异动类型
*/
@NotBlank(message = "异动类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String type;
/**
* 板块
*/
private String plate;
/**
* 部门ID
*/
@NotNull(message = "部门ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long deptId;
/**
* 员工ID
*/
@NotNull(message = "员工ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long employeeId;
/**
* 异动时间
*/
@NotNull(message = "异动时间不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDateTime changeDate;
/**
* 离职类型
*/
@NotBlank(message = "离职类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String resignType;
/**
* 离职工龄类型
*/
@NotBlank(message = "离职工龄类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String resignYearsOfServiceType;
}
package com.anplus.hr.domain.params; package com.anplus.hr.domain.params;
import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import java.time.LocalDate;
/** /**
* @author 刘斌 * @author 刘斌
* @date 2025/10/31 15:47 * @date 2025/10/31 15:47
...@@ -11,5 +14,11 @@ public class EmployeeEntryApplyParam { ...@@ -11,5 +14,11 @@ public class EmployeeEntryApplyParam {
private Long id; private Long id;
/**
* 入职时间
*/
@NotNull(message = "入职时间不能为空")
private LocalDate entryDate;
private String remark; private String remark;
} }
...@@ -8,13 +8,11 @@ import java.time.LocalDate; ...@@ -8,13 +8,11 @@ import java.time.LocalDate;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
;
/** /**
* 员工信息分页对象 employee_info * 员工信息分页对象 employee_info
* *
* @author LiuBin * @author LiuBin
* @date 2025-10-28 * @date 2025-11-13
*/ */
@Getter @Getter
@Setter @Setter
...@@ -25,11 +23,6 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -25,11 +23,6 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String plate; private String plate;
/**
* 项目
*/
private String project;
/** /**
* 一级部门 * 一级部门
*/ */
...@@ -40,6 +33,16 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -40,6 +33,16 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String secondLevelDepartment; private String secondLevelDepartment;
/**
* 三级部门
*/
private String thirdLevelDepartment;
/**
* 部门ID
*/
private Long deptId;
/** /**
* 工号 * 工号
*/ */
...@@ -48,17 +51,22 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -48,17 +51,22 @@ public class EmployeeInfoListParam extends PageQueryParam {
/** /**
* 职级 * 职级
*/ */
private String jobLevel; private Integer jobLevel;
/** /**
* 岗位 * 岗位类型
*/ */
private String position; private String positionType;
/**
* 序列
*/
private String sequence;
/** /**
* 职务 * 主岗位
*/ */
private String post; private String position;
/** /**
* 姓名 * 姓名
...@@ -75,6 +83,11 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -75,6 +83,11 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String idCardNumber; private String idCardNumber;
/**
* 照片
*/
private String photo;
/** /**
* 出生日期 * 出生日期
*/ */
...@@ -90,6 +103,31 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -90,6 +103,31 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String ageGroup; private String ageGroup;
/**
* 兼职板块
*/
private String partTimePlate;
/**
* 兼职一级部门
*/
private String partTimeFirstDept;
/**
* 兼职二级部门
*/
private String partTimeSecondDept;
/**
* 兼职三级部门
*/
private String partTimeThirdDept;
/**
* 兼职岗位
*/
private String partTimePosition;
/** /**
* 籍贯 * 籍贯
*/ */
...@@ -156,29 +194,59 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -156,29 +194,59 @@ public class EmployeeInfoListParam extends PageQueryParam {
private String yearsOfServiceSegment; private String yearsOfServiceSegment;
/** /**
* 学历 * 全日制学历
*/
private String fulltimeEducation;
/**
* 全日制毕业院校
*/
private String fulltimeSchool;
/**
* 全日制专业
*/
private String fulltimeMajor;
/**
* 全日制毕业日期
*/ */
private String education; private LocalDate fulltimeGraduationDate;
/** /**
* 学位 * 全日制学位
*/ */
private String degree; private String fulltimeDegree;
/** /**
* 毕业时间 * 非全日制学历
*/ */
private LocalDate graduationDate; private String nonFulltimeEducation;
/** /**
* 专业 * 非全日制毕业院校
*/ */
private String major; private String nonFulltimeSchool;
/** /**
* 毕业院校 * 非全日制专业
*/ */
private String graduateSchool; private String nonFulltimeMajor;
/**
* 非全日制毕业日期
*/
private LocalDate nonFulltimeGraduationDate;
/**
* 非全日制学位
*/
private String nonFulltimeDegree;
/**
* 学历分类
*/
private String educationCategory;
/** /**
* 员工类型 * 员工类型
...@@ -191,15 +259,30 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -191,15 +259,30 @@ public class EmployeeInfoListParam extends PageQueryParam {
private String professionalTitle; private String professionalTitle;
/** /**
* 简历 * 证书情况
*/
private String certificateStatus;
/**
* 外部个人履历
*/
private String externalResume;
/**
* 内部个人履历
*/ */
private String resume; private String internalResume;
/** /**
* 用工形式 * 用工形式
*/ */
private String employmentForm; private String employmentForm;
/**
* 合同形式
*/
private String contractForm;
/** /**
* 劳动合同期限 * 劳动合同期限
*/ */
...@@ -230,26 +313,101 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -230,26 +313,101 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String contractEntity; private String contractEntity;
/**
* 社保主体
*/
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
private String hasProvidentFundPaid;
/**
* 试用期(月数)
*/
private Integer probationPeriod;
/** /**
* 转正时间 * 转正时间
*/ */
private LocalDate regularizationDate; private LocalDate regularizationDate;
/** /**
* 异动情况 * 奖励情况
*/ */
private String transferStatus; private String rewardStatus;
/** /**
* 奖惩情况 * 处罚情况
*/ */
private String rewardPunishmentStatus; private String punishmentStatus;
/** /**
* 备注 * 备注
*/ */
private String remarks; private String remarks;
/**
* 办公电话
*/
private String officePhone;
/**
* 短线
*/
private String shortLine;
/**
* 银行卡号
*/
private String bankCardNumber;
/**
* 开户行
*/
private String bankName;
/**
* 公司内是否有亲属关系
*/
private String hasRelativeInCompany;
/**
* 亲属姓名
*/
private String relativeName;
/**
* 介绍人
*/
private String introducer;
/**
* 工资发放地
*/
private String salaryLocation;
/**
* 绩效比例
*/
private String performanceRatio;
/**
* 离职类型
*/
private String resignationType;
/** /**
* 离职时间 * 离职时间
*/ */
...@@ -260,6 +418,31 @@ public class EmployeeInfoListParam extends PageQueryParam { ...@@ -260,6 +418,31 @@ public class EmployeeInfoListParam extends PageQueryParam {
*/ */
private String resignationReason; private String resignationReason;
/**
* 最后结薪日
*/
private LocalDate finalPayDate;
/**
* 员工生命周期状态
*/
private Integer status;
// /**
// * 离职申请状态
// */
// private Integer resignationApplyStatus;
//
// /**
// * 入职审批状态
// */
// private Integer entryApplyStatus;
//
// /**
// * 调配申请状态
// */
// private Integer transferApplyStatus;
private Map<String, Object> params = new HashMap<>(); private Map<String, Object> params = new HashMap<>();
......
...@@ -10,13 +10,11 @@ import top.binfast.common.core.validate.EditGroup; ...@@ -10,13 +10,11 @@ import top.binfast.common.core.validate.EditGroup;
import java.time.LocalDate; import java.time.LocalDate;
;
/** /**
* 员工信息业务对象 employee_info * 员工信息业务对象 employee_info
* *
* @author LiuBin * @author LiuBin
* @date 2025-10-28 * @date 2025-11-13
*/ */
@Data @Data
@AutoMapper(target = EmployeeInfo.class, reverseConvertGenerate = false) @AutoMapper(target = EmployeeInfo.class, reverseConvertGenerate = false)
...@@ -34,12 +32,6 @@ public class EmployeeInfoParam { ...@@ -34,12 +32,6 @@ public class EmployeeInfoParam {
@NotBlank(message = "板块不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "板块不能为空", groups = { AddGroup.class, EditGroup.class })
private String plate; private String plate;
/**
* 项目
*/
@NotBlank(message = "项目不能为空", groups = { AddGroup.class, EditGroup.class })
private String project;
/** /**
* 一级部门 * 一级部门
*/ */
...@@ -53,34 +45,46 @@ public class EmployeeInfoParam { ...@@ -53,34 +45,46 @@ public class EmployeeInfoParam {
private String secondLevelDepartment; private String secondLevelDepartment;
/** /**
* 部门id * 三级部门
*/ */
@NotNull(message = "部门id不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "三级部门不能为空", groups = { AddGroup.class, EditGroup.class })
private String thirdLevelDepartment;
/**
* 部门ID
*/
@NotNull(message = "部门ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long deptId; private Long deptId;
/** /**
* 工号 * 工号
*/ */
@NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
private String employeeId; private String employeeId;
/** /**
* 职级 * 职级
*/ */
@NotBlank(message = "职级不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "职级不能为空", groups = { AddGroup.class, EditGroup.class })
private String jobLevel; private Integer jobLevel;
/** /**
* 岗位 * 岗位类型
*/ */
@NotBlank(message = "岗位不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "岗位类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String position; private String positionType;
/** /**
* 职务 * 序列
*/ */
@NotBlank(message = "职务不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "序列不能为空", groups = { AddGroup.class, EditGroup.class })
private String post; private String sequence;
/**
* 主岗位
*/
// @NotBlank(message = "主岗位不能为空", groups = { AddGroup.class, EditGroup.class })
private String position;
/** /**
* 姓名 * 姓名
...@@ -95,10 +99,9 @@ public class EmployeeInfoParam { ...@@ -95,10 +99,9 @@ public class EmployeeInfoParam {
private String gender; private String gender;
/** /**
* 简历图片 * 头像OSS_ID
*/ */
@NotBlank(message = "简历图片不能为空", groups = { AddGroup.class, EditGroup.class }) private Long ossId;
private String resumeImage;
/** /**
* 身份证号码 * 身份证号码
...@@ -106,6 +109,12 @@ public class EmployeeInfoParam { ...@@ -106,6 +109,12 @@ public class EmployeeInfoParam {
@NotBlank(message = "身份证号码不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "身份证号码不能为空", groups = { AddGroup.class, EditGroup.class })
private String idCardNumber; private String idCardNumber;
// /**
// * 照片
// */
// @NotBlank(message = "照片不能为空", groups = { AddGroup.class, EditGroup.class })
// private String photo;
/** /**
* 出生日期 * 出生日期
*/ */
...@@ -121,31 +130,66 @@ public class EmployeeInfoParam { ...@@ -121,31 +130,66 @@ public class EmployeeInfoParam {
/** /**
* 年龄段 * 年龄段
*/ */
@NotBlank(message = "年龄段不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "年龄段不能为空", groups = { AddGroup.class, EditGroup.class })
private String ageGroup; private String ageGroup;
/**
* 兼职板块
*/
// @NotBlank(message = "兼职板块不能为空", groups = { AddGroup.class, EditGroup.class })
private String partTimePlate;
/**
* 兼职一级部门
*/
// @NotBlank(message = "兼职一级部门不能为空", groups = { AddGroup.class, EditGroup.class })
private String partTimeFirstDept;
/**
* 兼职二级部门
*/
// @NotBlank(message = "兼职二级部门不能为空", groups = { AddGroup.class, EditGroup.class })
private String partTimeSecondDept;
/**
* 兼职三级部门
*/
// @NotBlank(message = "兼职三级部门不能为空", groups = { AddGroup.class, EditGroup.class })
private String partTimeThirdDept;
/**
* 兼职岗位
*/
// @NotBlank(message = "兼职岗位不能为空", groups = { AddGroup.class, EditGroup.class })
private String partTimePosition;
/**
* 兼职部门ID
*/
private Long partDeptId;
/** /**
* 籍贯 * 籍贯
*/ */
@NotBlank(message = "籍贯不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "籍贯不能为空", groups = { AddGroup.class, EditGroup.class })
private String nativePlace; private String nativePlace;
/** /**
* 民族 * 民族
*/ */
@NotBlank(message = "民族不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "民族不能为空", groups = { AddGroup.class, EditGroup.class })
private String ethnicity; private String ethnicity;
/** /**
* 婚姻状况 * 婚姻状况
*/ */
@NotBlank(message = "婚姻状况不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "婚姻状况不能为空", groups = { AddGroup.class, EditGroup.class })
private String maritalStatus; private String maritalStatus;
/** /**
* 政治面貌 * 政治面貌
*/ */
@NotBlank(message = "政治面貌不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "政治面貌不能为空", groups = { AddGroup.class, EditGroup.class })
private String politicalStatus; private String politicalStatus;
/** /**
...@@ -157,13 +201,13 @@ public class EmployeeInfoParam { ...@@ -157,13 +201,13 @@ public class EmployeeInfoParam {
/** /**
* 紧急联系人 * 紧急联系人
*/ */
@NotBlank(message = "紧急联系人不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "紧急联系人不能为空", groups = { AddGroup.class, EditGroup.class })
private String emergencyContact; private String emergencyContact;
/** /**
* 紧急联系人电话 * 紧急联系人电话
*/ */
@NotBlank(message = "紧急联系人电话不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "紧急联系人电话不能为空", groups = { AddGroup.class, EditGroup.class })
private String emergencyContactPhone; private String emergencyContactPhone;
/** /**
...@@ -175,67 +219,103 @@ public class EmployeeInfoParam { ...@@ -175,67 +219,103 @@ public class EmployeeInfoParam {
/** /**
* 户口所在地 * 户口所在地
*/ */
@NotBlank(message = "户口所在地不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "户口所在地不能为空", groups = { AddGroup.class, EditGroup.class })
private String householdRegistrationAddress; private String householdRegistrationAddress;
/** /**
* 参加工作时间 * 参加工作时间
*/ */
@NotNull(message = "参加工作时间不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "参加工作时间不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate workStartDate; private LocalDate workStartDate;
/** /**
* 入职时间 * 入职时间
*/ */
@NotNull(message = "入职时间不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "入职时间不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate entryDate; private LocalDate entryDate;
/** /**
* 工龄 * 工龄
*/ */
@NotNull(message = "工龄不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "工龄不能为空", groups = { AddGroup.class, EditGroup.class })
private String yearsOfService; private String yearsOfService;
/** /**
* 工龄段 * 工龄段
*/ */
@NotBlank(message = "工龄段不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "工龄段不能为空", groups = { AddGroup.class, EditGroup.class })
private String yearsOfServiceSegment; private String yearsOfServiceSegment;
/** /**
* 学历 * 全日制学历
*/
// @NotBlank(message = "全日制学历不能为空", groups = { AddGroup.class, EditGroup.class })
private String fulltimeEducation;
/**
* 全日制毕业院校
*/
// @NotBlank(message = "全日制毕业院校不能为空", groups = { AddGroup.class, EditGroup.class })
private String fulltimeSchool;
/**
* 全日制专业
*/ */
@NotBlank(message = "学历不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "全日制专业不能为空", groups = { AddGroup.class, EditGroup.class })
private String education; private String fulltimeMajor;
/** /**
* 学位 * 全日制毕业日期
*/ */
@NotBlank(message = "学位不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "全日制毕业日期不能为空", groups = { AddGroup.class, EditGroup.class })
private String degree; private LocalDate fulltimeGraduationDate;
/** /**
* 毕业时间 * 全日制学位
*/ */
@NotNull(message = "毕业时间不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "全日制学位不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate graduationDate; private String fulltimeDegree;
/** /**
* 专业 * 非全日制学历
*/ */
@NotBlank(message = "专业不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "非全日制学历不能为空", groups = { AddGroup.class, EditGroup.class })
private String major; private String nonFulltimeEducation;
/** /**
* 毕业院校 * 非全日制毕业院校
*/ */
@NotBlank(message = "毕业院校不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "非全日制毕业院校不能为空", groups = { AddGroup.class, EditGroup.class })
private String graduateSchool; private String nonFulltimeSchool;
/**
* 非全日制专业
*/
// @NotBlank(message = "非全日制专业不能为空", groups = { AddGroup.class, EditGroup.class })
private String nonFulltimeMajor;
/**
* 非全日制毕业日期
*/
// @NotNull(message = "非全日制毕业日期不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate nonFulltimeGraduationDate;
/**
* 非全日制学位
*/
// @NotBlank(message = "非全日制学位不能为空", groups = { AddGroup.class, EditGroup.class })
private String nonFulltimeDegree;
/**
* 学历分类
*/
// @NotBlank(message = "学历分类不能为空", groups = { AddGroup.class, EditGroup.class })
private String educationCategory;
/** /**
* 员工类型 * 员工类型
*/ */
@NotBlank(message = "员工类型不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "员工类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String employeeType; private String employeeType;
/** /**
...@@ -245,33 +325,51 @@ public class EmployeeInfoParam { ...@@ -245,33 +325,51 @@ public class EmployeeInfoParam {
private String professionalTitle; private String professionalTitle;
/** /**
* 简历 * 证书情况
*/
// @NotBlank(message = "证书情况不能为空", groups = { AddGroup.class, EditGroup.class })
private String certificateStatus;
/**
* 外部个人履历
*/
// @NotBlank(message = "外部个人履历不能为空", groups = { AddGroup.class, EditGroup.class })
private String externalResume;
/**
* 内部个人履历
*/ */
// @NotBlank(message = "历不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "内部个人履历不能为空", groups = { AddGroup.class, EditGroup.class })
private String resume; private String internalResume;
/** /**
* 用工形式 * 用工形式
*/ */
@NotBlank(message = "用工形式不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "用工形式不能为空", groups = { AddGroup.class, EditGroup.class })
private String employmentForm; private String employmentForm;
/**
* 合同形式
*/
// @NotBlank(message = "合同形式不能为空", groups = { AddGroup.class, EditGroup.class })
private String contractForm;
/** /**
* 劳动合同期限 * 劳动合同期限
*/ */
@NotBlank(message = "劳动合同期限不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "劳动合同期限不能为空", groups = { AddGroup.class, EditGroup.class })
private String contractTerm; private String contractTerm;
/** /**
* 劳动合同开始时间 * 劳动合同开始时间
*/ */
@NotNull(message = "劳动合同开始时间不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "劳动合同开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate contractStartDate; private LocalDate contractStartDate;
/** /**
* 劳动合同截止时间 * 劳动合同截止时间
*/ */
@NotNull(message = "劳动合同截止时间不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "劳动合同截止时间不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate contractEndDate; private LocalDate contractEndDate;
/** /**
...@@ -283,15 +381,45 @@ public class EmployeeInfoParam { ...@@ -283,15 +381,45 @@ public class EmployeeInfoParam {
/** /**
* 劳动合同签订情况 * 劳动合同签订情况
*/ */
@NotBlank(message = "劳动合同签订情况不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "劳动合同签订情况不能为空", groups = { AddGroup.class, EditGroup.class })
private String contractSigningStatus; private String contractSigningStatus;
/** /**
* 合同主体 * 合同主体
*/ */
@NotBlank(message = "合同主体不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "合同主体不能为空", groups = { AddGroup.class, EditGroup.class })
private String contractEntity; private String contractEntity;
/**
* 社保主体
*/
// @NotBlank(message = "社保主体不能为空", groups = { AddGroup.class, EditGroup.class })
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
// @NotBlank(message = "是否缴纳社保不能为空", groups = { AddGroup.class, EditGroup.class })
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
// @NotBlank(message = "公积金主体不能为空", groups = { AddGroup.class, EditGroup.class })
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
// @NotBlank(message = "是否缴纳公积金不能为空", groups = { AddGroup.class, EditGroup.class })
private String hasProvidentFundPaid;
/**
* 试用期(月数)
*/
// @NotNull(message = "试用期(月数)不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer probationPeriod;
/** /**
* 转正时间 * 转正时间
*/ */
...@@ -299,16 +427,16 @@ public class EmployeeInfoParam { ...@@ -299,16 +427,16 @@ public class EmployeeInfoParam {
private LocalDate regularizationDate; private LocalDate regularizationDate;
/** /**
* 异动情况 * 奖励情况
*/ */
// @NotBlank(message = "异动情况不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "奖励情况不能为空", groups = { AddGroup.class, EditGroup.class })
private String transferStatus; private String rewardStatus;
/** /**
* 奖惩情况 * 处罚情况
*/ */
// @NotBlank(message = "奖惩情况不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "处罚情况不能为空", groups = { AddGroup.class, EditGroup.class })
private String rewardPunishmentStatus; private String punishmentStatus;
/** /**
* 备注 * 备注
...@@ -316,6 +444,66 @@ public class EmployeeInfoParam { ...@@ -316,6 +444,66 @@ public class EmployeeInfoParam {
// @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String remarks; private String remarks;
/**
* 办公电话
*/
// @NotBlank(message = "办公电话不能为空", groups = { AddGroup.class, EditGroup.class })
private String officePhone;
/**
* 短线
*/
// @NotBlank(message = "短线不能为空", groups = { AddGroup.class, EditGroup.class })
private String shortLine;
/**
* 银行卡号
*/
// @NotBlank(message = "银行卡号不能为空", groups = { AddGroup.class, EditGroup.class })
private String bankCardNumber;
/**
* 开户行
*/
// @NotBlank(message = "开户行不能为空", groups = { AddGroup.class, EditGroup.class })
private String bankName;
/**
* 公司内是否有亲属关系
*/
// @NotBlank(message = "公司内是否有亲属关系不能为空", groups = { AddGroup.class, EditGroup.class })
private String hasRelativeInCompany;
/**
* 亲属姓名
*/
// @NotBlank(message = "亲属姓名不能为空", groups = { AddGroup.class, EditGroup.class })
private String relativeName;
/**
* 介绍人
*/
// @NotBlank(message = "介绍人不能为空", groups = { AddGroup.class, EditGroup.class })
private String introducer;
/**
* 工资发放地
*/
// @NotBlank(message = "工资发放地不能为空", groups = { AddGroup.class, EditGroup.class })
private String salaryLocation;
/**
* 绩效比例
*/
// @NotNull(message = "绩效比例不能为空", groups = { AddGroup.class, EditGroup.class })
private String performanceRatio;
/**
* 离职类型
*/
// @NotBlank(message = "离职类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String resignationType;
/** /**
* 离职时间 * 离职时间
*/ */
...@@ -328,5 +516,29 @@ public class EmployeeInfoParam { ...@@ -328,5 +516,29 @@ public class EmployeeInfoParam {
// @NotBlank(message = "离职原因不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "离职原因不能为空", groups = { AddGroup.class, EditGroup.class })
private String resignationReason; private String resignationReason;
/**
* 最后结薪日
*/
// @NotNull(message = "最后结薪日不能为空", groups = { AddGroup.class, EditGroup.class })
private LocalDate finalPayDate;
/**
* 离职申请状态
*/
// @NotNull(message = "离职申请状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer resignationApplyStatus;
/**
* 入职审批状态
*/
// @NotNull(message = "入职审批状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer entryApplyStatus;
/**
* 调配申请状态
*/
// @NotNull(message = "调配申请状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer transferApplyStatus;
} }
package com.anplus.hr.domain.params;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.time.LocalDate;
/**
* 转正申请参数
* @author 刘斌
* @date 2025/11/18 11:27
*
* !!!需要自动填写的字段!!!
* 员工类型:转正员工
* 用工形式:正式工
* 合同形式:新签
* 劳动合同期限:开始时间-结束时间
* 合同到期提醒:结束时间减一个月
*/
@Data
public class EmployeeRegularApplyParam {
private Long id;
/**
* 劳动合同开始时间
*/
@NotNull(message = "劳动合同开始时间")
private LocalDate contractStartDate;
/**
* 劳动合同截止时间
*/
@NotNull(message = "劳动合同截止时间")
private LocalDate contractEndDate;
/**
* 劳动合同签订情况
*/
private String contractSigningStatus;
/**
* 合同主体
*/
private String contractEntity;
/**
* 社保主体
*/
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
private String hasProvidentFundPaid;
/**
* 转正时间
*/
private LocalDate regularizationDate;
private String remark;
}
package com.anplus.hr.domain.params;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.time.LocalDate;
/**
* 续签合同申请参数
* @author 刘斌
* @date 2025/11/18 11:36
*
* !!!需要自动填写的字段!!!
* 劳动合同期限:开始时间-结束时间
* 合同到期提醒:结束时间减一个月
*/
@Data
public class EmployeeRenewalContractApplyParam {
private Long id;
/**
* 合同形式
*/
@NotBlank(message = "合同形式不能为空")
private String contractForm;
/**
* 劳动合同开始时间
*/
@NotNull(message = "劳动合同开始时间不能为空")
private LocalDate contractStartDate;
/**
* 劳动合同截止时间
*/
@NotNull(message = "劳动合同截止时间不能为空")
private LocalDate contractEndDate;
/**
* 劳动合同签订情况
*/
private String contractSigningStatus;
private String remark;
}
package com.anplus.hr.domain.params; package com.anplus.hr.domain.params;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup;
import java.time.LocalDate; import java.time.LocalDate;
/** /**
* 离职申请参数
* @author 刘斌 * @author 刘斌
* @date 2025/10/31 15:48 * @date 2025/10/31 15:48
*/ */
...@@ -14,12 +18,24 @@ public class EmployeeResignApplyParam { ...@@ -14,12 +18,24 @@ public class EmployeeResignApplyParam {
private Long id; private Long id;
/**
* 离职类型
*/
@NotBlank(message = "离职类型不能为空")
private String resignationType;
/** /**
* 离职时间 * 离职时间
*/ */
@NotNull(message = "离职时间不能为空") @NotNull(message = "离职时间不能为空")
private LocalDate resignDate; private LocalDate resignDate;
/**
* 最后结薪日
*/
// @NotNull(message = "最后结薪日不能为空")
private LocalDate finalPayDate;
/** /**
* 离职原因 * 离职原因
*/ */
......
...@@ -13,12 +13,33 @@ public class EmployeeTransferApplyParam { ...@@ -13,12 +13,33 @@ public class EmployeeTransferApplyParam {
private Long id; private Long id;
/**
* 板块
*/
@NotBlank(message = "板块不能为空")
private String plate;
/**
* 一级部门
*/
@NotBlank(message = "一级部门不能为空") @NotBlank(message = "一级部门不能为空")
private String firstLevelDepartment; private String firstLevelDepartment;
/**
* 二级部门
*/
@NotBlank(message = "二级部门不能为空") @NotBlank(message = "二级部门不能为空")
private String secondLevelDepartment; private String secondLevelDepartment;
/**
* 三级部门
*/
@NotBlank(message = "三级部门不能为空")
private String thirdLevelDepartment;
/**
* 部门id
*/
@NotNull(message = "部门id不能为空") @NotNull(message = "部门id不能为空")
private Long deptId; private Long deptId;
......
package com.anplus.hr.domain.vo;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.ExcelIgnore;
import com.anplus.hr.domain.EmployeeChangeLog;
import top.binfast.common.excel.annotion.ExcelDictFormat;
import top.binfast.common.excel.converters.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 员工异动记录视图对象 employee_change_log
*
* @author LiuBin
* @date 2025-11-17
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = EmployeeChangeLog.class)
public class EmployeeChangeLogVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 异动类型
*/
@ExcelProperty(value = "异动类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "HR_CHANGE_LOG_TYPE")
private String type;
/**
* 板块
*/
@ExcelProperty(value = "板块")
private String plate;
/**
* 部门ID
*/
@ExcelProperty(value = "部门ID")
private Long deptId;
/**
* 员工ID
*/
@ExcelProperty(value = "员工ID")
private Long employeeId;
/**
* 异动时间
*/
@ExcelProperty(value = "异动时间")
private LocalDateTime changeDate;
/**
* 离职类型
*/
@ExcelProperty(value = "离职类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "HR_RESIGNATION_TYPE")
private String resignType;
/**
* 离职工龄类型
*/
@ExcelProperty(value = "离职工龄类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "HR_RESIGN_YEARS_OF_SERVICE_TYPE")
private String resignYearsOfServiceType;
}
package com.anplus.hr.domain.vo; package com.anplus.hr.domain.vo;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty; import cn.idev.excel.annotation.ExcelProperty;
import com.anplus.hr.config.SeniorityUtils;
import com.anplus.hr.constant.HrConstant; import com.anplus.hr.constant.HrConstant;
import com.anplus.hr.domain.EmployeeInfo; import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeInfoParam; import com.anplus.hr.domain.params.EmployeeInfoParam;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers; import io.github.linpeilie.annotations.AutoMappers;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup;
import top.binfast.common.excel.annotion.ExcelDictFormat; import top.binfast.common.excel.annotion.ExcelDictFormat;
import top.binfast.common.excel.bean.ExcelBaseEntity; import top.binfast.common.excel.bean.ExcelBaseEntity;
import top.binfast.common.excel.converters.ExcelDictConvert; import top.binfast.common.excel.converters.ExcelDictConvert;
...@@ -33,21 +36,14 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -33,21 +36,14 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
/** /**
* 板块 * 板块
*/ */
@NotBlank(message = "板块不能为空") @NotBlank(message = "板块不能为空", groups = { AddGroup.class })
@ExcelProperty(value = "板块") @ExcelProperty(value = "板块")
private String plate; private String plate;
/**
* 项目
*/
@NotBlank(message = "项目不能为空")
@ExcelProperty(value = "项目")
private String project;
/** /**
* 一级部门 * 一级部门
*/ */
@NotBlank(message = "一级部门不能为空") @NotBlank(message = "一级部门不能为空", groups = { AddGroup.class })
@ExcelProperty(value = "一级部门") @ExcelProperty(value = "一级部门")
private String firstLevelDepartment; private String firstLevelDepartment;
...@@ -57,66 +53,78 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -57,66 +53,78 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelProperty(value = "二级部门") @ExcelProperty(value = "二级部门")
private String secondLevelDepartment; private String secondLevelDepartment;
/**
* 三级部门
*/
@ExcelProperty(value = "三级部门")
private String thirdLevelDepartment;
// /**
// * 部门ID
// */
// @ExcelProperty(value = "部门ID")
// private Long deptId;
/** /**
* 工号 * 工号
*/ */
@NotBlank(message = "工号不能为空")
@ExcelProperty(value = "工号") @ExcelProperty(value = "工号")
private String employeeId; private String employeeNo;
/** /**
* 职级 * 职级
*/ */
@ExcelProperty(value = "职级") @ExcelProperty(value = "职级")
private String jobLevel; // @ExcelDictFormat(dictType = "HR_JOB_LEVEL")
private Integer jobLevel;
/** /**
* 岗位 * 岗位类型
*/ */
@NotBlank(message = "岗位不能为空") @ExcelProperty(value = "岗位类型", converter = ExcelDictConvert.class)
@ExcelProperty(value = "岗位") @ExcelDictFormat(dictType = HrConstant.HR_POSITION_TYPE)
private String position; private String positionType;
/** /**
* 职务 * 序列
*/ */
@ExcelProperty(value = "职务") @ExcelProperty(value = "序列", converter = ExcelDictConvert.class)
private String post; @ExcelDictFormat(dictType = HrConstant.HR_SEQUENCE)
private String sequence;
/**
* 主岗位
*/
@ExcelProperty(value = "主岗位")
private String position;
/** /**
* 姓名 * 姓名
*/ */
@NotBlank(message = "姓名不能为空") @NotBlank(message = "姓名不能为空", groups = { AddGroup.class })
@ExcelProperty(value = "姓名") @ExcelProperty(value = "姓名")
private String name; private String name;
/** /**
* 性别 * 性别
*/ */
@NotBlank(message = "性别不能为空")
@ExcelProperty(value = "性别", converter = ExcelDictConvert.class) @ExcelProperty(value = "性别", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_USER_SEX) @ExcelDictFormat(dictType = HrConstant.HR_USER_SEX)
private String gender; private String gender;
/**
* 简历图片
*/
@ExcelProperty(value = "简历图片")
private String resumeImage;
// /**
// * 性别
// */
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_USER_SEX,refs = {"genderName"})
// private String gender;
/** /**
* 身份证号码 * 身份证号码
*/ */
@NotBlank(message = "身份证号码不能为空") @NotBlank(message = "身份证号码不能为空", groups = { AddGroup.class, EditGroup.class })
@ExcelProperty(value = "身份证号码") @ExcelProperty(value = "身份证号码")
private String idCardNumber; private String idCardNumber;
/**
* 照片
*/
@ExcelProperty(value = "照片")
private String photo;
/** /**
* 出生日期 * 出生日期
*/ */
...@@ -126,7 +134,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -126,7 +134,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
/** /**
* 年龄 * 年龄
*/ */
@NotNull(message = "年龄不能为空")
@ExcelProperty(value = "年龄") @ExcelProperty(value = "年龄")
private Integer age; private Integer age;
...@@ -137,12 +144,35 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -137,12 +144,35 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelDictFormat(dictType = HrConstant.HR_AGE_GROUP) @ExcelDictFormat(dictType = HrConstant.HR_AGE_GROUP)
private String ageGroup; private String ageGroup;
// /** /**
// * 年龄段 * 兼职板块
// */ */
//// @ExcelProperty(value = "年龄段") @ExcelProperty(value = "兼职板块")
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_AGE_GROUP,refs = {"ageGroupName"}) private String partTimePlate;
// private String ageGroup;
/**
* 兼职一级部门
*/
@ExcelProperty(value = "兼职一级部门")
private String partTimeFirstDept;
/**
* 兼职二级部门
*/
@ExcelProperty(value = "兼职二级部门")
private String partTimeSecondDept;
/**
* 兼职三级部门
*/
@ExcelProperty(value = "兼职三级部门")
private String partTimeThirdDept;
/**
* 兼职岗位
*/
@ExcelProperty(value = "兼职岗位")
private String partTimePosition;
/** /**
* 籍贯 * 籍贯
...@@ -163,31 +193,16 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -163,31 +193,16 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelDictFormat(dictType = HrConstant.HR_MARITAL_STATUS) @ExcelDictFormat(dictType = HrConstant.HR_MARITAL_STATUS)
private String maritalStatus; private String maritalStatus;
// /**
// * 婚姻状况
// */
//// @ExcelProperty(value = "婚姻状况")
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_MARITAL_STATUS,refs = {"maritalStatusName"})
// private String maritalStatus;
/** /**
* 政治面貌 * 政治面貌
*/ */
@ExcelProperty(value = "政治面貌", converter = ExcelDictConvert.class) @ExcelProperty(value = "政治面貌", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_POLITICAL_STATUS) @ExcelDictFormat(dictType = HrConstant.HR_POLITICAL_STATUS)
private String politicalStatus; private String politicalStatus;
//
// /**
// * 政治面貌
// */
// @ExcelProperty(value = "政治面貌")
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_POLITICAL_STATUS,refs = {"politicalStatusName"})
// private String politicalStatus;
/** /**
* 手机号码 * 手机号码
*/ */
@NotBlank(message = "手机号码不能为空")
@ExcelProperty(value = "手机号码") @ExcelProperty(value = "手机号码")
private String phoneNumber; private String phoneNumber;
...@@ -233,6 +248,12 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -233,6 +248,12 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelProperty(value = "工龄") @ExcelProperty(value = "工龄")
private String yearsOfService; private String yearsOfService;
/**
* 工龄总月数
*/
@ExcelIgnore
private Integer yearsOfServiceMonths;
/** /**
* 工龄段 * 工龄段
*/ */
...@@ -240,42 +261,72 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -240,42 +261,72 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelDictFormat(dictType = HrConstant.HR_YEARS_SERVICE_SEGMENT) @ExcelDictFormat(dictType = HrConstant.HR_YEARS_SERVICE_SEGMENT)
private String yearsOfServiceSegment; private String yearsOfServiceSegment;
// /** /**
// * 工龄段 * 全日制学历
// */ */
// @ExcelProperty(value = "工龄段") @ExcelProperty(value = "全日制学历")
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_YEARS_SERVICE_SEGMENT,refs = {"yearsOfServiceSegmentName"}) private String fulltimeEducation;
// private String yearsOfServiceSegment;
/** /**
* 学历 * 全日制毕业院校
*/ */
@ExcelProperty(value = "学历") @ExcelProperty(value = "全日制毕业院校")
private String education; private String fulltimeSchool;
/** /**
* 学位 * 全日制专业
*/ */
@ExcelProperty(value = "学位") @ExcelProperty(value = "全日制专业")
private String degree; private String fulltimeMajor;
/** /**
* 毕业时间 * 全日制毕业日期
*/ */
@ExcelProperty(value = "毕业时间") @ExcelProperty(value = "全日制毕业日期")
private LocalDate graduationDate; private LocalDate fulltimeGraduationDate;
/** /**
* 专业 * 全日制学位
*/ */
@ExcelProperty(value = "专业") @ExcelProperty(value = "全日制学位")
private String major; private String fulltimeDegree;
/** /**
* 毕业院校 * 非全日制学历
*/ */
@ExcelProperty(value = "毕业院校") @ExcelProperty(value = "非全日制学历")
private String graduateSchool; private String nonFulltimeEducation;
/**
* 非全日制毕业院校
*/
@ExcelProperty(value = "非全日制毕业院校")
private String nonFulltimeSchool;
/**
* 非全日制专业
*/
@ExcelProperty(value = "非全日制专业")
private String nonFulltimeMajor;
/**
* 非全日制毕业日期
*/
@ExcelProperty(value = "非全日制毕业日期")
private LocalDate nonFulltimeGraduationDate;
/**
* 非全日制学位
*/
@ExcelProperty(value = "非全日制学位")
private String nonFulltimeDegree;
/**
* 学历分类
*/
@ExcelProperty(value = "学历分类", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_EDUCATION_CATEGORY)
private String educationCategory;
/** /**
* 员工类型 * 员工类型
...@@ -284,13 +335,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -284,13 +335,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelDictFormat(dictType = HrConstant.HR_EMPLOYEE_TYPE) @ExcelDictFormat(dictType = HrConstant.HR_EMPLOYEE_TYPE)
private String employeeType; private String employeeType;
// /**
// * 员工类型
// */
//// @ExcelProperty(value = "员工类型")
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_EMPLOYEE_TYPE,refs = {"employeeTypeName"})
// private String employeeType;
/** /**
* 职称情况 * 职称情况
*/ */
...@@ -298,25 +342,36 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -298,25 +342,36 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
private String professionalTitle; private String professionalTitle;
/** /**
* 简历 * 证书情况
*/
@ExcelProperty(value = "证书情况")
private String certificateStatus;
/**
* 外部个人履历
*/
@ExcelProperty(value = "外部个人履历")
private String externalResume;
/**
* 内部个人履历
*/ */
@ExcelProperty(value = "历") @ExcelProperty(value = "内部个人履历")
private String resume; private String internalResume;
/** /**
* 用工形式 * 用工形式
*/ */
// @ExcelProperty(value = "用工形式")
@ExcelProperty(value = "用工形式", converter = ExcelDictConvert.class) @ExcelProperty(value = "用工形式", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_EMPLOYMENT_FORM) @ExcelDictFormat(dictType = HrConstant.HR_EMPLOYMENT_FORM)
private String employmentForm; private String employmentForm;
// /** /**
// * 用工形式 * 合同形式
// */ */
//// @ExcelProperty(value = "用工形式") @ExcelProperty(value = "合同形式", converter = ExcelDictConvert.class)
// @UnTrans(type= UnTransType.DICTIONARY, dict= HrConstant.HR_EMPLOYMENT_FORM,refs = {"employmentFormName"}) @ExcelDictFormat(dictType = HrConstant.HR_CONTRACT_FORM)
// private String employmentForm; private String contractForm;
/** /**
* 劳动合同期限 * 劳动合同期限
...@@ -338,8 +393,9 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -338,8 +393,9 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
/** /**
* 合同到期提醒 * 合同到期提醒
* 自动计算,不用导入了
*/ */
@ExcelProperty(value = "合同到期提醒") @ExcelIgnore
private LocalDate contractExpirationReminder; private LocalDate contractExpirationReminder;
/** /**
...@@ -354,6 +410,39 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -354,6 +410,39 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
@ExcelProperty(value = "合同主体") @ExcelProperty(value = "合同主体")
private String contractEntity; private String contractEntity;
/**
* 社保主体
*/
@ExcelProperty(value = "社保主体")
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
@ExcelProperty(value = "是否缴纳社保", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
@ExcelProperty(value = "公积金主体")
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
@ExcelProperty(value = "是否缴纳公积金", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
private String hasProvidentFundPaid;
/**
* 试用期(月数)
*/
@ExcelProperty(value = "试用期")
// @ExcelDictFormat(readConverterExp = "月=数")
private Integer probationPeriod;
/** /**
* 转正时间 * 转正时间
*/ */
...@@ -361,16 +450,16 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -361,16 +450,16 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
private LocalDate regularizationDate; private LocalDate regularizationDate;
/** /**
* 异动情况 * 奖励情况
*/ */
@ExcelProperty(value = "异动情况") @ExcelProperty(value = "奖励情况")
private String transferStatus; private String rewardStatus;
/** /**
* 奖惩情况 * 处罚情况
*/ */
@ExcelProperty(value = "奖惩情况") @ExcelProperty(value = "处罚情况")
private String rewardPunishmentStatus; private String punishmentStatus;
/** /**
* 备注 * 备注
...@@ -379,27 +468,65 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -379,27 +468,65 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
private String remarks; private String remarks;
/** /**
* 离职时间 * 办公电话
*/ */
@ExcelProperty(value = "离职时间") @ExcelProperty(value = "办公电话")
private LocalDate resignationDate; private String officePhone;
/** /**
* 离职原因 * 短线
*/ */
@ExcelProperty(value = "离职原因") @ExcelProperty(value = "短线")
private String resignationReason; private String shortLine;
/**
* 银行卡号
*/
@ExcelProperty(value = "银行卡号")
private String bankCardNumber;
/**
* 开户行
*/
@ExcelProperty(value = "开户行")
private String bankName;
/**
* 公司内是否有亲属关系
*/
@ExcelProperty(value = "公司内是否有亲属关系", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
private String hasRelativeInCompany;
/**
* 亲属姓名
*/
@ExcelProperty(value = "亲属姓名")
private String relativeName;
/**
* 介绍人
*/
@ExcelProperty(value = "介绍人")
private String introducer;
/**
* 工资发放地
*/
@ExcelProperty(value = "工资发放地")
private String salaryLocation;
/**
* 绩效比例
*/
@ExcelProperty(value = "绩效比例")
private String performanceRatio;
public void setPlate(String plate) { public void setPlate(String plate) {
this.plate = plate == null ? null : plate.trim(); this.plate = plate == null ? null : plate.trim();
} }
public void setProject(String project) {
this.project = project == null ? null : project.trim();
}
public void setFirstLevelDepartment(String firstLevelDepartment) { public void setFirstLevelDepartment(String firstLevelDepartment) {
this.firstLevelDepartment = firstLevelDepartment == null ? null : firstLevelDepartment.trim(); this.firstLevelDepartment = firstLevelDepartment == null ? null : firstLevelDepartment.trim();
} }
...@@ -408,20 +535,24 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -408,20 +535,24 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.secondLevelDepartment = secondLevelDepartment == null ? null : secondLevelDepartment.trim(); this.secondLevelDepartment = secondLevelDepartment == null ? null : secondLevelDepartment.trim();
} }
public void setEmployeeId(String employeeId) { public void setThirdLevelDepartment(String thirdLevelDepartment) {
this.employeeId = employeeId == null ? null : employeeId.trim(); this.thirdLevelDepartment = thirdLevelDepartment == null ? null : thirdLevelDepartment.trim();
} }
public void setJobLevel(String jobLevel) { public void setEmployeeNo(String employeeNo) {
this.jobLevel = jobLevel == null ? null : jobLevel.trim(); this.employeeNo = employeeNo == null ? null : employeeNo.trim();
} }
public void setPosition(String position) { public void setPositionType(String positionType) {
this.position = position == null ? null : position.trim(); this.positionType = positionType == null ? null : positionType.trim();
} }
public void setPost(String post) { public void setSequence(String sequence) {
this.post = post == null ? null : post.trim(); this.sequence = sequence == null ? null : sequence.trim();
}
public void setPosition(String position) {
this.position = position == null ? null : position.trim();
} }
public void setName(String name) { public void setName(String name) {
...@@ -432,26 +563,38 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -432,26 +563,38 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.gender = gender == null ? null : gender.trim(); this.gender = gender == null ? null : gender.trim();
} }
public void setResumeImage(String resumeImage) {
this.resumeImage = resumeImage == null ? null : resumeImage.trim();
}
public void setIdCardNumber(String idCardNumber) { public void setIdCardNumber(String idCardNumber) {
this.idCardNumber = idCardNumber == null ? null : idCardNumber.trim(); this.idCardNumber = idCardNumber == null ? null : idCardNumber.trim();
} }
public void setBirthDate(LocalDate birthDate) { public void setPhoto(String photo) {
this.birthDate = birthDate; this.photo = photo == null ? null : photo.trim();
}
public void setAge(Integer age) {
this.age = age;
} }
public void setAgeGroup(String ageGroup) { public void setAgeGroup(String ageGroup) {
this.ageGroup = ageGroup == null ? null : ageGroup.trim(); this.ageGroup = ageGroup == null ? null : ageGroup.trim();
} }
public void setPartTimePlate(String partTimePlate) {
this.partTimePlate = partTimePlate == null ? null : partTimePlate.trim();
}
public void setPartTimeFirstDept(String partTimeFirstDept) {
this.partTimeFirstDept = partTimeFirstDept == null ? null : partTimeFirstDept.trim();
}
public void setPartTimeSecondDept(String partTimeSecondDept) {
this.partTimeSecondDept = partTimeSecondDept == null ? null : partTimeSecondDept.trim();
}
public void setPartTimeThirdDept(String partTimeThirdDept) {
this.partTimeThirdDept = partTimeThirdDept == null ? null : partTimeThirdDept.trim();
}
public void setPartTimePosition(String partTimePosition) {
this.partTimePosition = partTimePosition == null ? null : partTimePosition.trim();
}
public void setNativePlace(String nativePlace) { public void setNativePlace(String nativePlace) {
this.nativePlace = nativePlace == null ? null : nativePlace.trim(); this.nativePlace = nativePlace == null ? null : nativePlace.trim();
} }
...@@ -488,14 +631,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -488,14 +631,6 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.householdRegistrationAddress = householdRegistrationAddress == null ? null : householdRegistrationAddress.trim(); this.householdRegistrationAddress = householdRegistrationAddress == null ? null : householdRegistrationAddress.trim();
} }
public void setWorkStartDate(LocalDate workStartDate) {
this.workStartDate = workStartDate;
}
public void setEntryDate(LocalDate entryDate) {
this.entryDate = entryDate;
}
public void setYearsOfService(String yearsOfService) { public void setYearsOfService(String yearsOfService) {
this.yearsOfService = yearsOfService == null ? null : yearsOfService.trim(); this.yearsOfService = yearsOfService == null ? null : yearsOfService.trim();
} }
...@@ -504,24 +639,40 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -504,24 +639,40 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.yearsOfServiceSegment = yearsOfServiceSegment == null ? null : yearsOfServiceSegment.trim(); this.yearsOfServiceSegment = yearsOfServiceSegment == null ? null : yearsOfServiceSegment.trim();
} }
public void setEducation(String education) { public void setFulltimeEducation(String fulltimeEducation) {
this.education = education == null ? null : education.trim(); this.fulltimeEducation = fulltimeEducation == null ? null : fulltimeEducation.trim();
} }
public void setDegree(String degree) { public void setFulltimeSchool(String fulltimeSchool) {
this.degree = degree == null ? null : degree.trim(); this.fulltimeSchool = fulltimeSchool == null ? null : fulltimeSchool.trim();
} }
public void setGraduationDate(LocalDate graduationDate) { public void setFulltimeMajor(String fulltimeMajor) {
this.graduationDate = graduationDate; this.fulltimeMajor = fulltimeMajor == null ? null : fulltimeMajor.trim();
} }
public void setMajor(String major) { public void setFulltimeDegree(String fulltimeDegree) {
this.major = major == null ? null : major.trim(); this.fulltimeDegree = fulltimeDegree == null ? null : fulltimeDegree.trim();
} }
public void setGraduateSchool(String graduateSchool) { public void setNonFulltimeEducation(String nonFulltimeEducation) {
this.graduateSchool = graduateSchool == null ? null : graduateSchool.trim(); this.nonFulltimeEducation = nonFulltimeEducation == null ? null : nonFulltimeEducation.trim();
}
public void setNonFulltimeSchool(String nonFulltimeSchool) {
this.nonFulltimeSchool = nonFulltimeSchool == null ? null : nonFulltimeSchool.trim();
}
public void setNonFulltimeMajor(String nonFulltimeMajor) {
this.nonFulltimeMajor = nonFulltimeMajor == null ? null : nonFulltimeMajor.trim();
}
public void setNonFulltimeDegree(String nonFulltimeDegree) {
this.nonFulltimeDegree = nonFulltimeDegree == null ? null : nonFulltimeDegree.trim();
}
public void setEducationCategory(String educationCategory) {
this.educationCategory = educationCategory == null ? null : educationCategory.trim();
} }
public void setEmployeeType(String employeeType) { public void setEmployeeType(String employeeType) {
...@@ -532,28 +683,28 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -532,28 +683,28 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.professionalTitle = professionalTitle == null ? null : professionalTitle.trim(); this.professionalTitle = professionalTitle == null ? null : professionalTitle.trim();
} }
public void setResume(String resume) { public void setCertificateStatus(String certificateStatus) {
this.resume = resume == null ? null : resume.trim(); this.certificateStatus = certificateStatus == null ? null : certificateStatus.trim();
} }
public void setEmploymentForm(String employmentForm) { public void setExternalResume(String externalResume) {
this.employmentForm = employmentForm == null ? null : employmentForm.trim(); this.externalResume = externalResume == null ? null : externalResume.trim();
} }
public void setContractTerm(String contractTerm) { public void setInternalResume(String internalResume) {
this.contractTerm = contractTerm == null ? null : contractTerm.trim(); this.internalResume = internalResume == null ? null : internalResume.trim();
} }
public void setContractStartDate(LocalDate contractStartDate) { public void setEmploymentForm(String employmentForm) {
this.contractStartDate = contractStartDate; this.employmentForm = employmentForm == null ? null : employmentForm.trim();
} }
public void setContractEndDate(LocalDate contractEndDate) { public void setContractForm(String contractForm) {
this.contractEndDate = contractEndDate; this.contractForm = contractForm == null ? null : contractForm.trim();
} }
public void setContractExpirationReminder(LocalDate contractExpirationReminder) { public void setContractTerm(String contractTerm) {
this.contractExpirationReminder = contractExpirationReminder; this.contractTerm = contractTerm == null ? null : contractTerm.trim();
} }
public void setContractSigningStatus(String contractSigningStatus) { public void setContractSigningStatus(String contractSigningStatus) {
...@@ -564,27 +715,127 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl ...@@ -564,27 +715,127 @@ public class EmployeeInfoImportVo extends ExcelBaseEntity implements Serializabl
this.contractEntity = contractEntity == null ? null : contractEntity.trim(); this.contractEntity = contractEntity == null ? null : contractEntity.trim();
} }
public void setRegularizationDate(LocalDate regularizationDate) { public void setSocialSecurityEntity(String socialSecurityEntity) {
this.regularizationDate = regularizationDate; this.socialSecurityEntity = socialSecurityEntity == null ? null : socialSecurityEntity.trim();
}
public void setHasSocialSecurityPaid(String hasSocialSecurityPaid) {
this.hasSocialSecurityPaid = hasSocialSecurityPaid == null ? null : hasSocialSecurityPaid.trim();
}
public void setProvidentFundEntity(String providentFundEntity) {
this.providentFundEntity = providentFundEntity == null ? null : providentFundEntity.trim();
}
public void setHasProvidentFundPaid(String hasProvidentFundPaid) {
this.hasProvidentFundPaid = hasProvidentFundPaid == null ? null : hasProvidentFundPaid.trim();
} }
public void setTransferStatus(String transferStatus) { public void setRewardStatus(String rewardStatus) {
this.transferStatus = transferStatus == null ? null : transferStatus.trim(); this.rewardStatus = rewardStatus == null ? null : rewardStatus.trim();
} }
public void setRewardPunishmentStatus(String rewardPunishmentStatus) { public void setPunishmentStatus(String punishmentStatus) {
this.rewardPunishmentStatus = rewardPunishmentStatus == null ? null : rewardPunishmentStatus.trim(); this.punishmentStatus = punishmentStatus == null ? null : punishmentStatus.trim();
} }
public void setRemarks(String remarks) { public void setRemarks(String remarks) {
this.remarks = remarks == null ? null : remarks.trim(); this.remarks = remarks == null ? null : remarks.trim();
} }
public void setResignationDate(LocalDate resignationDate) { public void setOfficePhone(String officePhone) {
this.resignationDate = resignationDate; this.officePhone = officePhone == null ? null : officePhone.trim();
}
public void setShortLine(String shortLine) {
this.shortLine = shortLine == null ? null : shortLine.trim();
}
public void setBankCardNumber(String bankCardNumber) {
this.bankCardNumber = bankCardNumber == null ? null : bankCardNumber.trim();
}
public void setBankName(String bankName) {
this.bankName = bankName == null ? null : bankName.trim();
}
public void setHasRelativeInCompany(String hasRelativeInCompany) {
this.hasRelativeInCompany = hasRelativeInCompany == null ? null : hasRelativeInCompany.trim();
}
public void setRelativeName(String relativeName) {
this.relativeName = relativeName == null ? null : relativeName.trim();
}
public void setIntroducer(String introducer) {
this.introducer = introducer == null ? null : introducer.trim();
}
public void setSalaryLocation(String salaryLocation) {
this.salaryLocation = salaryLocation == null ? null : salaryLocation.trim();
}
public void setPerformanceRatio(String performanceRatio) {
this.performanceRatio = performanceRatio == null ? null : performanceRatio.trim();
}
//
// public void setDeptId(Long deptId) {
// this.deptId = deptId;
// }
public void setJobLevel(Integer jobLevel) {
this.jobLevel = jobLevel;
}
public void setBirthDate(LocalDate birthDate) {
this.birthDate = birthDate;
}
public void setAge(Integer age) {
this.age = age;
}
public void setWorkStartDate(LocalDate workStartDate) {
this.workStartDate = workStartDate;
}
public void setEntryDate(LocalDate entryDate) {
this.entryDate = entryDate;
}
public void setFulltimeGraduationDate(LocalDate fulltimeGraduationDate) {
this.fulltimeGraduationDate = fulltimeGraduationDate;
}
public void setNonFulltimeGraduationDate(LocalDate nonFulltimeGraduationDate) {
this.nonFulltimeGraduationDate = nonFulltimeGraduationDate;
}
public void setProbationPeriod(Integer probationPeriod) {
this.probationPeriod = probationPeriod;
}
public void setRegularizationDate(LocalDate regularizationDate) {
this.regularizationDate = regularizationDate;
}
public void setContractStartDate(LocalDate contractStartDate) {
this.contractStartDate = contractStartDate;
}
public void setContractEndDate(LocalDate contractEndDate) {
this.contractEndDate = contractEndDate;
}
public void setContractExpirationReminder(LocalDate contractExpirationReminder) {
this.contractExpirationReminder = contractExpirationReminder;
}
public Integer getYearsOfServiceMonths() {
return SeniorityUtils.parseSeniorityToMonths(this.yearsOfService);
} }
public void setResignationReason(String resignationReason) { public void setYearsOfServiceMonths(Integer yearsOfServiceMonths) {
this.resignationReason = resignationReason == null ? null : resignationReason.trim(); this.yearsOfServiceMonths = yearsOfServiceMonths;
} }
} }
package com.anplus.hr.domain.vo;
import cn.idev.excel.annotation.ExcelProperty;
import com.anplus.hr.constant.HrConstant;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeInfoParam;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.Getter;
import lombok.Setter;
import top.binfast.common.excel.annotion.ExcelDictFormat;
import top.binfast.common.excel.converters.ExcelDictConvert;
import java.io.Serial;
import java.time.LocalDate;
/**
* @author 刘斌
* @date 2025/11/13 20:47
*/
@Getter
@AutoMappers({
@AutoMapper(target = EmployeeInfo.class, reverseConvertGenerate = false),
@AutoMapper(target = EmployeeInfoParam.class, reverseConvertGenerate = false)
})
public class EmployeeInfoResignImportVo extends EmployeeInfoImportVo {
@Serial
private static final long serialVersionUID = 1L;
/**
* 离职类型
*/
@ExcelProperty(value = "离职类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_RESIGNATION_TYPE)
private String resignationType;
/**
* 离职时间
*/
@Setter
@ExcelProperty(value = "离职时间")
private LocalDate resignationDate;
/**
* 离职原因
*/
@ExcelProperty(value = "离职原因")
private String resignationReason;
/**
* 最后结薪日
*/
@Setter
@ExcelProperty(value = "最后结薪日")
private LocalDate finalPayDate;
public void setResignationType(String resignationType) {
this.resignationType = resignationType == null ? null : resignationType.trim();
}
public void setResignationReason(String resignationReason) {
this.resignationReason = resignationReason == null ? null : resignationReason.trim();
}
}
package com.anplus.hr.domain.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.anplus.hr.constant.HrConstant;
import com.anplus.hr.domain.EmployeeInfo;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.core.trans.anno.Trans;
import org.dromara.core.trans.constant.TransType;
import top.binfast.common.excel.annotion.ExcelDictFormat;
import top.binfast.common.excel.converters.ExcelDictConvert;
import java.time.LocalDate;
/**
* @author 刘斌
* @date 2025/11/13 20:44
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = EmployeeInfo.class)
public class EmployeeInfoResignVo extends EmployeeInfoVo {
/**
* 离职类型
*/
@ExcelProperty(value = "离职类型", converter = ExcelDictConvert.class, index = 77)
@ExcelDictFormat(dictType = HrConstant.HR_RESIGNATION_TYPE)
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_RESIGNATION_TYPE)
private String resignationType;
/**
* 离职时间
*/
@ExcelProperty(value = "离职时间", index = 78)
private LocalDate resignationDate;
/**
* 离职原因
*/
@ExcelProperty(value = "离职原因", index = 79)
private String resignationReason;
/**
* 最后结薪日
*/
@ExcelProperty(value = "最后结薪日", index = 80)
private LocalDate finalPayDate;
/**
* 离职申请状态
*/
// @ExcelProperty(value = "离职申请状态")
private Integer resignationApplyStatus;
}
package com.anplus.hr.domain.vo; package com.anplus.hr.domain.vo;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty; import cn.idev.excel.annotation.ExcelProperty;
import com.anplus.hr.constant.HrConstant; import com.anplus.hr.constant.HrConstant;
...@@ -23,7 +24,7 @@ import java.time.LocalDate; ...@@ -23,7 +24,7 @@ import java.time.LocalDate;
* 员工信息视图对象 employee_info * 员工信息视图对象 employee_info
* *
* @author LiuBin * @author LiuBin
* @date 2025-10-28 * @date 2025-11-13
*/ */
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
...@@ -44,12 +45,6 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -44,12 +45,6 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@ExcelProperty(value = "板块") @ExcelProperty(value = "板块")
private String plate; private String plate;
/**
* 项目
*/
@ExcelProperty(value = "项目")
private String project;
/** /**
* 一级部门 * 一级部门
*/ */
...@@ -62,29 +57,53 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -62,29 +57,53 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@ExcelProperty(value = "二级部门") @ExcelProperty(value = "二级部门")
private String secondLevelDepartment; private String secondLevelDepartment;
/**
* 三级部门
*/
@ExcelProperty(value = "三级部门")
private String thirdLevelDepartment;
/**
* 部门ID
*/
@ExcelProperty(value = "部门ID")
private Long deptId;
/** /**
* 工号 * 工号
*/ */
@ExcelProperty(value = "工号") @ExcelProperty(value = "工号")
private String employeeId; private String employeeNo;
/** /**
* 职级 * 职级
*/ */
@ExcelProperty(value = "职级") @ExcelProperty(value = "职级")
private String jobLevel; // @ExcelDictFormat(dictType = "HR_JOB_LEVEL")
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_JOB_LEVEL)
private Integer jobLevel;
/** /**
* 岗位 * 岗位类型
*/ */
@ExcelProperty(value = "岗位") @ExcelProperty(value = "岗位类型", converter = ExcelDictConvert.class)
private String position; @ExcelDictFormat(dictType = HrConstant.HR_POSITION_TYPE)
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_POSITION_TYPE)
private String positionType;
/** /**
* 职务 * 序列
*/ */
@ExcelProperty(value = "职务") @ExcelProperty(value = "序列", converter = ExcelDictConvert.class)
private String post; @ExcelDictFormat(dictType = HrConstant.HR_SEQUENCE)
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_SEQUENCE)
private String sequence;
/**
* 主岗位
*/
@ExcelProperty(value = "主岗位")
private String position;
/** /**
* 姓名 * 姓名
...@@ -100,18 +119,24 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -100,18 +119,24 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_USER_SEX) @Trans(type = TransType.DICTIONARY, key = HrConstant.HR_USER_SEX)
private String gender; private String gender;
/**
* 简历图片
*/
@ExcelProperty(value = "简历图片", converter = ExcelUrlImageConverter.class)
private String resumeImage;
/** /**
* 身份证号码 * 身份证号码
*/ */
@ExcelProperty(value = "身份证号码") @ExcelProperty(value = "身份证号码")
private String idCardNumber; private String idCardNumber;
/**
* 头像OSS_ID
*/
@ExcelIgnore
private Long ossId;
/**
* 照片
*/
@ExcelProperty(value = "照片", converter = ExcelUrlImageConverter.class)
private String photo;
/** /**
* 出生日期 * 出生日期
*/ */
...@@ -132,6 +157,36 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -132,6 +157,36 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_AGE_GROUP) @Trans(type = TransType.DICTIONARY, key = HrConstant.HR_AGE_GROUP)
private String ageGroup; private String ageGroup;
/**
* 兼职板块
*/
@ExcelProperty(value = "兼职板块")
private String partTimePlate;
/**
* 兼职一级部门
*/
@ExcelProperty(value = "兼职一级部门")
private String partTimeFirstDept;
/**
* 兼职二级部门
*/
@ExcelProperty(value = "兼职二级部门")
private String partTimeSecondDept;
/**
* 兼职三级部门
*/
@ExcelProperty(value = "兼职三级部门")
private String partTimeThirdDept;
/**
* 兼职岗位
*/
@ExcelProperty(value = "兼职岗位")
private String partTimePosition;
/** /**
* 籍贯 * 籍贯
*/ */
...@@ -217,34 +272,72 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -217,34 +272,72 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
private String yearsOfServiceSegment; private String yearsOfServiceSegment;
/** /**
* 学历 * 全日制学历
*/
@ExcelProperty(value = "全日制学历")
private String fulltimeEducation;
/**
* 全日制毕业院校
*/
@ExcelProperty(value = "全日制毕业院校")
private String fulltimeSchool;
/**
* 全日制专业
*/
@ExcelProperty(value = "全日制专业")
private String fulltimeMajor;
/**
* 全日制毕业日期
*/
@ExcelProperty(value = "全日制毕业日期")
private LocalDate fulltimeGraduationDate;
/**
* 全日制学位
*/
@ExcelProperty(value = "全日制学位")
private String fulltimeDegree;
/**
* 非全日制学历
*/ */
@ExcelProperty(value = "学历") @ExcelProperty(value = "非全日制学历")
private String education; private String nonFulltimeEducation;
/** /**
* 学位 * 非全日制毕业院校
*/ */
@ExcelProperty(value = "学位") @ExcelProperty(value = "非全日制毕业院校")
private String degree; private String nonFulltimeSchool;
/** /**
* 毕业时间 * 非全日制专业
*/ */
@ExcelProperty(value = "毕业时间") @ExcelProperty(value = "非全日制专业")
private LocalDate graduationDate; private String nonFulltimeMajor;
/** /**
* 专业 * 非全日制毕业日期
*/ */
@ExcelProperty(value = "专业") @ExcelProperty(value = "非全日制毕业日期")
private String major; private LocalDate nonFulltimeGraduationDate;
/** /**
* 毕业院校 * 非全日制学位
*/ */
@ExcelProperty(value = "毕业院校") @ExcelProperty(value = "非全日制学位")
private String graduateSchool; private String nonFulltimeDegree;
/**
* 学历分类
*/
@ExcelProperty(value = "学历分类", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_EDUCATION_CATEGORY)
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_EDUCATION_CATEGORY)
private String educationCategory;
/** /**
* 员工类型 * 员工类型
...@@ -261,10 +354,22 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -261,10 +354,22 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
private String professionalTitle; private String professionalTitle;
/** /**
* 简历 * 证书情况
*/ */
@ExcelProperty(value = "简历") @ExcelProperty(value = "证书情况")
private String resume; private String certificateStatus;
/**
* 外部个人履历
*/
@ExcelProperty(value = "外部个人履历")
private String externalResume;
/**
* 内部个人履历
*/
@ExcelProperty(value = "内部个人履历")
private String internalResume;
/** /**
* 用工形式 * 用工形式
...@@ -274,6 +379,14 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -274,6 +379,14 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_EMPLOYMENT_FORM) @Trans(type = TransType.DICTIONARY, key = HrConstant.HR_EMPLOYMENT_FORM)
private String employmentForm; private String employmentForm;
/**
* 合同形式
*/
@ExcelProperty(value = "合同形式", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.HR_CONTRACT_FORM)
@Trans(type = TransType.DICTIONARY, key = HrConstant.HR_CONTRACT_FORM)
private String contractForm;
/** /**
* 劳动合同期限 * 劳动合同期限
*/ */
...@@ -310,6 +423,41 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -310,6 +423,41 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
@ExcelProperty(value = "合同主体") @ExcelProperty(value = "合同主体")
private String contractEntity; private String contractEntity;
/**
* 社保主体
*/
@ExcelProperty(value = "社保主体")
private String socialSecurityEntity;
/**
* 是否缴纳社保
*/
@ExcelProperty(value = "是否缴纳社保", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
@Trans(type = TransType.DICTIONARY, key = HrConstant.SYS_YES_NO)
private String hasSocialSecurityPaid;
/**
* 公积金主体
*/
@ExcelProperty(value = "公积金主体")
private String providentFundEntity;
/**
* 是否缴纳公积金
*/
@ExcelProperty(value = "是否缴纳公积金", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
@Trans(type = TransType.DICTIONARY, key = HrConstant.SYS_YES_NO)
private String hasProvidentFundPaid;
/**
* 试用期(月数)
*/
@ExcelProperty(value = "试用期")
// @ExcelDictFormat(readConverterExp = "月=数")
private Integer probationPeriod;
/** /**
* 转正时间 * 转正时间
*/ */
...@@ -317,16 +465,16 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -317,16 +465,16 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
private LocalDate regularizationDate; private LocalDate regularizationDate;
/** /**
* 异动情况 * 奖励情况
*/ */
@ExcelProperty(value = "异动情况") @ExcelProperty(value = "奖励情况")
private String transferStatus; private String rewardStatus;
/** /**
* 奖惩情况 * 处罚情况
*/ */
@ExcelProperty(value = "奖惩情况") @ExcelProperty(value = "处罚情况")
private String rewardPunishmentStatus; private String punishmentStatus;
/** /**
* 备注 * 备注
...@@ -335,22 +483,73 @@ public class EmployeeInfoVo implements TransPojo, Serializable { ...@@ -335,22 +483,73 @@ public class EmployeeInfoVo implements TransPojo, Serializable {
private String remarks; private String remarks;
/** /**
* 离职时间 * 办公电话
*/
@ExcelProperty(value = "办公电话")
private String officePhone;
/**
* 短线
*/
@ExcelProperty(value = "短线")
private String shortLine;
/**
* 银行卡号
*/
@ExcelProperty(value = "银行卡号")
private String bankCardNumber;
/**
* 开户行
*/
@ExcelProperty(value = "开户行")
private String bankName;
/**
* 公司内是否有亲属关系
*/ */
@ExcelProperty(value = "离职时间") @ExcelProperty(value = "公司内是否有亲属关系", converter = ExcelDictConvert.class)
private LocalDate resignationDate; @ExcelDictFormat(dictType = HrConstant.SYS_YES_NO)
@Trans(type = TransType.DICTIONARY, key = HrConstant.SYS_YES_NO)
private String hasRelativeInCompany;
/**
* 亲属姓名
*/
@ExcelProperty(value = "亲属姓名")
private String relativeName;
/**
* 介绍人
*/
@ExcelProperty(value = "介绍人")
private String introducer;
/**
* 工资发放地
*/
@ExcelProperty(value = "工资发放地")
private String salaryLocation;
/**
* 绩效比例
*/
@ExcelProperty(value = "绩效比例")
private String performanceRatio;
/** /**
* 离职原因 * 入职审批状态
*/ */
@ExcelProperty(value = "离职原因") // @ExcelProperty(value = "入职审批状态")
private String resignationReason; private Integer entryApplyStatus;
/** /**
* 是否转正 * 调配申请状态
*/ */
@ExcelProperty(value = "是否转正") // @ExcelProperty(value = "调配申请状态")
private String onDuty; private Integer transferApplyStatus;
} }
package com.anplus.hr.mapper;
import com.anplus.hr.domain.EmployeeChangeLog;
import top.binfast.common.mybatis.mapper.BinBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 员工异动记录Mapper接口
*
* @author LiuBin
* @date 2025-11-17
*/
@Mapper
public interface EmployeeChangeLogMapper extends BinBaseMapper<EmployeeChangeLog> {
}
...@@ -13,4 +13,13 @@ public interface EmployeeAuditLogServ { ...@@ -13,4 +13,13 @@ public interface EmployeeAuditLogServ {
List<SysAuditLog> queryAuditLogs(String flowLogIds); List<SysAuditLog> queryAuditLogs(String flowLogIds);
Boolean saveAuditLogs(List<SysAuditLog> auditLog); Boolean saveAuditLogs(List<SysAuditLog> auditLog);
default void saveAuditLog(String auditName, String auditField, String auditFieldName, String afterVal, List<SysAuditLog> list) {
SysAuditLog auditLog = new SysAuditLog();
auditLog.setAuditName(auditName);
auditLog.setAuditField(auditField);
auditLog.setAuditFieldName(auditFieldName);
auditLog.setAfterVal(afterVal);
list.add(auditLog);
}
} }
package com.anplus.hr.service;
import com.alibaba.cola.dto.PageResponse;
import com.anplus.hr.domain.EmployeeChangeLog;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeChangeLogListParam;
import com.anplus.hr.domain.params.EmployeeChangeLogParam;
import com.anplus.hr.domain.vo.EmployeeChangeLogVo;
import com.baomidou.mybatisplus.extension.service.IService;
import java.time.LocalDate;
import java.util.List;
/**
* 员工异动记录Service接口
*
* @author LiuBin
* @date 2025-11-17
*/
public interface EmployeeChangeLogServ extends IService<EmployeeChangeLog> {
/**
* 分页查询员工异动记录列表
*
* @param param 查询条件
* @return 员工异动记录分页列表
*/
PageResponse<EmployeeChangeLogVo> queryPageList(EmployeeChangeLogListParam param);
/**
* 查询符合条件的员工异动记录列表
*
* @param param 查询条件
* @return 员工异动记录列表
*/
List<EmployeeChangeLogVo> queryList(EmployeeChangeLogListParam param);
/**
* 查询员工异动记录
*
* @param id 主键
* @return 员工异动记录
*/
EmployeeChangeLogVo queryById(Long id);
/**
* 新增员工异动记录
*
* @param employeeInfo 员工信息
* @param changeType 变更类型
* @return 是否新增成功
*/
Boolean insertByEmployee(EmployeeInfo employeeInfo, String changeType, LocalDate changeDate);
/**
* 新增员工异动记录
*
* @param param 员工异动记录
* @return 是否新增成功
*/
Boolean insertByParam(EmployeeChangeLogParam param);
/**
* 修改员工异动记录
*
* @param param 员工异动记录
* @return 是否修改成功
*/
Boolean updateByParam(EmployeeChangeLogParam param);
/**
* 校验并批量删除员工异动记录信息
*
* @param ids 待删除的主键集合
* @return 是否删除成功
*/
Boolean delByIds(List<Long> ids);
}
package com.anplus.hr.service;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeInfoListParam;
import com.anplus.hr.domain.vo.EmployeeInfoResignImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoResignVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.stream.Stream;
/**
* @author 刘斌
* @date 2025/11/13 20:40
*/
public interface EmployeeInfoResignServ extends IService<EmployeeInfo> {
/**
* 分页查询离职员工信息列表
*
* @param param 查询条件
* @return 员工信息分页列表
*/
PageResponse<EmployeeInfoResignVo> queryPageList(EmployeeInfoListParam param);
/**
* 查询符合条件的离职员工信息列表
*
* @param param 查询条件
* @return 员工信息列表
*/
List<EmployeeInfoResignVo> queryList(EmployeeInfoListParam param);
/**
* 导入离职员工信息列表
*
* @param stream 员工信息列表
* @return 是否导入成功
*/
Response importEmployeeResignList(Stream<EmployeeInfoResignImportVo> stream, MultipartFile file);
/**
* 获取离职员工信息详情
*
* @param id 主键
* @return 员工信息
*/
EmployeeInfoResignVo infoDetail(Long id);
}
package com.anplus.hr.service; package com.anplus.hr.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response; import com.alibaba.cola.dto.Response;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.anplus.hr.domain.EmployeeInfo; import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.*; import com.anplus.hr.domain.params.*;
import com.anplus.hr.domain.vo.EmployeeInfoImportVo; import com.anplus.hr.domain.vo.EmployeeInfoImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoVo; import com.anplus.hr.domain.vo.EmployeeInfoVo;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import top.binfast.app.biz.sysapi.bean.model.oss.SysOss;
import top.binfast.common.excel.image.CellImageData;
import top.binfast.common.excel.image.ExcelProcessingResult;
import top.binfast.common.oss.entity.UploadResult;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -37,6 +44,14 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> { ...@@ -37,6 +44,14 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> {
*/ */
List<EmployeeInfoVo> queryList(EmployeeInfoListParam param); List<EmployeeInfoVo> queryList(EmployeeInfoListParam param);
/**
* 构建查询条件
*
* @param param 查询条件
* @return 查询条件
*/
LambdaQueryWrapper<EmployeeInfo> buildQueryWrapper(EmployeeInfoListParam param);
/** /**
* 导入员工信息列表 * 导入员工信息列表
* *
...@@ -105,6 +120,20 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> { ...@@ -105,6 +120,20 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> {
*/ */
Boolean applyResign(EmployeeResignApplyParam param); Boolean applyResign(EmployeeResignApplyParam param);
/**
* 员工转正申请
*
* @param param 参数
*/
Boolean applyRegular(EmployeeRegularApplyParam param);
/**
* 员工续签合同申请
*
* @param param 参数
*/
Boolean applyRenewalContract(EmployeeRenewalContractApplyParam param);
/** /**
* 校验并批量删除员工信息信息 * 校验并批量删除员工信息信息
* *
...@@ -113,4 +142,32 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> { ...@@ -113,4 +142,32 @@ public interface EmployeeInfoServ extends IService<EmployeeInfo> {
*/ */
Boolean delByIds(List<Long> ids); Boolean delByIds(List<Long> ids);
/**
* 处理图片上传结果
*
* @param excelProcessingResult excel处理结果
* @param importVo 导入数据
*/
SysOss handleImageToUrl(ExcelProcessingResult excelProcessingResult, EmployeeInfoImportVo importVo);
/**
* 构建部门名称字符串
*
* @param importVo 导入数据
* @return 部门名称字符串
*/
default String buildDeptNameStr(EmployeeInfoImportVo importVo) {
StringBuilder builder = new StringBuilder(importVo.getPlate());
if (StrUtil.isNotBlank(importVo.getFirstLevelDepartment())) {
builder.append(StrUtil.SLASH).append(importVo.getFirstLevelDepartment());
}
if (StrUtil.isNotBlank(importVo.getSecondLevelDepartment())) {
builder.append(StrUtil.SLASH).append(importVo.getSecondLevelDepartment());
}
if (StrUtil.isNotBlank(importVo.getThirdLevelDepartment())) {
builder.append(StrUtil.SLASH).append(importVo.getThirdLevelDepartment());
}
return builder.toString();
}
} }
package com.anplus.hr.service.impl;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.vo.EmployeeInfoVo;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import top.binfast.app.biz.sysapi.bean.model.oss.SysOss;
import top.binfast.app.biz.sysapi.dao.system.SysOssMapper;
import top.binfast.common.oss.core.OssService;
import top.binfast.common.oss.enums.AccessPolicyType;
import java.util.Date;
import java.util.List;
/**
* @author 刘斌
* @date 2025/11/17 10:35
*/
@Component
@RequiredArgsConstructor
public class EmployeeAsyncService {
private final SysOssMapper sysOssMapper;
private final OssService ossService;
@Async
public void saveOssBatch(List<SysOss> ossList) {
sysOssMapper.insert(ossList);
}
/**
* 生成临时URL
*
* @param employeeInfoVo
* @return
*/
public EmployeeInfoVo matchingUrl(EmployeeInfoVo employeeInfoVo) {
// OssClient storage = OssFactory.instance(oss.getService());
// 仅修改桶类型为 private 的URL,临时URL时长为300s
if (employeeInfoVo.getPhoto() == null) {
return employeeInfoVo;
}
Date expiration = new Date(new Date().getTime() + 300 * 1000L);
if (AccessPolicyType.PRIVATE == ossService.getAccessPolicy()) {
employeeInfoVo.setPhoto(ossService.getPrivateUrl(employeeInfoVo.getPhoto(), expiration));
}
return employeeInfoVo;
}
}
package com.anplus.hr.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.cola.dto.PageResponse;
import com.anplus.hr.constant.EmployeeChangeLogTypeConstant;
import com.anplus.hr.constant.HrResignYearsOfServiceTypeEnum;
import com.anplus.hr.constant.HrResignationTypeConstant;
import com.anplus.hr.domain.EmployeeChangeLog;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeChangeLogListParam;
import com.anplus.hr.domain.params.EmployeeChangeLogParam;
import com.anplus.hr.domain.vo.EmployeeChangeLogVo;
import com.anplus.hr.mapper.EmployeeChangeLogMapper;
import com.anplus.hr.service.EmployeeChangeLogServ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import top.binfast.app.biz.sysapi.bean.model.auth.SysDept;
import top.binfast.app.biz.sysapi.dao.auth.SysDeptMapper;
import top.binfast.common.core.util.MapstructUtils;
import top.binfast.common.mybatis.util.QueryUtil;
import java.time.LocalDate;
import java.util.List;
/**
* 员工异动记录Service业务层处理
*
* @author LiuBin
* @date 2025-11-17
*/
@RequiredArgsConstructor
@Service
public class EmployeeChangeLogServImpl extends ServiceImpl<EmployeeChangeLogMapper, EmployeeChangeLog> implements EmployeeChangeLogServ {
private final EmployeeChangeLogMapper employeeChangeLogMapper;
private final SysDeptMapper sysDeptMapper;
/**
* 分页查询员工异动记录列表
*
* @param param 查询条件
* @return 员工异动记录分页列表
*/
@Override
public PageResponse<EmployeeChangeLogVo> queryPageList(EmployeeChangeLogListParam param) {
Page<EmployeeChangeLog> page = QueryUtil.getPage(param);
LambdaQueryWrapper<EmployeeChangeLog> lambdaQuery = this.buildQueryWrapper(param);
employeeChangeLogMapper.selectPage(page, lambdaQuery);
return QueryUtil.getPageResponse(page, MapstructUtils.convert(page.getRecords(), EmployeeChangeLogVo.class));
}
/**
* 查询符合条件的员工异动记录列表
*
* @param param 查询条件
* @return 员工异动记录列表
*/
@Override
public List<EmployeeChangeLogVo> queryList(EmployeeChangeLogListParam param) {
LambdaQueryWrapper<EmployeeChangeLog> lambdaQuery = this.buildQueryWrapper(param);
return MapstructUtils.convert(employeeChangeLogMapper.selectList(lambdaQuery), EmployeeChangeLogVo.class);
}
private LambdaQueryWrapper<EmployeeChangeLog> buildQueryWrapper(EmployeeChangeLogListParam param) {
LambdaQueryWrapper<EmployeeChangeLog> lambdaQuery = Wrappers.<EmployeeChangeLog>lambdaQuery();
lambdaQuery.orderByDesc(EmployeeChangeLog::getId);
lambdaQuery.eq(StrUtil.isNotBlank(param.getType()), EmployeeChangeLog::getType, param.getType());
lambdaQuery.eq(param.getDeptId() != null, EmployeeChangeLog::getDeptId, param.getDeptId());
lambdaQuery.eq(param.getEmployeeId() != null, EmployeeChangeLog::getEmployeeId, param.getEmployeeId());
lambdaQuery.eq(param.getChangeDate() != null, EmployeeChangeLog::getChangeDate, param.getChangeDate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getResignType()), EmployeeChangeLog::getResignType, param.getResignType());
lambdaQuery.eq(StrUtil.isNotBlank(param.getResignYearsOfServiceType()), EmployeeChangeLog::getResignYearsOfServiceType, param.getResignYearsOfServiceType());
return lambdaQuery;
}
/**
* 查询员工异动记录
*
* @param id 主键
* @return 员工异动记录
*/
@Override
public EmployeeChangeLogVo queryById(Long id) {
EmployeeChangeLog employeeChangeLog = employeeChangeLogMapper.selectById(id);
return MapstructUtils.convert(employeeChangeLog, EmployeeChangeLogVo.class);
}
@Override
public Boolean insertByEmployee(EmployeeInfo employeeInfo, String changeType, LocalDate changeDate) {
SysDept childDept = sysDeptMapper.selectById(employeeInfo.getDeptId());
List<String> split = StrUtil.splitTrim(childDept.getNodePath(), '/');
if (split.size() < 2) {
return true;
}
Long parentDeptId = split.stream().map(Convert::toLong).filter(t -> t > 0).findFirst().get();
SysDept parentDept = sysDeptMapper.selectById(parentDeptId);
EmployeeChangeLog changeLog = new EmployeeChangeLog();
changeLog.setEmployeeId(employeeInfo.getId());
changeLog.setDeptId(employeeInfo.getDeptId());
changeLog.setPlate(parentDept.getName());
changeLog.setType(changeType);
changeLog.setChangeDate(changeDate != null ? changeDate : LocalDate.now());
if (EmployeeChangeLogTypeConstant.Resign.equals(changeType)) {
changeLog.setResignType(HrResignationTypeConstant.FIRED.equals(employeeInfo.getResignationType()) ?
HrResignationTypeConstant.FIRED : HrResignationTypeConstant.HAND_IN_WORK);
HrResignYearsOfServiceTypeEnum hrResignYearsOfServiceTypeEnum;
if (HrResignationTypeConstant.PROBATION_NOT_PASSED.equals(employeeInfo.getResignationType())) {
hrResignYearsOfServiceTypeEnum = HrResignYearsOfServiceTypeEnum.PROBATION_PERIOD;
} else {
hrResignYearsOfServiceTypeEnum = HrResignYearsOfServiceTypeEnum.getByTotalMonths(employeeInfo.getYearsOfServiceMonths());
}
if (hrResignYearsOfServiceTypeEnum != null) {
changeLog.setResignYearsOfServiceType(hrResignYearsOfServiceTypeEnum.getCode());
}
}
return this.save(changeLog);
}
/**
* 新增员工异动记录
*
* @param param 员工异动记录
* @return 是否新增成功
*/
@Override
public Boolean insertByParam(EmployeeChangeLogParam param) {
EmployeeChangeLog employeeChangeLog = MapstructUtils.convert(param, EmployeeChangeLog.class);
return this.save(employeeChangeLog);
}
/**
* 修改员工异动记录
*
* @param param 员工异动记录
* @return 是否修改成功
*/
@Override
public Boolean updateByParam(EmployeeChangeLogParam param) {
EmployeeChangeLog employeeChangeLog = MapstructUtils.convert(param, EmployeeChangeLog.class);
return this.updateById(employeeChangeLog);
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(EmployeeChangeLog entity) {
// 做一些数据校验,如唯一约束
}
/**
* 校验并批量删除员工异动记录信息
*
* @param ids 待删除的主键集合
* @return 是否删除成功
*/
@Override
// @Transactional(rollbackFor = {Exception.class})
public Boolean delByIds(List<Long> ids) {
//做一些业务上的校验,判断是否需要校验
return this.removeByIds(ids);
}
}
package com.anplus.hr.service.impl; package com.anplus.hr.service.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.anplus.hr.constant.EmployeeChangeLogTypeConstant;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.anplus.hr.constant.HrFlowEnum; import com.anplus.hr.constant.HrFlowEnum;
import com.anplus.hr.constant.HrFlowTypeConstant; import com.anplus.hr.constant.HrFlowTypeConstant;
import com.anplus.hr.constant.HrStatusEnum;
import com.anplus.hr.domain.EmployeeFlow; import com.anplus.hr.domain.EmployeeFlow;
import com.anplus.hr.domain.EmployeeInfo; import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeFlowListParam; import com.anplus.hr.domain.params.EmployeeFlowListParam;
...@@ -21,7 +20,12 @@ import com.anplus.hr.domain.vo.SysAuditLogVo; ...@@ -21,7 +20,12 @@ import com.anplus.hr.domain.vo.SysAuditLogVo;
import com.anplus.hr.mapper.EmployeeFlowMapper; import com.anplus.hr.mapper.EmployeeFlowMapper;
import com.anplus.hr.mapper.EmployeeInfoMapper; import com.anplus.hr.mapper.EmployeeInfoMapper;
import com.anplus.hr.service.EmployeeAuditLogServ; import com.anplus.hr.service.EmployeeAuditLogServ;
import com.anplus.hr.service.EmployeeChangeLogServ;
import com.anplus.hr.service.EmployeeFlowServ; import com.anplus.hr.service.EmployeeFlowServ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -62,6 +66,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ ...@@ -62,6 +66,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ
private final EmployeeAuditLogServ employeeAuditLogServ; private final EmployeeAuditLogServ employeeAuditLogServ;
private final EmployeeInfoMapper employeeInfoMapper; private final EmployeeInfoMapper employeeInfoMapper;
private final SysUserMapper sysUserMapper; private final SysUserMapper sysUserMapper;
private final EmployeeChangeLogServ employeeChangeLogServ;
/** /**
* 分页查询人事审批对象列表 * 分页查询人事审批对象列表
...@@ -109,7 +114,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ ...@@ -109,7 +114,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ
* @return 人事审批对象 * @return 人事审批对象
*/ */
@Override @Override
public EmployeeFlowVo queryById(Long id){ public EmployeeFlowVo queryById(Long id) {
EmployeeFlow employeeFlow = employeeFlowMapper.selectById(id); EmployeeFlow employeeFlow = employeeFlowMapper.selectById(id);
List<SysAuditLogVo> sysAuditLogVoList = null; List<SysAuditLogVo> sysAuditLogVoList = null;
if (StrUtil.isNotBlank(employeeFlow.getLogIds())) { if (StrUtil.isNotBlank(employeeFlow.getLogIds())) {
...@@ -180,7 +185,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ ...@@ -180,7 +185,7 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ
/** /**
* 保存前的数据校验 * 保存前的数据校验
*/ */
private void validEntityBeforeSave(EmployeeFlow entity){ private void validEntityBeforeSave(EmployeeFlow entity) {
// 做一些数据校验,如唯一约束 // 做一些数据校验,如唯一约束
} }
...@@ -229,8 +234,8 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ ...@@ -229,8 +234,8 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ
} }
if (processEvent.getSubmit()) { if (processEvent.getSubmit()) {
employeeFlow.setStatus(BusinessStatusEnum.WAITING.getStatus()); employeeFlow.setStatus(BusinessStatusEnum.WAITING.getStatus());
if(StrUtil.isBlank(employeeFlow.getApplyCode())){ if (StrUtil.isBlank(employeeFlow.getApplyCode())) {
String businessCode = MapUtil.getStr(params, "businessCode",StrUtil.EMPTY); String businessCode = MapUtil.getStr(params, "businessCode", StrUtil.EMPTY);
employeeFlow.setApplyCode(businessCode); employeeFlow.setApplyCode(businessCode);
} }
} else if (processEvent.getStatus().equals(BusinessStatusEnum.FINISH.getStatus())) { } else if (processEvent.getStatus().equals(BusinessStatusEnum.FINISH.getStatus())) {
...@@ -287,33 +292,150 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ ...@@ -287,33 +292,150 @@ public class EmployeeFlowServImpl extends ServiceImpl<EmployeeFlowMapper, Employ
case HrFlowTypeConstant.ENTRY_CODE: case HrFlowTypeConstant.ENTRY_CODE:
// 入职流程结束 // 入职流程结束
employeeInfo.setEntryApplyStatus(HrFlowEnum.FINISH.getStatus()); employeeInfo.setEntryApplyStatus(HrFlowEnum.FINISH.getStatus());
employeeInfo.setStatus(HrStatusEnum.ENTRY.getStatus());
for (SysAuditLog auditLog : auditLogs) {
if ("entryDate".equals(auditLog.getAuditField())) {
employeeInfo.setEntryDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
}
}
employeeChangeLogServ.insertByEmployee(employeeInfo, EmployeeChangeLogTypeConstant.Entry, employeeInfo.getEntryDate());
break;
case HrFlowTypeConstant.REGULARIZATION_CODE:
// 转正流程结束
employeeInfo.setRegularApplyStatus(HrFlowEnum.FINISH.getStatus());
employeeInfo.setStatus(HrStatusEnum.REGULARIZATION.getStatus());
for (SysAuditLog auditLog : auditLogs) {
switch (auditLog.getAuditField()) {
case "contractStartDate":
employeeInfo.setContractStartDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "contractEndDate":
employeeInfo.setContractEndDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "contractSigningStatus":
employeeInfo.setContractSigningStatus(auditLog.getAfterVal());
break;
case "contractEntity":
employeeInfo.setContractEntity(auditLog.getAfterVal());
break;
case "socialSecurityEntity":
employeeInfo.setSocialSecurityEntity(auditLog.getAfterVal());
break;
case "hasSocialSecurityPaid":
employeeInfo.setHasSocialSecurityPaid(auditLog.getAfterVal());
break;
case "providentFundEntity":
employeeInfo.setProvidentFundEntity(auditLog.getAfterVal());
break;
case "hasProvidentFundPaid":
employeeInfo.setHasProvidentFundPaid(auditLog.getAfterVal());
break;
case "regularizationDate":
employeeInfo.setRegularizationDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "employeeType":
employeeInfo.setEmployeeType(auditLog.getAfterVal());
break;
case "employmentForm":
employeeInfo.setEmploymentForm(auditLog.getAfterVal());
break;
case "contractForm":
employeeInfo.setContractForm(auditLog.getAfterVal());
break;
case "contractTerm":
employeeInfo.setContractTerm(auditLog.getAfterVal());
break;
case "contractExpirationReminder":
employeeInfo.setContractExpirationReminder(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
default:
break;
}
}
employeeChangeLogServ.insertByEmployee(employeeInfo, EmployeeChangeLogTypeConstant.Regularization, employeeInfo.getRegularizationDate());
break; break;
case HrFlowTypeConstant.RESIGN_CODE: case HrFlowTypeConstant.RESIGN_CODE:
// 离职流程结束 // 离职流程结束
employeeInfo.setResignationApplyStatus(HrFlowEnum.FINISH.getStatus()); employeeInfo.setResignationApplyStatus(HrFlowEnum.FINISH.getStatus());
employeeInfo.setStatus(HrStatusEnum.RESIGN.getStatus());
for (SysAuditLog auditLog : auditLogs) { for (SysAuditLog auditLog : auditLogs) {
if ("resignationReason".equals(auditLog.getAuditField())) { switch (auditLog.getAuditField()) {
case "resignationType":
employeeInfo.setResignationType(auditLog.getAfterVal());
break;
case "resignationReason":
employeeInfo.setResignationReason(auditLog.getAfterVal()); employeeInfo.setResignationReason(auditLog.getAfterVal());
} break;
if ("resignationDate".equals(auditLog.getAuditField())) { case "resignationDate":
employeeInfo.setResignationDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal())); employeeInfo.setResignationDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "finalPayDate":
employeeInfo.setFinalPayDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
default:
break;
} }
} }
employeeChangeLogServ.insertByEmployee(employeeInfo, EmployeeChangeLogTypeConstant.Resign, employeeInfo.getResignationDate());
break; break;
case HrFlowTypeConstant.TRANSFER_CODE: case HrFlowTypeConstant.TRANSFER_CODE:
// 调配流程结束 // 调配流程结束
employeeInfo.setTransferApplyStatus(HrFlowEnum.FINISH.getStatus()); employeeInfo.setTransferApplyStatus(HrFlowEnum.FINISH.getStatus());
for (SysAuditLog auditLog : auditLogs) { for (SysAuditLog auditLog : auditLogs) {
if ("firstLevelDepartment".equals(auditLog.getAuditField())) { switch (auditLog.getAuditField()) {
case "plate":
employeeInfo.setPlate(auditLog.getAfterVal());
break;
case "firstLevelDepartment":
employeeInfo.setFirstLevelDepartment(auditLog.getAfterVal()); employeeInfo.setFirstLevelDepartment(auditLog.getAfterVal());
} break;
if ("secondLevelDepartment".equals(auditLog.getAuditField())) { case "secondLevelDepartment":
employeeInfo.setSecondLevelDepartment(auditLog.getAfterVal()); employeeInfo.setSecondLevelDepartment(auditLog.getAfterVal());
break;
case "thirdLevelDepartment":
employeeInfo.setThirdLevelDepartment(auditLog.getAfterVal());
break;
case "deptId":
employeeInfo.setDeptId(Convert.toLong(auditLog.getAfterVal()));
break;
default:
break;
} }
} }
employeeChangeLogServ.insertByEmployee(employeeInfo, EmployeeChangeLogTypeConstant.Transfer, null);
break;
case HrFlowTypeConstant.RENEWAL_CONTRACT:
// 续签流程结束
employeeInfo.setRenewalApplyStatus(HrFlowEnum.FINISH.getStatus());
for (SysAuditLog auditLog : auditLogs) {
switch (auditLog.getAuditField()) {
case "contractForm":
employeeInfo.setContractForm(auditLog.getAfterVal());
break;
case "contractStartDate":
employeeInfo.setContractStartDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "contractEndDate":
employeeInfo.setContractEndDate(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
case "contractSigningStatus":
employeeInfo.setContractSigningStatus(auditLog.getAfterVal());
break;
case "contractTerm":
employeeInfo.setContractTerm(auditLog.getAfterVal());
break;
case "contractExpirationReminder":
employeeInfo.setContractExpirationReminder(LocalDateTimeUtil.parseDate(auditLog.getAfterVal(), DatePattern.NORM_DATE_PATTERN));
break;
default:
break;
}
}
employeeChangeLogServ.insertByEmployee(employeeInfo, EmployeeChangeLogTypeConstant.RenewalContract, employeeInfo.getContractStartDate());
break; break;
default: { default: {
// 其他流程结束 // 其他流程结束
break;
} }
} }
employeeInfoMapper.updateById(employeeInfo); employeeInfoMapper.updateById(employeeInfo);
......
package com.anplus.hr.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.anplus.hr.constant.HrStatusEnum;
import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.EmployeeInfoListParam;
import com.anplus.hr.domain.params.EmployeeInfoParam;
import com.anplus.hr.domain.vo.EmployeeInfoResignImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoResignVo;
import com.anplus.hr.domain.vo.EmployeeInfoVo;
import com.anplus.hr.mapper.EmployeeInfoMapper;
import com.anplus.hr.service.EmployeeInfoResignServ;
import com.anplus.hr.service.EmployeeInfoServ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import lombok.RequiredArgsConstructor;
import org.dromara.trans.service.impl.TransService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import top.binfast.app.biz.sysapi.bean.model.oss.SysOss;
import top.binfast.app.biz.sysapi.dao.system.SysOssMapper;
import top.binfast.common.core.enums.ResultCode;
import top.binfast.common.core.util.LambdaUtil;
import top.binfast.common.core.util.MapstructUtils;
import top.binfast.common.core.validate.EditGroup;
import top.binfast.common.excel.core.ExcelContextHolder;
import top.binfast.common.excel.image.ExcelProcessingResult;
import top.binfast.common.excel.image.TempFileExcelImageImporter;
import top.binfast.common.mybatis.util.QueryUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;
/**
* @author 刘斌
* @date 2025/11/13 20:51
*/
@RequiredArgsConstructor
@Service
public class EmployeeInfoResignServImpl extends ServiceImpl<EmployeeInfoMapper, EmployeeInfo> implements EmployeeInfoResignServ {
private final EmployeeInfoMapper employeeInfoMapper;
private final EmployeeInfoServ employeeInfoServ;
private final TransService transService;
private final SysOssMapper sysOssMapper;
private final EmployeeAsyncService employeeAsyncService;
/**
* 分页查询员工信息列表
*
*/
@Override
public PageResponse<EmployeeInfoResignVo> queryPageList(EmployeeInfoListParam param) {
Page<EmployeeInfo> page = QueryUtil.getPage(param);
param.setStatus(HrStatusEnum.RESIGN.getStatus());
LambdaQueryWrapper<EmployeeInfo> lambdaQuery = employeeInfoServ.buildQueryWrapper(param);
employeeInfoMapper.selectPage(page, lambdaQuery);
return QueryUtil.getPageResponse(page, MapstructUtils.convert(page.getRecords(), EmployeeInfoResignVo.class));
}
/**
* 查询符合条件的员工信息列表
*
*/
@Override
public List<EmployeeInfoResignVo> queryList(EmployeeInfoListParam param) {
param.setStatus(HrStatusEnum.RESIGN.getStatus());
LambdaQueryWrapper<EmployeeInfo> lambdaQuery = employeeInfoServ.buildQueryWrapper(param);
List<EmployeeInfoResignVo> employeeInfoResignVos = MapstructUtils.convert(employeeInfoMapper.selectList(lambdaQuery), EmployeeInfoResignVo.class);
List<Long> ossIdList = LambdaUtil.mapToList(employeeInfoResignVos, EmployeeInfoResignVo::getOssId);
if (CollUtil.isNotEmpty(ossIdList)) {
List<SysOss> sysOssList = sysOssMapper.selectByIds(ossIdList);
Map<Long, String> ossMap = LambdaUtil.toMap(sysOssList, SysOss::getId, SysOss::getFileName);
for (EmployeeInfoVo employeeInfoVo : employeeInfoResignVos) {
employeeInfoVo.setPhoto(ossMap.get(employeeInfoVo.getOssId()));
employeeAsyncService.matchingUrl(employeeInfoVo);
}
}
return employeeInfoResignVos;
}
/**
* 导入离职员工信息列表
*
*/
@Override
public Response importEmployeeResignList(Stream<EmployeeInfoResignImportVo> list, MultipartFile file) {
List<EmployeeInfoResignImportVo> errorList = new ArrayList<>();
List<EmployeeInfoResignImportVo> successList = new ArrayList<>();
List<SysOss> ossList = new ArrayList<>();
Map<String, EmployeeInfo> ossEmployeeInfoMap = new HashMap<>();
CompletableFuture<ExcelProcessingResult> future = CompletableFuture.supplyAsync(() -> {
try {
return TempFileExcelImageImporter.importExcelWithAllImages(file);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
list.forEach(item -> {
item.validGroup(EditGroup.class);
if (item.hasError()) {
errorList.add(item);
return;
}
EmployeeInfoParam employeeInfoParam = MapstructUtils.convert(item, EmployeeInfoParam.class);
if (!employeeInfoServ.checkEmployeeIdCardNumberUnique(employeeInfoParam)) {
item.addError("身份证号已存在");
errorList.add(item);
return;
}
successList.add(item);
});
if (CollUtil.isNotEmpty(successList)) {
// Map<String, Long> deptNamesIdMap = employeeSysDeptServ.selectJoinDeptNames();
ExcelProcessingResult excelProcessingResult = future.join();
List<EmployeeInfo> insertList = new ArrayList<>(successList.size());
for (EmployeeInfoResignImportVo importVo : successList) {
SysOss sysOss = employeeInfoServ.handleImageToUrl(excelProcessingResult, importVo);
// Long leafDeptId = deptNamesIdMap.get(employeeInfoServ.buildDeptNameStr(importVo));
// if (leafDeptId == null) {
// importVo.addError("部门不存在");
// errorList.add(importVo);
// continue;
// }
EmployeeInfo employeeInfo = MapstructUtils.convert(importVo, EmployeeInfo.class);
employeeInfo.setStatus(HrStatusEnum.RESIGN.getStatus());
// employeeInfo.setDeptId(leafDeptId);
if (sysOss != null) {
ossList.add(sysOss);
ossEmployeeInfoMap.put(sysOss.getFileName(), employeeInfo);
}
insertList.add(employeeInfo);
}
if (CollUtil.isNotEmpty(ossList)) {
boolean insertFlag = SqlHelper.retBool(sysOssMapper.insert(ossList));
if (insertFlag) {
for (SysOss oss : ossList) {
EmployeeInfo employeeInfo = ossEmployeeInfoMap.get(oss.getFileName());
if (employeeInfo != null) {
employeeInfo.setOssId(oss.getId());
}
}
}
}
employeeInfoMapper.insert(insertList);
// EmployeeDeptCheckAndSaveParam checkAndSaveParam =
// new EmployeeDeptCheckAndSaveParam(deptNameGroups, SecurityUtils.getCurrentUserId(), SecurityUtils.getTenantId());
// employeeDeptServ.checkAndSaveDept(checkAndSaveParam);
}
StringBuilder message;
if (CollUtil.isNotEmpty(errorList)) {
ExcelContextHolder.setErrorExist();
message = new StringBuilder("共" + errorList.size() + "条数据导入失败,错误如下:<br/>");
errorList.forEach(item -> message.append(item.defaultFailMsg()));
return Response.buildFailure(ResultCode.FAIL.getCode(), message.toString());
} else {
message = new StringBuilder("共" + successList.size() + "条数据导入成功");
Response response = Response.buildSuccess();
response.setErrMessage(message.toString());
return response;
}
}
/**
* 获取离职员工信息详情
*/
@Override
public EmployeeInfoResignVo infoDetail(Long id) {
EmployeeInfo employeeInfo = employeeInfoMapper.selectById(id);
EmployeeInfoResignVo employeeInfoVo = MapstructUtils.convert(employeeInfo, EmployeeInfoResignVo.class);
if (employeeInfo.getOssId() != null && employeeInfo.getOssId() > 0) {
SysOss sysOss = sysOssMapper.selectById(employeeInfo.getOssId());
if (sysOss != null) {
employeeInfoVo.setPhoto(sysOss.getFileName());
employeeAsyncService.matchingUrl(employeeInfoVo);
}
}
transService.transOne(employeeInfoVo);
return employeeInfoVo;
}
}
package com.anplus.hr.service.impl; package com.anplus.hr.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response; import com.alibaba.cola.dto.Response;
import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.anplus.hr.constant.HrEmployeeConstants;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.anplus.hr.constant.HrFlowEnum; import com.anplus.hr.constant.HrFlowEnum;
import com.anplus.hr.constant.HrFlowTypeConstant; import com.anplus.hr.constant.HrFlowTypeConstant;
import com.anplus.hr.constant.HrStatusEnum;
import com.anplus.hr.domain.EmployeeInfo; import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.domain.params.*; import com.anplus.hr.domain.params.*;
import com.anplus.hr.domain.vo.EmployeeInfoImportVo; import com.anplus.hr.domain.vo.EmployeeInfoImportVo;
import com.anplus.hr.domain.vo.EmployeeInfoVo; import com.anplus.hr.domain.vo.EmployeeInfoVo;
import com.anplus.hr.mapper.EmployeeInfoMapper; import com.anplus.hr.mapper.EmployeeInfoMapper;
import com.anplus.hr.service.*; import com.anplus.hr.service.EmployeeAuditLogServ;
import com.anplus.hr.service.EmployeeFlowServ;
import com.anplus.hr.service.EmployeeInfoServ;
import com.anplus.hr.service.EmployeeSysDeptServ;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.trans.service.impl.TransService; import org.dromara.trans.service.impl.TransService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import top.binfast.app.biz.sysapi.bean.model.oss.SysOss;
import top.binfast.app.biz.sysapi.dao.system.SysOssMapper;
import top.binfast.common.core.enums.ResultCode; import top.binfast.common.core.enums.ResultCode;
import top.binfast.common.core.util.LambdaUtil; import top.binfast.common.core.util.LambdaUtil;
import top.binfast.common.core.util.MapstructUtils; import top.binfast.common.core.util.MapstructUtils;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.excel.core.ExcelContextHolder; import top.binfast.common.excel.core.ExcelContextHolder;
import top.binfast.common.excel.image.CellImageData; import top.binfast.common.excel.image.CellImageData;
import top.binfast.common.excel.image.ExcelProcessingResult; import top.binfast.common.excel.image.ExcelProcessingResult;
...@@ -37,7 +47,10 @@ import top.binfast.common.mybatis.util.QueryUtil; ...@@ -37,7 +47,10 @@ import top.binfast.common.mybatis.util.QueryUtil;
import top.binfast.common.oss.core.OssService; import top.binfast.common.oss.core.OssService;
import top.binfast.common.oss.entity.UploadResult; import top.binfast.common.oss.entity.UploadResult;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -57,6 +70,8 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -57,6 +70,8 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
private final EmployeeAuditLogServ employeeAuditLogServ; private final EmployeeAuditLogServ employeeAuditLogServ;
private final TransService transService; private final TransService transService;
private final OssService ossService; private final OssService ossService;
private final SysOssMapper sysOssMapper;
private final EmployeeAsyncService employeeAsyncService;
/** /**
* 分页查询员工信息列表 * 分页查询员工信息列表
...@@ -82,27 +97,51 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -82,27 +97,51 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
@Override @Override
public List<EmployeeInfoVo> queryList(EmployeeInfoListParam param) { public List<EmployeeInfoVo> queryList(EmployeeInfoListParam param) {
LambdaQueryWrapper<EmployeeInfo> lambdaQuery = this.buildQueryWrapper(param); LambdaQueryWrapper<EmployeeInfo> lambdaQuery = this.buildQueryWrapper(param);
return MapstructUtils.convert(employeeInfoMapper.selectList(lambdaQuery), EmployeeInfoVo.class); List<EmployeeInfoVo> employeeInfoVoList = MapstructUtils.convert(employeeInfoMapper.selectList(lambdaQuery), EmployeeInfoVo.class);
List<Long> ossIdList = LambdaUtil.mapToList(employeeInfoVoList, EmployeeInfoVo::getOssId);
if (CollUtil.isNotEmpty(ossIdList)) {
List<SysOss> sysOssList = sysOssMapper.selectByIds(ossIdList);
Map<Long, String> ossMap = LambdaUtil.toMap(sysOssList, SysOss::getId, SysOss::getFileName);
for (EmployeeInfoVo employeeInfoVo : employeeInfoVoList) {
employeeInfoVo.setPhoto(ossMap.get(employeeInfoVo.getOssId()));
employeeAsyncService.matchingUrl(employeeInfoVo);
}
}
return employeeInfoVoList;
} }
private LambdaQueryWrapper<EmployeeInfo> buildQueryWrapper(EmployeeInfoListParam param) { @Override
public LambdaQueryWrapper<EmployeeInfo> buildQueryWrapper(EmployeeInfoListParam param) {
Map<String, Object> params = param.getParams(); Map<String, Object> params = param.getParams();
LambdaQueryWrapper<EmployeeInfo> lambdaQuery = Wrappers.<EmployeeInfo>lambdaQuery(); LambdaQueryWrapper<EmployeeInfo> lambdaQuery = Wrappers.<EmployeeInfo>lambdaQuery();
lambdaQuery.orderByDesc(EmployeeInfo::getId); lambdaQuery.orderByDesc(EmployeeInfo::getId);
if (param.getStatus() != null) {
lambdaQuery.eq(EmployeeInfo::getStatus, param.getStatus());
} else {
lambdaQuery.ne(EmployeeInfo::getStatus, HrStatusEnum.RESIGN.getStatus());
}
lambdaQuery.eq(StrUtil.isNotBlank(param.getPlate()), EmployeeInfo::getPlate, param.getPlate()); lambdaQuery.eq(StrUtil.isNotBlank(param.getPlate()), EmployeeInfo::getPlate, param.getPlate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getProject()), EmployeeInfo::getProject, param.getProject());
lambdaQuery.eq(StrUtil.isNotBlank(param.getFirstLevelDepartment()), EmployeeInfo::getFirstLevelDepartment, param.getFirstLevelDepartment()); lambdaQuery.eq(StrUtil.isNotBlank(param.getFirstLevelDepartment()), EmployeeInfo::getFirstLevelDepartment, param.getFirstLevelDepartment());
lambdaQuery.eq(StrUtil.isNotBlank(param.getSecondLevelDepartment()), EmployeeInfo::getSecondLevelDepartment, param.getSecondLevelDepartment()); lambdaQuery.eq(StrUtil.isNotBlank(param.getSecondLevelDepartment()), EmployeeInfo::getSecondLevelDepartment, param.getSecondLevelDepartment());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEmployeeId()), EmployeeInfo::getEmployeeId, param.getEmployeeId()); lambdaQuery.eq(StrUtil.isNotBlank(param.getThirdLevelDepartment()), EmployeeInfo::getThirdLevelDepartment, param.getThirdLevelDepartment());
lambdaQuery.eq(StrUtil.isNotBlank(param.getJobLevel()), EmployeeInfo::getJobLevel, param.getJobLevel()); lambdaQuery.eq(param.getDeptId() != null, EmployeeInfo::getDeptId, param.getDeptId());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEmployeeId()), EmployeeInfo::getEmployeeNo, param.getEmployeeId());
lambdaQuery.eq(param.getJobLevel() != null, EmployeeInfo::getJobLevel, param.getJobLevel());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPositionType()), EmployeeInfo::getPositionType, param.getPositionType());
lambdaQuery.eq(StrUtil.isNotBlank(param.getSequence()), EmployeeInfo::getSequence, param.getSequence());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPosition()), EmployeeInfo::getPosition, param.getPosition()); lambdaQuery.eq(StrUtil.isNotBlank(param.getPosition()), EmployeeInfo::getPosition, param.getPosition());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPost()), EmployeeInfo::getPost, param.getPost());
lambdaQuery.like(StrUtil.isNotBlank(param.getName()), EmployeeInfo::getName, param.getName()); lambdaQuery.like(StrUtil.isNotBlank(param.getName()), EmployeeInfo::getName, param.getName());
lambdaQuery.eq(StrUtil.isNotBlank(param.getGender()), EmployeeInfo::getGender, param.getGender()); lambdaQuery.eq(StrUtil.isNotBlank(param.getGender()), EmployeeInfo::getGender, param.getGender());
lambdaQuery.eq(StrUtil.isNotBlank(param.getIdCardNumber()), EmployeeInfo::getIdCardNumber, param.getIdCardNumber()); lambdaQuery.eq(StrUtil.isNotBlank(param.getIdCardNumber()), EmployeeInfo::getIdCardNumber, param.getIdCardNumber());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPhoto()), EmployeeInfo::getPhoto, param.getPhoto());
lambdaQuery.eq(param.getBirthDate() != null, EmployeeInfo::getBirthDate, param.getBirthDate()); lambdaQuery.eq(param.getBirthDate() != null, EmployeeInfo::getBirthDate, param.getBirthDate());
lambdaQuery.eq(param.getAge() != null, EmployeeInfo::getAge, param.getAge()); lambdaQuery.eq(param.getAge() != null, EmployeeInfo::getAge, param.getAge());
lambdaQuery.eq(StrUtil.isNotBlank(param.getAgeGroup()), EmployeeInfo::getAgeGroup, param.getAgeGroup()); lambdaQuery.eq(StrUtil.isNotBlank(param.getAgeGroup()), EmployeeInfo::getAgeGroup, param.getAgeGroup());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPartTimePlate()), EmployeeInfo::getPartTimePlate, param.getPartTimePlate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPartTimeFirstDept()), EmployeeInfo::getPartTimeFirstDept, param.getPartTimeFirstDept());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPartTimeSecondDept()), EmployeeInfo::getPartTimeSecondDept, param.getPartTimeSecondDept());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPartTimeThirdDept()), EmployeeInfo::getPartTimeThirdDept, param.getPartTimeThirdDept());
lambdaQuery.eq(StrUtil.isNotBlank(param.getPartTimePosition()), EmployeeInfo::getPartTimePosition, param.getPartTimePosition());
lambdaQuery.eq(StrUtil.isNotBlank(param.getNativePlace()), EmployeeInfo::getNativePlace, param.getNativePlace()); lambdaQuery.eq(StrUtil.isNotBlank(param.getNativePlace()), EmployeeInfo::getNativePlace, param.getNativePlace());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEthnicity()), EmployeeInfo::getEthnicity, param.getEthnicity()); lambdaQuery.eq(StrUtil.isNotBlank(param.getEthnicity()), EmployeeInfo::getEthnicity, param.getEthnicity());
lambdaQuery.eq(StrUtil.isNotBlank(param.getMaritalStatus()), EmployeeInfo::getMaritalStatus, param.getMaritalStatus()); lambdaQuery.eq(StrUtil.isNotBlank(param.getMaritalStatus()), EmployeeInfo::getMaritalStatus, param.getMaritalStatus());
...@@ -113,32 +152,59 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -113,32 +152,59 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
lambdaQuery.eq(StrUtil.isNotBlank(param.getHomeAddress()), EmployeeInfo::getHomeAddress, param.getHomeAddress()); lambdaQuery.eq(StrUtil.isNotBlank(param.getHomeAddress()), EmployeeInfo::getHomeAddress, param.getHomeAddress());
lambdaQuery.eq(StrUtil.isNotBlank(param.getHouseholdRegistrationAddress()), EmployeeInfo::getHouseholdRegistrationAddress, param.getHouseholdRegistrationAddress()); lambdaQuery.eq(StrUtil.isNotBlank(param.getHouseholdRegistrationAddress()), EmployeeInfo::getHouseholdRegistrationAddress, param.getHouseholdRegistrationAddress());
lambdaQuery.eq(param.getWorkStartDate() != null, EmployeeInfo::getWorkStartDate, param.getWorkStartDate()); lambdaQuery.eq(param.getWorkStartDate() != null, EmployeeInfo::getWorkStartDate, param.getWorkStartDate());
// lambdaQuery.eq(param.getEntryDate() != null, EmployeeInfo::getEntryDate, param.getEntryDate());
lambdaQuery.between(params.get("entryBeginTime") != null && params.get("entryEndTime") != null, lambdaQuery.between(params.get("entryBeginTime") != null && params.get("entryEndTime") != null,
EmployeeInfo::getEntryDate, params.get("entryBeginTime"), params.get("entryEndTime")); EmployeeInfo::getEntryDate, params.get("entryBeginTime"), params.get("entryEndTime"));
lambdaQuery.eq(param.getYearsOfService() != null, EmployeeInfo::getYearsOfService, param.getYearsOfService()); lambdaQuery.eq(StrUtil.isNotBlank(param.getYearsOfService()), EmployeeInfo::getYearsOfService, param.getYearsOfService());
lambdaQuery.eq(StrUtil.isNotBlank(param.getYearsOfServiceSegment()), EmployeeInfo::getYearsOfServiceSegment, param.getYearsOfServiceSegment()); lambdaQuery.eq(StrUtil.isNotBlank(param.getYearsOfServiceSegment()), EmployeeInfo::getYearsOfServiceSegment, param.getYearsOfServiceSegment());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEducation()), EmployeeInfo::getEducation, param.getEducation()); lambdaQuery.eq(StrUtil.isNotBlank(param.getFulltimeEducation()), EmployeeInfo::getFulltimeEducation, param.getFulltimeEducation());
lambdaQuery.eq(StrUtil.isNotBlank(param.getDegree()), EmployeeInfo::getDegree, param.getDegree()); lambdaQuery.eq(StrUtil.isNotBlank(param.getFulltimeSchool()), EmployeeInfo::getFulltimeSchool, param.getFulltimeSchool());
lambdaQuery.eq(param.getGraduationDate() != null, EmployeeInfo::getGraduationDate, param.getGraduationDate()); lambdaQuery.eq(StrUtil.isNotBlank(param.getFulltimeMajor()), EmployeeInfo::getFulltimeMajor, param.getFulltimeMajor());
lambdaQuery.eq(StrUtil.isNotBlank(param.getMajor()), EmployeeInfo::getMajor, param.getMajor()); lambdaQuery.eq(param.getFulltimeGraduationDate() != null, EmployeeInfo::getFulltimeGraduationDate, param.getFulltimeGraduationDate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getGraduateSchool()), EmployeeInfo::getGraduateSchool, param.getGraduateSchool()); lambdaQuery.eq(StrUtil.isNotBlank(param.getFulltimeDegree()), EmployeeInfo::getFulltimeDegree, param.getFulltimeDegree());
lambdaQuery.eq(StrUtil.isNotBlank(param.getNonFulltimeEducation()), EmployeeInfo::getNonFulltimeEducation, param.getNonFulltimeEducation());
lambdaQuery.eq(StrUtil.isNotBlank(param.getNonFulltimeSchool()), EmployeeInfo::getNonFulltimeSchool, param.getNonFulltimeSchool());
lambdaQuery.eq(StrUtil.isNotBlank(param.getNonFulltimeMajor()), EmployeeInfo::getNonFulltimeMajor, param.getNonFulltimeMajor());
lambdaQuery.eq(param.getNonFulltimeGraduationDate() != null, EmployeeInfo::getNonFulltimeGraduationDate, param.getNonFulltimeGraduationDate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getNonFulltimeDegree()), EmployeeInfo::getNonFulltimeDegree, param.getNonFulltimeDegree());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEducationCategory()), EmployeeInfo::getEducationCategory, param.getEducationCategory());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEmployeeType()), EmployeeInfo::getEmployeeType, param.getEmployeeType()); lambdaQuery.eq(StrUtil.isNotBlank(param.getEmployeeType()), EmployeeInfo::getEmployeeType, param.getEmployeeType());
lambdaQuery.eq(StrUtil.isNotBlank(param.getProfessionalTitle()), EmployeeInfo::getProfessionalTitle, param.getProfessionalTitle()); lambdaQuery.eq(StrUtil.isNotBlank(param.getProfessionalTitle()), EmployeeInfo::getProfessionalTitle, param.getProfessionalTitle());
lambdaQuery.eq(StrUtil.isNotBlank(param.getResume()), EmployeeInfo::getResume, param.getResume()); lambdaQuery.eq(StrUtil.isNotBlank(param.getCertificateStatus()), EmployeeInfo::getCertificateStatus, param.getCertificateStatus());
lambdaQuery.eq(StrUtil.isNotBlank(param.getExternalResume()), EmployeeInfo::getExternalResume, param.getExternalResume());
lambdaQuery.eq(StrUtil.isNotBlank(param.getInternalResume()), EmployeeInfo::getInternalResume, param.getInternalResume());
lambdaQuery.eq(StrUtil.isNotBlank(param.getEmploymentForm()), EmployeeInfo::getEmploymentForm, param.getEmploymentForm()); lambdaQuery.eq(StrUtil.isNotBlank(param.getEmploymentForm()), EmployeeInfo::getEmploymentForm, param.getEmploymentForm());
lambdaQuery.eq(StrUtil.isNotBlank(param.getContractForm()), EmployeeInfo::getContractForm, param.getContractForm());
lambdaQuery.eq(StrUtil.isNotBlank(param.getContractTerm()), EmployeeInfo::getContractTerm, param.getContractTerm()); lambdaQuery.eq(StrUtil.isNotBlank(param.getContractTerm()), EmployeeInfo::getContractTerm, param.getContractTerm());
lambdaQuery.eq(param.getContractStartDate() != null, EmployeeInfo::getContractStartDate, param.getContractStartDate()); lambdaQuery.eq(param.getContractStartDate() != null, EmployeeInfo::getContractStartDate, param.getContractStartDate());
lambdaQuery.eq(param.getContractEndDate() != null, EmployeeInfo::getContractEndDate, param.getContractEndDate()); lambdaQuery.eq(param.getContractEndDate() != null, EmployeeInfo::getContractEndDate, param.getContractEndDate());
lambdaQuery.eq(param.getContractExpirationReminder() != null, EmployeeInfo::getContractExpirationReminder, param.getContractExpirationReminder()); lambdaQuery.eq(param.getContractExpirationReminder() != null, EmployeeInfo::getContractExpirationReminder, param.getContractExpirationReminder());
lambdaQuery.eq(StrUtil.isNotBlank(param.getContractSigningStatus()), EmployeeInfo::getContractSigningStatus, param.getContractSigningStatus()); lambdaQuery.eq(StrUtil.isNotBlank(param.getContractSigningStatus()), EmployeeInfo::getContractSigningStatus, param.getContractSigningStatus());
lambdaQuery.eq(StrUtil.isNotBlank(param.getContractEntity()), EmployeeInfo::getContractEntity, param.getContractEntity()); lambdaQuery.eq(StrUtil.isNotBlank(param.getContractEntity()), EmployeeInfo::getContractEntity, param.getContractEntity());
lambdaQuery.eq(StrUtil.isNotBlank(param.getSocialSecurityEntity()), EmployeeInfo::getSocialSecurityEntity, param.getSocialSecurityEntity());
lambdaQuery.eq(StrUtil.isNotBlank(param.getHasSocialSecurityPaid()), EmployeeInfo::getHasSocialSecurityPaid, param.getHasSocialSecurityPaid());
lambdaQuery.eq(StrUtil.isNotBlank(param.getProvidentFundEntity()), EmployeeInfo::getProvidentFundEntity, param.getProvidentFundEntity());
lambdaQuery.eq(StrUtil.isNotBlank(param.getHasProvidentFundPaid()), EmployeeInfo::getHasProvidentFundPaid, param.getHasProvidentFundPaid());
lambdaQuery.eq(param.getProbationPeriod() != null, EmployeeInfo::getProbationPeriod, param.getProbationPeriod());
lambdaQuery.eq(param.getRegularizationDate() != null, EmployeeInfo::getRegularizationDate, param.getRegularizationDate()); lambdaQuery.eq(param.getRegularizationDate() != null, EmployeeInfo::getRegularizationDate, param.getRegularizationDate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getTransferStatus()), EmployeeInfo::getTransferStatus, param.getTransferStatus()); lambdaQuery.eq(StrUtil.isNotBlank(param.getRewardStatus()), EmployeeInfo::getRewardStatus, param.getRewardStatus());
lambdaQuery.eq(StrUtil.isNotBlank(param.getRewardPunishmentStatus()), EmployeeInfo::getRewardPunishmentStatus, param.getRewardPunishmentStatus()); lambdaQuery.eq(StrUtil.isNotBlank(param.getPunishmentStatus()), EmployeeInfo::getPunishmentStatus, param.getPunishmentStatus());
lambdaQuery.eq(StrUtil.isNotBlank(param.getRemarks()), EmployeeInfo::getRemarks, param.getRemarks()); lambdaQuery.eq(StrUtil.isNotBlank(param.getRemarks()), EmployeeInfo::getRemarks, param.getRemarks());
lambdaQuery.eq(StrUtil.isNotBlank(param.getOfficePhone()), EmployeeInfo::getOfficePhone, param.getOfficePhone());
lambdaQuery.eq(StrUtil.isNotBlank(param.getShortLine()), EmployeeInfo::getShortLine, param.getShortLine());
lambdaQuery.eq(StrUtil.isNotBlank(param.getBankCardNumber()), EmployeeInfo::getBankCardNumber, param.getBankCardNumber());
lambdaQuery.like(StrUtil.isNotBlank(param.getBankName()), EmployeeInfo::getBankName, param.getBankName());
lambdaQuery.eq(StrUtil.isNotBlank(param.getHasRelativeInCompany()), EmployeeInfo::getHasRelativeInCompany, param.getHasRelativeInCompany());
lambdaQuery.like(StrUtil.isNotBlank(param.getRelativeName()), EmployeeInfo::getRelativeName, param.getRelativeName());
lambdaQuery.eq(StrUtil.isNotBlank(param.getIntroducer()), EmployeeInfo::getIntroducer, param.getIntroducer());
lambdaQuery.eq(StrUtil.isNotBlank(param.getSalaryLocation()), EmployeeInfo::getSalaryLocation, param.getSalaryLocation());
lambdaQuery.eq(param.getPerformanceRatio() != null, EmployeeInfo::getPerformanceRatio, param.getPerformanceRatio());
lambdaQuery.eq(StrUtil.isNotBlank(param.getResignationType()), EmployeeInfo::getResignationType, param.getResignationType());
lambdaQuery.eq(param.getResignationDate() != null, EmployeeInfo::getResignationDate, param.getResignationDate()); lambdaQuery.eq(param.getResignationDate() != null, EmployeeInfo::getResignationDate, param.getResignationDate());
lambdaQuery.eq(StrUtil.isNotBlank(param.getResignationReason()), EmployeeInfo::getResignationReason, param.getResignationReason()); lambdaQuery.eq(StrUtil.isNotBlank(param.getResignationReason()), EmployeeInfo::getResignationReason, param.getResignationReason());
lambdaQuery.eq(param.getFinalPayDate() != null, EmployeeInfo::getFinalPayDate, param.getFinalPayDate());
// lambdaQuery.eq(param.getResignationApplyStatus() != null, EmployeeInfo::getResignationApplyStatus, param.getResignationApplyStatus());
// lambdaQuery.eq(param.getEntryApplyStatus() != null, EmployeeInfo::getEntryApplyStatus, param.getEntryApplyStatus());
// lambdaQuery.eq(param.getTransferApplyStatus() != null, EmployeeInfo::getTransferApplyStatus, param.getTransferApplyStatus());
return lambdaQuery; return lambdaQuery;
} }
...@@ -152,6 +218,8 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -152,6 +218,8 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
public Response importEmployeeList(Stream<EmployeeInfoImportVo> list, MultipartFile file) { public Response importEmployeeList(Stream<EmployeeInfoImportVo> list, MultipartFile file) {
List<EmployeeInfoImportVo> errorList = new ArrayList<>(); List<EmployeeInfoImportVo> errorList = new ArrayList<>();
List<EmployeeInfoImportVo> successList = new ArrayList<>(); List<EmployeeInfoImportVo> successList = new ArrayList<>();
List<SysOss> ossList = new ArrayList<>();
Map<String, EmployeeInfo> ossEmployeeInfoMap = new HashMap<>();
CompletableFuture<ExcelProcessingResult> future = CompletableFuture.supplyAsync(() -> { CompletableFuture<ExcelProcessingResult> future = CompletableFuture.supplyAsync(() -> {
try { try {
return TempFileExcelImageImporter.importExcelWithAllImages(file); return TempFileExcelImageImporter.importExcelWithAllImages(file);
...@@ -160,20 +228,20 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -160,20 +228,20 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
} }
}); });
list.forEach(item -> { list.forEach(item -> {
// System.out.println(item.getNickName()); item.validGroup(AddGroup.class);
// item.validGroup(AddGroup.class);
// Set<ConstraintViolation<ExportDemoVo>> validate = ValidatorUtils.validate(item, AddGroup.class);
if (item.hasError()) { if (item.hasError()) {
// item.addError("业务错误");
errorList.add(item); errorList.add(item);
return; return;
} }
EmployeeInfoParam employeeInfoParam = MapstructUtils.convert(item, EmployeeInfoParam.class); EmployeeInfoParam employeeInfoParam = MapstructUtils.convert(item, EmployeeInfoParam.class);
if (!checkEmployeeIdCardNumberUnique(employeeInfoParam)) { if (!checkEmployeeIdCardNumberUnique(employeeInfoParam)) {
item.addError("姓名已存在"); item.addError("身份证号已存在");
errorList.add(item); errorList.add(item);
return; return;
} }
if (item.getContractEndDate() != null) {
item.setContractExpirationReminder(item.getContractEndDate().minusMonths(1));
}
successList.add(item); successList.add(item);
}); });
if (CollUtil.isNotEmpty(successList)) { if (CollUtil.isNotEmpty(successList)) {
...@@ -181,7 +249,7 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -181,7 +249,7 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
ExcelProcessingResult excelProcessingResult = future.join(); ExcelProcessingResult excelProcessingResult = future.join();
List<EmployeeInfo> insertList = new ArrayList<>(successList.size()); List<EmployeeInfo> insertList = new ArrayList<>(successList.size());
for (EmployeeInfoImportVo importVo : successList) { for (EmployeeInfoImportVo importVo : successList) {
this.handleImageToUrl(excelProcessingResult, importVo); SysOss sysOss = this.handleImageToUrl(excelProcessingResult, importVo);
Long leafDeptId = deptNamesIdMap.get(buildDeptNameStr(importVo)); Long leafDeptId = deptNamesIdMap.get(buildDeptNameStr(importVo));
if (leafDeptId == null) { if (leafDeptId == null) {
importVo.addError("部门不存在"); importVo.addError("部门不存在");
...@@ -190,8 +258,25 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -190,8 +258,25 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
} }
EmployeeInfo employeeInfo = MapstructUtils.convert(importVo, EmployeeInfo.class); EmployeeInfo employeeInfo = MapstructUtils.convert(importVo, EmployeeInfo.class);
employeeInfo.setDeptId(leafDeptId); employeeInfo.setDeptId(leafDeptId);
employeeInfo.setStatus(HrEmployeeConstants.EMPLOYEE_TYPE_REGULAR.equals(employeeInfo.getEmployeeType())
? HrStatusEnum.REGULARIZATION.getStatus() : HrStatusEnum.ENTRY.getStatus());
if (sysOss != null) {
ossList.add(sysOss);
ossEmployeeInfoMap.put(sysOss.getFileName(), employeeInfo);
}
insertList.add(employeeInfo); insertList.add(employeeInfo);
} }
if (CollUtil.isNotEmpty(ossList)) {
boolean insertFlag = SqlHelper.retBool(sysOssMapper.insert(ossList));
if (insertFlag) {
for (SysOss oss : ossList) {
EmployeeInfo employeeInfo = ossEmployeeInfoMap.get(oss.getFileName());
if (employeeInfo != null) {
employeeInfo.setOssId(oss.getId());
}
}
}
}
employeeInfoMapper.insert(insertList); employeeInfoMapper.insert(insertList);
// EmployeeDeptCheckAndSaveParam checkAndSaveParam = // EmployeeDeptCheckAndSaveParam checkAndSaveParam =
// new EmployeeDeptCheckAndSaveParam(deptNameGroups, SecurityUtils.getCurrentUserId(), SecurityUtils.getTenantId()); // new EmployeeDeptCheckAndSaveParam(deptNameGroups, SecurityUtils.getCurrentUserId(), SecurityUtils.getTenantId());
...@@ -211,31 +296,34 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -211,31 +296,34 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
} }
} }
private void handleImageToUrl(ExcelProcessingResult excelProcessingResult, EmployeeInfoImportVo importVo) { @Override
public SysOss handleImageToUrl(ExcelProcessingResult excelProcessingResult, EmployeeInfoImportVo importVo) {
// 处理图片,保存到OSS,替换成url // 处理图片,保存到OSS,替换成url
List<CellImageData> imageData = null; List<CellImageData> imageData = null;
if (excelProcessingResult.checkWpsOrOffice(importVo.getResumeImage())) { if (excelProcessingResult.checkWpsOrOffice(importVo.getPhoto())) {
imageData = excelProcessingResult.getWpsImageData(importVo.getResumeImage()); imageData = excelProcessingResult.getWpsImageData(importVo.getPhoto());
} else { } else {
imageData = excelProcessingResult.getOfficeImageData(importVo.getLineNum()); imageData = excelProcessingResult.getOfficeImageData(importVo.getLineNum());
} }
if (CollUtil.isNotEmpty(imageData)) { if (CollUtil.isNotEmpty(imageData)) {
CellImageData cellImageData = imageData.getFirst(); CellImageData cellImageData = imageData.getFirst();
UploadResult uploadResult = ossService.upload(cellImageData.getImageName(), cellImageData.getImageData()); UploadResult uploadResult = ossService.upload(cellImageData.getImageName(), cellImageData.getImageData());
importVo.setResumeImage(uploadResult.getUrl()); // importVo.setPhoto(uploadResult.getFilename());
// SysOssExt ext1 = new SysOssExt();
// ext1.setFileSize((long) cellImageData.getImageData().length);
// ext1.setContentType(cellImageData.getImageType());
SysOss sysOss = new SysOss();
sysOss.setFileName(uploadResult.getFilename());
sysOss.setOriginalName(uploadResult.getOriginalName());
sysOss.setFileSuffix(uploadResult.getFileSuffix());
sysOss.setUrl(uploadResult.getUrl());
sysOss.setService(ossService.getOssServiceName());
// sysOss.setExt1(JsonUtils.toJsonString(ext1));
return sysOss;
} }
return null;
} }
private String buildDeptNameStr(EmployeeInfoImportVo importVo) {
StringBuilder builder = new StringBuilder(importVo.getPlate() + StrUtil.SLASH + importVo.getProject());
if (StrUtil.isNotBlank(importVo.getFirstLevelDepartment())) {
builder.append(StrUtil.SLASH).append(importVo.getFirstLevelDepartment());
}
if (StrUtil.isNotBlank(importVo.getSecondLevelDepartment())) {
builder.append(StrUtil.SLASH).append(importVo.getSecondLevelDepartment());
}
return builder.toString();
}
@Override @Override
public Boolean checkEmployeeIdCardNumberUnique(EmployeeInfoParam employee) { public Boolean checkEmployeeIdCardNumberUnique(EmployeeInfoParam employee) {
...@@ -267,6 +355,13 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -267,6 +355,13 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
public EmployeeInfoVo infoDetail(Long id) { public EmployeeInfoVo infoDetail(Long id) {
EmployeeInfo employeeInfo = employeeInfoMapper.selectById(id); EmployeeInfo employeeInfo = employeeInfoMapper.selectById(id);
EmployeeInfoVo employeeInfoVo = MapstructUtils.convert(employeeInfo, EmployeeInfoVo.class); EmployeeInfoVo employeeInfoVo = MapstructUtils.convert(employeeInfo, EmployeeInfoVo.class);
if (employeeInfo.getOssId() != null && employeeInfo.getOssId() > 0) {
SysOss sysOss = sysOssMapper.selectById(employeeInfo.getOssId());
if (sysOss != null) {
employeeInfoVo.setPhoto(sysOss.getFileName());
employeeAsyncService.matchingUrl(employeeInfoVo);
}
}
transService.transOne(employeeInfoVo); transService.transOne(employeeInfoVo);
return employeeInfoVo; return employeeInfoVo;
} }
...@@ -280,9 +375,10 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -280,9 +375,10 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
@Override @Override
public Boolean insertByParam(EmployeeInfoParam param) { public Boolean insertByParam(EmployeeInfoParam param) {
EmployeeInfo employeeInfo = MapstructUtils.convert(param, EmployeeInfo.class); EmployeeInfo employeeInfo = MapstructUtils.convert(param, EmployeeInfo.class);
// List<String> deptNameAncestors = employeeSysDeptServ.selectDeptNameAncestorsById(param.getDeptId());
// 检查或增加部门 // 检查或增加部门
Set<String> deptNameGroups = new HashSet<>(); // Set<String> deptNameGroups = new HashSet<>();
deptNameGroups.add(employeeInfo.getFirstLevelDepartment() + StrUtil.DASHED + employeeInfo.getSecondLevelDepartment()); // deptNameGroups.add(employeeInfo.getFirstLevelDepartment() + StrUtil.DASHED + employeeInfo.getSecondLevelDepartment());
// EmployeeDeptCheckAndSaveParam checkAndSaveParam = // EmployeeDeptCheckAndSaveParam checkAndSaveParam =
// new EmployeeDeptCheckAndSaveParam(deptNameGroups, SecurityUtils.getCurrentUserId(), SecurityUtils.getTenantId()); // new EmployeeDeptCheckAndSaveParam(deptNameGroups, SecurityUtils.getCurrentUserId(), SecurityUtils.getTenantId());
// employeeDeptServ.checkAndSaveDept(checkAndSaveParam); // employeeDeptServ.checkAndSaveDept(checkAndSaveParam);
...@@ -318,11 +414,17 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -318,11 +414,17 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean applyEntry(EmployeeEntryApplyParam param) { public Boolean applyEntry(EmployeeEntryApplyParam param) {
List<SysAuditLog> list = new ArrayList<>(6);
employeeAuditLogServ.saveAuditLog("入职申请", "entryDate",
"入职时间", LocalDateTimeUtil.format(param.getEntryDate(), DatePattern.NORM_DATE_PATTERN), list);
employeeAuditLogServ.saveAuditLogs(list);
String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA);
EmployeeFlowParam flowParam = new EmployeeFlowParam(); EmployeeFlowParam flowParam = new EmployeeFlowParam();
flowParam.setFlowCode(HrFlowTypeConstant.ENTRY_CODE); flowParam.setFlowCode(HrFlowTypeConstant.ENTRY_CODE);
flowParam.setFlowType(HrFlowTypeConstant.Entry); flowParam.setFlowType(HrFlowTypeConstant.ENTRY);
flowParam.setEmployeeId(param.getId()); flowParam.setEmployeeId(param.getId());
flowParam.setRemark(param.getRemark()); flowParam.setRemark(param.getRemark());
flowParam.setLogIds(logIds);
employeeFlowServ.submitAndFlowStart(flowParam); employeeFlowServ.submitAndFlowStart(flowParam);
return true; return true;
} }
...@@ -336,19 +438,17 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -336,19 +438,17 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
@Override @Override
public Boolean applyTransfer(EmployeeTransferApplyParam param) { public Boolean applyTransfer(EmployeeTransferApplyParam param) {
List<SysAuditLog> list = new ArrayList<>(6); List<SysAuditLog> list = new ArrayList<>(6);
SysAuditLog firstAuditLog = new SysAuditLog(); employeeAuditLogServ.saveAuditLog("调职申请", "plate",
firstAuditLog.setAuditName("调职申请"); "板块", param.getPlate(), list);
firstAuditLog.setAuditField("firstLevelDepartment"); employeeAuditLogServ.saveAuditLog("调职申请", "firstLevelDepartment",
firstAuditLog.setAuditFieldName("一级部门"); "一级部门", param.getFirstLevelDepartment(), list);
firstAuditLog.setAfterVal(param.getFirstLevelDepartment()); employeeAuditLogServ.saveAuditLog("调职申请", "secondLevelDepartment",
"二级部门", param.getSecondLevelDepartment(), list);
employeeAuditLogServ.saveAuditLog("调职申请", "thirdLevelDepartment",
"三级部门", param.getThirdLevelDepartment(), list);
employeeAuditLogServ.saveAuditLog("调职申请", "deptId",
"部门序号", Convert.toStr(param.getDeptId()), list);
SysAuditLog secondAuditLog = new SysAuditLog();
secondAuditLog.setAuditName("调职申请");
secondAuditLog.setAuditField("secondLevelDepartment");
secondAuditLog.setAuditFieldName("二级部门");
secondAuditLog.setAfterVal(param.getSecondLevelDepartment());
list.add(firstAuditLog);
list.add(secondAuditLog);
employeeAuditLogServ.saveAuditLogs(list); employeeAuditLogServ.saveAuditLogs(list);
String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA); String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA);
EmployeeFlowParam flowParam = new EmployeeFlowParam(); EmployeeFlowParam flowParam = new EmployeeFlowParam();
...@@ -371,21 +471,19 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -371,21 +471,19 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
@DSTransactional(rollbackFor = Exception.class) @DSTransactional(rollbackFor = Exception.class)
public Boolean applyResign(EmployeeResignApplyParam param) { public Boolean applyResign(EmployeeResignApplyParam param) {
List<SysAuditLog> list = new ArrayList<>(6); List<SysAuditLog> list = new ArrayList<>(6);
employeeAuditLogServ.saveAuditLog("离职申请", "resignationType",
"离职类型", param.getResignationType(), list);
employeeAuditLogServ.saveAuditLog("离职申请", "resignationDate",
"离职时间", LocalDateTimeUtil.format(param.getResignDate(), DatePattern.NORM_DATE_PATTERN), list);
if (StrUtil.isNotBlank(param.getResignReason())) { if (StrUtil.isNotBlank(param.getResignReason())) {
SysAuditLog reasonAuditLog = new SysAuditLog(); employeeAuditLogServ.saveAuditLog("离职申请", "resignationReason",
reasonAuditLog.setAuditName("离职申请"); "离职原因", param.getResignReason(), list);
reasonAuditLog.setAuditField("resignationReason"); }
reasonAuditLog.setAuditFieldName("离职原因"); if (ObjectUtil.isNotNull(param.getFinalPayDate())) {
reasonAuditLog.setAfterVal(param.getResignReason()); employeeAuditLogServ.saveAuditLog("离职申请", "finalPayDate",
list.add(reasonAuditLog); "最后结薪日", LocalDateTimeUtil.format(param.getFinalPayDate(), DatePattern.NORM_DATE_PATTERN), list);
} }
SysAuditLog dateAuditLog = new SysAuditLog();
dateAuditLog.setAuditName("离职申请");
dateAuditLog.setAuditField("resignationDate");
dateAuditLog.setAuditFieldName("离职时间");
dateAuditLog.setAfterVal(LocalDateTimeUtil.format(param.getResignDate(), DatePattern.NORM_DATE_PATTERN));
list.add(dateAuditLog);
employeeAuditLogServ.saveAuditLogs(list); employeeAuditLogServ.saveAuditLogs(list);
String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA); String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA);
EmployeeFlowParam flowParam = new EmployeeFlowParam(); EmployeeFlowParam flowParam = new EmployeeFlowParam();
...@@ -398,6 +496,100 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ ...@@ -398,6 +496,100 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
return true; return true;
} }
/**
* 员工转正申请
*
* @param param 转正申请参数
* @return 是否申请成功
*/
@Override
public Boolean applyRegular(EmployeeRegularApplyParam param) {
List<SysAuditLog> list = new ArrayList<>(6);
String contractStartDateStr = LocalDateTimeUtil.format(param.getContractStartDate(), DatePattern.NORM_DATE_PATTERN);
String contractEndDateStr = LocalDateTimeUtil.format(param.getContractEndDate(), DatePattern.NORM_DATE_PATTERN);
String contractExpirationReminderStr = LocalDateTimeUtil.format(param.getContractEndDate().minusMonths(1),
DatePattern.NORM_DATE_PATTERN);
employeeAuditLogServ.saveAuditLog("转正申请", "contractStartDate",
"劳动合同开始时间", contractStartDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractEndDate",
"劳动合同截止时间", contractEndDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractSigningStatus",
"劳动合同签订情况", param.getContractSigningStatus(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractEntity",
"合同主体", param.getContractEntity(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "socialSecurityEntity",
"社保主体", param.getSocialSecurityEntity(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "hasSocialSecurityPaid",
"是否缴纳社保", param.getHasSocialSecurityPaid(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "providentFundEntity",
"公积金主体", param.getProvidentFundEntity(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "hasProvidentFundPaid",
"是否缴纳公积金", param.getHasProvidentFundPaid(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "regularizationDate",
"转正时间", LocalDateTimeUtil.format(param.getRegularizationDate(), DatePattern.NORM_DATE_PATTERN), list);
employeeAuditLogServ.saveAuditLog("转正申请", "employeeType",
"员工类型", HrEmployeeConstants.EMPLOYEE_TYPE_REGULAR, list);
employeeAuditLogServ.saveAuditLog("转正申请", "employmentForm",
"用工形式", HrEmployeeConstants.EMPLOYMENT_FORM_REGULAR, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractForm",
"合同形式", HrEmployeeConstants.CONTRACT_FORM_NEW, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractTerm",
"劳动合同期限", contractStartDateStr + "-" + contractEndDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractExpirationReminder",
"合同到期提醒", contractExpirationReminderStr, list);
employeeAuditLogServ.saveAuditLogs(list);
String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA);
EmployeeFlowParam flowParam = new EmployeeFlowParam();
flowParam.setFlowCode(HrFlowTypeConstant.REGULARIZATION_CODE);
flowParam.setFlowType(HrFlowTypeConstant.REGULARIZATION);
flowParam.setEmployeeId(param.getId());
flowParam.setRemark(param.getRemark());
flowParam.setLogIds(logIds);
employeeFlowServ.submitAndFlowStart(flowParam);
return true;
}
/**
* 员工续签合同申请
*
* @param param 续签合同申请参数
* @return 是否申请成功
*/
@Override
public Boolean applyRenewalContract(EmployeeRenewalContractApplyParam param) {
List<SysAuditLog> list = new ArrayList<>(6);
String contractStartDateStr = LocalDateTimeUtil.format(param.getContractStartDate(), DatePattern.NORM_DATE_PATTERN);
String contractEndDateStr = LocalDateTimeUtil.format(param.getContractEndDate(), DatePattern.NORM_DATE_PATTERN);
String contractExpirationReminderStr = LocalDateTimeUtil.format(param.getContractEndDate().minusMonths(1),
DatePattern.NORM_DATE_PATTERN);
employeeAuditLogServ.saveAuditLog("转正申请", "contractForm",
"合同形式", param.getContractForm(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractStartDate",
"劳动合同开始时间", contractStartDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractEndDate",
"劳动合同截止时间", contractEndDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractSigningStatus",
"劳动合同签订情况", param.getContractSigningStatus(), list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractTerm",
"劳动合同期限", contractStartDateStr + "-" + contractEndDateStr, list);
employeeAuditLogServ.saveAuditLog("转正申请", "contractExpirationReminder",
"合同到期提醒", contractExpirationReminderStr, list);
employeeAuditLogServ.saveAuditLogs(list);
String logIds = LambdaUtil.join(list, (item) -> item.getId() + StrUtil.EMPTY, StrUtil.COMMA);
EmployeeFlowParam flowParam = new EmployeeFlowParam();
flowParam.setFlowCode(HrFlowTypeConstant.RENEWAL_CONTRACT_CODE);
flowParam.setFlowType(HrFlowTypeConstant.RENEWAL_CONTRACT);
flowParam.setEmployeeId(param.getId());
flowParam.setRemark(param.getRemark());
flowParam.setLogIds(logIds);
employeeFlowServ.submitAndFlowStart(flowParam);
return true;
}
/** /**
* 校验并批量删除员工信息信息 * 校验并批量删除员工信息信息
* *
......
package com.anplus.hr.service.impl; package com.anplus.hr.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.anplus.hr.config.SeniorityUtils;
import com.anplus.hr.constant.HrAgeGroupEnum;
import com.anplus.hr.constant.HrFlowEnum; import com.anplus.hr.constant.HrFlowEnum;
import com.anplus.hr.constant.HrYearsOfServiceSegmentEnum;
import com.anplus.hr.domain.EmployeeInfo; import com.anplus.hr.domain.EmployeeInfo;
import com.anplus.hr.mapper.EmployeeInfoMapper; import com.anplus.hr.mapper.EmployeeInfoMapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.Period; import java.time.Period;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -42,23 +45,42 @@ public class EmployeeScheduleService { ...@@ -42,23 +45,42 @@ public class EmployeeScheduleService {
List<EmployeeInfo> employeeInfos = employeeInfoMapper.selectList(new LambdaUpdateWrapper<EmployeeInfo>() List<EmployeeInfo> employeeInfos = employeeInfoMapper.selectList(new LambdaUpdateWrapper<EmployeeInfo>()
.eq(EmployeeInfo::getEntryApplyStatus, HrFlowEnum.FINISH.getStatus()) .eq(EmployeeInfo::getEntryApplyStatus, HrFlowEnum.FINISH.getStatus())
.ne(EmployeeInfo::getResignationApplyStatus, HrFlowEnum.FINISH.getStatus())); .ne(EmployeeInfo::getResignationApplyStatus, HrFlowEnum.FINISH.getStatus()));
List<EmployeeInfo> updateList = new ArrayList<>();
for (EmployeeInfo employeeInfo : employeeInfos) { for (EmployeeInfo employeeInfo : employeeInfos) {
Period period = LocalDateTimeUtil.betweenPeriod(employeeInfo.getEntryDate(), LocalDate.from(LocalDateTime.now())); boolean isUpdate = false;
int years = period.getYears(); int newTotalMonths = SeniorityUtils.calculateTotalMonths(employeeInfo.getEntryDate());
int months = period.getMonths(); if (employeeInfo.getYearsOfServiceMonths() != newTotalMonths) {
employeeInfo.setYearsOfService(years > 0 ? years + "年" + months + "个月" : months + "个月"); isUpdate = true;
// TODO 更新员工工龄组 employeeInfo.setYearsOfServiceMonths(newTotalMonths);
employeeInfo.setYearsOfService(SeniorityUtils.formatMonthsToSeniority(newTotalMonths));
precessRefreshAge(employeeInfo); // 更新员工工龄组
HrYearsOfServiceSegmentEnum yearsOfServiceSegmentEnum = HrYearsOfServiceSegmentEnum.getByTotalMonths(newTotalMonths);
if (yearsOfServiceSegmentEnum != null) {
employeeInfo.setYearsOfServiceSegment(yearsOfServiceSegmentEnum.getCode());
}
} }
isUpdate = isUpdate || precessRefreshAge(employeeInfo);
if (isUpdate) {
updateList.add(employeeInfo);
}
}
employeeInfoMapper.updateById(updateList);
} }
private void precessRefreshAge(EmployeeInfo employeeInfo) { private boolean precessRefreshAge(EmployeeInfo employeeInfo) {
boolean isUpdate = false;
Period period = LocalDateTimeUtil.betweenPeriod(employeeInfo.getBirthDate(), LocalDate.from(LocalDateTime.now())); Period period = LocalDateTimeUtil.betweenPeriod(employeeInfo.getBirthDate(), LocalDate.from(LocalDateTime.now()));
if (employeeInfo.getAge() != period.getYears()) { int years = period.getYears();
employeeInfo.setAge(period.getYears()); if (employeeInfo.getAge() != years) {
// TODO 更新员工年龄组 isUpdate = true;
employeeInfo.setAge(years);
// 更新员工年龄组
HrAgeGroupEnum ageGroupEnum = HrAgeGroupEnum.getByAge(years);
if (ageGroupEnum != null) {
employeeInfo.setAgeGroup(ageGroupEnum.getCode());
}
} }
return isUpdate;
} }
/** /**
......
...@@ -61,13 +61,16 @@ springdoc: ...@@ -61,13 +61,16 @@ springdoc:
oss: oss:
enable: true enable: true
endpoint: https://oss-cn-hangzhou.aliyuncs.com endpoint: https://oss-cn-beijing.aliyuncs.com
domain: http://cdn.hr.antaikeji.top
# 也可以采用自定义域名 # 也可以采用自定义域名
# endpoint: https://rjyefa9l9.hn-bkt.clouddn.com # endpoint: https://rjyefa9l9.hn-bkt.clouddn.com
access-key: AASFFFKKK access-key: LTAI4Fq5tjMLps5529Vnp7Kz
access-secret: PPSFSFAFJH8783JJK access-secret: W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
bucket: binfast bucket: an-plus-hr
region: cn-hangzhou region: cn-beijing
# 存储空间访问权限控制 0: 私有 1:公开 2:公共读
accessPolicy: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商 --- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用 # https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
......
...@@ -61,13 +61,16 @@ springdoc: ...@@ -61,13 +61,16 @@ springdoc:
oss: oss:
enable: true enable: true
endpoint: https://oss-cn-hangzhou.aliyuncs.com endpoint: https://oss-cn-beijing.aliyuncs.com
domain: http://cdn.hr.antaikeji.top
# 也可以采用自定义域名 # 也可以采用自定义域名
# endpoint: https://rjyefa9l9.hn-bkt.clouddn.com # endpoint: https://rjyefa9l9.hn-bkt.clouddn.com
access-key: AASFFFKKK access-key: LTAI4Fq5tjMLps5529Vnp7Kz
access-secret: PPSFSFAFJH8783JJK access-secret: W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
bucket: binfast bucket: an-plus-hr
region: cn-hangzhou region: cn-beijing
# 存储空间访问权限控制 0: 私有 1:公开 2:公共读
accessPolicy: 0
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商 --- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用 # https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.anplus.hr.mapper.EmployeeChangeLogMapper">
</mapper>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<mapstruct-plus.version>1.4.8</mapstruct-plus.version> <mapstruct-plus.version>1.4.8</mapstruct-plus.version>
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version> <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<therapi-javadoc.version>0.15.0</therapi-javadoc.version> <therapi-javadoc.version>0.15.0</therapi-javadoc.version>
<binfast.version>1.2.5</binfast.version> <binfast.version>1.2.6</binfast.version>
<lombok.version>1.18.38</lombok.version> <lombok.version>1.18.38</lombok.version>
</properties> </properties>
......
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