邀请面试业务逻辑完善
This commit is contained in:
@@ -2,6 +2,7 @@ package com.vetti.hotake.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeMeetingCalendarInfo;
|
||||
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarVo;
|
||||
|
||||
/**
|
||||
* 会议日历记录主Service接口
|
||||
@@ -67,4 +68,14 @@ public interface IHotakeMeetingCalendarInfoService
|
||||
*/
|
||||
public int batchInsertHotakeMeetingCalendarInfo(List<HotakeMeetingCalendarInfo> hotakeMeetingCalendarInfoList);
|
||||
|
||||
|
||||
/**
|
||||
* 保存会议日历记录
|
||||
*
|
||||
* @param calendarVo 面试邀请信息
|
||||
* @return 结果
|
||||
*/
|
||||
public void saveHotakeMeetingCalendarInfo(HotakeMeetingCalendarVo calendarVo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,16 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.vetti.common.core.domain.entity.SysUser;
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.enums.MeetingCalendarStatus;
|
||||
import com.vetti.common.enums.StageEnum;
|
||||
import com.vetti.hotake.domain.HotakeMeetingCalendarDetail;
|
||||
import com.vetti.hotake.domain.HotakeRolesApplyInfo;
|
||||
import com.vetti.hotake.domain.HotakeRolesInfo;
|
||||
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarInfoVo;
|
||||
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarVo;
|
||||
import com.vetti.hotake.mapper.HotakeMeetingCalendarDetailMapper;
|
||||
import com.vetti.hotake.mapper.HotakeRolesApplyInfoMapper;
|
||||
import com.vetti.hotake.mapper.HotakeRolesInfoMapper;
|
||||
import com.vetti.hotake.service.IHotakeMeetingCalendarDetailService;
|
||||
import com.vetti.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,12 +37,26 @@ import com.vetti.hotake.service.IHotakeMeetingCalendarInfoService;
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implements IHotakeMeetingCalendarInfoService {
|
||||
|
||||
private final String meetingName = "Interview Invitation";
|
||||
|
||||
|
||||
@Autowired
|
||||
private HotakeMeetingCalendarInfoMapper hotakeMeetingCalendarInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private HotakeMeetingCalendarDetailMapper hotakeMeetingCalendarDetailMapper;
|
||||
|
||||
@Autowired
|
||||
private IHotakeMeetingCalendarDetailService calendarDetailService;
|
||||
|
||||
@Autowired
|
||||
private HotakeRolesInfoMapper hotakeRolesInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private HotakeRolesApplyInfoMapper hotakeRolesApplyInfoMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@@ -47,21 +70,42 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
|
||||
@Override
|
||||
public HotakeMeetingCalendarInfo selectHotakeMeetingCalendarInfoById(Long id) {
|
||||
HotakeMeetingCalendarInfo calendarInfo = hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoById(id);
|
||||
|
||||
//查询岗位数据
|
||||
HotakeRolesInfo query = new HotakeRolesInfo();
|
||||
List<HotakeRolesInfo> rolesInfoList = hotakeRolesInfoMapper.selectHotakeRolesInfoList(query);
|
||||
|
||||
//查询岗位数据
|
||||
HotakeRolesApplyInfo queryApply = new HotakeRolesApplyInfo();
|
||||
List<HotakeRolesApplyInfo> applyInfoList = hotakeRolesApplyInfoMapper.selectHotakeRolesApplyInfoList(queryApply);
|
||||
|
||||
//获取对应的参会人员数据
|
||||
HotakeMeetingCalendarDetail queryDetail = new HotakeMeetingCalendarDetail();
|
||||
List<HotakeMeetingCalendarDetail> detailList = calendarDetailService.selectHotakeMeetingCalendarDetailList(queryDetail);
|
||||
if (CollectionUtil.isNotEmpty(detailList)) {
|
||||
|
||||
Map<Long, List<HotakeMeetingCalendarDetail>> mapDetailList = detailList.stream().collect(Collectors.groupingBy(HotakeMeetingCalendarDetail::getMeetingId));
|
||||
SysUser queryUser = new SysUser();
|
||||
List<SysUser> userList = userService.selectUserList(queryUser);
|
||||
List<HotakeMeetingCalendarDetail> calendarDetails = mapDetailList.get(calendarInfo.getId());
|
||||
for (HotakeMeetingCalendarDetail detail : calendarDetails) {
|
||||
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getUserId()).collect(Collectors.toList());
|
||||
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getCandidateId()).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(users)) {
|
||||
detail.setUser(users.get(0));
|
||||
detail.setCandidateUser(users.get(0));
|
||||
}
|
||||
}
|
||||
calendarInfo.setCalendarDetails(calendarDetails);
|
||||
//返回岗位数据信息
|
||||
//返回岗位数据信息
|
||||
List<HotakeRolesApplyInfo> applyInfos = applyInfoList.stream().filter(e->e.getId().longValue() == calendarInfo.getRoleApplyId().longValue()).toList();
|
||||
if(CollectionUtil.isNotEmpty(applyInfos)) {
|
||||
HotakeRolesApplyInfo applyInfo = applyInfos.get(0);
|
||||
List<HotakeRolesInfo> rolesInfos = rolesInfoList.stream().filter(e->e.getId().longValue() == applyInfo.getRoleId().longValue()).toList();
|
||||
if(CollectionUtil.isNotEmpty(rolesInfos)) {
|
||||
HotakeRolesInfo rolesInfo = rolesInfos.get(0);
|
||||
calendarInfo.setRolesInfo(rolesInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return calendarInfo;
|
||||
}
|
||||
@@ -77,6 +121,13 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
|
||||
public List<HotakeMeetingCalendarInfo> selectHotakeMeetingCalendarInfoList(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo) {
|
||||
List<HotakeMeetingCalendarInfo> calendarInfos = hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoList(hotakeMeetingCalendarInfo);
|
||||
if (CollectionUtil.isNotEmpty(calendarInfos)) {
|
||||
//查询岗位数据
|
||||
HotakeRolesInfo query = new HotakeRolesInfo();
|
||||
List<HotakeRolesInfo> rolesInfoList = hotakeRolesInfoMapper.selectHotakeRolesInfoList(query);
|
||||
|
||||
//查询岗位数据
|
||||
HotakeRolesApplyInfo queryApply = new HotakeRolesApplyInfo();
|
||||
List<HotakeRolesApplyInfo> applyInfoList = hotakeRolesApplyInfoMapper.selectHotakeRolesApplyInfoList(queryApply);
|
||||
//获取对应的参会人员数据
|
||||
HotakeMeetingCalendarDetail queryDetail = new HotakeMeetingCalendarDetail();
|
||||
List<HotakeMeetingCalendarDetail> detailList = calendarDetailService.selectHotakeMeetingCalendarDetailList(queryDetail);
|
||||
@@ -87,12 +138,22 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
|
||||
for (HotakeMeetingCalendarInfo calendarInfo : calendarInfos) {
|
||||
List<HotakeMeetingCalendarDetail> calendarDetails = mapDetailList.get(calendarInfo.getId());
|
||||
for (HotakeMeetingCalendarDetail detail : calendarDetails) {
|
||||
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getUserId()).collect(Collectors.toList());
|
||||
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getCandidateId()).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(users)) {
|
||||
detail.setUser(users.get(0));
|
||||
detail.setCandidateUser(users.get(0));
|
||||
}
|
||||
}
|
||||
calendarInfo.setCalendarDetails(calendarDetails);
|
||||
//返回岗位数据信息
|
||||
List<HotakeRolesApplyInfo> applyInfos = applyInfoList.stream().filter(e->e.getId().longValue() == calendarInfo.getRoleApplyId().longValue()).toList();
|
||||
if(CollectionUtil.isNotEmpty(applyInfos)) {
|
||||
HotakeRolesApplyInfo applyInfo = applyInfos.get(0);
|
||||
List<HotakeRolesInfo> rolesInfos = rolesInfoList.stream().filter(e->e.getId().longValue() == applyInfo.getRoleId().longValue()).toList();
|
||||
if(CollectionUtil.isNotEmpty(rolesInfos)) {
|
||||
HotakeRolesInfo rolesInfo = rolesInfos.get(0);
|
||||
calendarInfo.setRolesInfo(rolesInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,7 +171,6 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
|
||||
public HotakeMeetingCalendarInfo insertHotakeMeetingCalendarInfo(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo) {
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeMeetingCalendarInfo);
|
||||
hotakeMeetingCalendarInfoMapper.insertHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfo);
|
||||
|
||||
//保存参会人员
|
||||
//1.1 先删除对应的参会人员
|
||||
calendarDetailService.deleteHotakeMeetingCalendarDetailByInfoId(hotakeMeetingCalendarInfo.getId());
|
||||
@@ -182,4 +242,41 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
|
||||
public int batchInsertHotakeMeetingCalendarInfo(List<HotakeMeetingCalendarInfo> hotakeMeetingCalendarInfoList) {
|
||||
return hotakeMeetingCalendarInfoMapper.batchInsertHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存会议日历记录
|
||||
* @param calendarVo 面试邀请信息
|
||||
*/
|
||||
@Override
|
||||
public void saveHotakeMeetingCalendarInfo(HotakeMeetingCalendarVo calendarVo) {
|
||||
//保存面试邀请数据
|
||||
if(CollectionUtil.isNotEmpty(calendarVo.getCalendarInfoVoList())){
|
||||
for(HotakeMeetingCalendarInfoVo calendarInfoVo : calendarVo.getCalendarInfoVoList()){
|
||||
HotakeMeetingCalendarInfo calendarInfo = new HotakeMeetingCalendarInfo();
|
||||
calendarInfo.setRoleApplyId(calendarVo.getRoleApplyId());
|
||||
calendarInfo.setRecruiterId(calendarVo.getRecruiterId());
|
||||
calendarInfo.setMeetingDate(calendarInfoVo.getMeetingDate());
|
||||
calendarInfo.setTimes(calendarInfoVo.getTimes());
|
||||
calendarInfo.setMessageVia(calendarInfoVo.getMessageVia());
|
||||
calendarInfo.setStatus(MeetingCalendarStatus.NORMAL.getCode());
|
||||
calendarInfo.setMeetingName(meetingName);
|
||||
//保存主表数据
|
||||
fill(FillTypeEnum.INSERT.getCode(), calendarInfo);
|
||||
insertHotakeMeetingCalendarInfo(calendarInfo);
|
||||
//保存明细数据
|
||||
HotakeMeetingCalendarDetail hotakeMeetingCalendarDetail = new HotakeMeetingCalendarDetail();
|
||||
hotakeMeetingCalendarDetail.setMeetingId(calendarInfo.getId());
|
||||
hotakeMeetingCalendarDetail.setCandidateId(calendarInfoVo.getCandidateId());
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeMeetingCalendarDetail);
|
||||
hotakeMeetingCalendarDetailMapper.insertHotakeMeetingCalendarDetail(hotakeMeetingCalendarDetail);
|
||||
|
||||
//更新申请岗位状态
|
||||
HotakeRolesApplyInfo applyInfo = new HotakeRolesApplyInfo();
|
||||
applyInfo.setId(calendarVo.getRoleApplyId());
|
||||
applyInfo.setStage(StageEnum.INTERVIEW.getCode());
|
||||
hotakeRolesApplyInfoMapper.updateHotakeRolesApplyInfo(applyInfo);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,11 @@ public class HotakeRolesApplyInfoServiceImpl extends BaseServiceImpl implements
|
||||
applyInfo.setRolesInfo(rolesInfo);
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(applyInfo.getCvTemplateJson())){
|
||||
HotakeCvInfoDto cvInfoDto = handleAnalysisCvInfo(applyInfo.getCvTemplateJson());
|
||||
applyInfo.setCvInfoDto(cvInfoDto);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return applyInfoList;
|
||||
|
||||
Reference in New Issue
Block a user