邀请面试完善

This commit is contained in:
Unique-Jerry 2023-12-09 09:13:34 +08:00
parent 4b4f2002cd
commit eacf8e51cb
6 changed files with 95 additions and 79 deletions

View File

@ -1,11 +1,13 @@
package com.yzdx.AiInterviewer.controller.VxController; package com.yzdx.AiInterviewer.controller.VxController;
import com.yzdx.AiInterviewer.comment.R; import com.yzdx.AiInterviewer.comment.R;
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxInterviewRecordDto;
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxNoticeDto; import com.yzdx.AiInterviewer.entity.VxEntityDto.VxNoticeDto;
import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice; import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice;
import com.yzdx.AiInterviewer.service.InterviewNoticeService; import com.yzdx.AiInterviewer.service.InterviewNoticeService;
import com.yzdx.AiInterviewer.service.VxService.VxCarouselChartService; import com.yzdx.AiInterviewer.service.VxService.VxCarouselChartService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewApplicationService; import com.yzdx.AiInterviewer.service.VxService.VxInterviewApplicationService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,6 +23,8 @@ public class VxInterviewController {
private VxInterviewApplicationService vxInterviewApplicationService; private VxInterviewApplicationService vxInterviewApplicationService;
@Autowired @Autowired
private InterviewNoticeService interviewNoticeService; private InterviewNoticeService interviewNoticeService;
@Autowired
private VxInterviewRecordService vxInterviewRecordService;
@GetMapping("/getCarouselChart") @GetMapping("/getCarouselChart")
public R getCarouselChart(){ public R getCarouselChart(){
@ -46,5 +50,15 @@ public class VxInterviewController {
return R.success(VxNoticeDtoList); return R.success(VxNoticeDtoList);
} }
@GetMapping("getInterviewRecord")
public R getInterviewRecordList(Integer userId){
List<VxInterviewRecordDto> list=vxInterviewRecordService.getInterviewRecordList(userId);
return R.success(list);
}
@GetMapping("/searchInterviewRecord")
public R searchInterviewRecordList(String searchCompany,Integer userId){
List<VxInterviewRecordDto> list=vxInterviewRecordService.searchInterviewRecordList(searchCompany,userId);
return R.success(list);
}
} }

View File

@ -11,12 +11,9 @@ public class VxInterviewRecordDto extends VxInterviewRecord {
private String companyName; private String companyName;
@ApiModelProperty("公司logo") @ApiModelProperty("公司logo")
private String companyLogoUrl; private String companyLogoUrl;
@ApiModelProperty("面试公司id")
private String interviewCompanyId;
@ApiModelProperty("面试时间") @ApiModelProperty("面试时间")
private String interviewTime; private String interviewTime;
@ApiModelProperty("岗位") @ApiModelProperty("岗位")
private String job; private String job;
@ApiModelProperty("面试结果")
private Integer result;
} }

View File

@ -10,8 +10,6 @@ public interface InterviewNoticeService extends IService<VxInterviewNotice> {
/** /**
* 添加面试通知 * 添加面试通知
* @param encoding 发起通知的公司编码 * @param encoding 发起通知的公司编码
* @param detail 通知主体内容
* @param attention 面试注意事项
* @param recipient 接收人id * @param recipient 接收人id
* @param jobId 面试的岗位id * @param jobId 面试的岗位id
* @param postId 投递时的招聘id * @param postId 投递时的招聘id

View File

@ -7,7 +7,8 @@ import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewRecord;
import java.util.List; import java.util.List;
public interface VxInterviewRecordService extends IService<VxInterviewRecord> { public interface VxInterviewRecordService extends IService<VxInterviewRecord> {
List<VxInterviewRecordDto> getInterviewRecordList(Integer userId,Integer noticeId);
List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer noticeId); List<VxInterviewRecordDto> getInterviewRecordList(Integer userId);
List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer userId);
} }

View File

@ -1,7 +1,6 @@
package com.yzdx.AiInterviewer.service.VxService.impl; package com.yzdx.AiInterviewer.service.VxService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yzdx.AiInterviewer.entity.Company; import com.yzdx.AiInterviewer.entity.Company;
import com.yzdx.AiInterviewer.entity.JobEntity; import com.yzdx.AiInterviewer.entity.JobEntity;
@ -9,16 +8,16 @@ import com.yzdx.AiInterviewer.entity.VxEntityDto.VxInterviewRecordDto;
import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice; import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice;
import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewRecord; import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewRecord;
import com.yzdx.AiInterviewer.mapper.CompanyMapper; import com.yzdx.AiInterviewer.mapper.CompanyMapper;
import com.yzdx.AiInterviewer.mapper.InterviewNoticeMapper;
import com.yzdx.AiInterviewer.mapper.JobMapper; import com.yzdx.AiInterviewer.mapper.JobMapper;
import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewNoticeMapper; import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewNoticeMapper;
import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewRecordMapper; import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewRecordMapper;
import com.yzdx.AiInterviewer.service.CompanyService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewRecordService; import com.yzdx.AiInterviewer.service.VxService.VxInterviewRecordService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.ws.Action; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@ -31,83 +30,90 @@ public class VxInterviewRecordServiceImpl extends ServiceImpl<VxInterviewRecordM
private JobMapper jobMapper; private JobMapper jobMapper;
@Autowired @Autowired
private CompanyMapper companyMapper; private CompanyMapper companyMapper;
@Autowired
private CompanyService companyService;
@Override @Override
public List<VxInterviewRecordDto> getInterviewRecordList(Integer userId,Integer noticeId) { public List<VxInterviewRecordDto> getInterviewRecordList(Integer userId) {
LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>(); LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(VxInterviewRecord::getCreateUser,userId); queryWrapper.eq(VxInterviewRecord::getInterviewer,userId);
List<VxInterviewRecord> vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper); List<VxInterviewRecord> vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper);
List<VxInterviewRecordDto> vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{ List<VxInterviewRecordDto> vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{
//根据面试通知id查找面试通知表中的jod_id
LambdaQueryWrapper<VxInterviewNotice> queryWrapper1=new LambdaQueryWrapper<>();
queryWrapper1.eq(VxInterviewNotice::getId,noticeId);
VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper1);
Integer jobId = vxInterviewNotice.getJobId();
//根据岗位id查岗位名称
LambdaQueryWrapper<JobEntity> queryWrapper2=new LambdaQueryWrapper<>();
queryWrapper2.eq(JobEntity::getId,jobId);
JobEntity jobEntity = jobMapper.selectOne(queryWrapper2);
String jobName = jobEntity.getJobName();
VxInterviewRecordDto vxInterviewRecordDto=new VxInterviewRecordDto(); VxInterviewRecordDto vxInterviewRecordDto=new VxInterviewRecordDto();
BeanUtils.copyProperties(item,vxInterviewRecordDto); BeanUtils.copyProperties(item,vxInterviewRecordDto);
//获取岗位名称 Company companyDetail = companyService.getCompanyDetail(item.getCompanyEncoding());
vxInterviewRecordDto.setJob(jobName);
//获取面试时间 vxInterviewRecordDto.setCompanyName(companyDetail.getCompanyName());
vxInterviewRecordDto.setInterviewTime(vxInterviewRecordDto.getCreateTime());
//获取面试公司id vxInterviewRecordDto.setCompanyLogoUrl(companyDetail.getCompanyLogo());
LambdaQueryWrapper<Company> companyLambdaQueryWrapper=new LambdaQueryWrapper<>();
companyLambdaQueryWrapper.eq(Company::getEncoding,vxInterviewRecordDto.getInterviewCompanyId()); vxInterviewRecordDto.setInterviewTime(item.getCreateTime());
Company company = companyMapper.selectOne(companyLambdaQueryWrapper);
vxInterviewRecordDto.setInterviewCompanyId(company.getEncoding()); VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectById(item.getNoticeId());
//获取公司名称
vxInterviewRecordDto.setCompanyName(company.getCompanyName()); JobEntity jobEntity = jobMapper.selectById(vxInterviewNotice.getJobId());
//获取公司logo
vxInterviewRecordDto.setCompanyLogoUrl(company.getCompanyLogo()); vxInterviewRecordDto.setJob(jobEntity.getJobName());
//获取面试结果
vxInterviewRecordDto.setResult(vxInterviewRecordDto.getResult());
return vxInterviewRecordDto; return vxInterviewRecordDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return vxInterviewRecordDtos; return vxInterviewRecordDtos;
} }
@Override @Override
public List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer noticeId) { public List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer userId) {
LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.like(VxInterviewRecord::getCompanyEncoding,searchCompany);
List<VxInterviewRecord> vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper);
List<VxInterviewRecordDto> vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{
//根据面试通知id查找面试通知表中的jod_id
LambdaQueryWrapper<VxInterviewNotice> queryWrapper1=new LambdaQueryWrapper<>();
queryWrapper1.eq(VxInterviewNotice::getId,noticeId);
VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper1);
Integer jobId = vxInterviewNotice.getJobId();
//根据岗位id查岗位名称
LambdaQueryWrapper<JobEntity> queryWrapper2=new LambdaQueryWrapper<>();
queryWrapper2.eq(JobEntity::getId,jobId);
JobEntity jobEntity = jobMapper.selectOne(queryWrapper2);
String jobName = jobEntity.getJobName();
VxInterviewRecordDto vxInterviewRecordDto=new VxInterviewRecordDto();
BeanUtils.copyProperties(item,vxInterviewRecordDto); LambdaQueryWrapper<Company> queryWrapper1=new LambdaQueryWrapper<>();
//获取岗位名称 queryWrapper1.like(Company::getCompanyName,searchCompany);
vxInterviewRecordDto.setJob(jobName);
//获取面试时间 List<Company> companies = companyMapper.selectList(queryWrapper1);
vxInterviewRecordDto.setInterviewTime(vxInterviewRecordDto.getCreateTime());
//获取面试公司id if(companies.size()==0){
LambdaQueryWrapper<Company> companyLambdaQueryWrapper=new LambdaQueryWrapper<>();
companyLambdaQueryWrapper.eq(Company::getEncoding,vxInterviewRecordDto.getInterviewCompanyId()); return null;
Company company = companyMapper.selectOne(companyLambdaQueryWrapper); }
vxInterviewRecordDto.setInterviewCompanyId(company.getEncoding());
//获取公司名称 List<VxInterviewRecordDto> vxInterviewRecordDtoList=new ArrayList<>();
vxInterviewRecordDto.setCompanyName(company.getCompanyName()); for (Company company:companies) {
//获取公司logo
vxInterviewRecordDto.setCompanyLogoUrl(company.getCompanyLogo()); LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>();
//获取面试结果
vxInterviewRecordDto.setResult(vxInterviewRecordDto.getResult()); queryWrapper.eq(VxInterviewRecord::getInterviewer,userId).eq(VxInterviewRecord::getCompanyEncoding,company.getEncoding());
return vxInterviewRecordDto;
}).collect(Collectors.toList()); List<VxInterviewRecord> vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper);
return vxInterviewRecordDtos;
List<VxInterviewRecordDto> vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{
VxInterviewRecordDto vxInterviewRecordDto=new VxInterviewRecordDto();
BeanUtils.copyProperties(item,vxInterviewRecordDto);
Company companyDetail = companyService.getCompanyDetail(item.getCompanyEncoding());
vxInterviewRecordDto.setCompanyName(companyDetail.getCompanyName());
vxInterviewRecordDto.setCompanyLogoUrl(companyDetail.getCompanyLogo());
vxInterviewRecordDto.setInterviewTime(item.getCreateTime());
VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectById(item.getNoticeId());
JobEntity jobEntity = jobMapper.selectById(vxInterviewNotice.getJobId());
vxInterviewRecordDto.setJob(jobEntity.getJobName());
return vxInterviewRecordDto;
}).collect(Collectors.toList());
vxInterviewRecordDtoList.addAll(vxInterviewRecordDtos);
}
return vxInterviewRecordDtoList;
} }
} }

View File

@ -9,7 +9,7 @@ import com.yzdx.AiInterviewer.entity.VxEntityDto.VxNoticeDto;
import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice; import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewNotice;
import com.yzdx.AiInterviewer.mapper.JobMapper; import com.yzdx.AiInterviewer.mapper.JobMapper;
import com.yzdx.AiInterviewer.mapper.UserMapper; import com.yzdx.AiInterviewer.mapper.UserMapper;
import com.yzdx.AiInterviewer.mapper.VxMapper.InterviewNoticeMapper; import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewNoticeMapper;
import com.yzdx.AiInterviewer.service.CompanyService; import com.yzdx.AiInterviewer.service.CompanyService;
import com.yzdx.AiInterviewer.service.InterviewNoticeService; import com.yzdx.AiInterviewer.service.InterviewNoticeService;
import com.yzdx.AiInterviewer.utiles.EmailUtil; import com.yzdx.AiInterviewer.utiles.EmailUtil;
@ -22,10 +22,10 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMapper, VxInterviewNotice> implements InterviewNoticeService { public class InterviewNoticeServiceImpl extends ServiceImpl<VxInterviewNoticeMapper, VxInterviewNotice> implements InterviewNoticeService {
@Autowired @Autowired
private InterviewNoticeMapper interviewNoticeMapper; private VxInterviewNoticeMapper vxInterviewNoticeMapper;
@Autowired @Autowired
private UserMapper userMapper; private UserMapper userMapper;
@Autowired @Autowired
@ -43,7 +43,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
queryWrapper.eq(VxInterviewNotice::getCompanyEncoding,encoding).eq(VxInterviewNotice::getJobId,jobId) queryWrapper.eq(VxInterviewNotice::getCompanyEncoding,encoding).eq(VxInterviewNotice::getJobId,jobId)
.eq(VxInterviewNotice::getPostId,postId).eq(VxInterviewNotice::getInviteId,inviteId); .eq(VxInterviewNotice::getPostId,postId).eq(VxInterviewNotice::getInviteId,inviteId);
VxInterviewNotice vxInterviewNotice = interviewNoticeMapper.selectOne(queryWrapper); VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper);
if(vxInterviewNotice!=null){ if(vxInterviewNotice!=null){
@ -98,7 +98,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
return -3; return -3;
} }
Integer rows = interviewNoticeMapper.insert(newVxInterviewNotice); Integer rows = vxInterviewNoticeMapper.insert(newVxInterviewNotice);
return rows; return rows;
} }
@ -109,7 +109,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
queryWrapper.eq(VxInterviewNotice::getRecipient,userId); queryWrapper.eq(VxInterviewNotice::getRecipient,userId);
List<VxInterviewNotice> vxInterviewNotices = interviewNoticeMapper.selectList(queryWrapper); List<VxInterviewNotice> vxInterviewNotices = vxInterviewNoticeMapper.selectList(queryWrapper);
List<VxNoticeDto> VxNoticeDtoList=vxInterviewNotices.stream().map(item->{ List<VxNoticeDto> VxNoticeDtoList=vxInterviewNotices.stream().map(item->{