|
@@ -2,10 +2,18 @@ package com.zhongzheng.modules.recruit.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
|
|
+import com.zhongzheng.modules.course.domain.MajorCategory;
|
|
|
|
|
+import com.zhongzheng.modules.recruit.service.IRecruitNeedsService;
|
|
|
|
|
+import com.zhongzheng.modules.recruit.service.IRecruitResumeService;
|
|
|
import com.zhongzheng.modules.recruit.vo.CalendarInterviewVo;
|
|
import com.zhongzheng.modules.recruit.vo.CalendarInterviewVo;
|
|
|
import com.zhongzheng.modules.recruit.vo.DayInterviewVo;
|
|
import com.zhongzheng.modules.recruit.vo.DayInterviewVo;
|
|
|
|
|
+import com.zhongzheng.modules.recruit.vo.RecruitResumeVo;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -33,6 +41,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
@Service
|
|
|
public class RecruitInterviewServiceImpl extends ServiceImpl<RecruitInterviewMapper, RecruitInterview> implements IRecruitInterviewService {
|
|
public class RecruitInterviewServiceImpl extends ServiceImpl<RecruitInterviewMapper, RecruitInterview> implements IRecruitInterviewService {
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IRecruitResumeService iRecruitResumeService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public RecruitInterviewVo queryById(Long interviewId){
|
|
public RecruitInterviewVo queryById(Long interviewId){
|
|
|
RecruitInterview db = this.baseMapper.selectById(interviewId);
|
|
RecruitInterview db = this.baseMapper.selectById(interviewId);
|
|
@@ -79,6 +90,14 @@ public class RecruitInterviewServiceImpl extends ServiceImpl<RecruitInterviewMap
|
|
|
public Boolean insertByAddBo(RecruitInterviewAddBo bo) {
|
|
public Boolean insertByAddBo(RecruitInterviewAddBo bo) {
|
|
|
RecruitInterview add = BeanUtil.toBean(bo, RecruitInterview.class);
|
|
RecruitInterview add = BeanUtil.toBean(bo, RecruitInterview.class);
|
|
|
validEntityBeforeSave(add);
|
|
validEntityBeforeSave(add);
|
|
|
|
|
+ RecruitResumeVo recruitResumeVo = iRecruitResumeService.queryById(bo.getResumeId());
|
|
|
|
|
+ if(checkDelivery(add)){
|
|
|
|
|
+ throw new CustomException("你已投递该岗位");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(recruitResumeVo==null){
|
|
|
|
|
+ throw new CustomException("简历不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ add.setResumeJson(JSONObject.toJSONString(recruitResumeVo));
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
return this.save(add);
|
|
return this.save(add);
|
|
@@ -101,6 +120,17 @@ public class RecruitInterviewServiceImpl extends ServiceImpl<RecruitInterviewMap
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private boolean checkDelivery(RecruitInterview entity) {
|
|
|
|
|
+ RecruitInterview info = getOne(new LambdaQueryWrapper<RecruitInterview>()
|
|
|
|
|
+ .eq(RecruitInterview::getUserId,entity.getUserId())
|
|
|
|
|
+ .eq(RecruitInterview::getNeedsId,entity.getNeedsId())
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (Validator.isNotNull(info)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
if(isValid){
|
|
if(isValid){
|