邀请面试完善

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;
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.vxEntity.VxInterviewNotice;
import com.yzdx.AiInterviewer.service.InterviewNoticeService;
import com.yzdx.AiInterviewer.service.VxService.VxCarouselChartService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewApplicationService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -21,6 +23,8 @@ public class VxInterviewController {
private VxInterviewApplicationService vxInterviewApplicationService;
@Autowired
private InterviewNoticeService interviewNoticeService;
@Autowired
private VxInterviewRecordService vxInterviewRecordService;
@GetMapping("/getCarouselChart")
public R getCarouselChart(){
@ -46,5 +50,15 @@ public class VxInterviewController {
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;
@ApiModelProperty("公司logo")
private String companyLogoUrl;
@ApiModelProperty("面试公司id")
private String interviewCompanyId;
@ApiModelProperty("面试时间")
private String interviewTime;
@ApiModelProperty("岗位")
private String job;
@ApiModelProperty("面试结果")
private Integer result;
}

View File

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

View File

@ -7,7 +7,8 @@ import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewRecord;
import java.util.List;
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;
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.yzdx.AiInterviewer.entity.Company;
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.VxInterviewRecord;
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
import com.yzdx.AiInterviewer.mapper.InterviewNoticeMapper;
import com.yzdx.AiInterviewer.mapper.JobMapper;
import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewNoticeMapper;
import com.yzdx.AiInterviewer.mapper.VxMapper.VxInterviewRecordMapper;
import com.yzdx.AiInterviewer.service.CompanyService;
import com.yzdx.AiInterviewer.service.VxService.VxInterviewRecordService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.xml.ws.Action;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
@ -31,83 +30,90 @@ public class VxInterviewRecordServiceImpl extends ServiceImpl<VxInterviewRecordM
private JobMapper jobMapper;
@Autowired
private CompanyMapper companyMapper;
@Autowired
private CompanyService companyService;
@Override
public List<VxInterviewRecordDto> getInterviewRecordList(Integer userId,Integer noticeId) {
public List<VxInterviewRecordDto> getInterviewRecordList(Integer userId) {
LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(VxInterviewRecord::getCreateUser,userId);
queryWrapper.eq(VxInterviewRecord::getInterviewer,userId);
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);
//获取岗位名称
vxInterviewRecordDto.setJob(jobName);
//获取面试时间
vxInterviewRecordDto.setInterviewTime(vxInterviewRecordDto.getCreateTime());
//获取面试公司id
LambdaQueryWrapper<Company> companyLambdaQueryWrapper=new LambdaQueryWrapper<>();
companyLambdaQueryWrapper.eq(Company::getEncoding,vxInterviewRecordDto.getInterviewCompanyId());
Company company = companyMapper.selectOne(companyLambdaQueryWrapper);
vxInterviewRecordDto.setInterviewCompanyId(company.getEncoding());
//获取公司名称
vxInterviewRecordDto.setCompanyName(company.getCompanyName());
//获取公司logo
vxInterviewRecordDto.setCompanyLogoUrl(company.getCompanyLogo());
//获取面试结果
vxInterviewRecordDto.setResult(vxInterviewRecordDto.getResult());
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());
return vxInterviewRecordDtos;
}
@Override
public List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer noticeId) {
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();
public List<VxInterviewRecordDto> searchInterviewRecordList(String searchCompany,Integer userId) {
BeanUtils.copyProperties(item,vxInterviewRecordDto);
LambdaQueryWrapper<Company> queryWrapper1=new LambdaQueryWrapper<>();
//获取岗位名称
vxInterviewRecordDto.setJob(jobName);
//获取面试时间
vxInterviewRecordDto.setInterviewTime(vxInterviewRecordDto.getCreateTime());
//获取面试公司id
LambdaQueryWrapper<Company> companyLambdaQueryWrapper=new LambdaQueryWrapper<>();
companyLambdaQueryWrapper.eq(Company::getEncoding,vxInterviewRecordDto.getInterviewCompanyId());
Company company = companyMapper.selectOne(companyLambdaQueryWrapper);
vxInterviewRecordDto.setInterviewCompanyId(company.getEncoding());
//获取公司名称
vxInterviewRecordDto.setCompanyName(company.getCompanyName());
//获取公司logo
vxInterviewRecordDto.setCompanyLogoUrl(company.getCompanyLogo());
//获取面试结果
vxInterviewRecordDto.setResult(vxInterviewRecordDto.getResult());
return vxInterviewRecordDto;
}).collect(Collectors.toList());
return vxInterviewRecordDtos;
queryWrapper1.like(Company::getCompanyName,searchCompany);
List<Company> companies = companyMapper.selectList(queryWrapper1);
if(companies.size()==0){
return null;
}
List<VxInterviewRecordDto> vxInterviewRecordDtoList=new ArrayList<>();
for (Company company:companies) {
LambdaQueryWrapper<VxInterviewRecord> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(VxInterviewRecord::getInterviewer,userId).eq(VxInterviewRecord::getCompanyEncoding,company.getEncoding());
List<VxInterviewRecord> vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper);
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.mapper.JobMapper;
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.InterviewNoticeService;
import com.yzdx.AiInterviewer.utiles.EmailUtil;
@ -22,10 +22,10 @@ import java.util.List;
import java.util.stream.Collectors;
@Service
public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMapper, VxInterviewNotice> implements InterviewNoticeService {
public class InterviewNoticeServiceImpl extends ServiceImpl<VxInterviewNoticeMapper, VxInterviewNotice> implements InterviewNoticeService {
@Autowired
private InterviewNoticeMapper interviewNoticeMapper;
private VxInterviewNoticeMapper vxInterviewNoticeMapper;
@Autowired
private UserMapper userMapper;
@Autowired
@ -43,7 +43,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
queryWrapper.eq(VxInterviewNotice::getCompanyEncoding,encoding).eq(VxInterviewNotice::getJobId,jobId)
.eq(VxInterviewNotice::getPostId,postId).eq(VxInterviewNotice::getInviteId,inviteId);
VxInterviewNotice vxInterviewNotice = interviewNoticeMapper.selectOne(queryWrapper);
VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper);
if(vxInterviewNotice!=null){
@ -98,7 +98,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
return -3;
}
Integer rows = interviewNoticeMapper.insert(newVxInterviewNotice);
Integer rows = vxInterviewNoticeMapper.insert(newVxInterviewNotice);
return rows;
}
@ -109,7 +109,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl<InterviewNoticeMappe
queryWrapper.eq(VxInterviewNotice::getRecipient,userId);
List<VxInterviewNotice> vxInterviewNotices = interviewNoticeMapper.selectList(queryWrapper);
List<VxInterviewNotice> vxInterviewNotices = vxInterviewNoticeMapper.selectList(queryWrapper);
List<VxNoticeDto> VxNoticeDtoList=vxInterviewNotices.stream().map(item->{