当前季度和当月招聘会详情

This commit is contained in:
2026-01-13 17:12:06 +08:00
parent 7cb1fbb726
commit beeaa0e6b3
20 changed files with 1760 additions and 1 deletions

View File

@@ -97,4 +97,30 @@ public class AppFairController extends BaseController
{
return toAjax(jobFairSignUpService.cancelSignUp(fairId));
}
/**
* 查看当季度招聘会信息
*/
@BussinessLog(title = "查看当季度招聘会信息")
@ApiOperation("查看当季度招聘会信息")
@GetMapping("/currentQuarter")
public TableDataInfo currentQuarterFairs(JobFair jobFair)
{
startPage();
List<JobFair> results = jobFairService.getCurrentQuarterFairs(jobFair);
return getDataTable(results);
}
/**
* 查看当月招聘会信息
*/
@BussinessLog(title = "查看当月招聘会信息")
@ApiOperation("查看当月招聘会信息")
@GetMapping("/currentMonth")
public TableDataInfo currentMonthFairs(JobFair jobFair)
{
startPage();
List<JobFair> results = jobFairService.getCurrentMonthFairs(jobFair);
return getDataTable(results);
}
}

View File

@@ -60,4 +60,34 @@ public class PublicJobFairController extends BaseController {
List<PublicJobFairCompanyVO> list = publicJobFairService.getEnterprisesWithJobs(jobFairId);
return success(list);
}
/**
* 查看当季度招聘会信息
*/
@BussinessLog(title = "查看当季度招聘会信息")
@ApiOperation("查看当季度招聘会信息")
@GetMapping("/currentQuarter")
public AjaxResult currentQuarterFairs() {
return success(publicJobFairService.getCurrentQuarterFairs());
}
/**
* 查看当月招聘会信息
*/
@BussinessLog(title = "查看当月招聘会信息")
@ApiOperation("查看当月招聘会信息")
@GetMapping("/currentMonth")
public AjaxResult currentMonthFairs() {
return success(publicJobFairService.getCurrentMonthFairs());
}
/**
* 按年份查询每日招聘会数量
*/
@BussinessLog(title = "按年份查询每日招聘会数量")
@ApiOperation("按年份查询每日招聘会数量")
@GetMapping("/dailyCount/{year}")
public AjaxResult dailyCountByYear(@ApiParam("年份") @PathVariable Integer year) {
return success(publicJobFairService.getDailyCountByYear(year));
}
}

View File

@@ -0,0 +1,19 @@
package com.ruoyi.cms.domain.rc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 每日招聘会数量VO
*/
@Data
@ApiModel("每日招聘会数量")
public class JobFairDailyCountVO {
@ApiModelProperty("日期 (yyyy-MM-dd)")
private String date;
@ApiModelProperty("招聘会数量")
private Integer count;
}

View File

@@ -23,4 +23,20 @@ public interface JobFairMapper extends BaseMapper<JobFair>
List<JobFair> appList(JobFair jobFair);
List<JobFair> selectAppList(@Param("userId")Long userId, @Param("type")Integer type);
/**
* 查询当季度招聘会信息列表
*
* @param jobFair 招聘会信息
* @return 招聘会信息集合
*/
List<JobFair> getCurrentQuarterFairs(JobFair jobFair);
/**
* 查询当月招聘会信息列表
*
* @param jobFair 招聘会信息
* @return 招聘会信息集合
*/
List<JobFair> getCurrentMonthFairs(JobFair jobFair);
}

View File

@@ -37,6 +37,21 @@ public interface PublicJobFairMapper extends BaseMapper<PublicJobFair> {
*/
Integer checkUserSignUp(@Param("jobFairId") String jobFairId, @Param("personId") Long personId);
/**
* 查询当季度招聘会信息列表
*/
List<PublicJobFair> getCurrentQuarterFairs();
/**
* 查询当月招聘会信息列表
*/
List<PublicJobFair> getCurrentMonthFairs();
/**
* 按年份查询每日招聘会数量
*/
List<JobFairDailyCountVO> getDailyCountByYear(@Param("year") Integer year);
// ========== CMS后台管理接口 ==========
/**

View File

@@ -53,4 +53,20 @@ public interface IJobFairService
List<JobFair> appList(JobFair jobFair);
JobFair appDetail(Long fairId);
/**
* 查询当季度招聘会信息列表
*
* @param jobFair 招聘会信息
* @return 招聘会信息集合
*/
List<JobFair> getCurrentQuarterFairs(JobFair jobFair);
/**
* 查询当月招聘会信息列表
*
* @param jobFair 招聘会信息
* @return 招聘会信息集合
*/
List<JobFair> getCurrentMonthFairs(JobFair jobFair);
}

View File

