Commit e246a2b6 authored by alex yao's avatar alex yao

feat[AI人力]:新增职位上下架功能

parent 97bdf635
...@@ -9,6 +9,7 @@ import cn.com.poc.human_resources.entity.position.Job; ...@@ -9,6 +9,7 @@ import cn.com.poc.human_resources.entity.position.Job;
import cn.com.poc.human_resources.entity.position.Por; import cn.com.poc.human_resources.entity.position.Por;
import cn.com.poc.human_resources.entity.resume.Resume; import cn.com.poc.human_resources.entity.resume.Resume;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.web.bind.annotation.RequestParam;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
...@@ -62,7 +63,8 @@ public interface HumanResourceService { ...@@ -62,7 +63,8 @@ public interface HumanResourceService {
* @param id 职位id[更新必填] * @param id 职位id[更新必填]
* @param memberId 用户id * @param memberId 用户id
*/ */
BizHumanResourcePositionEntity saveOrUpdatePosition(BaseInfo baseInfo, Job job, Por por, Long id, Long memberId) throws Exception; BizHumanResourcePositionEntity saveOrUpdatePosition(BaseInfo baseInfo, Job job, Por por, Long id, Long memberId)
throws Exception;
/** /**
...@@ -89,6 +91,17 @@ public interface HumanResourceService { ...@@ -89,6 +91,17 @@ public interface HumanResourceService {
*/ */
void deletePositions(Long userId, Long... positionIds) throws Exception; void deletePositions(Long userId, Long... positionIds) throws Exception;
/**
* 发布职位-仅用于上架/发布职位
*/
String publishPositions(Long id, Long memberId) throws Exception;
/**
* 下架职位
*/
String unPublishPositions(Long id, Long memberId) throws Exception;
// ------------------------- 简历 -------------------------- // // ------------------------- 简历 -------------------------- //
/** /**
...@@ -100,7 +113,8 @@ public interface HumanResourceService { ...@@ -100,7 +113,8 @@ public interface HumanResourceService {
* @param resume * @param resume
* @throws Exception * @throws Exception
*/ */
BizHumanResourceResumeEntity saveResume(Long userId, String fileURL, Long positionId, Resume resume) throws Exception; BizHumanResourceResumeEntity saveResume(Long userId, String fileURL, Long positionId, Resume resume)
throws Exception;
/** /**
* 更新简历信息 * 更新简历信息
...@@ -113,7 +127,8 @@ public interface HumanResourceService { ...@@ -113,7 +127,8 @@ public interface HumanResourceService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
BizHumanResourceResumeEntity updateResume(Long id, Long userId, String fileURL, Long positionId, Resume resume) throws Exception; BizHumanResourceResumeEntity updateResume(Long id, Long userId, String fileURL, Long positionId, Resume resume)
throws Exception;
/** /**
* 查询简历列表 * 查询简历列表
...@@ -122,7 +137,8 @@ public interface HumanResourceService { ...@@ -122,7 +137,8 @@ public interface HumanResourceService {
* @param positionId * @param positionId
* @param pagingInfo * @param pagingInfo
*/ */
List<BizHumanResourceResumeEntity> listResumes(Long userId, Long positionId, PagingInfo pagingInfo) throws Exception; List<BizHumanResourceResumeEntity> listResumes(Long userId, Long positionId, PagingInfo pagingInfo)
throws Exception;
/** /**
* 查询简历详情 * 查询简历详情
......
package cn.com.poc.human_resources.constant;
/**
* @author alex.yao
* @date 2025/12/23
*/
public interface HumanResourcePositionConstant {
interface POST_STATUS {
String DRAFT = "DRAFT";
String PUBLISHED = "PUBLISHED";
}
}
...@@ -26,6 +26,7 @@ public class BizHumanResourcePositionConvert { ...@@ -26,6 +26,7 @@ public class BizHumanResourcePositionConvert {
public static BizHumanResourcePositionEntity modelToEntity(BizHumanResourcePositionModel model) { public static BizHumanResourcePositionEntity modelToEntity(BizHumanResourcePositionModel model) {
BizHumanResourcePositionEntity entity = new BizHumanResourcePositionEntity(); BizHumanResourcePositionEntity entity = new BizHumanResourcePositionEntity();
entity.setId(model.getId()); entity.setId(model.getId());
entity.setPostStatus(model.getPostStatus());
entity.setJobTitle(model.getJobTitle()); entity.setJobTitle(model.getJobTitle());
entity.setDepartment(model.getDepartment()); entity.setDepartment(model.getDepartment());
entity.setWorkLocation(model.getWorkLocation()); entity.setWorkLocation(model.getWorkLocation());
...@@ -52,6 +53,7 @@ public class BizHumanResourcePositionConvert { ...@@ -52,6 +53,7 @@ public class BizHumanResourcePositionConvert {
public static BizHumanResourcePositionModel entityToModel(BizHumanResourcePositionEntity entity) { public static BizHumanResourcePositionModel entityToModel(BizHumanResourcePositionEntity entity) {
BizHumanResourcePositionModel model = new BizHumanResourcePositionModel(); BizHumanResourcePositionModel model = new BizHumanResourcePositionModel();
model.setId(entity.getId()); model.setId(entity.getId());
model.setPostStatus(entity.getPostStatus());
model.setJobTitle(entity.getJobTitle()); model.setJobTitle(entity.getJobTitle());
model.setDepartment(entity.getDepartment()); model.setDepartment(entity.getDepartment());
model.setWorkLocation(entity.getWorkLocation()); model.setWorkLocation(entity.getWorkLocation());
...@@ -78,6 +80,7 @@ public class BizHumanResourcePositionConvert { ...@@ -78,6 +80,7 @@ public class BizHumanResourcePositionConvert {
public static BizHumanResourcePositionDto entityToDto(BizHumanResourcePositionEntity entity) { public static BizHumanResourcePositionDto entityToDto(BizHumanResourcePositionEntity entity) {
BizHumanResourcePositionDto dto = new BizHumanResourcePositionDto(); BizHumanResourcePositionDto dto = new BizHumanResourcePositionDto();
dto.setId(entity.getId()); dto.setId(entity.getId());
dto.setPostStatus(entity.getPostStatus());
dto.setJobTitle(entity.getJobTitle()); dto.setJobTitle(entity.getJobTitle());
dto.setDepartment(entity.getDepartment()); dto.setDepartment(entity.getDepartment());
dto.setWorkLocation(entity.getWorkLocation()); dto.setWorkLocation(entity.getWorkLocation());
...@@ -97,6 +100,7 @@ public class BizHumanResourcePositionConvert { ...@@ -97,6 +100,7 @@ public class BizHumanResourcePositionConvert {
public static BizHumanResourcePositionEntity dtoToEntity(BizHumanResourcePositionDto dto) { public static BizHumanResourcePositionEntity dtoToEntity(BizHumanResourcePositionDto dto) {
BizHumanResourcePositionEntity entity = new BizHumanResourcePositionEntity(); BizHumanResourcePositionEntity entity = new BizHumanResourcePositionEntity();
entity.setId(dto.getId()); entity.setId(dto.getId());
entity.setPostStatus(dto.getPostStatus());
entity.setJobTitle(dto.getJobTitle()); entity.setJobTitle(dto.getJobTitle());
entity.setDepartment(dto.getDepartment()); entity.setDepartment(dto.getDepartment());
entity.setWorkLocation(dto.getWorkLocation()); entity.setWorkLocation(dto.getWorkLocation());
...@@ -116,6 +120,8 @@ public class BizHumanResourcePositionConvert { ...@@ -116,6 +120,8 @@ public class BizHumanResourcePositionConvert {
public static HumanResourcePositionDto entityToHumanResourcePositionDto(BizHumanResourcePositionEntity positionEntity) { public static HumanResourcePositionDto entityToHumanResourcePositionDto(BizHumanResourcePositionEntity positionEntity) {
HumanResourcePositionDto resourcePositionDto = new HumanResourcePositionDto(); HumanResourcePositionDto resourcePositionDto = new HumanResourcePositionDto();
resourcePositionDto.setPostStatus(positionEntity.getPostStatus());
BaseInfo baseInfo = new BaseInfo(); BaseInfo baseInfo = new BaseInfo();
baseInfo.setJobTitle(positionEntity.getJobTitle()); baseInfo.setJobTitle(positionEntity.getJobTitle());
baseInfo.setDepartment(positionEntity.getDepartment()); baseInfo.setDepartment(positionEntity.getDepartment());
......
...@@ -18,6 +18,22 @@ public class BizHumanResourcePositionDto { ...@@ -18,6 +18,22 @@ public class BizHumanResourcePositionDto {
this.id = id; this.id = id;
} }
/**
* post_status
* 发布状态
* DRAFT-草稿
* PUBLISHED - 已发布
*/
private java.lang.String postStatus;
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
/** /**
* job_title * job_title
* 职位名称 * 职位名称
......
...@@ -12,12 +12,22 @@ public class HumanResourcePositionDto { ...@@ -12,12 +12,22 @@ public class HumanResourcePositionDto {
private Long id; private Long id;
private String postStatus;
private BaseInfo baseInfo; private BaseInfo baseInfo;
private Job job; private Job job;
private Por por; private Por por;
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
public Long getId() { public Long getId() {
return id; return id;
} }
......
...@@ -18,6 +18,22 @@ public class BizHumanResourcePositionEntity { ...@@ -18,6 +18,22 @@ public class BizHumanResourcePositionEntity {
public void setId(java.lang.Long id){ public void setId(java.lang.Long id){
this.id = id; this.id = id;
} }
/**
* post_status
* 发布状态
* DRAFT-草稿
* PUBLISHED - 已发布
*/
private java.lang.String postStatus;
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
/** job_title /** job_title
*职位名称 *职位名称
*/ */
......
...@@ -16,6 +16,19 @@ public class HumanResourcePositionBaseInfo { ...@@ -16,6 +16,19 @@ public class HumanResourcePositionBaseInfo {
this.id = id; this.id = id;
} }
/**
* 发布状态
*/
private String postStatus;
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
/** /**
* job_title * job_title
* 职位名称 * 职位名称
......
...@@ -41,6 +41,23 @@ public class BizHumanResourcePositionModel extends BaseModelClass implements Ser ...@@ -41,6 +41,23 @@ public class BizHumanResourcePositionModel extends BaseModelClass implements Ser
super.addValidField("id"); super.addValidField("id");
} }
/**
* post_status
* 发布状态
* DRAFT-草稿
* PUBLISHED - 已发布
*/
private java.lang.String postStatus;
@Column(name = "post_status",length = 10)
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
super.addValidField("postStatus");
}
/** job_title /** job_title
*职位名称 *职位名称
......
select select
bhrp.id, bhrp.id,
bhrp.post_status,
bhrp.job_title, bhrp.job_title,
bhrp.work_location, bhrp.work_location,
bhrp.job_nature, bhrp.job_nature,
...@@ -12,6 +13,7 @@ left join biz_human_resource_resume bhrr on bhrr.`position` = bhrp.id and bhrr.i ...@@ -12,6 +13,7 @@ left join biz_human_resource_resume bhrr on bhrr.`position` = bhrp.id and bhrr.i
where where
bhrp.is_deleted = 'N' bhrp.is_deleted = 'N'
<< and bhrp.member_id = :memberId >> << and bhrp.member_id = :memberId >>
<< and bhrp.post_status = :postStatus >>
GROUP BY GROUP BY
bhrp.id bhrp.id
order by bhrp.CREATED_TIME desc order by bhrp.CREATED_TIME desc
\ No newline at end of file
...@@ -20,4 +20,13 @@ public class PositionListQueryCondition implements Serializable{ ...@@ -20,4 +20,13 @@ public class PositionListQueryCondition implements Serializable{
this.memberId = memberId; this.memberId = memberId;
} }
private java.lang.String postStatus;
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
} }
\ No newline at end of file
...@@ -27,6 +27,23 @@ public class PositionListQueryItem extends BaseItemClass implements Serializable ...@@ -27,6 +27,23 @@ public class PositionListQueryItem extends BaseItemClass implements Serializable
this.id = id; this.id = id;
} }
/**
* post_status
* 发布状态
* DRAFT-草稿
* PUBLISHED - 已发布
*/
private java.lang.String postStatus;
@Column(name = "post_status")
public String getPostStatus() {
return postStatus;
}
public void setPostStatus(String postStatus) {
this.postStatus = postStatus;
}
/** job_title /** job_title
*job_title *job_title
*/ */
......
...@@ -63,6 +63,16 @@ public interface HumanResourceRest extends BaseRest { ...@@ -63,6 +63,16 @@ public interface HumanResourceRest extends BaseRest {
*/ */
void deletePositions(@RequestParam Long... positionIds) throws Exception; void deletePositions(@RequestParam Long... positionIds) throws Exception;
/**
* 发布职位-仅用于上架/发布职位
*/
String publishPositions(@RequestParam Long id) throws Exception;
/**
* 下架职位-仅用于下架职位
*/
String unPublishPositions(@RequestParam Long id) throws Exception;
// ------------------------- 简历 -------------------------- // // ------------------------- 简历 -------------------------- //
/** /**
...@@ -96,4 +106,5 @@ public interface HumanResourceRest extends BaseRest { ...@@ -96,4 +106,5 @@ public interface HumanResourceRest extends BaseRest {
* @throws Exception * @throws Exception
*/ */
void deleteResumes(@RequestParam Long... resumeIds) throws Exception; void deleteResumes(@RequestParam Long... resumeIds) throws Exception;
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ import cn.com.poc.human_resources.dto.*; ...@@ -9,6 +9,7 @@ import cn.com.poc.human_resources.dto.*;
import cn.com.poc.human_resources.entity.BizHumanResourcePositionEntity; import cn.com.poc.human_resources.entity.BizHumanResourcePositionEntity;
import cn.com.poc.human_resources.entity.HumanResourcePositionBaseInfo; import cn.com.poc.human_resources.entity.HumanResourcePositionBaseInfo;
import cn.com.poc.human_resources.rest.HumanResourceRest; import cn.com.poc.human_resources.rest.HumanResourceRest;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -82,11 +83,13 @@ public class HumanResourceRestImpl implements HumanResourceRest { ...@@ -82,11 +83,13 @@ public class HumanResourceRestImpl implements HumanResourceRest {
@Override @Override
public List<HumanResourcePositionBaseInfoDto> listPositions(PagingInfo pagingInfo) throws Exception { public List<HumanResourcePositionBaseInfoDto> listPositions(PagingInfo pagingInfo) throws Exception {
List<HumanResourcePositionBaseInfo> humanResourcePositionBaseInfos = humanResourceService.listPositions(BlContext.getCurrentUser().getUserId(), pagingInfo); List<HumanResourcePositionBaseInfo> humanResourcePositionBaseInfos =
humanResourceService.listPositions(BlContext.getCurrentUser().getUserId(), pagingInfo);
return humanResourcePositionBaseInfos.stream() return humanResourcePositionBaseInfos.stream()
.map(info -> { .map(info -> {
HumanResourcePositionBaseInfoDto dto = new HumanResourcePositionBaseInfoDto(); HumanResourcePositionBaseInfoDto dto = new HumanResourcePositionBaseInfoDto();
dto.setId(info.getId()); dto.setId(info.getId());
dto.setPostStatus(info.getPostStatus());
dto.setJobTitle(info.getJobTitle()); dto.setJobTitle(info.getJobTitle());
dto.setWorkLocation(info.getWorkLocation()); dto.setWorkLocation(info.getWorkLocation());
dto.setJobNature(info.getJobNature()); dto.setJobNature(info.getJobNature());
...@@ -99,11 +102,13 @@ public class HumanResourceRestImpl implements HumanResourceRest { ...@@ -99,11 +102,13 @@ public class HumanResourceRestImpl implements HumanResourceRest {
@Override @Override
public HumanResourcePositionDto getPositionDetail(Long positionId) throws Exception { public HumanResourcePositionDto getPositionDetail(Long positionId) throws Exception {
BizHumanResourcePositionEntity positionEntity = humanResourceService.getPositionDetail(BlContext.getCurrentUser().getUserId(), positionId); BizHumanResourcePositionEntity positionEntity =
humanResourceService.getPositionDetail(BlContext.getCurrentUser().getUserId(), positionId);
if (positionEntity == null) { if (positionEntity == null) {
throw new BusinessException("该岗位信息不存在"); throw new BusinessException("该岗位信息不存在");
} }
HumanResourcePositionDto resourcePositionDto = BizHumanResourcePositionConvert.entityToHumanResourcePositionDto(positionEntity); HumanResourcePositionDto resourcePositionDto =
BizHumanResourcePositionConvert.entityToHumanResourcePositionDto(positionEntity);
resourcePositionDto.setId(positionId); resourcePositionDto.setId(positionId);
return resourcePositionDto; return resourcePositionDto;
} }
...@@ -114,6 +119,16 @@ public class HumanResourceRestImpl implements HumanResourceRest { ...@@ -114,6 +119,16 @@ public class HumanResourceRestImpl implements HumanResourceRest {
humanResourceService.deletePositions(BlContext.getCurrentUser().getUserId(), positionIds); humanResourceService.deletePositions(BlContext.getCurrentUser().getUserId(), positionIds);
} }
@Override
public String publishPositions(Long id) throws Exception {
return humanResourceService.publishPositions(id, BlContext.getCurrentUser().getUserId());
}
@Override
public String unPublishPositions(Long id) throws Exception {
return humanResourceService.unPublishPositions(id, BlContext.getCurrentUser().getUserId());
}
@Override @Override
public void saveResume(SaveResumeDto saveResumeDto) throws Exception { public void saveResume(SaveResumeDto saveResumeDto) throws Exception {
Assert.notBlank(saveResumeDto.getFileURL(), "文件不能为空"); Assert.notBlank(saveResumeDto.getFileURL(), "文件不能为空");
...@@ -122,9 +137,11 @@ public class HumanResourceRestImpl implements HumanResourceRest { ...@@ -122,9 +137,11 @@ public class HumanResourceRestImpl implements HumanResourceRest {
Assert.notNull(saveResumeDto.getResume().getInfo(), "简历基础信息不能为空"); Assert.notNull(saveResumeDto.getResume().getInfo(), "简历基础信息不能为空");
Assert.notNull(saveResumeDto.getResume().getTag(), "简历标签信息不能为空"); Assert.notNull(saveResumeDto.getResume().getTag(), "简历标签信息不能为空");
if (saveResumeDto.getId() != null) { if (saveResumeDto.getId() != null) {
humanResourceService.updateResume(saveResumeDto.getId(), BlContext.getCurrentUser().getUserId(), saveResumeDto.getFileURL(), saveResumeDto.getPositionId(), saveResumeDto.getResume()); humanResourceService.updateResume(saveResumeDto.getId(), BlContext.getCurrentUser().getUserId(),
saveResumeDto.getFileURL(), saveResumeDto.getPositionId(), saveResumeDto.getResume());
} else { } else {
humanResourceService.saveResume(BlContext.getCurrentUser().getUserId(), saveResumeDto.getFileURL(), saveResumeDto.getPositionId(), saveResumeDto.getResume()); humanResourceService.saveResume(BlContext.getCurrentUser().getUserId(), saveResumeDto.getFileURL(),
saveResumeDto.getPositionId(), saveResumeDto.getResume());
} }
} }
...@@ -138,7 +155,8 @@ public class HumanResourceRestImpl implements HumanResourceRest { ...@@ -138,7 +155,8 @@ public class HumanResourceRestImpl implements HumanResourceRest {
@Override @Override
public ResumeDto getResumeDetail(Long resumeId) throws Exception { public ResumeDto getResumeDetail(Long resumeId) throws Exception {
return BizHumanResourceResumeConvert.entityToResumeDto(humanResourceService.getResumeDetail(BlContext.getCurrentUser().getUserId(), resumeId)); return BizHumanResourceResumeConvert.entityToResumeDto(
humanResourceService.getResumeDetail(BlContext.getCurrentUser().getUserId(), resumeId));
} }
@Override @Override
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
public interface BizHumanResourcePositionService extends BaseService { public interface BizHumanResourcePositionService extends BaseService {
BizHumanResourcePositionEntity get(java.lang.Long id) throws Exception; BizHumanResourcePositionEntity get(java.lang.Long id) ;
List<BizHumanResourcePositionEntity> findByExample(BizHumanResourcePositionEntity example, PagingInfo pagingInfo) throws Exception; List<BizHumanResourcePositionEntity> findByExample(BizHumanResourcePositionEntity example, PagingInfo pagingInfo) throws Exception;
......
...@@ -27,7 +27,7 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl ...@@ -27,7 +27,7 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl
@Resource @Resource
private BizHumanResourcePositionRepository repository; private BizHumanResourcePositionRepository repository;
public BizHumanResourcePositionEntity get(java.lang.Long id) throws Exception { public BizHumanResourcePositionEntity get(java.lang.Long id) {
Assert.notNull(id); Assert.notNull(id);
BizHumanResourcePositionModel model = this.repository.get(id); BizHumanResourcePositionModel model = this.repository.get(id);
if (model == null) { if (model == null) {
...@@ -40,7 +40,8 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl ...@@ -40,7 +40,8 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl
} }
public List<BizHumanResourcePositionEntity> findByExample(BizHumanResourcePositionEntity example, PagingInfo pagingInfo) throws Exception { public List<BizHumanResourcePositionEntity> findByExample(BizHumanResourcePositionEntity example,
PagingInfo pagingInfo) throws Exception {
List<BizHumanResourcePositionEntity> result = new ArrayList<BizHumanResourcePositionEntity>(); List<BizHumanResourcePositionEntity> result = new ArrayList<BizHumanResourcePositionEntity>();
BizHumanResourcePositionModel model = new BizHumanResourcePositionModel(); BizHumanResourcePositionModel model = new BizHumanResourcePositionModel();
if (example != null) { if (example != null) {
...@@ -68,6 +69,9 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl ...@@ -68,6 +69,9 @@ public class BizHumanResourcePositionServiceImpl extends BaseServiceImpl
Assert.notNull(entity.getId(), "update pk can not be null"); Assert.notNull(entity.getId(), "update pk can not be null");
BizHumanResourcePositionModel model = this.repository.get(entity.getId()); BizHumanResourcePositionModel model = this.repository.get(entity.getId());
if (entity.getPostStatus() != null) {
model.setPostStatus(entity.getPostStatus());
}
if (entity.getJobTitle() != null) { if (entity.getJobTitle() != null) {
model.setJobTitle(entity.getJobTitle()); model.setJobTitle(entity.getJobTitle());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment