feat: Implement job fair company registration review workflow
- Added review status fields to the public_job_fair_company table to manage company registration states (pending, approved, rejected). - Enhanced PublicJobFairServiceImpl to handle company registration, review, and job management for companies. - Updated PublicJobFairMapper.xml with new SQL queries for managing company relations and reviews. - Created migration script to add review fields and set default values for existing records. - Introduced new permissions for company users to manage job postings and registration status. - Added utility methods for ensuring proper role checks and company retrieval.
This commit is contained in:
@@ -15,6 +15,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 公共招聘会管理Controller(CMS后台)
|
||||
@@ -61,6 +62,17 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
return success(publicJobFairService.selectById(jobFairId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业报名线上招聘会,报名记录进入待审核状态。
|
||||
*/
|
||||
@ApiOperation("企业报名招聘会")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:signup')")
|
||||
@Log(title = "企业报名招聘会", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/{jobFairId}/company/signup")
|
||||
public AjaxResult signup(@ApiParam("招聘会ID") @PathVariable String jobFairId) {
|
||||
return publicJobFairService.signupCurrentCompany(jobFairId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招聘会
|
||||
*/
|
||||
@@ -98,7 +110,7 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
* 添加企业到招聘会
|
||||
*/
|
||||
@ApiOperation("添加企业到招聘会")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:company:add')")
|
||||
@Log(title = "招聘会添加企业", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/company")
|
||||
public AjaxResult addCompany(@RequestBody PublicJobFairCompany company) {
|
||||
@@ -109,7 +121,7 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
* 批量添加企业到招聘会
|
||||
*/
|
||||
@ApiOperation("批量添加企业到招聘会")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:company:add')")
|
||||
@Log(title = "招聘会批量添加企业", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/company/batch")
|
||||
public AjaxResult addCompanyBatch(@RequestBody List<PublicJobFairCompany> companies) {
|
||||
@@ -120,18 +132,35 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
* 移除招聘会企业
|
||||
*/
|
||||
@ApiOperation("移除招聘会企业")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:company:remove')")
|
||||
@Log(title = "移除招聘会企业", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/company/{id}")
|
||||
public AjaxResult removeCompany(@ApiParam("关联ID") @PathVariable String id) {
|
||||
return toAjax(publicJobFairService.removeCompany(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员审核企业报名。
|
||||
*/
|
||||
@ApiOperation("审核招聘会参会企业")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:review')")
|
||||
@Log(title = "审核招聘会参会企业", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{jobFairId}/companies/{relationId}/review")
|
||||
public AjaxResult reviewCompany(@ApiParam("招聘会ID") @PathVariable String jobFairId,
|
||||
@ApiParam("企业报名关联ID") @PathVariable String relationId,
|
||||
@RequestBody Map<String, Object> request) {
|
||||
String reviewStatus = request == null || request.get("reviewStatus") == null
|
||||
? null : String.valueOf(request.get("reviewStatus"));
|
||||
String reviewRemark = request == null || request.get("reviewRemark") == null
|
||||
? null : String.valueOf(request.get("reviewRemark"));
|
||||
return publicJobFairService.reviewCompany(jobFairId, relationId, reviewStatus, reviewRemark);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加岗位到招聘会
|
||||
*/
|
||||
@ApiOperation("添加岗位到招聘会")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:add')")
|
||||
@Log(title = "招聘会添加岗位", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/job")
|
||||
public AjaxResult addJob(@RequestBody PublicJobFairJob job) {
|
||||
@@ -142,7 +171,7 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
* 批量添加岗位到招聘会
|
||||
*/
|
||||
@ApiOperation("批量添加岗位到招聘会")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:add')")
|
||||
@Log(title = "招聘会批量添加岗位", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/job/batch")
|
||||
public AjaxResult addJobBatch(@RequestBody List<PublicJobFairJob> jobs) {
|
||||
@@ -153,13 +182,50 @@ public class CmsPublicJobFairController extends BaseController {
|
||||
* 移除招聘会岗位
|
||||
*/
|
||||
@ApiOperation("移除招聘会岗位")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:remove')")
|
||||
@Log(title = "移除招聘会岗位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/job/{id}")
|
||||
public AjaxResult removeJob(@ApiParam("关联ID") @PathVariable String id) {
|
||||
return toAjax(publicJobFairService.removeJob(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业新增已审核通过招聘会的报名岗位。
|
||||
*/
|
||||
@ApiOperation("企业新增报名岗位")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:add')")
|
||||
@Log(title = "企业新增报名岗位", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/{jobFairId}/company/jobs")
|
||||
public AjaxResult addCurrentCompanyJob(@ApiParam("招聘会ID") @PathVariable String jobFairId,
|
||||
@RequestBody com.ruoyi.cms.domain.Job job) {
|
||||
return publicJobFairService.addCurrentCompanyJob(jobFairId, job);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业修改自己的报名岗位。
|
||||
*/
|
||||
@ApiOperation("企业修改报名岗位")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:edit')")
|
||||
@Log(title = "企业修改报名岗位", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{jobFairId}/company/jobs/{jobId}")
|
||||
public AjaxResult updateCurrentCompanyJob(@ApiParam("招聘会ID") @PathVariable String jobFairId,
|
||||
@ApiParam("岗位ID") @PathVariable Long jobId,
|
||||
@RequestBody com.ruoyi.cms.domain.Job job) {
|
||||
return publicJobFairService.updateCurrentCompanyJob(jobFairId, jobId, job);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业删除自己的报名岗位。
|
||||
*/
|
||||
@ApiOperation("企业删除报名岗位")
|
||||
@PreAuthorize("@ss.hasPermi('cms:publicJobFair:job:remove')")
|
||||
@Log(title = "企业删除报名岗位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jobFairId}/company/jobs/{jobId}")
|
||||
public AjaxResult removeCurrentCompanyJob(@ApiParam("招聘会ID") @PathVariable String jobFairId,
|
||||
@ApiParam("岗位ID") @PathVariable Long jobId) {
|
||||
return publicJobFairService.removeCurrentCompanyJob(jobFairId, jobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招聘会报名列表
|
||||
*/
|
||||
|
||||
@@ -94,6 +94,12 @@ public class PublicJobFair implements Serializable {
|
||||
@ApiModelProperty("是否报名")
|
||||
private String isSignUp;
|
||||
|
||||
@ApiModelProperty("当前企业是否可以报名")
|
||||
private Boolean canSignUp;
|
||||
|
||||
@ApiModelProperty("当前企业是否可以维护报名岗位")
|
||||
private Boolean canEditJobs;
|
||||
|
||||
@ApiModelProperty("企业数量")
|
||||
private String enterpriseNum;
|
||||
|
||||
|
||||
@@ -42,4 +42,17 @@ public class PublicJobFairCompany implements Serializable {
|
||||
|
||||
@ApiModelProperty("删除标志")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty("审核状态 0待审核 1通过 2驳回")
|
||||
private String reviewStatus;
|
||||
|
||||
@ApiModelProperty("审核人")
|
||||
private String reviewBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("审核时间")
|
||||
private Date reviewTime;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewRemark;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,30 @@ public class PublicJobFairCompanyVO implements Serializable {
|
||||
@ApiModelProperty("企业类型")
|
||||
private String companyType;
|
||||
|
||||
@ApiModelProperty("审核状态 0待审核 1通过 2驳回")
|
||||
private String reviewStatus;
|
||||
|
||||
@ApiModelProperty("审核人")
|
||||
private String reviewBy;
|
||||
|
||||
@ApiModelProperty("审核时间")
|
||||
private java.util.Date reviewTime;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewRemark;
|
||||
|
||||
@ApiModelProperty("是否可以审核")
|
||||
private Boolean canReview;
|
||||
|
||||
@ApiModelProperty("是否可以添加岗位")
|
||||
private Boolean canAddJob;
|
||||
|
||||
@ApiModelProperty("是否可以移除企业")
|
||||
private Boolean canRemoveCompany;
|
||||
|
||||
@ApiModelProperty("当前企业是否可以编辑岗位")
|
||||
private Boolean canEditJobs;
|
||||
|
||||
@ApiModelProperty("在招职位列表")
|
||||
private List<Job> jobInfoList;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,28 @@ public interface PublicJobFairMapper extends BaseMapper<PublicJobFair> {
|
||||
*/
|
||||
List<PublicJobFairCompanyVO> selectCompanyListByJobFairId(@Param("jobFairId") String jobFairId);
|
||||
|
||||
/**
|
||||
* 查询指定企业在招聘会中的关联记录。
|
||||
*/
|
||||
PublicJobFairCompany selectCompanyRelation(@Param("jobFairId") String jobFairId,
|
||||
@Param("companyId") Long companyId);
|
||||
|
||||
/**
|
||||
* 批量查询指定企业的招聘会报名状态。
|
||||
*/
|
||||
List<PublicJobFairCompany> selectCompanyRelations(@Param("jobFairIds") List<String> jobFairIds,
|
||||
@Param("companyId") Long companyId);
|
||||
|
||||
/**
|
||||
* 查询招聘会企业关联记录。
|
||||
*/
|
||||
PublicJobFairCompany selectCompanyRelationById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 审核招聘会企业报名。
|
||||
*/
|
||||
int updateCompanyReview(PublicJobFairCompany relation);
|
||||
|
||||
/**
|
||||
* 查询招聘会关联的岗位列表
|
||||
*/
|
||||
@@ -94,6 +116,12 @@ public interface PublicJobFairMapper extends BaseMapper<PublicJobFair> {
|
||||
*/
|
||||
int deleteJobFairCompanyById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 删除招聘会中指定企业的全部岗位关联。
|
||||
*/
|
||||
int deleteJobFairJobsByCompany(@Param("jobFairId") String jobFairId,
|
||||
@Param("companyId") Long companyId);
|
||||
|
||||
/**
|
||||
* 添加岗位到招聘会
|
||||
*/
|
||||
@@ -109,6 +137,17 @@ public interface PublicJobFairMapper extends BaseMapper<PublicJobFair> {
|
||||
*/
|
||||
int deleteJobFairJobById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 查询招聘会岗位关联。
|
||||
*/
|
||||
PublicJobFairJob selectJobRelation(@Param("jobFairId") String jobFairId,
|
||||
@Param("jobId") Long jobId);
|
||||
|
||||
/**
|
||||
* 根据关联主键查询招聘会岗位关联。
|
||||
*/
|
||||
PublicJobFairJob selectJobRelationById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 查询招聘会报名列表(包含用户信息)
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.cms.service.rc;
|
||||
|
||||
import com.ruoyi.cms.domain.rc.*;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -76,6 +78,16 @@ public interface IPublicJobFairService {
|
||||
*/
|
||||
int addCompanyBatch(List<PublicJobFairCompany> companies);
|
||||
|
||||
/**
|
||||
* 当前企业报名招聘会,进入待审核状态。
|
||||
*/
|
||||
AjaxResult signupCurrentCompany(String jobFairId);
|
||||
|
||||
/**
|
||||
* 审核企业报名。
|
||||
*/
|
||||
AjaxResult reviewCompany(String jobFairId, String relationId, String reviewStatus, String reviewRemark);
|
||||
|
||||
/**
|
||||
* 移除招聘会企业
|
||||
*/
|
||||
@@ -96,6 +108,21 @@ public interface IPublicJobFairService {
|
||||
*/
|
||||
int removeJob(String id);
|
||||
|
||||
/**
|
||||
* 当前企业新增报名岗位。
|
||||
*/
|
||||
AjaxResult addCurrentCompanyJob(String jobFairId, Job job);
|
||||
|
||||
/**
|
||||
* 当前企业修改报名岗位。
|
||||
*/
|
||||
AjaxResult updateCurrentCompanyJob(String jobFairId, Long jobId, Job job);
|
||||
|
||||
/**
|
||||
* 当前企业删除报名岗位。
|
||||
*/
|
||||
AjaxResult removeCurrentCompanyJob(String jobFairId, Long jobId);
|
||||
|
||||
/**
|
||||
* 查询招聘会报名列表
|
||||
*/
|
||||
|
||||
@@ -91,6 +91,9 @@ public class JobFairSignUpServiceImpl extends ServiceImpl<JobFairSignUpMapper, J
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult companySignUp(CompanyJobFairSignUpVO signUpVO) {
|
||||
// 1. 校验参数
|
||||
if (signUpVO == null) {
|
||||
return AjaxResult.error("报名参数不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(signUpVO.getJobFairId())) {
|
||||
return AjaxResult.error("招聘会ID不能为空");
|
||||
}
|
||||
@@ -121,19 +124,31 @@ public class JobFairSignUpServiceImpl extends ServiceImpl<JobFairSignUpMapper, J
|
||||
Long companyId = company.getCompanyId();
|
||||
|
||||
// 4. 检查企业是否已报名该招聘会
|
||||
List<com.ruoyi.cms.domain.rc.PublicJobFairCompanyVO> existCompanies = publicJobFairMapper.selectCompanyListByJobFairId(jobFairId);
|
||||
boolean alreadySignUp = existCompanies.stream().anyMatch(c -> companyId.equals(c.getCompanyId()));
|
||||
if (alreadySignUp) {
|
||||
PublicJobFairCompany existingRelation = publicJobFairMapper.selectCompanyRelation(jobFairId, companyId);
|
||||
if (existingRelation != null && !"2".equals(existingRelation.getReviewStatus())) {
|
||||
return AjaxResult.error("您的企业已报名该招聘会,请勿重复报名");
|
||||
}
|
||||
|
||||
// 5. 创建企业-招聘会关联 (public_job_fair_company)
|
||||
PublicJobFairCompany fairCompany = new PublicJobFairCompany();
|
||||
fairCompany.setId(IdUtil.simpleUUID());
|
||||
fairCompany.setJobFairId(jobFairId);
|
||||
fairCompany.setCompanyId(companyId);
|
||||
fairCompany.setCreateTime(new Date());
|
||||
publicJobFairMapper.insertJobFairCompany(fairCompany);
|
||||
Date now = new Date();
|
||||
PublicJobFairCompany fairCompany = existingRelation;
|
||||
if (fairCompany == null) {
|
||||
fairCompany = new PublicJobFairCompany();
|
||||
fairCompany.setId(IdUtil.simpleUUID());
|
||||
fairCompany.setJobFairId(jobFairId);
|
||||
fairCompany.setCompanyId(companyId);
|
||||
fairCompany.setCreateTime(now);
|
||||
fairCompany.setReviewStatus("0");
|
||||
publicJobFairMapper.insertJobFairCompany(fairCompany);
|
||||
} else {
|
||||
// 被驳回后重新报名,恢复为待审核并清空旧审核意见。
|
||||
fairCompany.setReviewStatus("0");
|
||||
fairCompany.setReviewBy(null);
|
||||
fairCompany.setReviewTime(null);
|
||||
fairCompany.setReviewRemark(null);
|
||||
fairCompany.setUpdateTime(now);
|
||||
publicJobFairMapper.updateCompanyReview(fairCompany);
|
||||
}
|
||||
|
||||
// 6. 批量插入岗位到job表,并创建岗位-招聘会关联
|
||||
List<Job> jobList = signUpVO.getJobList();
|
||||
@@ -155,7 +170,7 @@ public class JobFairSignUpServiceImpl extends ServiceImpl<JobFairSignUpMapper, J
|
||||
fairJob.setJobFairId(jobFairId);
|
||||
fairJob.setJobId(job.getJobId());
|
||||
fairJob.setCompanyId(companyId);
|
||||
fairJob.setCreateTime(new Date());
|
||||
fairJob.setCreateTime(now);
|
||||
fairJobList.add(fairJob);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,23 @@ package com.ruoyi.cms.service.rc.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.rc.*;
|
||||
import com.ruoyi.cms.mapper.CompanyMapper;
|
||||
import com.ruoyi.cms.mapper.rc.PublicJobFairMapper;
|
||||
import com.ruoyi.cms.service.ICompanyService;
|
||||
import com.ruoyi.cms.service.IJobService;
|
||||
import com.ruoyi.cms.service.rc.IPublicJobFairService;
|
||||
import com.ruoyi.cms.util.RoleUtils;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.Company;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,8 +26,12 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -29,10 +44,20 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
@Autowired
|
||||
private PublicJobFairMapper publicJobFairMapper;
|
||||
|
||||
@Autowired
|
||||
private CompanyMapper companyMapper;
|
||||
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
|
||||
@Autowired
|
||||
private IJobService jobService;
|
||||
|
||||
@Override
|
||||
public PublicJobFairResponse getJobFairPage(PublicJobFairQuery query) {
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
List<PublicJobFair> list = publicJobFairMapper.selectPublicJobFairList(query);
|
||||
fillCompanyApplyState(list);
|
||||
PageInfo<PublicJobFair> pageInfo = new PageInfo<>(list);
|
||||
|
||||
PublicJobFairResponse response = new PublicJobFairResponse();
|
||||
@@ -93,14 +118,38 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
@Override
|
||||
public List<PublicJobFairCompanyVO> getEnterprisesWithJobs(String jobFairId) {
|
||||
List<PublicJobFairCompanyVO> companyList = publicJobFairMapper.selectCompanyListByJobFairId(jobFairId);
|
||||
|
||||
if (companyList != null && !companyList.isEmpty()) {
|
||||
for (PublicJobFairCompanyVO company : companyList) {
|
||||
List<Job> jobList = publicJobFairMapper.selectJobListByJobFairIdAndCompanyId(jobFairId, company.getCompanyId());
|
||||
company.setJobInfoList(jobList);
|
||||
}
|
||||
|
||||
if (companyList == null || companyList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return companyList;
|
||||
|
||||
boolean enterpriseRole = RoleUtils.isCompanyAdmin();
|
||||
boolean cmsAdmin = SecurityUtils.isLogin() && !enterpriseRole;
|
||||
Company currentCompany = enterpriseRole ? getCurrentCompanyOrNull() : null;
|
||||
if (enterpriseRole && currentCompany == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<PublicJobFairCompanyVO> visibleCompanies = companyList.stream()
|
||||
.filter(company -> !enterpriseRole
|
||||
|| currentCompany.getCompanyId().equals(company.getCompanyId()))
|
||||
.collect(Collectors.toList());
|
||||
for (PublicJobFairCompanyVO company : visibleCompanies) {
|
||||
String reviewStatus = effectiveReviewStatus(company.getReviewStatus());
|
||||
company.setReviewStatus(reviewStatus);
|
||||
// 管理员审核,并且审核通过后才允许添加岗位/移除企业。
|
||||
company.setCanReview(cmsAdmin && !"1".equals(reviewStatus));
|
||||
company.setCanAddJob(cmsAdmin && "1".equals(reviewStatus));
|
||||
company.setCanRemoveCompany(cmsAdmin && "1".equals(reviewStatus));
|
||||
// 企业角色只维护自己的岗位,且报名审核必须通过。
|
||||
company.setCanEditJobs(enterpriseRole && "1".equals(reviewStatus)
|
||||
&& currentCompany != null
|
||||
&& currentCompany.getCompanyId().equals(company.getCompanyId()));
|
||||
List<Job> jobList = publicJobFairMapper.selectJobListByJobFairIdAndCompanyId(
|
||||
jobFairId, company.getCompanyId());
|
||||
company.setJobInfoList(jobList);
|
||||
}
|
||||
return visibleCompanies;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,7 +171,9 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
|
||||
@Override
|
||||
public List<PublicJobFair> selectList(PublicJobFairQuery query) {
|
||||
return publicJobFairMapper.selectPublicJobFairList(query);
|
||||
List<PublicJobFair> list = publicJobFairMapper.selectPublicJobFairList(query);
|
||||
fillCompanyApplyState(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,34 +213,148 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
@Override
|
||||
@Transactional
|
||||
public int addCompany(PublicJobFairCompany company) {
|
||||
if (company == null || StringUtils.isBlank(company.getJobFairId()) || company.getCompanyId() == null) {
|
||||
throw new ServiceException("招聘会和企业不能为空");
|
||||
}
|
||||
ensureAdminOperation();
|
||||
ensureJobFairExists(company.getJobFairId());
|
||||
if (publicJobFairMapper.selectCompanyRelation(company.getJobFairId(), company.getCompanyId()) != null) {
|
||||
throw new ServiceException("该企业已参加当前招聘会");
|
||||
}
|
||||
company.setId(IdUtils.fastSimpleUUID());
|
||||
company.setCreateTime(new Date());
|
||||
company.setCreateBy(SecurityUtils.getUsername());
|
||||
// 管理员直接添加的企业视为已审核通过。
|
||||
company.setReviewStatus("1");
|
||||
return publicJobFairMapper.insertJobFairCompany(company);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int addCompanyBatch(List<PublicJobFairCompany> companies) {
|
||||
ensureAdminOperation();
|
||||
if (companies == null || companies.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date now = new Date();
|
||||
for (PublicJobFairCompany company : companies) {
|
||||
if (company == null || StringUtils.isBlank(company.getJobFairId()) || company.getCompanyId() == null) {
|
||||
throw new ServiceException("招聘会和企业不能为空");
|
||||
}
|
||||
ensureJobFairExists(company.getJobFairId());
|
||||
if (publicJobFairMapper.selectCompanyRelation(company.getJobFairId(), company.getCompanyId()) != null) {
|
||||
throw new ServiceException("企业已参加当前招聘会,不能重复添加");
|
||||
}
|
||||
company.setId(IdUtils.fastSimpleUUID());
|
||||
company.setCreateTime(now);
|
||||
company.setCreateBy(username);
|
||||
company.setReviewStatus("1");
|
||||
}
|
||||
return publicJobFairMapper.insertJobFairCompanyBatch(companies);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult signupCurrentCompany(String jobFairId) {
|
||||
if (!RoleUtils.isCompanyAdmin()) {
|
||||
return AjaxResult.error("仅企业用户可以报名招聘会");
|
||||
}
|
||||
if (StringUtils.isBlank(jobFairId)) {
|
||||
return AjaxResult.error("招聘会ID不能为空");
|
||||
}
|
||||
ensureJobFairExists(jobFairId);
|
||||
Company company = getCurrentCompanyOrThrow();
|
||||
PublicJobFairCompany relation = publicJobFairMapper.selectCompanyRelation(
|
||||
jobFairId, company.getCompanyId());
|
||||
Date now = new Date();
|
||||
if (relation != null && !"2".equals(effectiveReviewStatus(relation.getReviewStatus()))) {
|
||||
return AjaxResult.error("您的企业已报名该招聘会,请勿重复报名");
|
||||
}
|
||||
if (relation == null) {
|
||||
relation = new PublicJobFairCompany();
|
||||
relation.setId(IdUtils.fastSimpleUUID());
|
||||
relation.setJobFairId(jobFairId);
|
||||
relation.setCompanyId(company.getCompanyId());
|
||||
relation.setCreateBy(SecurityUtils.getUsername());
|
||||
relation.setCreateTime(now);
|
||||
relation.setReviewStatus("0");
|
||||
publicJobFairMapper.insertJobFairCompany(relation);
|
||||
} else {
|
||||
// 被驳回后允许重新报名,并清空上一次审核结论。
|
||||
relation.setReviewStatus("0");
|
||||
relation.setReviewBy(null);
|
||||
relation.setReviewTime(null);
|
||||
relation.setReviewRemark(null);
|
||||
relation.setUpdateBy(SecurityUtils.getUsername());
|
||||
relation.setUpdateTime(now);
|
||||
publicJobFairMapper.updateCompanyReview(relation);
|
||||
}
|
||||
return AjaxResult.success("报名成功,等待管理员审核", relation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult reviewCompany(String jobFairId, String relationId,
|
||||
String reviewStatus, String reviewRemark) {
|
||||
ensureAdminOperation();
|
||||
if (StringUtils.isBlank(jobFairId) || StringUtils.isBlank(relationId)) {
|
||||
return AjaxResult.error("招聘会和报名记录不能为空");
|
||||
}
|
||||
if (!isValidReviewStatus(reviewStatus)) {
|
||||
return AjaxResult.error("审核状态不正确");
|
||||
}
|
||||
if ("2".equals(reviewStatus) && StringUtils.isBlank(reviewRemark)) {
|
||||
return AjaxResult.error("驳回时请填写原因");
|
||||
}
|
||||
PublicJobFairCompany relation = publicJobFairMapper.selectCompanyRelationById(relationId);
|
||||
if (relation == null || !jobFairId.equals(relation.getJobFairId())) {
|
||||
return AjaxResult.error("参会企业报名记录不存在");
|
||||
}
|
||||
relation.setReviewStatus(reviewStatus);
|
||||
relation.setReviewBy(SecurityUtils.getUsername());
|
||||
relation.setReviewTime(new Date());
|
||||
relation.setReviewRemark(StringUtils.isBlank(reviewRemark) ? null : reviewRemark.trim());
|
||||
relation.setUpdateBy(SecurityUtils.getUsername());
|
||||
relation.setUpdateTime(new Date());
|
||||
int updated = publicJobFairMapper.updateCompanyReview(relation);
|
||||
return updated > 0 ? AjaxResult.success("审核完成", relation) : AjaxResult.error("审核失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int removeCompany(String id) {
|
||||
ensureAdminOperation();
|
||||
PublicJobFairCompany relation = publicJobFairMapper.selectCompanyRelationById(id);
|
||||
if (relation == null) {
|
||||
throw new ServiceException("参会企业不存在");
|
||||
}
|
||||
ensureApproved(relation);
|
||||
publicJobFairMapper.deleteJobFairJobsByCompany(relation.getJobFairId(), relation.getCompanyId());
|
||||
return publicJobFairMapper.deleteJobFairCompanyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int addJob(PublicJobFairJob job) {
|
||||
ensureAdminOperation();
|
||||
if (job == null || StringUtils.isBlank(job.getJobFairId()) || job.getJobId() == null) {
|
||||
throw new ServiceException("招聘会和岗位不能为空");
|
||||
}
|
||||
Job existingJob = jobService.selectJobByJobId(job.getJobId());
|
||||
if (existingJob == null) {
|
||||
throw new ServiceException("岗位不存在");
|
||||
}
|
||||
if (job.getCompanyId() == null) {
|
||||
job.setCompanyId(existingJob.getCompanyId());
|
||||
}
|
||||
if (!job.getCompanyId().equals(existingJob.getCompanyId())) {
|
||||
throw new ServiceException("岗位不属于所选企业");
|
||||
}
|
||||
ensureApproved(job.getJobFairId(), job.getCompanyId());
|
||||
if (publicJobFairMapper.selectJobRelation(job.getJobFairId(), job.getJobId()) != null) {
|
||||
throw new ServiceException("该岗位已添加到当前招聘会");
|
||||
}
|
||||
job.setId(IdUtils.fastSimpleUUID());
|
||||
job.setCreateTime(new Date());
|
||||
job.setCreateBy(SecurityUtils.getUsername());
|
||||
@@ -199,9 +364,30 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
@Override
|
||||
@Transactional
|
||||
public int addJobBatch(List<PublicJobFairJob> jobs) {
|
||||
ensureAdminOperation();
|
||||
if (jobs == null || jobs.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date now = new Date();
|
||||
for (PublicJobFairJob job : jobs) {
|
||||
if (job == null || StringUtils.isBlank(job.getJobFairId()) || job.getJobId() == null) {
|
||||
throw new ServiceException("招聘会和岗位不能为空");
|
||||
}
|
||||
Job existingJob = jobService.selectJobByJobId(job.getJobId());
|
||||
if (existingJob == null) {
|
||||
throw new ServiceException("岗位不存在");
|
||||
}
|
||||
if (job.getCompanyId() == null) {
|
||||
job.setCompanyId(existingJob.getCompanyId());
|
||||
}
|
||||
if (!job.getCompanyId().equals(existingJob.getCompanyId())) {
|
||||
throw new ServiceException("岗位不属于所选企业");
|
||||
}
|
||||
ensureApproved(job.getJobFairId(), job.getCompanyId());
|
||||
if (publicJobFairMapper.selectJobRelation(job.getJobFairId(), job.getJobId()) != null) {
|
||||
throw new ServiceException("岗位已添加到当前招聘会,不能重复添加");
|
||||
}
|
||||
job.setId(IdUtils.fastSimpleUUID());
|
||||
job.setCreateTime(now);
|
||||
job.setCreateBy(username);
|
||||
@@ -212,9 +398,233 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
@Override
|
||||
@Transactional
|
||||
public int removeJob(String id) {
|
||||
ensureAdminOperation();
|
||||
PublicJobFairJob relation = publicJobFairMapper.selectJobRelationById(id);
|
||||
if (relation == null) {
|
||||
throw new ServiceException("招聘会岗位不存在");
|
||||
}
|
||||
ensureApproved(relation.getJobFairId(), relation.getCompanyId());
|
||||
return publicJobFairMapper.deleteJobFairJobById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addCurrentCompanyJob(String jobFairId, Job job) {
|
||||
ensureCompanyOperation();
|
||||
if (StringUtils.isBlank(jobFairId) || job == null) {
|
||||
return AjaxResult.error("招聘会和岗位不能为空");
|
||||
}
|
||||
Company company = getCurrentCompanyOrThrow();
|
||||
ensureApproved(jobFairId, company.getCompanyId());
|
||||
job.setJobId(null);
|
||||
job.setCompanyId(company.getCompanyId());
|
||||
job.setCompanyName(company.getName());
|
||||
if (job.getIsPublish() == null) {
|
||||
job.setIsPublish(1);
|
||||
}
|
||||
int inserted = jobService.insertJob(job);
|
||||
if (inserted <= 0 || job.getJobId() == null) {
|
||||
return AjaxResult.error("岗位新增失败");
|
||||
}
|
||||
PublicJobFairJob relation = new PublicJobFairJob();
|
||||
relation.setId(IdUtils.fastSimpleUUID());
|
||||
relation.setJobFairId(jobFairId);
|
||||
relation.setJobId(job.getJobId());
|
||||
relation.setCompanyId(company.getCompanyId());
|
||||
relation.setCreateBy(SecurityUtils.getUsername());
|
||||
relation.setCreateTime(new Date());
|
||||
publicJobFairMapper.insertJobFairJob(relation);
|
||||
return AjaxResult.success(job);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult updateCurrentCompanyJob(String jobFairId, Long jobId, Job job) {
|
||||
ensureCompanyOperation();
|
||||
if (StringUtils.isBlank(jobFairId) || jobId == null || job == null) {
|
||||
return AjaxResult.error("招聘会、岗位和岗位内容不能为空");
|
||||
}
|
||||
Company company = getCurrentCompanyOrThrow();
|
||||
PublicJobFairJob relation = ensureCurrentCompanyJob(jobFairId, jobId, company.getCompanyId());
|
||||
ensureApproved(relation);
|
||||
job.setJobId(jobId);
|
||||
job.setCompanyId(company.getCompanyId());
|
||||
job.setCompanyName(company.getName());
|
||||
// 企业编辑报名岗位时不改变岗位发布状态。
|
||||
job.setIsPublish(null);
|
||||
return jobService.updateJob(job) > 0
|
||||
? AjaxResult.success(job)
|
||||
: AjaxResult.error("岗位修改失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult removeCurrentCompanyJob(String jobFairId, Long jobId) {
|
||||
ensureCompanyOperation();
|
||||
if (StringUtils.isBlank(jobFairId) || jobId == null) {
|
||||
return AjaxResult.error("招聘会和岗位不能为空");
|
||||
}
|
||||
Company company = getCurrentCompanyOrThrow();
|
||||
PublicJobFairJob relation = ensureCurrentCompanyJob(jobFairId, jobId, company.getCompanyId());
|
||||
ensureApproved(relation);
|
||||
int relationDeleted = publicJobFairMapper.deleteJobFairJobById(relation.getId());
|
||||
int jobDeleted = jobService.deleteJobByJobIds(new Long[]{jobId});
|
||||
return relationDeleted > 0 && jobDeleted > 0
|
||||
? AjaxResult.success("岗位已移除")
|
||||
: AjaxResult.error("岗位移除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 为企业端列表补充报名状态和按钮状态。
|
||||
*/
|
||||
private void fillCompanyApplyState(List<PublicJobFair> list) {
|
||||
if (list == null || list.isEmpty() || !RoleUtils.isCompanyAdmin()) {
|
||||
return;
|
||||
}
|
||||
Company company = getCurrentCompanyOrNull();
|
||||
if (company == null) {
|
||||
for (PublicJobFair fair : list) {
|
||||
fair.setIsSignUp("0");
|
||||
fair.setCanSignUp(false);
|
||||
fair.setCanEditJobs(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> jobFairIds = list.stream()
|
||||
.map(PublicJobFair::getJobFairId)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, PublicJobFairCompany> relationMap = new HashMap<>();
|
||||
if (!jobFairIds.isEmpty()) {
|
||||
publicJobFairMapper.selectCompanyRelations(jobFairIds, company.getCompanyId())
|
||||
.forEach(relation -> relationMap.putIfAbsent(relation.getJobFairId(), relation));
|
||||
}
|
||||
for (PublicJobFair fair : list) {
|
||||
PublicJobFairCompany relation = relationMap.get(fair.getJobFairId());
|
||||
String reviewStatus = relation == null ? null : effectiveReviewStatus(relation.getReviewStatus());
|
||||
fair.setIsSignUp(relation == null ? "0" : "1");
|
||||
fair.setEnterpriseId(String.valueOf(company.getCompanyId()));
|
||||
fair.setEnterpriseReviewStatus(reviewStatus);
|
||||
fair.setEnterpriseReviewComments(relation == null ? null : relation.getReviewRemark());
|
||||
fair.setCanSignUp(relation == null || "2".equals(reviewStatus));
|
||||
fair.setCanEditJobs("1".equals(reviewStatus));
|
||||
}
|
||||
}
|
||||
|
||||
private String effectiveReviewStatus(String reviewStatus) {
|
||||
return StringUtils.isBlank(reviewStatus) ? "1" : reviewStatus;
|
||||
}
|
||||
|
||||
private boolean isValidReviewStatus(String reviewStatus) {
|
||||
return "0".equals(reviewStatus) || "1".equals(reviewStatus) || "2".equals(reviewStatus);
|
||||
}
|
||||
|
||||
private void ensureCompanyOperation() {
|
||||
if (!RoleUtils.isCompanyAdmin()) {
|
||||
throw new ServiceException("仅企业用户可以维护报名岗位");
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureAdminOperation() {
|
||||
if (RoleUtils.isCompanyAdmin()) {
|
||||
throw new ServiceException("企业用户不能执行管理员操作");
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureJobFairExists(String jobFairId) {
|
||||
if (StringUtils.isBlank(jobFairId)
|
||||
|| publicJobFairMapper.selectPublicJobFairById(jobFairId) == null) {
|
||||
throw new ServiceException("招聘会不存在");
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureApproved(String jobFairId, Long companyId) {
|
||||
if (companyId == null) {
|
||||
throw new ServiceException("企业不能为空");
|
||||
}
|
||||
PublicJobFairCompany relation = publicJobFairMapper.selectCompanyRelation(jobFairId, companyId);
|
||||
if (relation == null) {
|
||||
throw new ServiceException("该企业未报名当前招聘会");
|
||||
}
|
||||
ensureApproved(relation);
|
||||
}
|
||||
|
||||
private void ensureApproved(PublicJobFairCompany relation) {
|
||||
if (relation == null || !"1".equals(effectiveReviewStatus(relation.getReviewStatus()))) {
|
||||
throw new ServiceException("报名审核通过后才能操作");
|
||||
}
|
||||
}
|
||||
|
||||
private PublicJobFairJob ensureCurrentCompanyJob(String jobFairId, Long jobId, Long companyId) {
|
||||
PublicJobFairJob relation = publicJobFairMapper.selectJobRelation(jobFairId, jobId);
|
||||
if (relation == null) {
|
||||
throw new ServiceException("当前招聘会不存在该岗位");
|
||||
}
|
||||
if (!companyId.equals(relation.getCompanyId())) {
|
||||
throw new ServiceException("只能维护本企业报名岗位");
|
||||
}
|
||||
return relation;
|
||||
}
|
||||
|
||||
private Company getCurrentCompanyOrThrow() {
|
||||
Company company = getCurrentCompanyOrNull();
|
||||
if (company == null) {
|
||||
throw new ServiceException("未查询到当前登录企业信息");
|
||||
}
|
||||
return company;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业账号的历史数据可能只保存了统一信用代码,部分账号则通过 company.user_id 关联。
|
||||
* 两种方式都保留,和户外招聘会的企业识别规则一致。
|
||||
*/
|
||||
private Company getCurrentCompanyOrNull() {
|
||||
if (!RoleUtils.isCompanyAdmin() || !SecurityUtils.isLogin()) {
|
||||
return null;
|
||||
}
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser == null || loginUser.getUser() == null) {
|
||||
return null;
|
||||
}
|
||||
SysUser sysUser = loginUser.getUser();
|
||||
if (StringUtils.isNotBlank(sysUser.getIdCard())) {
|
||||
Company company = companyService.queryCodeCompany(sysUser.getIdCard());
|
||||
if (company != null) {
|
||||
return company;
|
||||
}
|
||||
}
|
||||
Long userId = loginUser.getUserId() == null ? sysUser.getUserId() : loginUser.getUserId();
|
||||
if (userId != null) {
|
||||
Company company = companyMapper.selectOne(new LambdaQueryWrapper<Company>()
|
||||
.eq(Company::getUserId, userId)
|
||||
.eq(Company::getDelFlag, "0")
|
||||
.orderByDesc(Company::getUpdateTime)
|
||||
.last("LIMIT 1"));
|
||||
if (company != null) {
|
||||
return company;
|
||||
}
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(sysUser.getNickName())) {
|
||||
names.add(sysUser.getNickName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(sysUser.getUserName()) && !names.contains(sysUser.getUserName())) {
|
||||
names.add(sysUser.getUserName());
|
||||
}
|
||||
if (!names.isEmpty()) {
|
||||
List<Company> companies = companyMapper.selectList(new LambdaQueryWrapper<Company>()
|
||||
.in(Company::getName, names)
|
||||
.eq(Company::getStatus, 1)
|
||||
.eq(Company::getDelFlag, "0")
|
||||
.orderByDesc(Company::getUpdateTime));
|
||||
if (companies.size() == 1) {
|
||||
return companies.get(0);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JobFairSignUpVO> selectSignUpList(String jobFairId) {
|
||||
return publicJobFairMapper.selectSignUpListByJobFairId(jobFairId);
|
||||
|
||||
@@ -54,6 +54,25 @@
|
||||
<result property="scale" column="scale"/>
|
||||
<result property="industry" column="industry"/>
|
||||
<result property="companyType" column="nature"/>
|
||||
<result property="reviewStatus" column="review_status"/>
|
||||
<result property="reviewBy" column="review_by"/>
|
||||
<result property="reviewTime" column="review_time"/>
|
||||
<result property="reviewRemark" column="review_remark"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.ruoyi.cms.domain.rc.PublicJobFairCompany" id="PublicJobFairCompanyResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="jobFairId" column="job_fair_id"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="reviewStatus" column="review_status"/>
|
||||
<result property="reviewBy" column="review_by"/>
|
||||
<result property="reviewTime" column="review_time"/>
|
||||
<result property="reviewRemark" column="review_remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPublicJobFairVo">
|
||||
@@ -91,13 +110,60 @@
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyListByJobFairId" resultMap="CompanyVOResult">
|
||||
select pfc.id, pfc.company_id, c.name, c.scale, c.industry, c.nature
|
||||
select pfc.id, pfc.company_id, c.name, c.scale, c.industry, c.nature,
|
||||
pfc.review_status, pfc.review_by, pfc.review_time, pfc.review_remark
|
||||
from public_job_fair_company pfc
|
||||
left join company c on pfc.company_id = c.company_id
|
||||
where pfc.job_fair_id = #{jobFairId} and pfc.del_flag = '0'
|
||||
order by pfc.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyRelation" resultMap="PublicJobFairCompanyResult">
|
||||
select id, job_fair_id, company_id, create_by, create_time, update_by, update_time,
|
||||
del_flag, review_status, review_by, review_time, review_remark
|
||||
from public_job_fair_company
|
||||
where job_fair_id = #{jobFairId}
|
||||
and company_id = #{companyId}
|
||||
and del_flag = '0'
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyRelations" resultMap="PublicJobFairCompanyResult">
|
||||
select id, job_fair_id, company_id, create_by, create_time, update_by, update_time,
|
||||
del_flag, review_status, review_by, review_time, review_remark
|
||||
from public_job_fair_company
|
||||
where company_id = #{companyId}
|
||||
and del_flag = '0'
|
||||
and job_fair_id in
|
||||
<foreach item="jobFairId" collection="jobFairIds" open="(" separator="," close=")">
|
||||
#{jobFairId}
|
||||
</foreach>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyRelationById" resultMap="PublicJobFairCompanyResult">
|
||||
select id, job_fair_id, company_id, create_by, create_time, update_by, update_time,
|
||||
del_flag, review_status, review_by, review_time, review_remark
|
||||
from public_job_fair_company
|
||||
where id = #{id} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<update id="updateCompanyReview">
|
||||
update public_job_fair_company
|
||||
<set>
|
||||
review_status = #{reviewStatus},
|
||||
review_by = #{reviewBy},
|
||||
review_time = #{reviewTime},
|
||||
review_remark = #{reviewRemark},
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime}
|
||||
</set>
|
||||
where id = #{id}
|
||||
and job_fair_id = #{jobFairId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<select id="selectJobListByJobFairIdAndCompanyId" resultType="com.ruoyi.cms.domain.Job">
|
||||
select j.job_id, j.job_title, j.min_salary, j.max_salary, j.education, j.experience,
|
||||
j.company_name, j.job_location, j.job_location_area_code, j.posting_date, j.vacancies,
|
||||
@@ -203,15 +269,27 @@
|
||||
</update>
|
||||
|
||||
<insert id="insertJobFairCompany">
|
||||
insert into public_job_fair_company (id, job_fair_id, company_id, create_by, create_time, del_flag)
|
||||
values (#{id}, #{jobFairId}, #{companyId}, #{createBy}, #{createTime}, '0')
|
||||
insert into public_job_fair_company (
|
||||
id, job_fair_id, company_id, create_by, create_time, del_flag,
|
||||
review_status, review_by, review_time, review_remark
|
||||
)
|
||||
values (
|
||||
#{id}, #{jobFairId}, #{companyId}, #{createBy}, #{createTime}, '0',
|
||||
#{reviewStatus}, #{reviewBy}, #{reviewTime}, #{reviewRemark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertJobFairCompanyBatch">
|
||||
insert into public_job_fair_company (id, job_fair_id, company_id, create_by, create_time, del_flag)
|
||||
insert into public_job_fair_company (
|
||||
id, job_fair_id, company_id, create_by, create_time, del_flag,
|
||||
review_status, review_by, review_time, review_remark
|
||||
)
|
||||
values
|
||||
<foreach item="item" collection="list" separator=",">
|
||||
(#{item.id}, #{item.jobFairId}, #{item.companyId}, #{item.createBy}, #{item.createTime}, '0')
|
||||
(
|
||||
#{item.id}, #{item.jobFairId}, #{item.companyId}, #{item.createBy}, #{item.createTime}, '0',
|
||||
#{item.reviewStatus}, #{item.reviewBy}, #{item.reviewTime}, #{item.reviewRemark}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -219,6 +297,14 @@
|
||||
update public_job_fair_company set del_flag = '2' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteJobFairJobsByCompany">
|
||||
update public_job_fair_job
|
||||
set del_flag = '2', update_time = CURRENT_TIMESTAMP
|
||||
where job_fair_id = #{jobFairId}
|
||||
and company_id = #{companyId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<insert id="insertJobFairJob">
|
||||
insert into public_job_fair_job (id, job_fair_id, job_id, company_id, create_by, create_time, del_flag)
|
||||
values (#{id}, #{jobFairId}, #{jobId}, #{companyId}, #{createBy}, #{createTime}, '0')
|
||||
@@ -236,6 +322,22 @@
|
||||
update public_job_fair_job set del_flag = '2' where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectJobRelation" resultType="com.ruoyi.cms.domain.rc.PublicJobFairJob">
|
||||
select id, job_fair_id, job_id, company_id, create_by, create_time, update_by, update_time, del_flag
|
||||
from public_job_fair_job
|
||||
where job_fair_id = #{jobFairId}
|
||||
and job_id = #{jobId}
|
||||
and del_flag = '0'
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectJobRelationById" resultType="com.ruoyi.cms.domain.rc.PublicJobFairJob">
|
||||
select id, job_fair_id, job_id, company_id, create_by, create_time, update_by, update_time, del_flag
|
||||
from public_job_fair_job
|
||||
where id = #{id}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<resultMap type="com.ruoyi.cms.domain.rc.JobFairSignUpVO" id="SignUpVOResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="jobFairId" column="job_fair_id"/>
|
||||
|
||||
Reference in New Issue
Block a user