feat: Add job fair region type to models, database, and migration scripts
This commit is contained in:
@@ -136,6 +136,10 @@ public class CmsJobController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Job job)
|
||||
{
|
||||
AjaxResult companyCheck = bindRecruitingCompany(job, false);
|
||||
if (companyCheck != null) {
|
||||
return companyCheck;
|
||||
}
|
||||
// 校验描述中的敏感词
|
||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||
if (!sensitiveWords.isEmpty()) {
|
||||
@@ -156,6 +160,10 @@ public class CmsJobController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Job job)
|
||||
{
|
||||
AjaxResult companyCheck = bindRecruitingCompany(job, true);
|
||||
if (companyCheck != null) {
|
||||
return companyCheck;
|
||||
}
|
||||
// 校验描述中的敏感词
|
||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||
if (!sensitiveWords.isEmpty()) {
|
||||
@@ -165,6 +173,52 @@ public class CmsJobController extends BaseController
|
||||
return toAjax(jobService.updateJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定岗位的招聘公司。
|
||||
*
|
||||
* <p>企业账号的招聘公司由登录账号确定,前端无需也不能指定;管理员仍须传入其选择的公司。
|
||||
* 同时同步公司名称,避免隐藏企业端表单字段后产生 company_name 为空的岗位数据。</p>
|
||||
*
|
||||
* @param job 岗位信息
|
||||
* @param editing 是否为修改岗位
|
||||
* @return 校验失败时的响应,校验通过时返回 {@code null}
|
||||
*/
|
||||
private AjaxResult bindRecruitingCompany(Job job, boolean editing)
|
||||
{
|
||||
Company company;
|
||||
if (RoleUtils.isCompanyAdmin()) {
|
||||
company = companyService.queryCodeCompany(RoleUtils.getCurrentUseridCard());
|
||||
if (company == null) {
|
||||
return AjaxResult.error("未查询到当前企业信息");
|
||||
}
|
||||
|
||||
if (editing) {
|
||||
if (job.getJobId() == null) {
|
||||
return AjaxResult.error("jobId不能为空");
|
||||
}
|
||||
Job existingJob = jobService.selectJobByJobId(job.getJobId());
|
||||
if (existingJob == null) {
|
||||
return AjaxResult.error("岗位不存在");
|
||||
}
|
||||
if (!Objects.equals(company.getCompanyId(), existingJob.getCompanyId())) {
|
||||
return AjaxResult.error("无权修改其他企业的岗位");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (job.getCompanyId() == null) {
|
||||
return AjaxResult.error("请选择招聘公司");
|
||||
}
|
||||
company = companyService.selectCompanyByCompanyId(job.getCompanyId());
|
||||
if (company == null) {
|
||||
return AjaxResult.error("招聘公司不存在");
|
||||
}
|
||||
}
|
||||
|
||||
job.setCompanyId(company.getCompanyId());
|
||||
job.setCompanyName(company.getName());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,9 @@ public class PublicJobFair implements Serializable {
|
||||
@ApiModelProperty("招聘会类型")
|
||||
private String jobFairType;
|
||||
|
||||
@ApiModelProperty("区域类型(1-疆内 2-疆外 3-师市以内 4-师市以外)")
|
||||
private String jobFairRegionType;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("招聘会开始时间")
|
||||
private Date jobFairStartTime;
|
||||
|
||||
@@ -41,6 +41,9 @@ public class PublicJobFairDetail implements Serializable {
|
||||
@ApiModelProperty("招聘会类型 1-线上 2-线下")
|
||||
private Integer jobFairType;
|
||||
|
||||
@ApiModelProperty("区域类型(1-疆内 2-疆外 3-师市以内 4-师市以外)")
|
||||
private String jobFairRegionType;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ public class PublicJobFairQuery implements Serializable {
|
||||
@ApiModelProperty("招聘会类型")
|
||||
private String jobFairType;
|
||||
|
||||
@ApiModelProperty("区域类型")
|
||||
private String jobFairRegionType;
|
||||
|
||||
@ApiModelProperty("招聘会举办时间(格式:yyyy-MM-dd)")
|
||||
private String zphjbsj;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<result property="jobFairTitle" column="job_fair_title"/>
|
||||
<result property="jobFairAddress" column="job_fair_address"/>
|
||||
<result property="jobFairType" column="job_fair_type"/>
|
||||
<result property="jobFairRegionType" column="job_fair_region_type"/>
|
||||
<result property="jobFairStartTime" column="job_fair_start_time"/>
|
||||
<result property="jobFairEndTime" column="job_fair_end_time"/>
|
||||
<result property="jobFairHostUnit" column="job_fair_host_unit"/>
|
||||
@@ -43,6 +44,7 @@
|
||||
<result property="jobFairStartTime" column="job_fair_start_time"/>
|
||||
<result property="jobFairEndTime" column="job_fair_end_time"/>
|
||||
<result property="jobFairType" column="job_fair_type"/>
|
||||
<result property="jobFairRegionType" column="job_fair_region_type"/>
|
||||
<result property="latitude" column="latitude"/>
|
||||
<result property="longitude" column="longitude"/>
|
||||
</resultMap>
|
||||
@@ -76,7 +78,8 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPublicJobFairVo">
|
||||
select job_fair_id, job_fair_title, job_fair_address, job_fair_type, job_fair_start_time, job_fair_end_time,
|
||||
select job_fair_id, job_fair_title, job_fair_address, job_fair_type, job_fair_region_type,
|
||||
job_fair_start_time, job_fair_end_time,
|
||||
job_fair_host_unit, job_fair_help_unit, job_fair_organize_unit, job_fair_introduction, job_fair_remark,
|
||||
job_fair_phone, job_fair_image, job_fair_area_image, create_by, create_time, update_by, update_time,
|
||||
job_fair_venue_id, job_fair_sign_up_start_time, job_fair_sign_up_end_time, enterprise_num, booth_num,
|
||||
@@ -94,6 +97,9 @@
|
||||
<if test="query.jobFairType != null and query.jobFairType != ''">
|
||||
and job_fair_type = #{query.jobFairType}
|
||||
</if>
|
||||
<if test="query.jobFairRegionType != null and query.jobFairRegionType != ''">
|
||||
and job_fair_region_type = #{query.jobFairRegionType}
|
||||
</if>
|
||||
<if test="query.zphjbsj != null and query.zphjbsj != ''">
|
||||
and to_char(job_fair_start_time, 'YYYY-MM-DD') <= #{query.zphjbsj}
|
||||
and to_char(job_fair_end_time, 'YYYY-MM-DD') >= #{query.zphjbsj}
|
||||
@@ -104,7 +110,7 @@
|
||||
|
||||
<select id="selectPublicJobFairDetailById" resultMap="DetailResult">
|
||||
select job_fair_id, job_fair_title, job_fair_address, job_fair_introduction,
|
||||
job_fair_start_time, job_fair_end_time, job_fair_type, latitude, longitude
|
||||
job_fair_start_time, job_fair_end_time, job_fair_type, job_fair_region_type, latitude, longitude
|
||||
from public_job_fair
|
||||
where job_fair_id = #{jobFairId} and del_flag = '0'
|
||||
</select>
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
<insert id="insertPublicJobFair">
|
||||
insert into public_job_fair (
|
||||
job_fair_id, job_fair_title, job_fair_address, job_fair_type,
|
||||
job_fair_id, job_fair_title, job_fair_address, job_fair_type, job_fair_region_type,
|
||||
job_fair_start_time, job_fair_end_time, job_fair_host_unit, job_fair_help_unit,
|
||||
job_fair_organize_unit, job_fair_introduction, job_fair_remark, job_fair_phone,
|
||||
job_fair_image, job_fair_area_image, job_fair_venue_id,
|
||||
@@ -214,7 +220,7 @@
|
||||
job_fair_category, is_cross_domain, cross_domain_cities, latitude, longitude,
|
||||
create_by, create_time, del_flag
|
||||
) values (
|
||||
#{jobFairId}, #{jobFairTitle}, #{jobFairAddress}, #{jobFairType},
|
||||
#{jobFairId}, #{jobFairTitle}, #{jobFairAddress}, #{jobFairType}, #{jobFairRegionType},
|
||||
#{jobFairStartTime}, #{jobFairEndTime}, #{jobFairHostUnit}, #{jobFairHelpUnit},
|
||||
#{jobFairOrganizeUnit}, #{jobFairIntroduction}, #{jobFairRemark}, #{jobFairPhone},
|
||||
#{jobFairImage}, #{jobFairAreaImage}, #{jobFairVenueId},
|
||||
@@ -231,6 +237,7 @@
|
||||
<if test="jobFairTitle != null">job_fair_title = #{jobFairTitle},</if>
|
||||
<if test="jobFairAddress != null">job_fair_address = #{jobFairAddress},</if>
|
||||
<if test="jobFairType != null">job_fair_type = #{jobFairType},</if>
|
||||
<if test="jobFairRegionType != null">job_fair_region_type = #{jobFairRegionType},</if>
|
||||
<if test="jobFairStartTime != null">job_fair_start_time = #{jobFairStartTime},</if>
|
||||
<if test="jobFairEndTime != null">job_fair_end_time = #{jobFairEndTime},</if>
|
||||
<if test="jobFairHostUnit != null">job_fair_host_unit = #{jobFairHostUnit},</if>
|
||||
|
||||
Reference in New Issue
Block a user