修改入职管理里的岗位是绑定而非手填
This commit is contained in:
parent
61d03988ba
commit
84ac56b9fc
|
@ -58,9 +58,9 @@ spring:
|
|||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
max-file-size: 20MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
max-request-size: 40MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
|
|
|
@ -626,12 +626,12 @@ public class HomePageController extends BaseController {
|
|||
announcementNode.setInterviewFirstResult("待定");
|
||||
}
|
||||
//如果初试有日期,但是未到面,则视为放弃
|
||||
else if(resumeFollowRecord.getFirstDate()!=null ){
|
||||
if(resumeFollowRecord.getFirstReach().equals("0")|| resumeFollowRecord.getFirstReach().isEmpty()){
|
||||
|
||||
} else if(resumeFollowRecord.getFirstDate()!=null &&resumeFollowRecord.getFirstReach()!=null){
|
||||
if(resumeFollowRecord.getFirstReach().equals("0")){
|
||||
announcementNode.setInterviewFirstResult("放弃");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (resumeFollowRecord.getFinalPass() != null) {
|
||||
if (resumeFollowRecord.getFinalPass().equals("1")) {
|
||||
announcementNode.setInterviewFinalResult("通过");
|
||||
|
|
|
@ -17,6 +17,7 @@ import cn.zeroerr.service.*;
|
|||
import cn.zeroerr.system.service.ISysDeptService;
|
||||
import cn.zeroerr.system.service.ISysUserService;
|
||||
import cn.zeroerr.system.service.RecruitStructureService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
|
@ -261,6 +262,13 @@ public class RecruitFollowController extends BaseController {
|
|||
if (followVO.getOfferCount() == null) followVO.setOfferCount(0L);
|
||||
if (followVO.getEntryCount() == null) followVO.setEntryCount(0L);
|
||||
|
||||
//再根据岗位公海里绑定的hr进行重新覆盖写入;因为有可能某岗位被分配给其他人了。
|
||||
RecruitPost recruitPost = recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getNodeId, followVO.getPostId()));
|
||||
if(!ObjectUtils.isEmpty(recruitPost)){
|
||||
followVO.setHrId(recruitPost.getHrId());
|
||||
followVO.setHrName(recruitPost.getHrName());
|
||||
}
|
||||
|
||||
Optional<PostGrade> optionalPostGrade = postGradeList.stream()
|
||||
.filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId()))
|
||||
.findFirst();
|
||||
|
|
|
@ -412,21 +412,25 @@ public class RecruitProcessController extends BaseController {
|
|||
//查询该hr的信息
|
||||
SysUser sysUser = iSysUserService.selectUserById(req.getUserId());
|
||||
//更新岗位绑定该hr负责
|
||||
if(req.getTaskId()!=null){
|
||||
recruitProcessTaskService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getTaskId());
|
||||
recruitPostService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getTaskId());
|
||||
}
|
||||
recruitPostService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getPostId());
|
||||
}else {
|
||||
if(req.getTaskId()!=null){
|
||||
recruitProcessTaskService.updateUnBindHR(req.getTaskId());
|
||||
recruitPostService.updateUnBindHR(req.getTaskId());
|
||||
}
|
||||
recruitPostService.updateUnBindHR(req.getPostId());
|
||||
}
|
||||
|
||||
return success("成功分配");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('recruit:postsea:distribution')")
|
||||
@GetMapping("/mypost/getOne/{taskId}")
|
||||
@GetMapping("/mypost/getOne/{postId}")
|
||||
@ApiOperation(value = "岗位公海-获取某个岗位的hr分配数据")
|
||||
public AjaxResult getPostList(@PathVariable("taskId")String taskId) {
|
||||
return AjaxResult.success(recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getTaskId, taskId)));
|
||||
public AjaxResult getPostList(@PathVariable("postId")Long postId) {
|
||||
return AjaxResult.success(recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getPostId, postId)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('recruit:mypost:list')")
|
||||
|
|
|
@ -7,6 +7,8 @@ import cn.zeroerr.common.core.domain.AjaxResult;
|
|||
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
|
||||
import cn.zeroerr.common.enums.BusinessType;
|
||||
import cn.zeroerr.common.utils.StringUtils;
|
||||
import cn.zeroerr.domain.entity.RecruitPost;
|
||||
import cn.zeroerr.service.RecruitPostService;
|
||||
import cn.zeroerr.system.service.RecruitStructureService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
@ -24,6 +26,11 @@ import static cn.zeroerr.common.core.domain.AjaxResult.error;
|
|||
public class RecruitStructureController extends BaseController {
|
||||
@Autowired
|
||||
private RecruitStructureService recruitStructureService;
|
||||
|
||||
@Autowired
|
||||
private RecruitPostService recruitPostService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增节点
|
||||
*/
|
||||
|
@ -32,12 +39,20 @@ public class RecruitStructureController extends BaseController {
|
|||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody RecruitStructure node)
|
||||
{
|
||||
|
||||
if (!recruitStructureService.checkNodeNameUnique(node))
|
||||
{
|
||||
return error("新增节点'" + node.getNodeName() + "'失败,节点名称已存在");
|
||||
}
|
||||
node.setCreateBy(getUsername());
|
||||
return toAjax(recruitStructureService.insertNode(node));
|
||||
recruitStructureService.insertNode(node);
|
||||
node.setNodeId(node.getNodeId());
|
||||
RecruitStructure deptByNodeId = recruitStructureService.getDeptByNodeId(node.getNodeId());
|
||||
//如果是已招聘状态,则自动新增岗位在公海里等待被分配给具体的hr。
|
||||
if(node.getPostType().equals(2)){
|
||||
recruitPostService.newRecruitPost(node,deptByNodeId.getNodeId(),deptByNodeId.getNodeName());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,5 +20,7 @@ public class ApprovedResultVO {
|
|||
private String remark;
|
||||
@ApiModelProperty("hr的用户id;如果需要打回,则需要选择一个hr进行修改。")
|
||||
private Long userId;
|
||||
@ApiModelProperty("岗位公海的id,非真正的岗位id")
|
||||
private String postId;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ public interface RecruitPostMapper extends BaseMapper<RecruitPost> {
|
|||
|
||||
List<RecruitPost> listPostSea(@Param("req") RecruitPost req);
|
||||
|
||||
void updateBindHR(@Param("userId") Long userId, @Param("nickName") String nickName, @Param("taskId") String taskId);
|
||||
void updateBindHR(@Param("userId") Long userId, @Param("nickName") String nickName, @Param("postId") String postId);
|
||||
|
||||
List<RecruitPost> listMyPost(@Param("userId") Long userId);
|
||||
|
||||
void updateUnBindHR(@Param("taskId") String taskId);
|
||||
void updateUnBindHR(@Param("postId") String postId);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.zeroerr.service;
|
||||
|
||||
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
|
||||
import cn.zeroerr.domain.entity.RecruitPost;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
@ -14,9 +15,11 @@ public interface RecruitPostService extends IService<RecruitPost> {
|
|||
|
||||
List<RecruitPost> listPostSea(RecruitPost req);
|
||||
|
||||
void updateBindHR(Long userId, String nickName, String taskId);
|
||||
void updateBindHR(Long userId, String nickName, String postId);
|
||||
|
||||
List<RecruitPost> listMyPost(Long userId);
|
||||
|
||||
void updateUnBindHR(String taskId);
|
||||
void updateUnBindHR(String postId);
|
||||
|
||||
void newRecruitPost(RecruitStructure node,Long deptId,String deptName);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package cn.zeroerr.service.impl;
|
||||
|
||||
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.zeroerr.domain.entity.RecruitPost;
|
||||
import cn.zeroerr.service.RecruitPostService;
|
||||
import cn.zeroerr.mapper.RecruitPostMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -23,8 +25,8 @@ public class RecruitPostServiceImpl extends ServiceImpl<RecruitPostMapper, Recru
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateBindHR(Long userId, String nickName, String taskId) {
|
||||
this.baseMapper.updateBindHR(userId,nickName,taskId);
|
||||
public void updateBindHR(Long userId, String nickName, String postId) {
|
||||
this.baseMapper.updateBindHR(userId,nickName,postId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,8 +35,23 @@ public class RecruitPostServiceImpl extends ServiceImpl<RecruitPostMapper, Recru
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateUnBindHR(String taskId) {
|
||||
this.baseMapper.updateUnBindHR(taskId);
|
||||
public void updateUnBindHR(String postId) {
|
||||
this.baseMapper.updateUnBindHR(postId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void newRecruitPost(RecruitStructure node,Long deptId,String deptName) {
|
||||
RecruitPost recruitPost = RecruitPost.builder()
|
||||
.nodeId(node.getNodeId())
|
||||
.postName(node.getNodeName())
|
||||
.deptId(deptId)
|
||||
.deptName(deptName)
|
||||
//默认未分配
|
||||
.isAllocation(0)
|
||||
.createTime(LocalDate.now())
|
||||
.build();
|
||||
|
||||
this.baseMapper.insert(recruitPost);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
|
||||
<update id="updateBindHR">
|
||||
update recruit_post set hr_id=#{userId} ,hr_name=#{nickName} ,is_allocation=1 where task_id=#{taskId}
|
||||
update recruit_post set hr_id=#{userId} ,hr_name=#{nickName} ,is_allocation=1 where post_id=#{postId}
|
||||
</update>
|
||||
|
||||
<select id="listMyPost" resultMap="BaseResultMap">
|
||||
|
@ -46,6 +46,6 @@
|
|||
</select>
|
||||
|
||||
<update id="updateUnBindHR">
|
||||
update recruit_post set hr_id=null ,hr_name=null,is_allocation=0 where task_id=#{taskId}
|
||||
update recruit_post set hr_id=null ,hr_name=null,is_allocation=0 where post_id=#{postId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
@ -17,7 +17,7 @@ public interface RecruitStructureMapper extends BaseMapper<RecruitStructure> {
|
|||
|
||||
RecruitStructure selectNodeById(@Param("parentId") Long parentId);
|
||||
|
||||
int insertNode(RecruitStructure node);
|
||||
Long insertNode(RecruitStructure node);
|
||||
|
||||
List<RecruitStructure> selectNodeList(RecruitStructure node);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||
public interface RecruitStructureService extends IService<RecruitStructure> {
|
||||
boolean checkNodeNameUnique(RecruitStructure node);
|
||||
|
||||
int insertNode(RecruitStructure node);
|
||||
Long insertNode(RecruitStructure node);
|
||||
|
||||
List<RecruitStructure> selectNodeList(RecruitStructure node);
|
||||
|
||||
|
@ -51,4 +51,6 @@ public interface RecruitStructureService extends IService<RecruitStructure> {
|
|||
List<Long> filterByPostIdList(List<Long> uniquePostIdList);
|
||||
|
||||
String findTopLevelDepartmentNameByNodeId(Long postId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class RecruitStructureServiceImpl extends ServiceImpl<RecruitStructureMap
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNode(RecruitStructure node) {
|
||||
public Long insertNode(RecruitStructure node) {
|
||||
RecruitStructure info = this.baseMapper.selectNodeById(node.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||
|
@ -196,6 +196,8 @@ public class RecruitStructureServiceImpl extends ServiceImpl<RecruitStructureMap
|
|||
return recruitStructureMapper.findTopLevelDepartmentNameByNodeId(postId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private List<TreeSelect> buildDeptTreeSelect(List<RecruitStructure> depts) {
|
||||
List<RecruitStructure> deptTrees = buildDeptTree(depts);
|
||||
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
where d.node_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertNode" parameterType="cn.zeroerr.common.core.domain.entity.RecruitStructure">
|
||||
<insert id="insertNode" parameterType="cn.zeroerr.common.core.domain.entity.RecruitStructure" useGeneratedKeys="true" keyProperty="nodeId">
|
||||
insert into recruit_structure(
|
||||
<if test="nodeId != null and nodeId != 0">node_id,</if>
|
||||
<if test="type != null ">type,</if>
|
||||
|
|
Loading…
Reference in New Issue