取消岗位企业关注
This commit is contained in:
parent
cdec6945dd
commit
96d26bbd67
|
@ -3,6 +3,8 @@ package com.yzdx.AiInterviewer.controller;
|
||||||
import com.yzdx.AiInterviewer.comment.R;
|
import com.yzdx.AiInterviewer.comment.R;
|
||||||
import com.yzdx.AiInterviewer.entity.Company;
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
import com.yzdx.AiInterviewer.entity.JobEntity;
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyDetailDto;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobDetailDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobPostingDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobPostingDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobSettingDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobSettingDto;
|
||||||
|
@ -110,7 +112,7 @@ public class RecruitmentController {
|
||||||
if(id==null){
|
if(id==null){
|
||||||
return R.error("获取失败");
|
return R.error("获取失败");
|
||||||
}
|
}
|
||||||
JobEntity jobById = jobListService.getJobById(id);
|
VxJobDetailDto jobById = jobListService.getJobById(id);
|
||||||
if(jobById==null){
|
if(jobById==null){
|
||||||
return R.error("出错了,请联系管理员!");
|
return R.error("出错了,请联系管理员!");
|
||||||
}
|
}
|
||||||
|
@ -314,7 +316,7 @@ public class RecruitmentController {
|
||||||
return R.error("获取失败");
|
return R.error("获取失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
Company companyDetail = companyService.getCompanyDetail(encoding);
|
VxCompanyDetailDto companyDetail = companyService.getCompanyDetail(encoding);
|
||||||
if(companyDetail==null){
|
if(companyDetail==null){
|
||||||
return R.error("获取失败");
|
return R.error("获取失败");
|
||||||
}
|
}
|
||||||
|
@ -430,10 +432,16 @@ public class RecruitmentController {
|
||||||
|
|
||||||
return R.success(jobPostingDtos);
|
return R.success(jobPostingDtos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取简历申请列表
|
||||||
|
* @param companyEncoding
|
||||||
|
* @param jobId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/getApplicationList")
|
@GetMapping("/getApplicationList")
|
||||||
public R getApplicationList(String companyEncoding,Integer jobId){
|
public R getApplicationList(String companyEncoding,Integer jobId){
|
||||||
List<VxInterviewApplication> list=vxInterviewApplicationService.getApplicationList(companyEncoding,jobId);
|
List<VxInterviewApplication> list=vxInterviewApplicationService.getApplicationList(companyEncoding,jobId);
|
||||||
return R.success(list);
|
return R.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.yzdx.AiInterviewer.controller.VxController;
|
||||||
import com.yzdx.AiInterviewer.comment.R;
|
import com.yzdx.AiInterviewer.comment.R;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
||||||
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
import com.yzdx.AiInterviewer.service.CompanyService;
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
||||||
import com.yzdx.AiInterviewer.service.JobListService;
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
import com.yzdx.AiInterviewer.service.VxService.VxCompanyLikeService;
|
import com.yzdx.AiInterviewer.service.VxService.VxCompanyLikeService;
|
||||||
|
@ -74,24 +75,52 @@ public class VxJobController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消岗位关注
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/cancelJobLike")
|
||||||
|
public R cancelJobLike(Integer jobId,Integer userId){
|
||||||
|
Integer rows=vxJobLikeService.cancelJobLike(jobId,userId);
|
||||||
|
if(rows==-1){
|
||||||
|
return R.error("取消收藏失败");
|
||||||
|
}
|
||||||
|
return R.success("取消收藏成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏企业关注
|
* 收藏企业关注
|
||||||
*/
|
*/
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "companyId",required = true),
|
@ApiImplicitParam(name = "companyEncoding",required = true),
|
||||||
@ApiImplicitParam(name = "userId",required = true),
|
@ApiImplicitParam(name = "userId",required = true),
|
||||||
})
|
})
|
||||||
@PostMapping("/addCompanyLike")
|
@PostMapping("/addCompanyLike")
|
||||||
public R addCompanyLike(@RequestParam(value = "companyId")Integer companyId,
|
public R addCompanyLike(@RequestParam(value = "companyEncoding")String companyEncoding,
|
||||||
@RequestParam(value = "userId")Integer userId){
|
@RequestParam(value = "userId")Integer userId){
|
||||||
Integer rows=vxCompanyLikeService.addCompanyLike(companyId,userId);
|
Integer rows=vxCompanyLikeService.addCompanyLike(companyEncoding,userId);
|
||||||
|
|
||||||
if(rows!=-1){
|
if(rows!=1){
|
||||||
return R.error("收藏失败");
|
return R.error("收藏失败");
|
||||||
}
|
}
|
||||||
return R.success("收藏成功");
|
return R.success("收藏成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消企业关注
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/cancelCompanyLike")
|
||||||
|
public R cancelCompanyLike(String companyEncoding,Integer userId){
|
||||||
|
Integer rows=vxCompanyLikeService.cancelCompanyLike(companyEncoding,userId);
|
||||||
|
if(rows==-1){
|
||||||
|
return R.error("取消关注失败");
|
||||||
|
}
|
||||||
|
return R.success("取消关注成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vx搜索岗位和企业
|
* vx搜索岗位和企业
|
||||||
* @param searchName
|
* @param searchName
|
||||||
|
@ -120,5 +149,12 @@ public class VxJobController {
|
||||||
|
|
||||||
return R.success(result);
|
return R.success(result);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取猜你喜欢
|
||||||
|
*/
|
||||||
|
@GetMapping("/getYourLikeJob")
|
||||||
|
public R getYourLikeJob(Integer jobId){
|
||||||
|
List<JobDto> list=jobListService.getYourLikeJob(jobId);
|
||||||
|
return R.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,5 +47,4 @@ public class JobEntity extends BaseEntity {
|
||||||
private Integer status;
|
private Integer status;
|
||||||
@ApiModelProperty("岗位福利")
|
@ApiModelProperty("岗位福利")
|
||||||
private String jobWelfale;
|
private String jobWelfale;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity.VxEntityDto;
|
||||||
|
|
||||||
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VxCompanyDetailDto extends Company {
|
||||||
|
private Integer isLike;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity.VxEntityDto;
|
||||||
|
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VxJobDetailDto extends JobEntity {
|
||||||
|
private Integer isLike;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.yzdx.AiInterviewer.entity.dto;
|
package com.yzdx.AiInterviewer.entity.dto;
|
||||||
|
|
||||||
import com.yzdx.AiInterviewer.entity.BaseEntity;
|
import com.yzdx.AiInterviewer.entity.BaseEntity;
|
||||||
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -24,4 +25,6 @@ public class JobDto extends BaseEntity {
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
private Company company;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,8 @@ public class VxCompanyLike extends BaseEntity {
|
||||||
@ApiModelProperty("关注公司id")
|
@ApiModelProperty("关注公司id")
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@ApiModelProperty("公司id")
|
@ApiModelProperty("公司编码")
|
||||||
private Integer companyId;
|
private String companyEncoding;
|
||||||
@ApiModelProperty("用户id")
|
@ApiModelProperty("用户id")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.yzdx.AiInterviewer.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.yzdx.AiInterviewer.entity.Company;
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyDetailDto;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -14,7 +15,7 @@ public interface CompanyService extends IService<Company> {
|
||||||
* @return 公司详情对象
|
* @return 公司详情对象
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
Company getCompanyDetail(String encoding);
|
VxCompanyDetailDto getCompanyDetail(String encoding);
|
||||||
/**
|
/**
|
||||||
* 更新公司详情
|
* 更新公司详情
|
||||||
* @param userId 人的id
|
* @param userId 人的id
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.yzdx.AiInterviewer.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.yzdx.AiInterviewer.entity.JobEntity;
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobDetailDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ public interface JobListService extends IService<JobEntity> {
|
||||||
* @param id 岗位id
|
* @param id 岗位id
|
||||||
* @return 岗位对象
|
* @return 岗位对象
|
||||||
* */
|
* */
|
||||||
JobEntity getJobById(Integer id);
|
VxJobDetailDto getJobById(Integer id);
|
||||||
/**
|
/**
|
||||||
* 修改岗位
|
* 修改岗位
|
||||||
* @param userId 添加人的id
|
* @param userId 添加人的id
|
||||||
|
@ -141,4 +142,11 @@ public interface JobListService extends IService<JobEntity> {
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
List<Map<String,Object>> getSuggestJob(Integer userId);
|
List<Map<String,Object>> getSuggestJob(Integer userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据岗位id查猜你喜欢
|
||||||
|
* @param jobId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JobDto> getYourLikeJob(Integer jobId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,7 @@ public interface VxCompanyLikeService extends IService<VxCompanyLike> {
|
||||||
|
|
||||||
List<VxCompanyLikeDto> getCompanyLikeListById(Integer userId);
|
List<VxCompanyLikeDto> getCompanyLikeListById(Integer userId);
|
||||||
|
|
||||||
Integer addCompanyLike(Integer companyId, Integer userId);
|
Integer addCompanyLike(String companyEncoding, Integer userId);
|
||||||
|
|
||||||
|
Integer cancelCompanyLike(String companyEncoding,Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,5 @@ public interface VxJobLikeService extends IService<VxJobLike> {
|
||||||
Integer addJobLike(Integer jobId, Integer userId);
|
Integer addJobLike(Integer jobId, Integer userId);
|
||||||
|
|
||||||
|
|
||||||
|
Integer cancelJobLike(Integer jobId,Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.yzdx.AiInterviewer.entity.Company;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
import com.yzdx.AiInterviewer.entity.vxEntity.VxCompanyLike;
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxCompanyLike;
|
||||||
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxJobLike;
|
||||||
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
||||||
import com.yzdx.AiInterviewer.mapper.VxMapper.VxCompanyLikeMapper;
|
import com.yzdx.AiInterviewer.mapper.VxMapper.VxCompanyLikeMapper;
|
||||||
import com.yzdx.AiInterviewer.service.JobListService;
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
|
@ -42,14 +43,14 @@ public class VxCompanyLikeServiceImpl extends ServiceImpl<VxCompanyLikeMapper, V
|
||||||
VxCompanyLikeDto vxCompanyLikeDto=new VxCompanyLikeDto();
|
VxCompanyLikeDto vxCompanyLikeDto=new VxCompanyLikeDto();
|
||||||
|
|
||||||
BeanUtils.copyProperties(item,vxCompanyLikeDto);
|
BeanUtils.copyProperties(item,vxCompanyLikeDto);
|
||||||
// 得到公司id
|
// 得到公司编码
|
||||||
LambdaQueryWrapper<Company> queryWrapper1=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Company> queryWrapper1=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper1.eq(Company::getId,vxCompanyLikeDto.getCompanyId());
|
queryWrapper1.eq(Company::getEncoding,vxCompanyLikeDto.getCompanyEncoding());
|
||||||
|
|
||||||
Company company = companyMapper.selectOne(queryWrapper1);
|
Company company = companyMapper.selectOne(queryWrapper1);
|
||||||
|
|
||||||
vxCompanyLikeDto.setCompanyId(company.getId());
|
vxCompanyLikeDto.setCompanyEncoding(company.getEncoding());
|
||||||
|
|
||||||
vxCompanyLikeDto.setCompanyName(company.getCompanyName());
|
vxCompanyLikeDto.setCompanyName(company.getCompanyName());
|
||||||
//得到公司类型
|
//得到公司类型
|
||||||
|
@ -79,19 +80,31 @@ public class VxCompanyLikeServiceImpl extends ServiceImpl<VxCompanyLikeMapper, V
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer addCompanyLike(Integer companyId, Integer userId) {
|
public Integer addCompanyLike(String companyEncoding, Integer userId) {
|
||||||
LambdaQueryWrapper<VxCompanyLike> queryWrapper=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<VxCompanyLike> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(VxCompanyLike::getCompanyId,companyId);
|
queryWrapper.eq(VxCompanyLike::getCompanyEncoding,companyEncoding);
|
||||||
VxCompanyLike vxCompanyLike = vxCompanyLikeMapper.selectOne(queryWrapper);
|
VxCompanyLike vxCompanyLike = vxCompanyLikeMapper.selectOne(queryWrapper);
|
||||||
if(vxCompanyLike!=null){
|
if(vxCompanyLike!=null){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
VxCompanyLike vxCompanyLike1=new VxCompanyLike();
|
VxCompanyLike vxCompanyLike1=new VxCompanyLike();
|
||||||
vxCompanyLike1.setCompanyId(companyId);
|
vxCompanyLike1.setCompanyEncoding(companyEncoding);
|
||||||
vxCompanyLike1.setUserId(userId);
|
vxCompanyLike1.setUserId(userId);
|
||||||
vxCompanyLike1.setCreateTime(TimeUtil.getTime());
|
vxCompanyLike1.setCreateTime(TimeUtil.getTime());
|
||||||
vxCompanyLike1.setCreateUser(userId);
|
vxCompanyLike1.setCreateUser(userId);
|
||||||
Integer row = vxCompanyLikeMapper.insert(vxCompanyLike1);
|
Integer row = vxCompanyLikeMapper.insert(vxCompanyLike1);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer cancelCompanyLike(String companyEncoding,Integer userId) {
|
||||||
|
LambdaQueryWrapper<VxCompanyLike> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(VxCompanyLike::getCompanyEncoding,companyEncoding).eq(VxCompanyLike::getUserId,userId);
|
||||||
|
VxCompanyLike vxJobLike = vxCompanyLikeMapper.selectOne(queryWrapper);
|
||||||
|
if(vxJobLike==null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
Integer row = vxCompanyLikeMapper.delete(queryWrapper);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -47,7 +47,6 @@ public class VxInterviewApplicationServiceImpl extends ServiceImpl<VxInterviewAp
|
||||||
Integer insert = vxInterviewApplicationMapper.insert(vxInterviewApplication1);
|
Integer insert = vxInterviewApplicationMapper.insert(vxInterviewApplication1);
|
||||||
return insert;
|
return insert;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<VxInterviewApplication> getApplicationList(String companyEncoding, Integer jobId) {
|
public List<VxInterviewApplication> getApplicationList(String companyEncoding, Integer jobId) {
|
||||||
LambdaQueryWrapper<VxInterviewApplication> queryWrapper=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<VxInterviewApplication> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
|
@ -96,4 +96,16 @@ public class VxJobLikeServiceImpl extends ServiceImpl<VxJobLikeMapper, VxJobLike
|
||||||
return rows;
|
return rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer cancelJobLike(Integer jobId,Integer userId) {
|
||||||
|
LambdaQueryWrapper<VxJobLike> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(VxJobLike::getJobId,jobId).eq(VxJobLike::getUserId,userId);
|
||||||
|
VxJobLike vxJobLike = vxJobLikeMapper.selectOne(queryWrapper);
|
||||||
|
if(vxJobLike==null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
Integer row = vxJobLikeMapper.delete(queryWrapper);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyDetailDto;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxCompanyLike;
|
||||||
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
||||||
import com.yzdx.AiInterviewer.mapper.JobMapper;
|
import com.yzdx.AiInterviewer.mapper.JobMapper;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.VxMapper.VxCompanyLikeMapper;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.VxMapper.VxJobLikeMapper;
|
||||||
import com.yzdx.AiInterviewer.service.CompanyService;
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
||||||
import com.yzdx.AiInterviewer.service.JobListService;
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
||||||
|
@ -28,16 +32,34 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JobMapper jobMapper;
|
private JobMapper jobMapper;
|
||||||
|
@Autowired
|
||||||
|
private VxCompanyLikeMapper vxCompanyLikeMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Company getCompanyDetail(String encoding) {
|
public VxCompanyDetailDto getCompanyDetail(String encoding) {
|
||||||
|
|
||||||
LambdaQueryWrapper<Company> queryWrapper=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Company> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq(Company::getEncoding,encoding);
|
queryWrapper.eq(Company::getEncoding,encoding);
|
||||||
|
|
||||||
Company company = companyMapper.selectOne(queryWrapper);
|
Company company = companyMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
return company;
|
VxCompanyDetailDto vxCompanyDetailDto=new VxCompanyDetailDto();
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(company,vxCompanyDetailDto);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<VxCompanyLike> queryWrapper1=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper1.eq(VxCompanyLike::getCompanyEncoding,company.getEncoding());
|
||||||
|
|
||||||
|
VxCompanyLike vxCompanyLike = vxCompanyLikeMapper.selectOne(queryWrapper1);
|
||||||
|
|
||||||
|
if(vxCompanyLike!=null){
|
||||||
|
vxCompanyDetailDto.setIsLike(1);
|
||||||
|
return vxCompanyDetailDto;
|
||||||
|
}
|
||||||
|
vxCompanyDetailDto.setIsLike(0);
|
||||||
|
return vxCompanyDetailDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -9,9 +9,12 @@ 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;
|
||||||
import com.yzdx.AiInterviewer.entity.Resume;
|
import com.yzdx.AiInterviewer.entity.Resume;
|
||||||
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobDetailDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
||||||
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxJobLike;
|
||||||
import com.yzdx.AiInterviewer.mapper.JobMapper;
|
import com.yzdx.AiInterviewer.mapper.JobMapper;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.VxMapper.VxJobLikeMapper;
|
||||||
import com.yzdx.AiInterviewer.service.CompanyService;
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
||||||
import com.yzdx.AiInterviewer.service.JobListService;
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
import com.yzdx.AiInterviewer.service.ResumeService;
|
import com.yzdx.AiInterviewer.service.ResumeService;
|
||||||
|
@ -37,7 +40,8 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResumeService resumeService;
|
private ResumeService resumeService;
|
||||||
|
@Autowired
|
||||||
|
private VxJobLikeMapper vxJobLikeMapper;
|
||||||
@Override
|
@Override
|
||||||
public Integer addJob(List<String> address, String address_detail, String details, String jobName, String startTime, String endTime, List<String> jobTips, Integer jobType, String min_salary, String max_salary, String min_number, String max_number, Integer requirement, Integer userId, String encoding) {
|
public Integer addJob(List<String> address, String address_detail, String details, String jobName, String startTime, String endTime, List<String> jobTips, Integer jobType, String min_salary, String max_salary, String min_number, String max_number, Integer requirement, Integer userId, String encoding) {
|
||||||
//查看岗位名称是否存在
|
//查看岗位名称是否存在
|
||||||
|
@ -204,12 +208,30 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JobEntity getJobById(Integer id) {
|
public VxJobDetailDto getJobById(Integer id) {
|
||||||
LambdaQueryWrapper<JobEntity> queryWrapper=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<JobEntity> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq(JobEntity::getId,id);
|
queryWrapper.eq(JobEntity::getId,id);
|
||||||
|
|
||||||
return jobMapper.selectOne(queryWrapper);
|
JobEntity jobEntity = jobMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
VxJobDetailDto vxJobDetailDto=new VxJobDetailDto();
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(jobEntity,vxJobDetailDto);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<VxJobLike> queryWrapper1=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper1.eq(VxJobLike::getJobId,jobEntity.getId());
|
||||||
|
|
||||||
|
VxJobLike vxJobLike = vxJobLikeMapper.selectOne(queryWrapper1);
|
||||||
|
|
||||||
|
if(vxJobLike!=null){
|
||||||
|
vxJobDetailDto.setIsLike(1);
|
||||||
|
return vxJobDetailDto;
|
||||||
|
}
|
||||||
|
vxJobDetailDto.setIsLike(0);
|
||||||
|
return vxJobDetailDto;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -422,8 +444,30 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
||||||
result.add(jobEntitys);
|
result.add(jobEntitys);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<JobDto> getYourLikeJob(Integer jobId) {
|
||||||
|
LambdaQueryWrapper<JobEntity> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.like(JobEntity::getId,jobId);
|
||||||
|
List<JobEntity> vxJobLikes = jobMapper.selectList(queryWrapper);
|
||||||
|
List<JobDto> jobDtos=vxJobLikes.stream().map(item->{
|
||||||
|
JobDto vxJobLikeDto=new JobDto();
|
||||||
|
BeanUtils.copyProperties(item,vxJobLikeDto);
|
||||||
|
//获取岗位名称
|
||||||
|
LambdaQueryWrapper<JobEntity> queryWrapper1=new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper1.eq(JobEntity::getId,item.getId());
|
||||||
|
JobEntity jobById = jobMapper.selectOne(queryWrapper1);
|
||||||
|
vxJobLikeDto.setJobName(jobById.getJobName());
|
||||||
|
//获取薪水
|
||||||
|
vxJobLikeDto.setSalary(jobById.getMinSalary()+"-"+jobById.getMaxSalary());
|
||||||
|
//获取公司名称
|
||||||
|
Company company=companyService.getCompanyDetail(item.getCompanyEncoding());
|
||||||
|
vxJobLikeDto.setCompany(company);
|
||||||
|
//获取员工人数
|
||||||
|
//获取公司位置
|
||||||
|
return vxJobLikeDto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return jobDtos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue