|
@@ -26,6 +26,7 @@ import org.dromara.main.domain.MainOrder;
|
|
|
import org.dromara.main.domain.MainPosition;
|
|
import org.dromara.main.domain.MainPosition;
|
|
|
import org.dromara.main.domain.MainPostCandidateReview;
|
|
import org.dromara.main.domain.MainPostCandidateReview;
|
|
|
import org.dromara.main.domain.MainBackInterview;
|
|
import org.dromara.main.domain.MainBackInterview;
|
|
|
|
|
+import org.dromara.main.domain.bo.BackgroundCheckFormBo;
|
|
|
import org.dromara.main.domain.bo.MainBackOrderBo;
|
|
import org.dromara.main.domain.bo.MainBackOrderBo;
|
|
|
import org.dromara.main.domain.bo.PortalCheckOrderCreateBo;
|
|
import org.dromara.main.domain.bo.PortalCheckOrderCreateBo;
|
|
|
import org.dromara.main.domain.MainStudent;
|
|
import org.dromara.main.domain.MainStudent;
|
|
@@ -1334,6 +1335,232 @@ public class MainBackOrderServiceImpl implements IMainBackOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 提交背景调查表单(总控填写后提交)
|
|
|
|
|
+ * 将前端表单数据拆分写入 education / experience / review / interview 四张表,
|
|
|
|
|
+ * 并将 record 的 report_status 设为 1(已出具)。
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void submitBackgroundCheckForm(BackgroundCheckFormBo bo) {
|
|
|
|
|
+ // 1. 校验 record 存在
|
|
|
|
|
+ MainBackRecord record = recordMapper.selectById(bo.getRecordId());
|
|
|
|
|
+ if (record == null) {
|
|
|
|
|
+ throw new ServiceException("背调记录不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MainBackCandidate candidate = mainBackCandidateMapper.selectById(record.getCandidateId());
|
|
|
|
|
+ if (candidate == null) {
|
|
|
|
|
+ throw new ServiceException("候选人记录不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ Long studentId = candidate.getStudentId();
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 更新学历信息
|
|
|
|
|
+ saveEducation(studentId, bo);
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 更新工作经历
|
|
|
|
|
+ saveExperience(studentId, bo);
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 更新/创建评价记录
|
|
|
|
|
+ saveReview(candidate, bo);
|
|
|
|
|
+
|
|
|
|
|
+ // 5. 保存访谈记录(先删旧的,再插入新的)
|
|
|
|
|
+ saveInterviews(record, candidate, bo);
|
|
|
|
|
+
|
|
|
|
|
+ // 6. 更新 record 状态为已出具,清除缓存的报告URL
|
|
|
|
|
+ MainBackRecord update = new MainBackRecord();
|
|
|
|
|
+ update.setId(record.getId());
|
|
|
|
|
+ update.setReportStatus(1);
|
|
|
|
|
+ update.setReportUrl(null);
|
|
|
|
|
+ update.setFinishTime(LocalDateTime.now());
|
|
|
|
|
+ recordMapper.updateById(update);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void saveEducation(Long studentId, BackgroundCheckFormBo bo) {
|
|
|
|
|
+ MainStudentEducation education = mainStudentEducationMapper.selectOne(
|
|
|
|
|
+ Wrappers.<MainStudentEducation>lambdaQuery()
|
|
|
|
|
+ .eq(MainStudentEducation::getStudentId, studentId)
|
|
|
|
|
+ .orderByDesc(MainStudentEducation::getCreateTime)
|
|
|
|
|
+ .last("limit 1")
|
|
|
|
|
+ );
|
|
|
|
|
+ if (education == null) {
|
|
|
|
|
+ education = new MainStudentEducation();
|
|
|
|
|
+ education.setStudentId(studentId);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getGradSchool())) {
|
|
|
|
|
+ education.setSchool(bo.getGradSchool());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getEduCertNo())) {
|
|
|
|
|
+ education.setCertNo(bo.getEduCertNo());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getEduVerifyStatus())) {
|
|
|
|
|
+ education.setCheckResult(bo.getEduVerifyStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (education.getId() == null) {
|
|
|
|
|
+ mainStudentEducationMapper.insert(education);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mainStudentEducationMapper.updateById(education);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void saveExperience(Long studentId, BackgroundCheckFormBo bo) {
|
|
|
|
|
+ MainStudentExperience experience = mainStudentExperienceMapper.selectOne(
|
|
|
|
|
+ Wrappers.<MainStudentExperience>lambdaQuery()
|
|
|
|
|
+ .eq(MainStudentExperience::getStudentId, studentId)
|
|
|
|
|
+ .orderByDesc(MainStudentExperience::getCreateTime)
|
|
|
|
|
+ .last("limit 1")
|
|
|
|
|
+ );
|
|
|
|
|
+ if (experience == null) {
|
|
|
|
|
+ experience = new MainStudentExperience();
|
|
|
|
|
+ experience.setStudentId(studentId);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getCompanyName())) {
|
|
|
|
|
+ experience.setCompany(bo.getCompanyName());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (bo.getWorkPeriod() != null && bo.getWorkPeriod().size() >= 2) {
|
|
|
|
|
+ experience.setStartTime(bo.getWorkPeriod().get(0));
|
|
|
|
|
+ experience.setEndTime(bo.getWorkPeriod().get(1));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getPosition())) {
|
|
|
|
|
+ experience.setJobTitle(bo.getPosition());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLastSalary())) {
|
|
|
|
|
+ experience.setLastSalary(bo.getLastSalary());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getAttachment1Remark())) {
|
|
|
|
|
+ experience.setCheckRemark(bo.getAttachment1Remark());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (experience.getId() == null) {
|
|
|
|
|
+ mainStudentExperienceMapper.insert(experience);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mainStudentExperienceMapper.updateById(experience);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void saveReview(MainBackCandidate candidate, BackgroundCheckFormBo bo) {
|
|
|
|
|
+ MainPostCandidateReview review = mainPostCandidateReviewMapper.selectOne(
|
|
|
|
|
+ Wrappers.<MainPostCandidateReview>lambdaQuery()
|
|
|
|
|
+ .eq(MainPostCandidateReview::getCandidateId, candidate.getId())
|
|
|
|
|
+ .last("limit 1")
|
|
|
|
|
+ );
|
|
|
|
|
+ if (review == null) {
|
|
|
|
|
+ review = new MainPostCandidateReview();
|
|
|
|
|
+ review.setCandidateId(candidate.getId());
|
|
|
|
|
+ review.setStudentId(candidate.getStudentId());
|
|
|
|
|
+ review.setPostId(candidate.getPostId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 离职原因核实
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaveReasonVerify())) {
|
|
|
|
|
+ review.setLeaveReason(bo.getLeaveReasonVerify());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 上级评价
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalAdvantage())) {
|
|
|
|
|
+ review.setStrength(bo.getLeaderEvalAdvantage());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalImprove())) {
|
|
|
|
|
+ review.setImprovement(bo.getLeaderEvalImprove());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 能力维度(名称 + 评语)
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalProf())) {
|
|
|
|
|
+ review.setAbilityAName("专业能力");
|
|
|
|
|
+ review.setAbilityARemark(bo.getLeaderEvalProf());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalAttitude())) {
|
|
|
|
|
+ review.setAbilityBName("工作态度");
|
|
|
|
|
+ review.setAbilityBRemark(bo.getLeaderEvalAttitude());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalTeam())) {
|
|
|
|
|
+ review.setAbilityCName("团队协作");
|
|
|
|
|
+ review.setAbilityCRemark(bo.getLeaderEvalTeam());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getLeaderEvalMorals())) {
|
|
|
|
|
+ review.setAbilityDName("职业操守");
|
|
|
|
|
+ review.setAbilityDRemark(bo.getLeaderEvalMorals());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 同事评价
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getColleagueEvalTeamwork())) {
|
|
|
|
|
+ review.setCooperation(bo.getColleagueEvalTeamwork());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getColleagueEvalProf())) {
|
|
|
|
|
+ review.setColleagueAbility(bo.getColleagueEvalProf());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // HR评价
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getHrEvalDispute())) {
|
|
|
|
|
+ review.setViolation(bo.getHrEvalDispute());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getHrEvalTransfer())) {
|
|
|
|
|
+ review.setHandover(bo.getHrEvalTransfer());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getAttachment2Remark())) {
|
|
|
|
|
+ review.setPerformRemark(bo.getAttachment2Remark());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 法务风险
|
|
|
|
|
+ if (bo.getHasNonCompete() != null) {
|
|
|
|
|
+ review.setNonCompeteAgreement(bo.getHasNonCompete() ? 1 : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (bo.getHasNda() != null) {
|
|
|
|
|
+ review.setConfidentialityAgreement(bo.getHasNda() ? 1 : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getAgreementRemark())) {
|
|
|
|
|
+ review.setAgreementRemark(bo.getAgreementRemark());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (bo.getHasDisputeStatus() != null) {
|
|
|
|
|
+ review.setLaborDispute(bo.getHasDisputeStatus() ? 1 : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getDisputeRemark())) {
|
|
|
|
|
+ review.setDisputeRemark(bo.getDisputeRemark());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 调查结论
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getConclusion())) {
|
|
|
|
|
+ review.setConclusionResult(bo.getConclusion());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getConclusionReason())) {
|
|
|
|
|
+ review.setTotalRemark(bo.getConclusionReason());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ review.setReviewStatus("1"); // 已填写
|
|
|
|
|
+
|
|
|
|
|
+ if (review.getId() == null) {
|
|
|
|
|
+ mainPostCandidateReviewMapper.insert(review);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mainPostCandidateReviewMapper.updateById(review);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void saveInterviews(MainBackRecord record, MainBackCandidate candidate, BackgroundCheckFormBo bo) {
|
|
|
|
|
+ // 先删掉该 record 下的旧访谈记录
|
|
|
|
|
+ mainBackInterviewMapper.delete(
|
|
|
|
|
+ Wrappers.<MainBackInterview>lambdaQuery()
|
|
|
|
|
+ .eq(MainBackInterview::getRecordId, record.getId())
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // 逐条插入
|
|
|
|
|
+ BackgroundCheckFormBo.InterviewInfo[] interviews = {
|
|
|
|
|
+ bo.getInterviewSupervisor(), bo.getInterviewHR(), bo.getInterviewColleague()
|
|
|
|
|
+ };
|
|
|
|
|
+ for (BackgroundCheckFormBo.InterviewInfo info : interviews) {
|
|
|
|
|
+ if (info != null && info.hasContent()) {
|
|
|
|
|
+ MainBackInterview interview = new MainBackInterview();
|
|
|
|
|
+ interview.setCandidateId(candidate.getId());
|
|
|
|
|
+ interview.setRecordId(record.getId());
|
|
|
|
|
+ interview.setIntervieweeName(info.getName());
|
|
|
|
|
+ interview.setIntervieweeRelation(info.getRelationship());
|
|
|
|
|
+ interview.setIntervieweeContact(info.getContact());
|
|
|
|
|
+ interview.setQa1(info.getQ1());
|
|
|
|
|
+ interview.setQa2(info.getQ2());
|
|
|
|
|
+ interview.setQa3(info.getQ3());
|
|
|
|
|
+ interview.setQa4(info.getQ4());
|
|
|
|
|
+ interview.setQa5(info.getQ5());
|
|
|
|
|
+ mainBackInterviewMapper.insert(interview);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static class ReportContext {
|
|
private static class ReportContext {
|
|
|
private MainStudent student;
|
|
private MainStudent student;
|
|
|
private MainPostCandidateReview review;
|
|
private MainPostCandidateReview review;
|