feat: Refactor company and job management to include company nature

- Added companyNature field to Company entity and updated related services and mappers.
- Removed jobNature field from Job and ESJobDocument entities as it is no longer needed.
- Updated CompanyController to handle current company information and synchronization of account codes.
- Enhanced CompanyServiceImpl to manage company nature changes and synchronize related job postings.
- Updated SQL migrations to add company nature field and associated business dictionary entries.
- Refactored job-related services to ensure they reflect the latest company nature information.
This commit is contained in:
2026-07-16 15:05:53 +08:00
parent 3f1624da3a
commit acb0762dcc
17 changed files with 378 additions and 135 deletions

View File

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="description" column="description" />
<result property="nature" column="nature" />
<result property="companyNature" column="company_nature" />
<result property="totalRecruitment" column="total_recruitment" />
<result property="userId" column="user_id" />
<result property="businessLicenseUrl" column="business_license_url" />
@@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCompanyVo">
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone,is_hrs from company
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,company_nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone,is_hrs from company
</sql>
<sql id="companyIndustryFilter">
@@ -99,13 +100,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO company (
name, location, industry, scale, code, description, nature,
name, location, industry, scale, code, description, nature, company_nature,
create_by, create_time, del_flag
) VALUES
<foreach collection="list" item="company" separator=",">
(
#{company.name}, #{company.location}, #{company.industry}, #{company.scale},
#{company.code}, #{company.description}, #{company.nature},
#{company.code}, #{company.description}, #{company.nature}, #{company.companyNature},
#{company.createBy}, #{company.createTime}, #{company.delFlag}
)
</foreach>
@@ -127,9 +128,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="companyIndustryFilter"/>
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
<if test="companyNature != null and companyNature != ''"> and company_nature = #{companyNature}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="isHrs != null and isHrs != ''"> and is_hrs = #{isHrs}</if>
<if test="startDate != null and startDate != ''">
and create_time >= #{startDate}
@@ -143,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT * FROM COMPANY WHERE COMPANY_ID IN (select -1
<if test="companyNature!=null and companyNature!=''">
UNION
SELECT COMPANY_ID FROM COMPANY WHERE nature = #{companyNature}
SELECT COMPANY_ID FROM COMPANY WHERE company_nature = #{companyNature}
</if>
<if test="targ!=null and targ!=''">
UNION
@@ -160,6 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="companyIndustryFilter"/>
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
<if test="companyNature != null and companyNature != ''"> and company_nature = #{companyNature}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
@@ -176,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAdminCompanyList" parameterType="CompanySearch" resultMap="CompanyResult">
select t.company_id, t.name, t.location, t.industry, t.scale, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,t.code,t.description,
t.nature,t.total_recruitment,t.registered_address,t.contact_person,t.contact_person_phone,t.is_abnormal,t.not_pass_reason,t.status,case when t.status='2'
t.nature,t.company_nature,t.total_recruitment,t.registered_address,t.contact_person,t.contact_person_phone,t.is_abnormal,t.not_pass_reason,t.status,case when t.status='2'
then t.update_time else null end reject_time,t.is_imp_company,t.imp_company_type,t.enterprise_type,t.legal_person,t.legal_id_card,t.legal_phone,t.is_hrs,
su.lc_userid from company t
left join sys_user su on t.code=su.id_card
@@ -184,6 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null and name != ''"> and t.name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<if test="scale != null and scale != ''"> and t.scale = #{scale}</if>
<if test="nature != null and nature != ''"> and t.nature = #{nature}</if>
<if test="companyNature != null and companyNature != ''"> and t.company_nature = #{companyNature}</if>
<if test="code != null and code != ''"> and t.code = #{code}</if>
<if test="status != null and status != ''"> and t.status = #{status}</if>
<if test="companyId != null and companyId != ''"> and t.company_id = #{companyId}</if>

View File

@@ -31,7 +31,7 @@
<result property="jobUrl" column="job_url" />
<result property="rowId" column="row_id" />
<result property="jobCategory" column="job_category" />
<result property="jobNature" column="job_nature" />
<result property="companyNature" column="company_nature" />
<result property="isExplain" column="is_explain" />
<result property="explainUrl" column="explain_url" />
<result property="cover" column="cover" />
@@ -75,7 +75,6 @@
<result property="jobUrl" column="job_url" />
<result property="rowId" column="row_id" />
<result property="jobCategory" column="job_category" />
<result property="jobNature" column="job_nature" />
<result property="isExplain" column="is_explain" />
<result property="explainUrl" column="explain_url" />
<result property="cover" column="cover" />
@@ -114,7 +113,7 @@
</resultMap>
<sql id="selectJobVo">
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,is_urgent,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,job_nature,is_explain,explain_url,cover,job_type,job_address, review_status,is_key_populations,key_populations from job
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,is_urgent,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover,job_type,job_address, review_status,is_key_populations,key_populations from job
</sql>
<insert id="insertBatchRowWork">
INSERT INTO row_work (
@@ -144,7 +143,7 @@
job_title, min_salary, max_salary, education, experience, company_name, job_location,
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
is_hot, is_urgent, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
create_by, create_time, row_id, job_category,job_nature,job_type,job_address,job_status,is_key_populations,
create_by, create_time, row_id, job_category,job_type,job_address,job_status,is_key_populations,
key_populations
) VALUES
<foreach collection="list" item="job" separator=",">
@@ -154,7 +153,7 @@
#{job.vacancies}, #{job.latitude}, #{job.longitude}, #{job.view}, #{job.companyId},
#{job.isHot}, #{job.isUrgent}, #{job.applyNum}, #{job.description}, #{job.isPublish}, #{job.dataSource},
#{job.jobUrl}, #{job.remark}, #{job.delFlag}, #{job.createBy}, #{job.createTime},
#{job.rowId}, #{job.jobCategory},#{job.jobNature},#{job.jobType},#{job.jobAddress},#{job.jobStatus},#{job.isKeyPopulations},#{job.keyPopulations}
#{job.rowId}, #{job.jobCategory},#{job.jobType},#{job.jobAddress},#{job.jobStatus},#{job.isKeyPopulations},#{job.keyPopulations}
)
</foreach>
</insert>
@@ -301,7 +300,7 @@
)
</select>
<select id="selectAllJob" resultMap="JobEsResult">
SELECT j.*,c.industry,c.scale,c.nature as company_nature,c.code,c.description as company_description,c.name,c.company_id,t.contact_person,t.contact_person_phone,jc.contact_person as job_contact_person,jc.contact_person_phone as job_contact_person_phone FROM job as j
SELECT j.*,c.industry,c.scale,c.company_nature,c.code,c.description as company_description,c.name,c.company_id,t.contact_person,t.contact_person_phone,jc.contact_person as job_contact_person,jc.contact_person_phone as job_contact_person_phone FROM job as j
left join company as c on c.company_id = j.company_id and j.del_flag='0' and c.del_flag='0' and c.company_status='0'
LEFT JOIN (SELECT t1.*, ROW_NUMBER() OVER (PARTITION BY t1.company_id ORDER BY t1.id) AS rn FROM company_contact AS t1 WHERE t1.del_flag = '0' ) AS t ON t.company_id = j.company_id AND t.rn = 1
LEFT JOIN (SELECT jc1.*, ROW_NUMBER() OVER(PARTITION BY jc1.job_id ORDER BY jc1.id) rn FROM job_contact jc1 WHERE jc1.del_flag='0') jc ON jc.job_id = j.job_id AND jc.rn=1
@@ -348,7 +347,7 @@
inner join bussiness_dict_data as ed on ed.dict_type = 'education' and ed.dict_value = j.education
inner join bussiness_dict_data as ex on ex.dict_type = 'experience' and ex.dict_value = j.experience
left join bussiness_dict_data as ar on ar.dict_type = 'area' and ar.dict_value = j.job_location_area_code
left join bussiness_dict_data as ab on ab.dict_type = 'company_nature' and ab.dict_value = c.nature
left join bussiness_dict_data as ab on ab.dict_type = 'company_nature' and ab.dict_value = c.company_nature
left join bussiness_dict_data as ac on ac.dict_type = 'scale' and ac.dict_value = c.scale
where job_id =#{jobId}
</select>
@@ -363,7 +362,7 @@
</select>
<select id="getJobInfo" resultType="com.ruoyi.cms.domain.Job">
SELECT j.*,c.code,c.name as companyName,c.company_id FROM job as j
SELECT j.*,c.code,c.company_nature,c.name as companyName,c.company_id FROM job as j
left join company as c on c.company_id = j.company_id and c.del_flag='0'
WHERE j.del_flag='0' AND j.job_id=#{jobId}
limit 1

View File

@@ -167,7 +167,7 @@
<select id="selectJobListByJobFairIdAndCompanyId" resultType="com.ruoyi.cms.domain.Job">
select pfj.id as fair_relation_id, 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,
j.company_id, j.description, j.job_category, j.job_nature, j.job_address
j.company_id, j.description, j.job_category, j.job_address
from public_job_fair_job pfj
inner join job j on pfj.job_id = j.job_id
where pfj.job_fair_id = #{jobFairId} and pfj.company_id = #{companyId} and pfj.del_flag = '0' and j.del_flag = '0'