diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/VxController/VxInterviewController.java b/src/main/java/com/yzdx/AiInterviewer/controller/VxController/VxInterviewController.java index 604f22b..3622045 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/VxController/VxInterviewController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/VxController/VxInterviewController.java @@ -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 list=vxInterviewRecordService.getInterviewRecordList(userId); + return R.success(list); + } + @GetMapping("/searchInterviewRecord") + public R searchInterviewRecordList(String searchCompany,Integer userId){ + List list=vxInterviewRecordService.searchInterviewRecordList(searchCompany,userId); + return R.success(list); + } } diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/VxEntityDto/VxInterviewRecordDto.java b/src/main/java/com/yzdx/AiInterviewer/entity/VxEntityDto/VxInterviewRecordDto.java index a1d9615..f716e6a 100644 --- a/src/main/java/com/yzdx/AiInterviewer/entity/VxEntityDto/VxInterviewRecordDto.java +++ b/src/main/java/com/yzdx/AiInterviewer/entity/VxEntityDto/VxInterviewRecordDto.java @@ -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; + } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/InterviewNoticeService.java b/src/main/java/com/yzdx/AiInterviewer/service/InterviewNoticeService.java index 872af17..d801bce 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/InterviewNoticeService.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/InterviewNoticeService.java @@ -10,8 +10,6 @@ public interface InterviewNoticeService extends IService { /** * 添加面试通知 * @param encoding 发起通知的公司编码 - * @param detail 通知主体内容 - * @param attention 面试注意事项 * @param recipient 接收人id * @param jobId 面试的岗位id * @param postId 投递时的招聘id diff --git a/src/main/java/com/yzdx/AiInterviewer/service/VxService/VxInterviewRecordService.java b/src/main/java/com/yzdx/AiInterviewer/service/VxService/VxInterviewRecordService.java index 299a18e..f384f4a 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/VxService/VxInterviewRecordService.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/VxService/VxInterviewRecordService.java @@ -7,7 +7,8 @@ import com.yzdx.AiInterviewer.entity.vxEntity.VxInterviewRecord; import java.util.List; public interface VxInterviewRecordService extends IService { - List getInterviewRecordList(Integer userId,Integer noticeId); - List searchInterviewRecordList(String searchCompany,Integer noticeId); + List getInterviewRecordList(Integer userId); + + List searchInterviewRecordList(String searchCompany,Integer userId); } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/VxService/impl/VxInterviewRecordServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/VxService/impl/VxInterviewRecordServiceImpl.java index dd81ad7..ad4bea1 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/VxService/impl/VxInterviewRecordServiceImpl.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/VxService/impl/VxInterviewRecordServiceImpl.java @@ -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 getInterviewRecordList(Integer userId,Integer noticeId) { + public List getInterviewRecordList(Integer userId) { LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); - queryWrapper.eq(VxInterviewRecord::getCreateUser,userId); + queryWrapper.eq(VxInterviewRecord::getInterviewer,userId); List vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper); List vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{ - //根据面试通知id查找面试通知表中的jod_id - LambdaQueryWrapper queryWrapper1=new LambdaQueryWrapper<>(); - queryWrapper1.eq(VxInterviewNotice::getId,noticeId); - VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper1); - Integer jobId = vxInterviewNotice.getJobId(); - //根据岗位id查岗位名称 - LambdaQueryWrapper 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 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 searchInterviewRecordList(String searchCompany,Integer noticeId) { - LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); - queryWrapper.like(VxInterviewRecord::getCompanyEncoding,searchCompany); - List vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper); - List vxInterviewRecordDtos=vxInterviewRecords.stream().map(item->{ - //根据面试通知id查找面试通知表中的jod_id - LambdaQueryWrapper queryWrapper1=new LambdaQueryWrapper<>(); - queryWrapper1.eq(VxInterviewNotice::getId,noticeId); - VxInterviewNotice vxInterviewNotice = vxInterviewNoticeMapper.selectOne(queryWrapper1); - Integer jobId = vxInterviewNotice.getJobId(); - //根据岗位id查岗位名称 - LambdaQueryWrapper queryWrapper2=new LambdaQueryWrapper<>(); - queryWrapper2.eq(JobEntity::getId,jobId); - JobEntity jobEntity = jobMapper.selectOne(queryWrapper2); - String jobName = jobEntity.getJobName(); - VxInterviewRecordDto vxInterviewRecordDto=new VxInterviewRecordDto(); + public List searchInterviewRecordList(String searchCompany,Integer userId) { - BeanUtils.copyProperties(item,vxInterviewRecordDto); + LambdaQueryWrapper queryWrapper1=new LambdaQueryWrapper<>(); - //获取岗位名称 - vxInterviewRecordDto.setJob(jobName); - //获取面试时间 - vxInterviewRecordDto.setInterviewTime(vxInterviewRecordDto.getCreateTime()); - //获取面试公司id - LambdaQueryWrapper 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 companies = companyMapper.selectList(queryWrapper1); + + if(companies.size()==0){ + + return null; + } + + List vxInterviewRecordDtoList=new ArrayList<>(); + for (Company company:companies) { + + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + + queryWrapper.eq(VxInterviewRecord::getInterviewer,userId).eq(VxInterviewRecord::getCompanyEncoding,company.getEncoding()); + + List vxInterviewRecords = vxInterviewRecordMapper.selectList(queryWrapper); + + List 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; } } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/InterviewNoticeServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/InterviewNoticeServiceImpl.java index ef7a806..04d3b22 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/impl/InterviewNoticeServiceImpl.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/InterviewNoticeServiceImpl.java @@ -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 implements InterviewNoticeService { +public class InterviewNoticeServiceImpl extends ServiceImpl implements InterviewNoticeService { @Autowired - private InterviewNoticeMapper interviewNoticeMapper; + private VxInterviewNoticeMapper vxInterviewNoticeMapper; @Autowired private UserMapper userMapper; @Autowired @@ -43,7 +43,7 @@ public class InterviewNoticeServiceImpl extends ServiceImpl vxInterviewNotices = interviewNoticeMapper.selectList(queryWrapper); + List vxInterviewNotices = vxInterviewNoticeMapper.selectList(queryWrapper); List VxNoticeDtoList=vxInterviewNotices.stream().map(item->{