@@ -67,7 +67,7 @@ public class ESJobSearchImpl implements IESJobSearchService
/**
* 项目启动时,初始化索引及数据
*/
@PostConstruct
// @PostConstruct
public void init()
{
boolean isLockAcquired = false;

View File

@@ -174,4 +174,42 @@ public class JobFairServiceImpl extends ServiceImpl<JobFairMapper,JobFair> imple
}
return fairCompanies;
}
@Override
public List<JobFair> getCurrentQuarterFairs(JobFair jobFair) {
List<JobFair> fairCompanies = jobFairMapper.getCurrentQuarterFairs(jobFair);
if(fairCompanies.isEmpty()){return new ArrayList<>();}
if(SiteSecurityUtils.isLogin()){
//收藏
Set<Long> collectionIds = fairCollectionMapper.selectList(Wrappers.<FairCollection>lambdaQuery()
.eq(FairCollection::getUserId, SiteSecurityUtils.getUserId())
.in(FairCollection::getFairId, fairCompanies.stream().map(JobFair::getJobFairId).collect(Collectors.toList())))
.stream().map(FairCollection::getFairId).collect(Collectors.toSet());
for (JobFair j : fairCompanies) {
if (collectionIds.contains(j.getJobFairId())) {
j.setIsCollection(1);
}
}
}
return fairCompanies;
}
@Override
public List<JobFair> getCurrentMonthFairs(JobFair jobFair) {
List<JobFair> fairCompanies = jobFairMapper.getCurrentMonthFairs(jobFair);
if(fairCompanies.isEmpty()){return new ArrayList<>();}
if(SiteSecurityUtils.isLogin()){
//收藏
Set<Long> collectionIds = fairCollectionMapper.selectList(Wrappers.<FairCollection>lambdaQuery()
.eq(FairCollection::getUserId, SiteSecurityUtils.getUserId())
.in(FairCollection::getFairId, fairCompanies.stream().map(JobFair::getJobFairId).collect(Collectors.toList())))
.stream().map(FairCollection::getFairId).collect(Collectors.toSet());
for (JobFair j : fairCompanies) {
if (collectionIds.contains(j.getJobFairId())) {
j.setIsCollection(1);
}
}
}
return fairCompanies;
}
}

View File

@@ -24,6 +24,21 @@ public interface IPublicJobFairService {
*/
List<PublicJobFairCompanyVO> getEnterprisesWithJobs(String jobFairId);
/**
* 查询当季度招聘会信息列表
*/
List<PublicJobFair> getCurrentQuarterFairs();
/**
* 查询当月招聘会信息列表
*/
List<PublicJobFair> getCurrentMonthFairs();
/**
* 按年份查询每日招聘会数量
*/
List<JobFairDailyCountVO> getDailyCountByYear(Integer year);
// ========== CMS后台管理接口 ==========
/**

View File

@@ -103,6 +103,21 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
return companyList;
}
@Override
public List<PublicJobFair> getCurrentQuarterFairs() {
return publicJobFairMapper.getCurrentQuarterFairs();
}
@Override
public List<PublicJobFair> getCurrentMonthFairs() {
return publicJobFairMapper.getCurrentMonthFairs();
}
@Override
public List<JobFairDailyCountVO> getDailyCountByYear(Integer year) {
return publicJobFairMapper.getDailyCountByYear(year);
}
// ========== CMS后台管理接口实现 ==========
@Override

View File

@@ -65,4 +65,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by j.START_TIME desc
</select>
<select id="getCurrentQuarterFairs" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
<include refid="selectJobFairVo"/>
<where>
del_flag = '0'
AND NOW() BETWEEN start_time AND end_time
AND EXTRACT(QUARTER FROM start_time) = EXTRACT(QUARTER FROM NOW())
AND EXTRACT(YEAR FROM start_time) = EXTRACT(YEAR FROM NOW())
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
</where>
ORDER BY start_time DESC
</select>
<select id="getCurrentMonthFairs" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
<include refid="selectJobFairVo"/>
<where>
del_flag = '0'
AND NOW() BETWEEN start_time AND end_time
AND EXTRACT(MONTH FROM start_time) = EXTRACT(MONTH FROM NOW())
AND EXTRACT(YEAR FROM start_time) = EXTRACT(YEAR FROM NOW())
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
</where>
ORDER BY start_time DESC
</select>
</mapper>

View File

@@ -235,4 +235,35 @@
order by s.sign_up_time desc
</select>
<select id="getCurrentQuarterFairs" resultMap="PublicJobFairResult">
<include refid="selectPublicJobFairVo"/>
where del_flag = '0'
AND EXTRACT(QUARTER FROM job_fair_start_time) = EXTRACT(QUARTER FROM NOW())
AND EXTRACT(YEAR FROM job_fair_start_time) = EXTRACT(YEAR FROM NOW())
order by job_fair_start_time desc
</select>
<select id="getCurrentMonthFairs" resultMap="PublicJobFairResult">
<include refid="selectPublicJobFairVo"/>
where del_flag = '0'
AND EXTRACT(MONTH FROM job_fair_start_time) = EXTRACT(MONTH FROM NOW())
AND EXTRACT(YEAR FROM job_fair_start_time) = EXTRACT(YEAR FROM NOW())
order by job_fair_start_time desc
</select>
<select id="getDailyCountByYear" resultType="com.ruoyi.cms.domain.rc.JobFairDailyCountVO">
SELECT TO_CHAR(d.date, 'YYYY-MM-DD') AS date,
COUNT(*) AS count
FROM public_job_fair f,
generate_series(
DATE_TRUNC('day', f.job_fair_start_time),
DATE_TRUNC('day', f.job_fair_end_time),
'1 day'::interval
) AS d(date)
WHERE f.del_flag = '0'
AND TO_CHAR(d.date, 'YYYY') = CAST(#{year} AS VARCHAR)
GROUP BY TO_CHAR(d.date, 'YYYY-MM-DD')
ORDER BY date
</select>
</mapper>