添加岗位申请导出-完成

This commit is contained in:
sh
2025-10-16 13:14:35 +08:00
parent 2502d9726b
commit 7994112283
6 changed files with 53 additions and 14 deletions

View File

@@ -1,11 +1,12 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.cms.domain.vo.CandidateVO;
import com.ruoyi.cms.service.IJobApplyService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
@@ -40,10 +41,10 @@ public class JobApplyController extends BaseController {
@PreAuthorize("@ss.hasPermi('cms:jobApply:export')")
@Log(title = "APP用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, @PathVariable Long companyId)
public void export(HttpServletResponse response, Job job)
{
List<AppUser> list = iJobApplyService.selectAppUserList(companyId);
ExcelUtil<AppUser> util = new ExcelUtil<AppUser>(AppUser.class);
List<CandidateVO> list = iJobApplyService.selectAppUserList(job);
ExcelUtil<CandidateVO> util = new ExcelUtil<CandidateVO>(CandidateVO.class);
util.exportExcel(response, list, "APP用户数据");
}
}

View File

@@ -1,6 +1,7 @@
package com.ruoyi.cms.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.AppUser;
import lombok.Data;
@@ -12,4 +13,9 @@ public class CandidateVO extends AppUser {
private Date applyDate;
private Integer matchingDegree;
private String applyId;
@Excel(name = "公司名称", sort = 0)
private String companyName;
@Excel(name = "岗位名称", sort = 1)
private String jobName;
}

View File

@@ -8,7 +8,6 @@ import java.util.List;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.cms.domain.vo.CandidateVO;
import com.ruoyi.common.core.domain.entity.AppUser;
/**
* 岗位申请Mapper接口
@@ -32,5 +31,5 @@ public interface JobApplyMapper extends BaseMapper<JobApply>
HashMap<String,Integer> trendChart(JobApply jobApply);
List<AppUser> selectAppUserList(Long companyId);
List<CandidateVO> selectAppUserList(Job job);
}

View File

@@ -5,7 +5,7 @@ import java.util.List;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.cms.domain.vo.CandidateVO;
/**
* 岗位申请Service接口
@@ -61,5 +61,5 @@ public interface IJobApplyService
HashMap<String,Integer> trendChart(JobApply jobApply);
List<AppUser> selectAppUserList(Long companyId);
List<CandidateVO> selectAppUserList(Job job);
}

View File

@@ -6,15 +6,14 @@ import com.ruoyi.cms.domain.FairCollection;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.cms.domain.query.MineJobQuery;
import com.ruoyi.cms.domain.vo.CandidateVO;
import com.ruoyi.cms.mapper.*;
import com.ruoyi.cms.service.IJobApplyService;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.utils.SiteSecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -125,7 +124,7 @@ public class JobApplyServiceImpl extends ServiceImpl<JobApplyMapper,JobApply> im
}
@Override
public List<AppUser> selectAppUserList(Long companyId) {
return jobApplyMapper.selectAppUserList(companyId);
public List<CandidateVO> selectAppUserList(Job job) {
return jobApplyMapper.selectAppUserList(job);
}
}

View File

@@ -59,12 +59,46 @@
select user_id, name, age, sex, birth_date, education, political_affiliation, phone, avatar, salary_min, salary_max, area, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark,job_title_id,is_recommend,id_card,hire from app_user
</sql>
<select id="selectAppUserList" parameterType="java.lang.Long" resultType="com.ruoyi.common.core.domain.entity.AppUser">
select b.job_title,l.name company_name,e.* from job_apply a
<select id="selectAppUserList" parameterType="com.ruoyi.cms.domain.Job" resultType="com.ruoyi.cms.domain.vo.CandidateVO">
select b.job_title jobName,l.name companyName,e.* from job_apply a
INNER join job b on a.job_id=b.job_id and b.del_flag='0'
INNER join app_user e on a.user_id =e.user_id and e.del_flag='0'
INNER join company l on b.company_id =l.company_id and l.del_flag='0'
where a.del_flag='0' and a.hire='0'
<if test="jobTitle != null and jobTitle != ''"> and b.job_title like concat('%', cast(#{jobTitle, jdbcType=VARCHAR} as varchar), '%')</if>
<if test="education != null and education != ''"> and b.education = #{education}</if>
<if test="experience != null and experience != ''"> and b.experience = #{experience}</if>
<if test="companyName != null and companyName != ''"> and b.company_name like concat('%', cast(#{companyName, jdbcType=VARCHAR} as varchar), '%')</if>
<if test="jobLocation != null and jobLocation != ''"> and b.job_location = #{jobLocation}</if>
<if test="postingDate != null and postingDate!=''"> and b.posting_date = #{postingDate}</if>
<if test="vacancies != null "> and b.vacancies = #{vacancies}</if>
<if test="latitude != null "> and b.latitude = #{latitude}</if>
<if test="longitude != null "> and b.longitude = #{longitude}</if>
<if test="view != null "> and b."view" = #{view}</if>
<if test="companyId != null "> and b.company_id = #{companyId}</if>
<if test="isHot != null "> and b.is_hot = #{isHot}</if>
<if test="applyNum != null "> and b.apply_num = #{applyNum}</if>
<if test="code != null "> and b.company_id in(select company_id from company where code=#{code})</if>
<if test="compensation!=null ">
<if test="compensation==0 ">
and b.min_salary &lt; 1750
</if>
<if test="compensation==1 ">
and b.max_salary &lt; 2000 and b.min_salary &gt;= 1750
</if>
<if test="compensation==2 ">
and b.max_salary &lt; 3000 and b.min_salary &gt;= 2000
</if>
<if test="compensation==3 ">
and b.max_salary &lt; 4000 and b.min_salary &gt;= 3000
</if>
<if test="compensation==4 ">
and b.max_salary &lt; 5000 and b.min_salary &gt;= 4000
</if>
<if test="compensation==5 ">
and b.min_salary &gt; 5000
</if>
</if>
</select>
</mapper>