完善员工招聘历史工作经历功能
This commit is contained in:
@@ -5,6 +5,7 @@ import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentWorkExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiStaffRecruitmentVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResultVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
@@ -128,6 +129,15 @@ public class CcdiStaffRecruitmentController extends BaseController {
|
||||
EasyExcelUtil.importTemplateWithDictDropdown(response, CcdiStaffRecruitmentExcel.class, "员工招聘信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载历史工作经历导入模板
|
||||
*/
|
||||
@Operation(summary = "下载历史工作经历导入模板")
|
||||
@PostMapping("/workImportTemplate")
|
||||
public void workImportTemplate(HttpServletResponse response) {
|
||||
EasyExcelUtil.importTemplateWithDictDropdown(response, CcdiStaffRecruitmentWorkExcel.class, "历史工作经历");
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步导入招聘信息
|
||||
*/
|
||||
@@ -155,6 +165,31 @@ public class CcdiStaffRecruitmentController extends BaseController {
|
||||
return AjaxResult.success("导入任务已提交,正在后台处理", result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步导入历史工作经历
|
||||
*/
|
||||
@Operation(summary = "异步导入历史工作经历")
|
||||
@Parameter(name = "file", description = "导入文件", required = true)
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:staffRecruitment:import')")
|
||||
@Log(title = "员工招聘历史工作经历", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importWorkData")
|
||||
public AjaxResult importWorkData(@Parameter(description = "导入文件") MultipartFile file) throws Exception {
|
||||
List<CcdiStaffRecruitmentWorkExcel> list = EasyExcelUtil.importExcel(file.getInputStream(), CcdiStaffRecruitmentWorkExcel.class);
|
||||
|
||||
if (list == null || list.isEmpty()) {
|
||||
return error("至少需要一条数据");
|
||||
}
|
||||
|
||||
String taskId = recruitmentService.importRecruitmentWork(list);
|
||||
|
||||
ImportResultVO result = new ImportResultVO();
|
||||
result.setTaskId(taskId);
|
||||
result.setStatus("PROCESSING");
|
||||
result.setMessage("历史工作经历导入任务已提交,正在后台处理");
|
||||
|
||||
return AjaxResult.success("历史工作经历导入任务已提交,正在后台处理", result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询导入状态
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CcdiStaffRecruitment implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 招聘项目编号 */
|
||||
/** 招聘记录编号 */
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String recruitId;
|
||||
|
||||
@@ -41,6 +41,9 @@ public class CcdiStaffRecruitment implements Serializable {
|
||||
/** 应聘人员姓名 */
|
||||
private String candName;
|
||||
|
||||
/** 招聘类型:SOCIAL-社招,CAMPUS-校招 */
|
||||
private String recruitType;
|
||||
|
||||
/** 应聘人员学历 */
|
||||
private String candEdu;
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.ruoyi.info.collection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 招聘记录历史工作经历对象 ccdi_staff_recruitment_work
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-15
|
||||
*/
|
||||
@Data
|
||||
@TableName("ccdi_staff_recruitment_work")
|
||||
public class CcdiStaffRecruitmentWork implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 关联招聘记录编号 */
|
||||
private String recruitId;
|
||||
|
||||
/** 排序号 */
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 工作单位 */
|
||||
private String companyName;
|
||||
|
||||
/** 所属部门 */
|
||||
private String departmentName;
|
||||
|
||||
/** 岗位名称 */
|
||||
private String positionName;
|
||||
|
||||
/** 入职年月 */
|
||||
private String jobStartMonth;
|
||||
|
||||
/** 离职年月 */
|
||||
private String jobEndMonth;
|
||||
|
||||
/** 离职原因 */
|
||||
private String departureReason;
|
||||
|
||||
/** 主要工作内容 */
|
||||
private String workContent;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createdBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/** 更新人 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updatedBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import com.ruoyi.info.collection.annotation.EnumValid;
|
||||
import com.ruoyi.info.collection.enums.AdmitStatus;
|
||||
import com.ruoyi.info.collection.enums.RecruitType;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -22,9 +23,9 @@ public class CcdiStaffRecruitmentAddDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 招聘项目编号 */
|
||||
@NotBlank(message = "招聘项目编号不能为空")
|
||||
@Size(max = 32, message = "招聘项目编号长度不能超过32个字符")
|
||||
/** 招聘记录编号 */
|
||||
@NotBlank(message = "招聘记录编号不能为空")
|
||||
@Size(max = 32, message = "招聘记录编号长度不能超过32个字符")
|
||||
private String recruitId;
|
||||
|
||||
/** 招聘项目名称 */
|
||||
@@ -51,6 +52,11 @@ public class CcdiStaffRecruitmentAddDTO implements Serializable {
|
||||
@Size(max = 20, message = "应聘人员姓名长度不能超过20个字符")
|
||||
private String candName;
|
||||
|
||||
/** 招聘类型 */
|
||||
@NotBlank(message = "招聘类型不能为空")
|
||||
@EnumValid(enumClass = RecruitType.class, message = "招聘类型状态值不合法")
|
||||
private String recruitType;
|
||||
|
||||
/** 应聘人员学历 */
|
||||
@NotBlank(message = "应聘人员学历不能为空")
|
||||
@Size(max = 20, message = "应聘人员学历长度不能超过20个字符")
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import com.ruoyi.info.collection.annotation.EnumValid;
|
||||
import com.ruoyi.info.collection.enums.AdmitStatus;
|
||||
import com.ruoyi.info.collection.enums.RecruitType;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
@@ -23,8 +24,8 @@ public class CcdiStaffRecruitmentEditDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 招聘项目编号 */
|
||||
@NotNull(message = "招聘项目编号不能为空")
|
||||
/** 招聘记录编号 */
|
||||
@NotNull(message = "招聘记录编号不能为空")
|
||||
private String recruitId;
|
||||
|
||||
/** 招聘项目名称 */
|
||||
@@ -46,6 +47,10 @@ public class CcdiStaffRecruitmentEditDTO implements Serializable {
|
||||
@Size(max = 20, message = "应聘人员姓名长度不能超过20个字符")
|
||||
private String candName;
|
||||
|
||||
/** 招聘类型 */
|
||||
@EnumValid(enumClass = RecruitType.class, message = "招聘类型状态值不合法")
|
||||
private String recruitType;
|
||||
|
||||
/** 应聘人员学历 */
|
||||
@Size(max = 20, message = "应聘人员学历长度不能超过20个字符")
|
||||
private String candEdu;
|
||||
|
||||
@@ -26,6 +26,9 @@ public class CcdiStaffRecruitmentQueryDTO implements Serializable {
|
||||
/** 候选人姓名(模糊查询) */
|
||||
private String candName;
|
||||
|
||||
/** 招聘类型(精确查询) */
|
||||
private String recruitType;
|
||||
|
||||
/** 证件号码(精确查询) */
|
||||
private String candId;
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.info.collection.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.ruoyi.common.annotation.Required;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 招聘记录历史工作经历Excel导入对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-20
|
||||
*/
|
||||
@Data
|
||||
public class CcdiStaffRecruitmentWorkExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 招聘记录编号 */
|
||||
@ExcelProperty(value = "招聘记录编号", index = 0)
|
||||
@ColumnWidth(20)
|
||||
@Required
|
||||
private String recruitId;
|
||||
|
||||
/** 候选人姓名 */
|
||||
@ExcelProperty(value = "候选人姓名", index = 1)
|
||||
@ColumnWidth(15)
|
||||
@Required
|
||||
private String candName;
|
||||
|
||||
/** 招聘项目名称 */
|
||||
@ExcelProperty(value = "招聘项目名称", index = 2)
|
||||
@ColumnWidth(25)
|
||||
@Required
|
||||
private String recruitName;
|
||||
|
||||
/** 职位名称 */
|
||||
@ExcelProperty(value = "职位名称", index = 3)
|
||||
@ColumnWidth(20)
|
||||
@Required
|
||||
private String posName;
|
||||
|
||||
/** 排序号 */
|
||||
@ExcelProperty(value = "排序号", index = 4)
|
||||
@ColumnWidth(10)
|
||||
@Required
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 工作单位 */
|
||||
@ExcelProperty(value = "工作单位", index = 5)
|
||||
@ColumnWidth(25)
|
||||
@Required
|
||||
private String companyName;
|
||||
|
||||
/** 所属部门 */
|
||||
@ExcelProperty(value = "所属部门", index = 6)
|
||||
@ColumnWidth(18)
|
||||
private String departmentName;
|
||||
|
||||
/** 岗位 */
|
||||
@ExcelProperty(value = "岗位", index = 7)
|
||||
@ColumnWidth(20)
|
||||
@Required
|
||||
private String positionName;
|
||||
|
||||
/** 入职年月 */
|
||||
@ExcelProperty(value = "入职年月", index = 8)
|
||||
@ColumnWidth(12)
|
||||
@Required
|
||||
private String jobStartMonth;
|
||||
|
||||
/** 离职年月 */
|
||||
@ExcelProperty(value = "离职年月", index = 9)
|
||||
@ColumnWidth(12)
|
||||
private String jobEndMonth;
|
||||
|
||||
/** 离职原因 */
|
||||
@ExcelProperty(value = "离职原因", index = 10)
|
||||
@ColumnWidth(30)
|
||||
private String departureReason;
|
||||
|
||||
/** 工作内容 */
|
||||
@ExcelProperty(value = "工作内容", index = 11)
|
||||
@ColumnWidth(35)
|
||||
private String workContent;
|
||||
|
||||
/** 备注 */
|
||||
@ExcelProperty(value = "备注", index = 12)
|
||||
@ColumnWidth(25)
|
||||
private String remark;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工招聘信息VO
|
||||
@@ -18,7 +19,7 @@ public class CcdiStaffRecruitmentVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 招聘项目编号 */
|
||||
/** 招聘记录编号 */
|
||||
private String recruitId;
|
||||
|
||||
/** 招聘项目名称 */
|
||||
@@ -36,6 +37,9 @@ public class CcdiStaffRecruitmentVO implements Serializable {
|
||||
/** 应聘人员姓名 */
|
||||
private String candName;
|
||||
|
||||
/** 招聘类型 */
|
||||
private String recruitType;
|
||||
|
||||
/** 应聘人员学历 */
|
||||
private String candEdu;
|
||||
|
||||
@@ -57,6 +61,12 @@ public class CcdiStaffRecruitmentVO implements Serializable {
|
||||
/** 录用情况描述 */
|
||||
private String admitStatusDesc;
|
||||
|
||||
/** 历史工作经历条数 */
|
||||
private Long workExperienceCount;
|
||||
|
||||
/** 历史工作经历列表 */
|
||||
private List<CcdiStaffRecruitmentWorkVO> workExperienceList;
|
||||
|
||||
/** 面试官1姓名 */
|
||||
private String interviewerName1;
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 招聘记录历史工作经历VO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-15
|
||||
*/
|
||||
@Data
|
||||
public class CcdiStaffRecruitmentWorkVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 排序号 */
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 工作单位 */
|
||||
private String companyName;
|
||||
|
||||
/** 所属部门 */
|
||||
private String departmentName;
|
||||
|
||||
/** 岗位名称 */
|
||||
private String positionName;
|
||||
|
||||
/** 入职年月 */
|
||||
private String jobStartMonth;
|
||||
|
||||
/** 离职年月 */
|
||||
private String jobEndMonth;
|
||||
|
||||
/** 离职原因 */
|
||||
private String departureReason;
|
||||
|
||||
/** 主要工作内容 */
|
||||
private String workContent;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -19,6 +19,9 @@ public class RecruitmentImportFailureVO {
|
||||
@Schema(description = "招聘项目名称")
|
||||
private String recruitName;
|
||||
|
||||
@Schema(description = "职位名称")
|
||||
private String posName;
|
||||
|
||||
@Schema(description = "应聘人员姓名")
|
||||
private String candName;
|
||||
|
||||
@@ -28,6 +31,12 @@ public class RecruitmentImportFailureVO {
|
||||
@Schema(description = "录用情况")
|
||||
private String admitStatus;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "岗位")
|
||||
private String positionName;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMessage;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.info.collection.enums;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 招聘类型枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum RecruitType {
|
||||
|
||||
/** 社招 */
|
||||
SOCIAL("SOCIAL", "社招"),
|
||||
|
||||
/** 校招 */
|
||||
CAMPUS("CAMPUS", "校招");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
RecruitType(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
for (RecruitType type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String inferCode(String recruitName) {
|
||||
if (StringUtils.isNotEmpty(recruitName) && recruitName.contains("校园")) {
|
||||
return CAMPUS.code;
|
||||
}
|
||||
return SOCIAL.code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.info.collection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffRecruitmentWork;
|
||||
|
||||
/**
|
||||
* 招聘记录历史工作经历 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-15
|
||||
*/
|
||||
public interface CcdiStaffRecruitmentWorkMapper extends BaseMapper<CcdiStaffRecruitmentWork> {
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.info.collection.service;
|
||||
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentWorkExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
import com.ruoyi.info.collection.domain.vo.RecruitmentImportFailureVO;
|
||||
|
||||
@@ -25,6 +26,17 @@ public interface ICcdiStaffRecruitmentImportService {
|
||||
String taskId,
|
||||
String userName);
|
||||
|
||||
/**
|
||||
* 异步导入招聘记录历史工作经历数据
|
||||
*
|
||||
* @param excelList Excel数据列表
|
||||
* @param taskId 任务ID
|
||||
* @param userName 用户名
|
||||
*/
|
||||
void importRecruitmentWorkAsync(List<CcdiStaffRecruitmentWorkExcel> excelList,
|
||||
String taskId,
|
||||
String userName);
|
||||
|
||||
/**
|
||||
* 查询导入状态
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentWorkExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiStaffRecruitmentVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -81,4 +82,12 @@ public interface ICcdiStaffRecruitmentService {
|
||||
* @return 结果
|
||||
*/
|
||||
String importRecruitment(List<CcdiStaffRecruitmentExcel> excelList);
|
||||
|
||||
/**
|
||||
* 导入招聘记录历史工作经历数据(异步)
|
||||
*
|
||||
* @param excelList Excel实体列表
|
||||
* @return 任务ID
|
||||
*/
|
||||
String importRecruitmentWork(List<CcdiStaffRecruitmentWorkExcel> excelList);
|
||||
}
|
||||
|
||||
@@ -3,13 +3,17 @@ package com.ruoyi.info.collection.service.impl;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffRecruitment;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffRecruitmentWork;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentAddDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentWorkExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResult;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
import com.ruoyi.info.collection.domain.vo.RecruitmentImportFailureVO;
|
||||
import com.ruoyi.info.collection.enums.AdmitStatus;
|
||||
import com.ruoyi.info.collection.enums.RecruitType;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffRecruitmentMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffRecruitmentWorkMapper;
|
||||
import com.ruoyi.info.collection.service.ICcdiStaffRecruitmentImportService;
|
||||
import com.ruoyi.info.collection.utils.ImportLogUtils;
|
||||
import com.ruoyi.common.utils.IdCardUtil;
|
||||
@@ -43,6 +47,9 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
@Resource
|
||||
private CcdiStaffRecruitmentMapper recruitmentMapper;
|
||||
|
||||
@Resource
|
||||
private CcdiStaffRecruitmentWorkMapper recruitmentWorkMapper;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@@ -60,10 +67,10 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
List<CcdiStaffRecruitment> newRecords = new ArrayList<>();
|
||||
List<RecruitmentImportFailureVO> failures = new ArrayList<>();
|
||||
|
||||
// 批量查询已存在的招聘项目编号
|
||||
ImportLogUtils.logBatchQueryStart(log, taskId, "已存在的招聘项目编号", excelList.size());
|
||||
// 批量查询已存在的招聘记录编号
|
||||
ImportLogUtils.logBatchQueryStart(log, taskId, "已存在的招聘记录编号", excelList.size());
|
||||
Set<String> existingRecruitIds = getExistingRecruitIds(excelList);
|
||||
ImportLogUtils.logBatchQueryComplete(log, taskId, "招聘项目编号", existingRecruitIds.size());
|
||||
ImportLogUtils.logBatchQueryComplete(log, taskId, "招聘记录编号", existingRecruitIds.size());
|
||||
|
||||
// 用于检测Excel内部的重复ID
|
||||
Set<String> excelProcessedIds = new HashSet<>();
|
||||
@@ -76,19 +83,21 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
// 转换为AddDTO进行验证
|
||||
CcdiStaffRecruitmentAddDTO addDTO = new CcdiStaffRecruitmentAddDTO();
|
||||
BeanUtils.copyProperties(excel, addDTO);
|
||||
addDTO.setRecruitType(RecruitType.inferCode(addDTO.getRecruitName()));
|
||||
|
||||
// 验证数据
|
||||
validateRecruitmentData(addDTO, existingRecruitIds);
|
||||
|
||||
CcdiStaffRecruitment recruitment = new CcdiStaffRecruitment();
|
||||
BeanUtils.copyProperties(excel, recruitment);
|
||||
recruitment.setRecruitType(addDTO.getRecruitType());
|
||||
|
||||
if (existingRecruitIds.contains(excel.getRecruitId())) {
|
||||
// 招聘项目编号在数据库中已存在,直接报错
|
||||
throw new RuntimeException(String.format("招聘项目编号[%s]已存在,请勿重复导入", excel.getRecruitId()));
|
||||
// 招聘记录编号在数据库中已存在,直接报错
|
||||
throw new RuntimeException(String.format("招聘记录编号[%s]已存在,请勿重复导入", excel.getRecruitId()));
|
||||
} else if (excelProcessedIds.contains(excel.getRecruitId())) {
|
||||
// 招聘项目编号在Excel文件内部重复
|
||||
throw new RuntimeException(String.format("招聘项目编号[%s]在导入文件中重复,已跳过此条记录", excel.getRecruitId()));
|
||||
// 招聘记录编号在Excel文件内部重复
|
||||
throw new RuntimeException(String.format("招聘记录编号[%s]在导入文件中重复,已跳过此条记录", excel.getRecruitId()));
|
||||
} else {
|
||||
recruitment.setCreatedBy(userName);
|
||||
recruitment.setUpdatedBy(userName);
|
||||
@@ -107,7 +116,7 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
failures.add(failure);
|
||||
|
||||
// 记录验证失败日志
|
||||
String keyData = String.format("招聘项目编号=%s, 项目名称=%s, 应聘人员=%s",
|
||||
String keyData = String.format("招聘记录编号=%s, 项目名称=%s, 应聘人员=%s",
|
||||
excel.getRecruitId(), excel.getRecruitName(), excel.getCandName());
|
||||
ImportLogUtils.logValidationError(log, taskId, i + 1, e.getMessage(), keyData);
|
||||
}
|
||||
@@ -142,7 +151,85 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
|
||||
// 记录导入完成
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
ImportLogUtils.logImportComplete(log, taskId, "招聘信息",
|
||||
ImportLogUtils.logImportComplete(log, taskId, "招聘信息",
|
||||
excelList.size(), result.getSuccessCount(), result.getFailureCount(), duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
@Transactional
|
||||
public void importRecruitmentWorkAsync(List<CcdiStaffRecruitmentWorkExcel> excelList,
|
||||
String taskId,
|
||||
String userName) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
ImportLogUtils.logImportStart(log, taskId, "招聘历史工作经历", excelList.size(), userName);
|
||||
|
||||
List<RecruitmentImportFailureVO> failures = new ArrayList<>();
|
||||
List<CcdiStaffRecruitmentWork> validRecords = new ArrayList<>();
|
||||
Set<String> failedRecruitIds = new HashSet<>();
|
||||
Set<String> processedRecruitSortKeys = new HashSet<>();
|
||||
|
||||
Map<String, CcdiStaffRecruitment> recruitmentMap = getRecruitmentMap(excelList);
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
CcdiStaffRecruitmentWorkExcel excel = excelList.get(i);
|
||||
try {
|
||||
CcdiStaffRecruitment recruitment = recruitmentMap.get(trim(excel.getRecruitId()));
|
||||
validateRecruitmentWorkData(excel, recruitment, processedRecruitSortKeys);
|
||||
|
||||
CcdiStaffRecruitmentWork work = new CcdiStaffRecruitmentWork();
|
||||
BeanUtils.copyProperties(excel, work);
|
||||
work.setRecruitId(trim(excel.getRecruitId()));
|
||||
work.setCreatedBy(userName);
|
||||
work.setUpdatedBy(userName);
|
||||
validRecords.add(work);
|
||||
|
||||
ImportLogUtils.logProgress(log, taskId, i + 1, excelList.size(),
|
||||
validRecords.size(), failures.size());
|
||||
} catch (Exception e) {
|
||||
failedRecruitIds.add(trim(excel.getRecruitId()));
|
||||
failures.add(buildWorkFailure(excel, e.getMessage()));
|
||||
String keyData = String.format("招聘记录编号=%s, 候选人=%s, 工作单位=%s",
|
||||
excel.getRecruitId(), excel.getCandName(), excel.getCompanyName());
|
||||
ImportLogUtils.logValidationError(log, taskId, i + 1, e.getMessage(), keyData);
|
||||
}
|
||||
}
|
||||
|
||||
List<CcdiStaffRecruitmentWork> importRecords = validRecords.stream()
|
||||
.filter(work -> !failedRecruitIds.contains(work.getRecruitId()))
|
||||
.toList();
|
||||
appendSkippedFailures(validRecords, failedRecruitIds, failures);
|
||||
|
||||
if (!importRecords.isEmpty()) {
|
||||
Set<String> importRecruitIds = importRecords.stream()
|
||||
.map(CcdiStaffRecruitmentWork::getRecruitId)
|
||||
.collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<CcdiStaffRecruitmentWork> deleteWrapper = new LambdaQueryWrapper<>();
|
||||
deleteWrapper.in(CcdiStaffRecruitmentWork::getRecruitId, importRecruitIds);
|
||||
recruitmentWorkMapper.delete(deleteWrapper);
|
||||
|
||||
importRecords.forEach(recruitmentWorkMapper::insert);
|
||||
}
|
||||
|
||||
if (!failures.isEmpty()) {
|
||||
try {
|
||||
String failuresKey = "import:recruitment:" + taskId + ":failures";
|
||||
redisTemplate.opsForValue().set(failuresKey, failures, 7, TimeUnit.DAYS);
|
||||
ImportLogUtils.logRedisOperation(log, taskId, "保存失败记录", failures.size());
|
||||
} catch (Exception e) {
|
||||
ImportLogUtils.logRedisError(log, taskId, "保存失败记录", e);
|
||||
}
|
||||
}
|
||||
|
||||
ImportResult result = new ImportResult();
|
||||
result.setTotalCount(excelList.size());
|
||||
result.setSuccessCount(importRecords.size());
|
||||
result.setFailureCount(failures.size());
|
||||
String finalStatus = result.getFailureCount() == 0 ? "SUCCESS" : "PARTIAL_SUCCESS";
|
||||
updateImportStatus(taskId, finalStatus, result);
|
||||
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
ImportLogUtils.logImportComplete(log, taskId, "招聘历史工作经历",
|
||||
excelList.size(), result.getSuccessCount(), result.getFailureCount(), duration);
|
||||
}
|
||||
|
||||
@@ -184,7 +271,7 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询已存在的招聘项目编号
|
||||
* 批量查询已存在的招聘记录编号
|
||||
*/
|
||||
private Set<String> getExistingRecruitIds(List<CcdiStaffRecruitmentExcel> excelList) {
|
||||
List<String> recruitIds = excelList.stream()
|
||||
@@ -212,7 +299,7 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
Set<String> existingRecruitIds) {
|
||||
// 验证必填字段
|
||||
if (StringUtils.isEmpty(addDTO.getRecruitId())) {
|
||||
throw new RuntimeException("招聘项目编号不能为空");
|
||||
throw new RuntimeException("招聘记录编号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getRecruitName())) {
|
||||
throw new RuntimeException("招聘项目名称不能为空");
|
||||
@@ -247,6 +334,9 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
if (StringUtils.isEmpty(addDTO.getAdmitStatus())) {
|
||||
throw new RuntimeException("录用情况不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getRecruitType())) {
|
||||
throw new RuntimeException("招聘类型不能为空");
|
||||
}
|
||||
|
||||
// 验证证件号码格式
|
||||
String idCardError = IdCardUtil.getErrorMessage(addDTO.getCandId());
|
||||
@@ -263,6 +353,115 @@ public class CcdiStaffRecruitmentImportServiceImpl implements ICcdiStaffRecruitm
|
||||
if (AdmitStatus.getDescByCode(addDTO.getAdmitStatus()) == null) {
|
||||
throw new RuntimeException("录用情况只能填写'录用'、'未录用'或'放弃'");
|
||||
}
|
||||
|
||||
if (RecruitType.getDescByCode(addDTO.getRecruitType()) == null) {
|
||||
throw new RuntimeException("招聘类型只能填写'SOCIAL'或'CAMPUS'");
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, CcdiStaffRecruitment> getRecruitmentMap(List<CcdiStaffRecruitmentWorkExcel> excelList) {
|
||||
List<String> recruitIds = excelList.stream()
|
||||
.map(CcdiStaffRecruitmentWorkExcel::getRecruitId)
|
||||
.map(this::trim)
|
||||
.filter(StringUtils::isNotEmpty)
|
||||
.distinct()
|
||||
.toList();
|
||||
if (recruitIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<CcdiStaffRecruitment> recruitments = recruitmentMapper.selectBatchIds(recruitIds);
|
||||
return recruitments.stream()
|
||||
.collect(Collectors.toMap(CcdiStaffRecruitment::getRecruitId, item -> item));
|
||||
}
|
||||
|
||||
private void validateRecruitmentWorkData(CcdiStaffRecruitmentWorkExcel excel,
|
||||
CcdiStaffRecruitment recruitment,
|
||||
Set<String> processedRecruitSortKeys) {
|
||||
if (StringUtils.isEmpty(trim(excel.getRecruitId()))) {
|
||||
throw new RuntimeException("招聘记录编号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getCandName()))) {
|
||||
throw new RuntimeException("候选人姓名不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getRecruitName()))) {
|
||||
throw new RuntimeException("招聘项目名称不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getPosName()))) {
|
||||
throw new RuntimeException("职位名称不能为空");
|
||||
}
|
||||
if (excel.getSortOrder() == null || excel.getSortOrder() <= 0) {
|
||||
throw new RuntimeException("排序号不能为空且必须大于0");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getCompanyName()))) {
|
||||
throw new RuntimeException("工作单位不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getPositionName()))) {
|
||||
throw new RuntimeException("岗位不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(trim(excel.getJobStartMonth()))) {
|
||||
throw new RuntimeException("入职年月不能为空");
|
||||
}
|
||||
validateMonth(excel.getJobStartMonth(), "入职年月");
|
||||
if (StringUtils.isNotEmpty(trim(excel.getJobEndMonth()))) {
|
||||
validateMonth(excel.getJobEndMonth(), "离职年月");
|
||||
}
|
||||
if (recruitment == null) {
|
||||
throw new RuntimeException("招聘记录编号不存在,请先维护招聘主信息");
|
||||
}
|
||||
if (!"SOCIAL".equals(recruitment.getRecruitType())) {
|
||||
throw new RuntimeException("该招聘记录不是社招,不允许导入历史工作经历");
|
||||
}
|
||||
if (!sameText(excel.getCandName(), recruitment.getCandName())) {
|
||||
throw new RuntimeException("招聘记录编号与候选人姓名不匹配");
|
||||
}
|
||||
if (!sameText(excel.getRecruitName(), recruitment.getRecruitName())) {
|
||||
throw new RuntimeException("招聘记录编号与招聘项目名称不匹配");
|
||||
}
|
||||
if (!sameText(excel.getPosName(), recruitment.getPosName())) {
|
||||
throw new RuntimeException("招聘记录编号与职位名称不匹配");
|
||||
}
|
||||
String duplicateKey = trim(excel.getRecruitId()) + "#" + excel.getSortOrder();
|
||||
if (!processedRecruitSortKeys.add(duplicateKey)) {
|
||||
throw new RuntimeException("同一招聘记录编号下排序号重复");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMonth(String value, String fieldName) {
|
||||
String month = trim(value);
|
||||
if (!month.matches("^((19|20)\\d{2})-(0[1-9]|1[0-2])$")) {
|
||||
throw new RuntimeException(fieldName + "格式不正确,应为YYYY-MM");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean sameText(String first, String second) {
|
||||
return Objects.equals(trim(first), trim(second));
|
||||
}
|
||||
|
||||
private String trim(String value) {
|
||||
return value == null ? null : value.trim();
|
||||
}
|
||||
|
||||
private RecruitmentImportFailureVO buildWorkFailure(CcdiStaffRecruitmentWorkExcel excel, String errorMessage) {
|
||||
RecruitmentImportFailureVO failure = new RecruitmentImportFailureVO();
|
||||
BeanUtils.copyProperties(excel, failure);
|
||||
failure.setErrorMessage(errorMessage);
|
||||
return failure;
|
||||
}
|
||||
|
||||
private void appendSkippedFailures(List<CcdiStaffRecruitmentWork> validRecords,
|
||||
Set<String> failedRecruitIds,
|
||||
List<RecruitmentImportFailureVO> failures) {
|
||||
Set<String> appendedRecruitIds = new HashSet<>();
|
||||
for (CcdiStaffRecruitmentWork work : validRecords) {
|
||||
if (failedRecruitIds.contains(work.getRecruitId()) && appendedRecruitIds.add(work.getRecruitId())) {
|
||||
RecruitmentImportFailureVO failure = new RecruitmentImportFailureVO();
|
||||
failure.setRecruitId(work.getRecruitId());
|
||||
failure.setCompanyName(work.getCompanyName());
|
||||
failure.setPositionName(work.getPositionName());
|
||||
failure.setErrorMessage("同一招聘记录编号存在失败行,已跳过该编号下全部工作经历,避免覆盖旧数据");
|
||||
failures.add(failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package com.ruoyi.info.collection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffRecruitment;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffRecruitmentWork;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiStaffRecruitmentQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffRecruitmentWorkExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiStaffRecruitmentVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiStaffRecruitmentWorkVO;
|
||||
import com.ruoyi.info.collection.enums.AdmitStatus;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffRecruitmentWorkMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffRecruitmentMapper;
|
||||
import com.ruoyi.info.collection.service.ICcdiStaffRecruitmentImportService;
|
||||
import com.ruoyi.info.collection.service.ICcdiStaffRecruitmentService;
|
||||
@@ -19,6 +24,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -37,6 +43,9 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
@Resource
|
||||
private CcdiStaffRecruitmentMapper recruitmentMapper;
|
||||
|
||||
@Resource
|
||||
private CcdiStaffRecruitmentWorkMapper recruitmentWorkMapper;
|
||||
|
||||
@Resource
|
||||
private ICcdiStaffRecruitmentImportService recruitmentImportService;
|
||||
|
||||
@@ -96,7 +105,7 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
/**
|
||||
* 查询招聘信息详情
|
||||
*
|
||||
* @param recruitId 招聘项目编号
|
||||
* @param recruitId 招聘记录编号
|
||||
* @return 招聘信息VO
|
||||
*/
|
||||
@Override
|
||||
@@ -104,6 +113,7 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
CcdiStaffRecruitmentVO vo = recruitmentMapper.selectRecruitmentById(recruitId);
|
||||
if (vo != null) {
|
||||
vo.setAdmitStatusDesc(AdmitStatus.getDescByCode(vo.getAdmitStatus()));
|
||||
vo.setWorkExperienceList(selectWorkExperienceList(recruitId));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
@@ -117,9 +127,9 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertRecruitment(CcdiStaffRecruitmentAddDTO addDTO) {
|
||||
// 检查招聘项目编号唯一性
|
||||
// 检查招聘记录编号唯一性
|
||||
if (recruitmentMapper.selectById(addDTO.getRecruitId()) != null) {
|
||||
throw new RuntimeException("该招聘项目编号已存在");
|
||||
throw new RuntimeException("该招聘记录编号已存在");
|
||||
}
|
||||
|
||||
CcdiStaffRecruitment recruitment = new CcdiStaffRecruitment();
|
||||
@@ -148,12 +158,15 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
/**
|
||||
* 批量删除招聘信息
|
||||
*
|
||||
* @param recruitIds 需要删除的招聘项目编号
|
||||
* @param recruitIds 需要删除的招聘记录编号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteRecruitmentByIds(String[] recruitIds) {
|
||||
LambdaQueryWrapper<CcdiStaffRecruitmentWork> workWrapper = new LambdaQueryWrapper<>();
|
||||
workWrapper.in(CcdiStaffRecruitmentWork::getRecruitId, List.of(recruitIds));
|
||||
recruitmentWorkMapper.delete(workWrapper);
|
||||
return recruitmentMapper.deleteBatchIds(List.of(recruitIds));
|
||||
}
|
||||
|
||||
@@ -197,4 +210,56 @@ public class CcdiStaffRecruitmentServiceImpl implements ICcdiStaffRecruitmentSer
|
||||
|
||||
return taskId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入招聘记录历史工作经历数据(异步)
|
||||
*
|
||||
* @param excelList Excel实体列表
|
||||
* @return 任务ID
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public String importRecruitmentWork(List<CcdiStaffRecruitmentWorkExcel> excelList) {
|
||||
if (StringUtils.isNull(excelList) || excelList.isEmpty()) {
|
||||
throw new RuntimeException("至少需要一条数据");
|
||||
}
|
||||
|
||||
String taskId = UUID.randomUUID().toString();
|
||||
long startTime = System.currentTimeMillis();
|
||||
String userName = SecurityUtils.getUsername();
|
||||
|
||||
String statusKey = "import:recruitment:" + taskId;
|
||||
Map<String, Object> statusData = new HashMap<>();
|
||||
statusData.put("taskId", taskId);
|
||||
statusData.put("status", "PROCESSING");
|
||||
statusData.put("totalCount", excelList.size());
|
||||
statusData.put("successCount", 0);
|
||||
statusData.put("failureCount", 0);
|
||||
statusData.put("progress", 0);
|
||||
statusData.put("startTime", startTime);
|
||||
statusData.put("message", "正在处理历史工作经历...");
|
||||
|
||||
redisTemplate.opsForHash().putAll(statusKey, statusData);
|
||||
redisTemplate.expire(statusKey, 7, TimeUnit.DAYS);
|
||||
|
||||
recruitmentImportService.importRecruitmentWorkAsync(excelList, taskId, userName);
|
||||
|
||||
return taskId;
|
||||
}
|
||||
|
||||
private List<CcdiStaffRecruitmentWorkVO> selectWorkExperienceList(String recruitId) {
|
||||
LambdaQueryWrapper<CcdiStaffRecruitmentWork> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CcdiStaffRecruitmentWork::getRecruitId, recruitId)
|
||||
.orderByAsc(CcdiStaffRecruitmentWork::getSortOrder)
|
||||
.orderByDesc(CcdiStaffRecruitmentWork::getId);
|
||||
List<CcdiStaffRecruitmentWork> workList = recruitmentWorkMapper.selectList(wrapper);
|
||||
if (workList == null || workList.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return workList.stream().map(work -> {
|
||||
CcdiStaffRecruitmentWorkVO vo = new CcdiStaffRecruitmentWorkVO();
|
||||
BeanUtils.copyProperties(work, vo);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
<result property="posCategory" column="pos_category"/>
|
||||
<result property="posDesc" column="pos_desc"/>
|
||||
<result property="candName" column="cand_name"/>
|
||||
<result property="recruitType" column="recruit_type"/>
|
||||
<result property="candEdu" column="cand_edu"/>
|
||||
<result property="candId" column="cand_id"/>
|
||||
<result property="candSchool" column="cand_school"/>
|
||||
<result property="candMajor" column="cand_major"/>
|
||||
<result property="candGrad" column="cand_grad"/>
|
||||
<result property="admitStatus" column="admit_status"/>
|
||||
<result property="workExperienceCount" column="work_experience_count"/>
|
||||
<result property="interviewerName1" column="interviewer_name1"/>
|
||||
<result property="interviewerId1" column="interviewer_id1"/>
|
||||
<result property="interviewerName2" column="interviewer_name2"/>
|
||||
@@ -31,44 +33,53 @@
|
||||
<!-- 分页查询招聘信息列表 -->
|
||||
<select id="selectRecruitmentPage" resultMap="CcdiStaffRecruitmentVOResult">
|
||||
SELECT
|
||||
recruit_id, recruit_name, pos_name, pos_category, pos_desc,
|
||||
cand_name, cand_edu, cand_id, cand_school, cand_major, cand_grad,
|
||||
admit_status, interviewer_name1, interviewer_id1, interviewer_name2, interviewer_id2,
|
||||
created_by, create_time, updated_by, update_time
|
||||
FROM ccdi_staff_recruitment
|
||||
r.recruit_id, r.recruit_name, r.pos_name, r.pos_category, r.pos_desc,
|
||||
r.cand_name, r.recruit_type, r.cand_edu, r.cand_id, r.cand_school, r.cand_major, r.cand_grad,
|
||||
r.admit_status, COALESCE(w.work_experience_count, 0) AS work_experience_count,
|
||||
r.interviewer_name1, r.interviewer_id1, r.interviewer_name2, r.interviewer_id2,
|
||||
r.created_by, r.create_time, r.updated_by, r.update_time
|
||||
FROM ccdi_staff_recruitment r
|
||||
LEFT JOIN (
|
||||
SELECT recruit_id, COUNT(1) AS work_experience_count
|
||||
FROM ccdi_staff_recruitment_work
|
||||
GROUP BY recruit_id
|
||||
) w ON w.recruit_id = r.recruit_id
|
||||
<where>
|
||||
<if test="query.recruitName != null and query.recruitName != ''">
|
||||
AND recruit_name LIKE CONCAT('%', #{query.recruitName}, '%')
|
||||
AND r.recruit_name LIKE CONCAT('%', #{query.recruitName}, '%')
|
||||
</if>
|
||||
<if test="query.posName != null and query.posName != ''">
|
||||
AND pos_name LIKE CONCAT('%', #{query.posName}, '%')
|
||||
AND r.pos_name LIKE CONCAT('%', #{query.posName}, '%')
|
||||
</if>
|
||||
<if test="query.candName != null and query.candName != ''">
|
||||
AND cand_name LIKE CONCAT('%', #{query.candName}, '%')
|
||||
AND r.cand_name LIKE CONCAT('%', #{query.candName}, '%')
|
||||
</if>
|
||||
<if test="query.recruitType != null and query.recruitType != ''">
|
||||
AND r.recruit_type = #{query.recruitType}
|
||||
</if>
|
||||
<if test="query.candId != null and query.candId != ''">
|
||||
AND cand_id = #{query.candId}
|
||||
AND r.cand_id = #{query.candId}
|
||||
</if>
|
||||
<if test="query.admitStatus != null and query.admitStatus != ''">
|
||||
AND admit_status = #{query.admitStatus}
|
||||
AND r.admit_status = #{query.admitStatus}
|
||||
</if>
|
||||
<if test="query.interviewerName != null and query.interviewerName != ''">
|
||||
AND (interviewer_name1 LIKE CONCAT('%', #{query.interviewerName}, '%')
|
||||
OR interviewer_name2 LIKE CONCAT('%', #{query.interviewerName}, '%'))
|
||||
AND (r.interviewer_name1 LIKE CONCAT('%', #{query.interviewerName}, '%')
|
||||
OR r.interviewer_name2 LIKE CONCAT('%', #{query.interviewerName}, '%'))
|
||||
</if>
|
||||
<if test="query.interviewerId != null and query.interviewerId != ''">
|
||||
AND (interviewer_id1 = #{query.interviewerId}
|
||||
OR interviewer_id2 = #{query.interviewerId})
|
||||
AND (r.interviewer_id1 = #{query.interviewerId}
|
||||
OR r.interviewer_id2 = #{query.interviewerId})
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
ORDER BY r.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询招聘信息详情 -->
|
||||
<select id="selectRecruitmentById" resultMap="CcdiStaffRecruitmentVOResult">
|
||||
SELECT
|
||||
recruit_id, recruit_name, pos_name, pos_category, pos_desc,
|
||||
cand_name, cand_edu, cand_id, cand_school, cand_major, cand_grad,
|
||||
cand_name, recruit_type, cand_edu, cand_id, cand_school, cand_major, cand_grad,
|
||||
admit_status, interviewer_name1, interviewer_id1, interviewer_name2, interviewer_id2,
|
||||
created_by, create_time, updated_by, update_time
|
||||
FROM ccdi_staff_recruitment
|
||||
@@ -79,13 +90,13 @@
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO ccdi_staff_recruitment
|
||||
(recruit_id, recruit_name, pos_name, pos_category, pos_desc,
|
||||
cand_name, cand_edu, cand_id, cand_school, cand_major, cand_grad,
|
||||
cand_name, recruit_type, cand_edu, cand_id, cand_school, cand_major, cand_grad,
|
||||
admit_status, interviewer_name1, interviewer_id1, interviewer_name2, interviewer_id2,
|
||||
created_by, create_time, updated_by, update_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.recruitId}, #{item.recruitName}, #{item.posName}, #{item.posCategory}, #{item.posDesc},
|
||||
#{item.candName}, #{item.candEdu}, #{item.candId}, #{item.candSchool}, #{item.candMajor}, #{item.candGrad},
|
||||
#{item.candName}, #{item.recruitType}, #{item.candEdu}, #{item.candId}, #{item.candSchool}, #{item.candMajor}, #{item.candGrad},
|
||||
#{item.admitStatus}, #{item.interviewerName1}, #{item.interviewerId1}, #{item.interviewerName2}, #{item.interviewerId2},
|
||||
#{item.createdBy}, NOW(), #{item.updatedBy}, NOW())
|
||||
</foreach>
|
||||
@@ -100,6 +111,7 @@
|
||||
pos_category = #{item.posCategory},
|
||||
pos_desc = #{item.posDesc},
|
||||
cand_name = #{item.candName},
|
||||
recruit_type = #{item.recruitType},
|
||||
cand_edu = #{item.candEdu},
|
||||
cand_id = #{item.candId},
|
||||
cand_school = #{item.candSchool},
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# 员工招聘功能自验收清单
|
||||
|
||||
验收日期:2026-04-20
|
||||
|
||||
## 验收范围
|
||||
|
||||
本次自验收覆盖员工招聘页面与接口联动所需的前后端能力,包括招聘类型、候选人历史工作经历、工作经历单独导入、详情/编辑页展示顺序、面试官字段展示一致性,以及基于现有招聘数据补充联调样例数据。
|
||||
|
||||
## 前端页面
|
||||
|
||||
- [x] 查询条件保持原有结构,仅新增“招聘类型”筛选项。
|
||||
- [x] 顶部操作区包含“新增”“导入”“导入工作经历”“导出”。
|
||||
- [x] 列表列按最新口径展示:招聘记录编号、招聘项目名称、职位名称、候选人姓名、录用情况、学历 / 毕业学校、招聘类型、历史工作经历、操作。
|
||||
- [x] 列表“操作”列包含“详情”“编辑”“删除”按钮。
|
||||
- [x] 招聘项目名称列已加宽,长名称不再只显示为“办结”一类截断残片。
|
||||
- [x] “学历 / 毕业学校”在列表合并展示,详情/编辑中仍保留学历、毕业院校、毕业年月、专业等候选人基础字段。
|
||||
- [x] 详情页模块顺序为:招聘岗位信息、录用情况、候选人情况、候选人历史工作经历、面试官信息。
|
||||
- [x] 编辑页模块顺序与详情页保持一致:招聘岗位信息、录用情况、候选人情况、面试官信息。
|
||||
- [x] 详情页“面试官信息”统一按四个字段展示:面试官1姓名、面试官1工号、面试官2姓名、面试官2工号。
|
||||
- [x] 详情页不再展示重复的“社招工作经历摘要”,只保留“候选人历史工作经历”。
|
||||
- [x] 工作经历导入使用独立入口、独立模板、独立上传接口。
|
||||
|
||||
## 后端接口与数据结构
|
||||
|
||||
- [x] 主表 `ccdi_staff_recruitment` 保留原有创建/更新人员字段命名,不改动既有审计字段口径。
|
||||
- [x] 主表新增 `recruit_type`,用于区分社招、校招。
|
||||
- [x] 历史工作经历使用独立表 `ccdi_staff_recruitment_work`,不把工作经历摘要字段放入主表。
|
||||
- [x] 列表查询聚合返回历史工作经历段数,避免前端列表加载完整经历明细。
|
||||
- [x] 详情查询返回完整历史工作经历列表。
|
||||
- [x] 删除招聘记录时同步删除对应历史工作经历。
|
||||
- [x] 工作经历导入以招聘记录编号为唯一匹配依据。
|
||||
- [x] 工作经历导入时,候选人姓名、招聘项目名称、职位名称仅用于人工核对和导入校验。
|
||||
- [x] 工作经历导入时,三个辅助字段与主表不一致则禁止导入。
|
||||
- [x] 工作经历导入只允许社招记录导入,校招记录禁止导入。
|
||||
- [x] 同一个招聘记录编号在工作经历导入文件中任意一行失败时,该招聘记录编号下本次所有工作经历均不覆盖入库。
|
||||
|
||||
## 数据库与联调样例数据
|
||||
|
||||
- [x] 已补充数据库迁移脚本:`sql/migration/2026-04-15-add-staff-recruitment-social-work-summary.sql`。
|
||||
- [x] 已补充现有数据联调样例脚本:`sql/migration/2026-04-20-seed-staff-recruitment-work-existing-data.sql`。
|
||||
- [x] 样例脚本不改动已有招聘项目名称、职位名称、候选人姓名、录用情况、面试官等原始业务信息。
|
||||
- [x] 样例脚本只在招聘类型为空时补充 `recruit_type`,并生成带标记的历史工作经历样例。
|
||||
- [x] 数据库验证结果:`SOCIAL = 4646`,`CAMPUS = 1355`。
|
||||
- [x] 数据库验证结果:已生成历史工作经历样例 `25` 条,覆盖社招招聘记录 `20` 条。
|
||||
|
||||
## 构建与验证
|
||||
|
||||
- [x] 后端编译通过:`mvn -pl ccdi-info-collection -am compile -DskipTests`。
|
||||
- [x] 前端生产构建通过:`npm run build:prod`。
|
||||
- [x] 前端构建仅存在体积提示类 warning,未出现编译错误。
|
||||
- [x] 前端预览截图已生成,覆盖列表、工作经历导入、详情面试官展示。
|
||||
- [x] 验证过程中启动的前端预览进程已停止,未保留 8088 端口监听。
|
||||
|
||||
## 预览截图
|
||||
|
||||
- 列表页:`C:\Users\20696\codex-preview\staff-recruitment-work-import-list.png`
|
||||
- 工作经历导入弹窗:`C:\Users\20696\codex-preview\staff-recruitment-work-import-dialog.png`
|
||||
- 详情页面试官四字段展示:`C:\Users\20696\codex-preview\staff-recruitment-detail-interviewer-separated.png`
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 当前机器无法通过 `bin/mysql_utf8_exec.sh` 调用 MySQL 客户端执行中文 SQL,实际数据库脚本执行采用本地 Maven 缓存中的 MySQL JDBC 驱动,并显式设置 `utf8mb4` 会话字符集。
|
||||
- 列表默认第一页如果主要是校招记录,“历史工作经历”可能显示为 `-`;筛选“社招”后可看到已补充的工作经历段数。
|
||||
- 仓库中存在与本次招聘功能无关的未跟踪 `docx` 文件,本次未处理、未纳入验收范围。
|
||||
@@ -9,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login', '/register', '/prototype/account-library']
|
||||
const whiteList = ['/login', '/register', '/prototype/account-library', '/prototype/staff-recruitment']
|
||||
|
||||
const isWhiteList = (path) => {
|
||||
return whiteList.some(pattern => isPathMatch(pattern, path))
|
||||
|
||||
@@ -85,6 +85,13 @@ export const constantRoutes = [
|
||||
hidden: true,
|
||||
meta: { title: '账户库管理原型', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'prototype/staff-recruitment',
|
||||
component: () => import('@/views/ccdiStaffRecruitment/index'),
|
||||
name: 'StaffRecruitmentPrototype',
|
||||
hidden: true,
|
||||
meta: { title: '招聘信息预览', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'ccdiAccountInfo',
|
||||
component: () => import('@/views/ccdiAccountInfo/index'),
|
||||
|
||||
@@ -44,6 +44,16 @@
|
||||
<el-option label="放弃" value="放弃" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="招聘类型" prop="recruitType">
|
||||
<el-select v-model="queryParams.recruitType" placeholder="请选择招聘类型" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="item in recruitTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -53,6 +63,15 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
@@ -63,6 +82,15 @@
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
>导入</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
@@ -73,6 +101,34 @@
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
size="mini"
|
||||
@click="handleWorkImport"
|
||||
>导入工作经历</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
size="mini"
|
||||
@click="handleWorkImport"
|
||||
v-hasPermi="['ccdi:staffRecruitment:import']"
|
||||
>导入工作经历</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@@ -100,13 +156,10 @@
|
||||
|
||||
<el-table v-loading="loading" :data="recruitmentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="招聘项目编号" align="center" prop="recruitId" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="招聘项目名称" align="center" prop="recruitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="招聘记录编号" align="center" prop="recruitId" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="招聘项目名称" align="center" prop="recruitName" min-width="220" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="职位名称" align="center" prop="posName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="候选人姓名" align="center" prop="candName" width="120"/>
|
||||
<el-table-column label="证件号码" align="center" prop="candId" width="180"/>
|
||||
<el-table-column label="毕业院校" align="center" prop="candSchool" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="专业" align="center" prop="candMajor" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="录用情况" align="center" prop="admitStatus" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.admitStatus === '录用'" type="success" size="small">录用</el-tag>
|
||||
@@ -114,14 +167,34 @@
|
||||
<el-tag v-else type="warning" size="small">放弃</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column label="学历 / 毕业学校" align="center" min-width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ formatEducationSchool(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="招聘类型" align="center" prop="recruitType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.recruitType === 'SOCIAL' ? 'success' : 'info'" size="small">
|
||||
{{ formatRecruitType(scope.row.recruitType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="历史工作经历" align="center" prop="workExperienceCount" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ formatWorkExperienceCount(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@@ -129,6 +202,14 @@
|
||||
v-hasPermi="['ccdi:staffRecruitment:query']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@@ -136,6 +217,14 @@
|
||||
v-hasPermi="['ccdi:staffRecruitment:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-if="isPreviewMode()"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@@ -157,11 +246,11 @@
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-divider content-position="left">招聘项目信息</el-divider>
|
||||
<el-divider content-position="left">招聘岗位信息</el-divider>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招聘项目编号" prop="recruitId">
|
||||
<el-input v-model="form.recruitId" placeholder="请输入招聘项目编号" maxlength="32" :disabled="!isAdd" />
|
||||
<el-form-item label="招聘记录编号" prop="recruitId">
|
||||
<el-input v-model="form.recruitId" placeholder="请输入招聘记录编号" maxlength="32" :disabled="!isAdd" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -171,7 +260,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">职位信息</el-divider>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职位名称" prop="posName">
|
||||
@@ -188,18 +276,43 @@
|
||||
<el-input v-model="form.posDesc" type="textarea" :rows="3" placeholder="请输入职位描述" />
|
||||
</el-form-item>
|
||||
|
||||
<el-divider content-position="left">候选人信息</el-divider>
|
||||
<el-divider content-position="left">录用情况</el-divider>
|
||||
<el-form-item label="录用情况" prop="admitStatus">
|
||||
<el-radio-group v-model="form.admitStatus">
|
||||
<el-radio label="录用">录用</el-radio>
|
||||
<el-radio label="未录用">未录用</el-radio>
|
||||
<el-radio label="放弃">放弃</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider content-position="left">候选人情况</el-divider>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="候选人姓名" prop="candName">
|
||||
<el-input v-model="form.candName" placeholder="请输入候选人姓名" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招聘类型" prop="recruitType">
|
||||
<el-radio-group v-model="form.recruitType">
|
||||
<el-radio
|
||||
v-for="item in recruitTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="candEdu">
|
||||
<el-input v-model="form.candEdu" placeholder="请输入学历" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12"></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
@@ -226,15 +339,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">录用信息</el-divider>
|
||||
<el-form-item label="录用情况" prop="admitStatus">
|
||||
<el-radio-group v-model="form.admitStatus">
|
||||
<el-radio label="录用">录用</el-radio>
|
||||
<el-radio label="未录用">未录用</el-radio>
|
||||
<el-radio label="放弃">放弃</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider content-position="left">面试官信息</el-divider>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
@@ -270,30 +374,16 @@
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog title="招聘信息详情" :visible.sync="detailOpen" width="900px" append-to-body>
|
||||
<div class="detail-container">
|
||||
<el-divider content-position="left">招聘项目信息</el-divider>
|
||||
<el-divider content-position="left">招聘岗位信息</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="招聘项目编号">{{ recruitmentDetail.recruitId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="招聘记录编号">{{ recruitmentDetail.recruitId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="招聘项目名称">{{ recruitmentDetail.recruitName || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-divider content-position="left">职位信息</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="职位名称">{{ recruitmentDetail.posName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="职位类别">{{ recruitmentDetail.posCategory || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="职位描述" :span="2">{{ recruitmentDetail.posDesc || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-divider content-position="left">候选人信息</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="候选人姓名">{{ recruitmentDetail.candName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学历">{{ recruitmentDetail.candEdu || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="证件号码">{{ recruitmentDetail.candId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业年月">{{ recruitmentDetail.candGrad || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业院校">{{ recruitmentDetail.candSchool || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ recruitmentDetail.candMajor || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-divider content-position="left">录用信息</el-divider>
|
||||
<el-divider content-position="left">录用情况</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="录用情况">
|
||||
<el-tag v-if="recruitmentDetail.admitStatus === '录用'" type="success" size="small">录用</el-tag>
|
||||
@@ -302,18 +392,48 @@
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-divider content-position="left">候选人情况</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="候选人姓名">{{ recruitmentDetail.candName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="招聘类型">{{ formatRecruitType(recruitmentDetail.recruitType) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学历">{{ recruitmentDetail.candEdu || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="证件号码">{{ recruitmentDetail.candId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业年月">{{ recruitmentDetail.candGrad || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业院校">{{ recruitmentDetail.candSchool || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ recruitmentDetail.candMajor || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<template v-if="isSocialRecruitment(recruitmentDetail)">
|
||||
<el-divider content-position="left">候选人历史工作经历</el-divider>
|
||||
<el-table
|
||||
v-if="recruitmentDetail.workExperienceList && recruitmentDetail.workExperienceList.length"
|
||||
:data="recruitmentDetail.workExperienceList"
|
||||
border
|
||||
>
|
||||
<el-table-column label="序号" align="center" prop="sortOrder" width="80" />
|
||||
<el-table-column label="工作单位" align="center" prop="companyName" min-width="180" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="岗位" align="center" prop="positionName" min-width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="任职时间" align="center" min-width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ getEmploymentPeriod(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="离职原因" align="center" prop="departureReason" min-width="220" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
<el-empty
|
||||
v-else
|
||||
description="暂无历史工作经历"
|
||||
:image-size="72"
|
||||
class="work-experience-empty"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<el-divider content-position="left">面试官信息</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="面试官1">{{ recruitmentDetail.interviewerName1 || '-' }} ({{ recruitmentDetail.interviewerId1 || '-' }})</el-descriptions-item>
|
||||
<el-descriptions-item label="面试官2">{{ recruitmentDetail.interviewerName2 || '-' }} ({{ recruitmentDetail.interviewerId2 || '-' }})</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ recruitmentDetail.createTime ? parseTime(recruitmentDetail.createTime) : '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建人">{{ recruitmentDetail.createdBy || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">
|
||||
{{ recruitmentDetail.updateTime ? parseTime(recruitmentDetail.updateTime) : '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="更新人">{{ recruitmentDetail.updatedBy || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="面试官1姓名">{{ recruitmentDetail.interviewerName1 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="面试官1工号">{{ recruitmentDetail.interviewerId1 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="面试官2姓名">{{ recruitmentDetail.interviewerName2 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="面试官2工号">{{ recruitmentDetail.interviewerId2 || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -341,7 +461,7 @@
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<span>仅允许导入"xls"或"xlsx"格式文件。</span>
|
||||
<span>{{ upload.tip }}</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -374,11 +494,33 @@
|
||||
/>
|
||||
|
||||
<el-table :data="failureList" v-loading="failureLoading">
|
||||
<el-table-column label="招聘项目编号" prop="recruitId" align="center" width="150" />
|
||||
<el-table-column label="招聘记录编号" prop="recruitId" align="center" width="150" />
|
||||
<el-table-column label="招聘项目名称" prop="recruitName" align="center" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="职位名称" prop="posName" align="center" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="候选人姓名" prop="candName" align="center" width="120"/>
|
||||
<el-table-column label="证件号码" prop="candId" align="center" width="180"/>
|
||||
<el-table-column
|
||||
v-if="currentImportType !== 'work'"
|
||||
label="证件号码"
|
||||
prop="candId"
|
||||
align="center"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="currentImportType === 'work'"
|
||||
label="工作单位"
|
||||
prop="companyName"
|
||||
align="center"
|
||||
min-width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="currentImportType === 'work'"
|
||||
label="岗位"
|
||||
prop="positionName"
|
||||
align="center"
|
||||
min-width="140"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="失败原因" prop="errorMessage" align="center" min-width="200"
|
||||
:show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
@@ -416,6 +558,109 @@ import ImportResultDialog from "@/components/ImportResultDialog.vue";
|
||||
const idCardPattern = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/;
|
||||
// 毕业年月校验正则 (YYYYMM)
|
||||
const gradPattern = /^((19|20)\d{2})(0[1-9]|1[0-2])$/;
|
||||
const previewRecruitmentList = [
|
||||
{
|
||||
recruitId: "RC2025001205",
|
||||
recruitName: "2024年社会招聘-技术部",
|
||||
posName: "Java开发工程师",
|
||||
posCategory: "技术研发",
|
||||
posDesc: "负责核心业务系统设计、开发与维护。",
|
||||
candName: "杨丽思思",
|
||||
recruitType: "SOCIAL",
|
||||
candEdu: "本科",
|
||||
candId: "330101199403150021",
|
||||
candSchool: "四川大学",
|
||||
candMajor: "法学",
|
||||
candGrad: "202110",
|
||||
admitStatus: "录用",
|
||||
workExperienceCount: 2,
|
||||
interviewerName1: "陈志远",
|
||||
interviewerId1: "I0001",
|
||||
interviewerName2: "王晨",
|
||||
interviewerId2: "I0002",
|
||||
createdBy: "admin",
|
||||
updatedBy: "admin",
|
||||
createTime: "2026-04-15 09:00:00",
|
||||
updateTime: "2026-04-15 09:20:00",
|
||||
workExperienceList: [
|
||||
{
|
||||
sortOrder: 1,
|
||||
companyName: "杭州数联科技有限公司",
|
||||
positionName: "Java开发工程师",
|
||||
jobStartMonth: "2022-07",
|
||||
jobEndMonth: "2024-12",
|
||||
departureReason: "个人职业发展需要,期望参与更大规模系统建设"
|
||||
},
|
||||
{
|
||||
sortOrder: 2,
|
||||
companyName: "成都云启信息技术有限公司",
|
||||
positionName: "初级开发工程师",
|
||||
jobStartMonth: "2021-07",
|
||||
jobEndMonth: "2022-06",
|
||||
departureReason: "项目阶段结束后选择新的发展机会"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
recruitId: "RC2025001206",
|
||||
recruitName: "2024年社会招聘-技术部",
|
||||
posName: "数据分析师",
|
||||
posCategory: "数据分析",
|
||||
posDesc: "负责经营分析、指标体系建设与专题分析。",
|
||||
candName: "罗军晓东",
|
||||
recruitType: "SOCIAL",
|
||||
candEdu: "本科",
|
||||
candId: "420106199603120018",
|
||||
candSchool: "华中科技大学",
|
||||
candMajor: "软件工程",
|
||||
candGrad: "202003",
|
||||
admitStatus: "录用",
|
||||
workExperienceCount: 1,
|
||||
interviewerName1: "李倩",
|
||||
interviewerId1: "I0003",
|
||||
interviewerName2: "周腾",
|
||||
interviewerId2: "I0004",
|
||||
createdBy: "admin",
|
||||
updatedBy: "admin",
|
||||
createTime: "2026-04-15 09:05:00",
|
||||
updateTime: "2026-04-15 09:25:00",
|
||||
workExperienceList: [
|
||||
{
|
||||
sortOrder: 1,
|
||||
companyName: "上海明策数据服务有限公司",
|
||||
positionName: "数据分析师",
|
||||
jobStartMonth: "2021-03",
|
||||
jobEndMonth: "2025-01",
|
||||
departureReason: "期望转向更深入的数据建模分析工作"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
recruitId: "RC2025001003",
|
||||
recruitName: "2024年春季校园招聘",
|
||||
posName: "Java开发工程师",
|
||||
posCategory: "技术研发",
|
||||
posDesc: "参与项目需求开发与系统维护。",
|
||||
candName: "黄伟梓萱",
|
||||
recruitType: "CAMPUS",
|
||||
candEdu: "本科",
|
||||
candId: "440105200001018888",
|
||||
candSchool: "中山大学",
|
||||
candMajor: "建筑学",
|
||||
candGrad: "202108",
|
||||
admitStatus: "录用",
|
||||
workExperienceCount: 0,
|
||||
interviewerName1: "陈志远",
|
||||
interviewerId1: "I0001",
|
||||
interviewerName2: "王晨",
|
||||
interviewerId2: "I0002",
|
||||
createdBy: "admin",
|
||||
updatedBy: "admin",
|
||||
createTime: "2026-04-15 09:10:00",
|
||||
updateTime: "2026-04-15 09:30:00",
|
||||
workExperienceList: []
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
name: "StaffRecruitment",
|
||||
@@ -436,6 +681,10 @@ export default {
|
||||
total: 0,
|
||||
// 招聘信息表格数据
|
||||
recruitmentList: [],
|
||||
recruitTypeOptions: [
|
||||
{ value: "SOCIAL", label: "社招" },
|
||||
{ value: "CAMPUS", label: "校招" }
|
||||
],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -455,6 +704,7 @@ export default {
|
||||
candName: null,
|
||||
candId: null,
|
||||
admitStatus: null,
|
||||
recruitType: null,
|
||||
interviewerName: null,
|
||||
interviewerId: null
|
||||
},
|
||||
@@ -463,8 +713,8 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
recruitId: [
|
||||
{ required: true, message: "招聘项目编号不能为空", trigger: "blur" },
|
||||
{ max: 32, message: "招聘项目编号长度不能超过32个字符", trigger: "blur" }
|
||||
{ required: true, message: "招聘记录编号不能为空", trigger: "blur" },
|
||||
{ max: 32, message: "招聘记录编号长度不能超过32个字符", trigger: "blur" }
|
||||
],
|
||||
recruitName: [
|
||||
{ required: true, message: "招聘项目名称不能为空", trigger: "blur" },
|
||||
@@ -485,6 +735,9 @@ export default {
|
||||
{ required: true, message: "候选人姓名不能为空", trigger: "blur" },
|
||||
{ max: 20, message: "候选人姓名长度不能超过20个字符", trigger: "blur" }
|
||||
],
|
||||
recruitType: [
|
||||
{ required: true, message: "招聘类型不能为空", trigger: "change" }
|
||||
],
|
||||
candEdu: [
|
||||
{ required: true, message: "学历不能为空", trigger: "blur" },
|
||||
{ max: 20, message: "学历长度不能超过20个字符", trigger: "blur" }
|
||||
@@ -515,6 +768,10 @@ export default {
|
||||
open: false,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 导入类型
|
||||
importType: "recruitment",
|
||||
// 弹窗提示
|
||||
tip: "仅允许导入\"xls\"或\"xlsx\"格式文件。",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
@@ -531,6 +788,8 @@ export default {
|
||||
showFailureButton: false,
|
||||
// 当前导入任务ID
|
||||
currentTaskId: null,
|
||||
// 当前导入类型
|
||||
currentImportType: "recruitment",
|
||||
// 失败记录对话框
|
||||
failureDialogVisible: false,
|
||||
failureList: [],
|
||||
@@ -549,12 +808,16 @@ export default {
|
||||
lastImportInfo() {
|
||||
const savedTask = this.getImportTaskFromStorage();
|
||||
if (savedTask && savedTask.totalCount) {
|
||||
return `导入时间: ${this.parseTime(savedTask.saveTime)} | 总数: ${savedTask.totalCount}条 | 成功: ${savedTask.successCount}条 | 失败: ${savedTask.failureCount}条`;
|
||||
return `导入类型: ${this.getImportTypeLabel(savedTask.importType || 'recruitment')} | 导入时间: ${this.parseTime(savedTask.saveTime)} | 总数: ${savedTask.totalCount}条 | 成功: ${savedTask.successCount}条 | 失败: ${savedTask.failureCount}条`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isPreviewMode()) {
|
||||
this.loadPreviewPage();
|
||||
return;
|
||||
}
|
||||
this.getList();
|
||||
this.restoreImportState(); // 恢复导入状态
|
||||
},
|
||||
@@ -568,6 +831,10 @@ export default {
|
||||
methods: {
|
||||
/** 查询招聘信息列表 */
|
||||
getList() {
|
||||
if (this.isPreviewMode()) {
|
||||
this.loadPreviewList();
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
listStaffRecruitment(this.queryParams).then(response => {
|
||||
this.recruitmentList = response.rows;
|
||||
@@ -589,12 +856,15 @@ export default {
|
||||
posCategory: null,
|
||||
posDesc: null,
|
||||
candName: null,
|
||||
recruitType: "SOCIAL",
|
||||
candEdu: null,
|
||||
candId: null,
|
||||
candSchool: null,
|
||||
candMajor: null,
|
||||
candGrad: null,
|
||||
admitStatus: "录用",
|
||||
workExperienceCount: 0,
|
||||
workExperienceList: [],
|
||||
interviewerName1: null,
|
||||
interviewerId1: null,
|
||||
interviewerName2: null,
|
||||
@@ -629,8 +899,26 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const recruitId = row.recruitId || this.ids[0];
|
||||
if (this.isPreviewMode()) {
|
||||
const target = this.findPreviewRecruitment(recruitId);
|
||||
if (target) {
|
||||
this.form = {
|
||||
...this.form,
|
||||
...target,
|
||||
workExperienceList: this.normalizeWorkExperienceList(target.workExperienceList)
|
||||
};
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改招聘信息";
|
||||
this.isAdd = false;
|
||||
return;
|
||||
}
|
||||
getStaffRecruitment(recruitId).then(response => {
|
||||
this.form = response.data;
|
||||
this.form = {
|
||||
...this.form,
|
||||
...response.data,
|
||||
workExperienceList: this.normalizeWorkExperienceList(response.data && response.data.workExperienceList)
|
||||
};
|
||||
this.open = true;
|
||||
this.title = "修改招聘信息";
|
||||
this.isAdd = false;
|
||||
@@ -639,15 +927,114 @@ export default {
|
||||
/** 详情按钮操作 */
|
||||
handleDetail(row) {
|
||||
const recruitId = row.recruitId;
|
||||
if (this.isPreviewMode()) {
|
||||
const target = this.findPreviewRecruitment(recruitId);
|
||||
if (target) {
|
||||
this.recruitmentDetail = {
|
||||
...target,
|
||||
workExperienceList: this.normalizeWorkExperienceList(target.workExperienceList)
|
||||
};
|
||||
this.detailOpen = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
getStaffRecruitment(recruitId).then(response => {
|
||||
this.recruitmentDetail = response.data;
|
||||
this.recruitmentDetail = {
|
||||
...response.data,
|
||||
workExperienceList: this.normalizeWorkExperienceList(response.data && response.data.workExperienceList)
|
||||
};
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
/** 招聘类型格式化 */
|
||||
formatRecruitType(value) {
|
||||
const matched = this.recruitTypeOptions.find(item => item.value === value);
|
||||
return matched ? matched.label : "-";
|
||||
},
|
||||
/** 学历与毕业学校格式化 */
|
||||
formatEducationSchool(row) {
|
||||
if (!row) {
|
||||
return "-";
|
||||
}
|
||||
const edu = row.candEdu || "-";
|
||||
const school = row.candSchool || "-";
|
||||
return `${edu} / ${school}`;
|
||||
},
|
||||
/** 历史工作经历展示 */
|
||||
formatWorkExperienceCount(row) {
|
||||
if (!row || row.recruitType !== "SOCIAL") {
|
||||
return "-";
|
||||
}
|
||||
const count = Number(row.workExperienceCount || 0);
|
||||
return `${count}段`;
|
||||
},
|
||||
/** 是否为社招 */
|
||||
isSocialRecruitment(row) {
|
||||
return row && row.recruitType === "SOCIAL";
|
||||
},
|
||||
/** 任职时间展示 */
|
||||
getEmploymentPeriod(row) {
|
||||
if (!row) {
|
||||
return "-";
|
||||
}
|
||||
const start = row.jobStartMonth || "-";
|
||||
const end = row.jobEndMonth || "至今";
|
||||
return `${start} ~ ${end}`;
|
||||
},
|
||||
/** 工作经历列表归一化 */
|
||||
normalizeWorkExperienceList(list) {
|
||||
if (!Array.isArray(list)) {
|
||||
return [];
|
||||
}
|
||||
return list.slice().sort((a, b) => {
|
||||
const first = Number(a.sortOrder || 0);
|
||||
const second = Number(b.sortOrder || 0);
|
||||
return first - second;
|
||||
});
|
||||
},
|
||||
/** 是否为预览模式 */
|
||||
isPreviewMode() {
|
||||
return this.$route && this.$route.query && this.$route.query.preview === "1";
|
||||
},
|
||||
/** 加载预览页面 */
|
||||
loadPreviewPage() {
|
||||
this.loadPreviewList();
|
||||
const mode = this.$route.query.mode;
|
||||
const recruitId = this.$route.query.recruitId || "RC2025001205";
|
||||
if (mode === "detail") {
|
||||
this.handleDetail({ recruitId });
|
||||
} else if (mode === "edit") {
|
||||
this.handleUpdate({ recruitId });
|
||||
} else if (mode === "workImport") {
|
||||
this.handleWorkImport();
|
||||
} else if (mode === "import") {
|
||||
this.handleImport();
|
||||
} else if (mode === "add") {
|
||||
this.handleAdd();
|
||||
}
|
||||
},
|
||||
/** 加载预览列表 */
|
||||
loadPreviewList() {
|
||||
this.loading = false;
|
||||
this.recruitmentList = previewRecruitmentList.map(item => ({
|
||||
...item,
|
||||
workExperienceList: this.normalizeWorkExperienceList(item.workExperienceList)
|
||||
}));
|
||||
this.total = this.recruitmentList.length;
|
||||
},
|
||||
/** 查找预览记录 */
|
||||
findPreviewRecruitment(recruitId) {
|
||||
return previewRecruitmentList.find(item => item.recruitId === recruitId) || null;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.isPreviewMode()) {
|
||||
this.$modal.msgSuccess(this.isAdd ? "预览模式:新增成功" : "预览模式:修改成功");
|
||||
this.open = false;
|
||||
return;
|
||||
}
|
||||
if (this.isAdd) {
|
||||
addStaffRecruitment(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
@@ -667,6 +1054,10 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const recruitIds = row.recruitId || this.ids;
|
||||
if (this.isPreviewMode()) {
|
||||
this.$modal.msgSuccess(`预览模式:已模拟删除 ${recruitIds}`);
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('是否确认删除招聘信息编号为"' + recruitIds + '"的数据项?').then(function() {
|
||||
return delStaffRecruitment(recruitIds);
|
||||
}).then(() => {
|
||||
@@ -682,11 +1073,36 @@ export default {
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "招聘信息数据导入";
|
||||
this.openImportDialog("recruitment");
|
||||
},
|
||||
/** 导入工作经历按钮操作 */
|
||||
handleWorkImport() {
|
||||
this.openImportDialog("work");
|
||||
},
|
||||
/** 打开导入弹窗 */
|
||||
openImportDialog(importType) {
|
||||
const isWorkImport = importType === "work";
|
||||
this.upload.importType = importType;
|
||||
this.currentImportType = importType;
|
||||
this.upload.title = isWorkImport ? "历史工作经历数据导入" : "招聘信息数据导入";
|
||||
this.upload.url = process.env.VUE_APP_BASE_API + (isWorkImport
|
||||
? "/ccdi/staffRecruitment/importWorkData"
|
||||
: "/ccdi/staffRecruitment/importData");
|
||||
this.upload.tip = isWorkImport
|
||||
? "仅允许导入\"xls\"或\"xlsx\"格式文件;招聘记录编号用于匹配,姓名/项目/职位用于校验。"
|
||||
: "仅允许导入\"xls\"或\"xlsx\"格式文件。";
|
||||
if (this.isPreviewMode()) {
|
||||
this.upload.open = true;
|
||||
return;
|
||||
}
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
if (this.upload.importType === "work") {
|
||||
this.download('ccdi/staffRecruitment/workImportTemplate', {}, `历史工作经历导入模板_${new Date().getTime()}.xlsx`);
|
||||
return;
|
||||
}
|
||||
this.download('ccdi/staffRecruitment/importTemplate', {}, `招聘信息导入模板_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
// 文件上传中处理
|
||||
@@ -722,17 +1138,19 @@ export default {
|
||||
taskId: taskId,
|
||||
status: 'PROCESSING',
|
||||
timestamp: Date.now(),
|
||||
hasFailures: false
|
||||
hasFailures: false,
|
||||
importType: this.upload.importType
|
||||
});
|
||||
|
||||
// 重置状态
|
||||
this.showFailureButton = false;
|
||||
this.currentTaskId = taskId;
|
||||
this.currentImportType = this.upload.importType;
|
||||
|
||||
// 显示后台处理提示
|
||||
this.$notify({
|
||||
title: '导入任务已提交',
|
||||
message: '正在后台处理中,处理完成后将通知您',
|
||||
message: `${this.getImportTypeLabel(this.upload.importType)}正在后台处理中,处理完成后将通知您`,
|
||||
type: 'info',
|
||||
duration: 3000
|
||||
});
|
||||
@@ -780,14 +1198,15 @@ export default {
|
||||
hasFailures: statusResult.failureCount > 0,
|
||||
totalCount: statusResult.totalCount,
|
||||
successCount: statusResult.successCount,
|
||||
failureCount: statusResult.failureCount
|
||||
failureCount: statusResult.failureCount,
|
||||
importType: this.currentImportType
|
||||
});
|
||||
|
||||
if (statusResult.status === 'SUCCESS') {
|
||||
// 全部成功
|
||||
this.$notify({
|
||||
title: '导入完成',
|
||||
message: `全部成功!共导入${statusResult.totalCount}条数据`,
|
||||
message: `${this.getImportTypeLabel(this.currentImportType)}全部成功!共导入${statusResult.totalCount}条数据`,
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
});
|
||||
@@ -797,7 +1216,7 @@ export default {
|
||||
// 部分失败
|
||||
this.$notify({
|
||||
title: '导入完成',
|
||||
message: `成功${statusResult.successCount}条,失败${statusResult.failureCount}条`,
|
||||
message: `${this.getImportTypeLabel(this.currentImportType)}成功${statusResult.successCount}条,失败${statusResult.failureCount}条`,
|
||||
type: 'warning',
|
||||
duration: 5000
|
||||
});
|
||||
@@ -866,6 +1285,7 @@ export default {
|
||||
// 如果有失败记录,恢复按钮显示
|
||||
if (savedTask.hasFailures && savedTask.taskId) {
|
||||
this.currentTaskId = savedTask.taskId;
|
||||
this.currentImportType = savedTask.importType || "recruitment";
|
||||
this.showFailureButton = true;
|
||||
}
|
||||
},
|
||||
@@ -875,7 +1295,7 @@ export default {
|
||||
if (savedTask && savedTask.saveTime) {
|
||||
const date = new Date(savedTask.saveTime);
|
||||
const timeStr = this.parseTime(date, '{y}-{m}-{d} {h}:{i}');
|
||||
return `上次导入: ${timeStr}`;
|
||||
return `上次${this.getImportTypeLabel(savedTask.importType || 'recruitment')}: ${timeStr}`;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
@@ -954,12 +1374,21 @@ export default {
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
if (this.isPreviewMode()) {
|
||||
this.$modal.msgSuccess(`预览模式:已模拟提交${this.getImportTypeLabel(this.upload.importType)}`);
|
||||
this.upload.open = false;
|
||||
return;
|
||||
}
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
// 关闭导入对话框
|
||||
handleImportDialogClose() {
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
},
|
||||
/** 导入类型展示 */
|
||||
getImportTypeLabel(importType) {
|
||||
return importType === "work" ? "历史工作经历导入" : "招聘信息导入";
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -973,4 +1402,8 @@ export default {
|
||||
.el-divider {
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.work-experience-empty {
|
||||
padding: 24px 0 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
-- 员工招聘:招聘类型与候选人历史工作经历结构变更
|
||||
-- 说明:
|
||||
-- 1. 本脚本对应招聘功能正式表结构变更,需要进入代码仓库作为后续部署、测试和合并依据。
|
||||
-- 2. 当前联调数据库已于 2026-04-20 手工/脚本执行过等价结构变更:
|
||||
-- - ccdi_staff_recruitment 已存在 recruit_type 字段;
|
||||
-- - ccdi_staff_recruitment_work 子表已创建。
|
||||
-- 3. 后续环境执行前请先确认字段和表是否已存在;若已存在,不要重复执行 ALTER ADD COLUMN,避免重复字段报错。
|
||||
-- 4. 本脚本只负责结构与招聘类型基础回填,不包含演示/联调造数。
|
||||
|
||||
ALTER TABLE `ccdi_staff_recruitment`
|
||||
ADD COLUMN `recruit_type` VARCHAR(20) NULL COMMENT '招聘类型:SOCIAL-社招,CAMPUS-校招' AFTER `cand_grad`;
|
||||
|
||||
UPDATE `ccdi_staff_recruitment`
|
||||
SET `recruit_type` = CASE
|
||||
WHEN `recruit_name` LIKE '%校园%' THEN 'CAMPUS'
|
||||
ELSE 'SOCIAL'
|
||||
END
|
||||
WHERE `recruit_type` IS NULL
|
||||
OR `recruit_type` = '';
|
||||
|
||||
ALTER TABLE `ccdi_staff_recruitment`
|
||||
MODIFY COLUMN `recruit_type` VARCHAR(20) NOT NULL COMMENT '招聘类型:SOCIAL-社招,CAMPUS-校招';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ccdi_staff_recruitment_work`
|
||||
(
|
||||
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`recruit_id` VARCHAR(32) NOT NULL COMMENT '关联招聘记录编号',
|
||||
`sort_order` INT NOT NULL DEFAULT 1 COMMENT '排序号,1 表示最近一段经历',
|
||||
`company_name` VARCHAR(200) NOT NULL COMMENT '工作单位',
|
||||
`department_name` VARCHAR(100) DEFAULT NULL COMMENT '所属部门',
|
||||
`position_name` VARCHAR(100) DEFAULT NULL COMMENT '岗位名称',
|
||||
`job_start_month` VARCHAR(7) NOT NULL COMMENT '入职年月,格式 YYYY-MM',
|
||||
`job_end_month` VARCHAR(7) DEFAULT NULL COMMENT '离职年月,格式 YYYY-MM',
|
||||
`departure_reason` VARCHAR(500) DEFAULT NULL COMMENT '离职原因',
|
||||
`work_content` VARCHAR(1000) DEFAULT NULL COMMENT '主要工作内容',
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
`created_by` VARCHAR(20) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_by` VARCHAR(20) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_recruit_id` (`recruit_id`),
|
||||
KEY `idx_recruit_id_sort_order` (`recruit_id`, `sort_order`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='招聘信息历史工作经历表';
|
||||
Reference in New Issue
Block a user