Compare commits
No commits in common. "main" and "wjx" have entirely different histories.
@ -22,7 +22,4 @@ public class RecruitResume extends BaseModelWithTenant<RecruitResume> {
|
|||||||
|
|
||||||
@ApiModelProperty("简历来源")
|
@ApiModelProperty("简历来源")
|
||||||
String resumeSource;
|
String resumeSource;
|
||||||
|
|
||||||
@ApiModelProperty("关联的职位ID")
|
|
||||||
String positionId; // 外键字段
|
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wangjx
|
|
||||||
* @data 2025.2.21
|
|
||||||
*/
|
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "职位管理")
|
@Api(tags = "职位管理")
|
||||||
@RequestMapping("recruit/position")
|
@RequestMapping("recruit/position")
|
||||||
|
@ -4,7 +4,6 @@ import cn.zgfxrc.boot.common.core.entity.interfaces.AddGroup;
|
|||||||
import cn.zgfxrc.boot.common.core.entity.interfaces.DelGroup;
|
import cn.zgfxrc.boot.common.core.entity.interfaces.DelGroup;
|
||||||
import cn.zgfxrc.boot.common.core.entity.interfaces.EditGroup;
|
import cn.zgfxrc.boot.common.core.entity.interfaces.EditGroup;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -17,14 +16,14 @@ import com.seepine.wrap.WrapException;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.Valid;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author huanghs@zgfxrc.cn
|
* @author huanghs@zgfxrc.cn
|
||||||
@ -36,7 +35,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class RecruitResumeController {
|
public class RecruitResumeController {
|
||||||
RecruitResumeService service;
|
RecruitResumeService service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
*
|
||||||
@ -110,67 +108,4 @@ public class RecruitResumeController {
|
|||||||
throw new WrapException("删除失败");
|
throw new WrapException("删除失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 把简历投给职位,通过外键去关联表
|
|
||||||
*
|
|
||||||
* @param entity 实体类
|
|
||||||
* @author wangjx
|
|
||||||
* @data 2025.2.21
|
|
||||||
*/
|
|
||||||
@Log("投递")
|
|
||||||
@ApiOperation("根据外键去关联,将简历投给职位")
|
|
||||||
@PostMapping("add_delivery")
|
|
||||||
public void addDelivery(
|
|
||||||
@ApiParam("简历信息,包含关联职位的外键 positionId") @RequestBody @Valid RecruitResume entity) {
|
|
||||||
// 检查职位 ID 是否为空,如果为空则抛出异常
|
|
||||||
if (entity.getPositionId() == null) {
|
|
||||||
throw new RuntimeException("关联的职位 ID 不能为空");
|
|
||||||
}
|
|
||||||
// 检查简历 id 是否为空,如果为空则抛出异常
|
|
||||||
if (entity.getId() == null) {
|
|
||||||
throw new RuntimeException("关联的简历 ID 不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建更新条件包装器,根据简历 id 进行更新
|
|
||||||
UpdateWrapper<RecruitResume> updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.eq("id", entity.getId());
|
|
||||||
|
|
||||||
// 创建要更新的字段
|
|
||||||
RecruitResume updateEntity = new RecruitResume();
|
|
||||||
updateEntity.setPositionId(entity.getPositionId());
|
|
||||||
// 设置更新时间为当前时间
|
|
||||||
updateEntity.setUpdateTime(Timestamp.valueOf(LocalDateTime.now()).toLocalDateTime());
|
|
||||||
|
|
||||||
// 调用服务层的 update 方法更新简历信息
|
|
||||||
boolean result = service.update(updateEntity, updateWrapper);
|
|
||||||
if (!result) {
|
|
||||||
throw new RuntimeException("简历投递失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据传进来的职位id查询目标下面的简历
|
|
||||||
*
|
|
||||||
* @param positionId 职位id
|
|
||||||
* @author wangjx
|
|
||||||
* @data 2025.2.22
|
|
||||||
*/
|
|
||||||
@Log("查询岗位下的简历")
|
|
||||||
@ApiOperation("根据传进来的职位id查询目标下面的简历")
|
|
||||||
@GetMapping("getResumesByPositionId")
|
|
||||||
public List<RecruitResume> getResumesByPositionId(
|
|
||||||
@ApiParam("职位id") @RequestParam String positionId) {
|
|
||||||
// 检查职位 ID 是否为空,如果为空则抛出异常
|
|
||||||
if (positionId == null || positionId.isEmpty() || positionId.equals("null")) {
|
|
||||||
throw new RuntimeException("职位 ID 不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建查询条件包装器,根据职位id进行查询
|
|
||||||
LambdaQueryWrapper<RecruitResume> queryWrapper = Wrappers.lambdaQuery();
|
|
||||||
queryWrapper.eq(RecruitResume::getPositionId, positionId);
|
|
||||||
|
|
||||||
// 调用服务层的 list 方法查询简历信息
|
|
||||||
return service.list(queryWrapper);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,5 @@ import cn.zgfxrc.boot.common.mybatis.base.MpBaseMapper;
|
|||||||
import com.rsjst.hcm.recruit.api.entity.RecruitPositionPojo;
|
import com.rsjst.hcm.recruit.api.entity.RecruitPositionPojo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wangjx
|
|
||||||
* @data 2025.2.21
|
|
||||||
*/
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RecruitPositionMapper extends MpBaseMapper<RecruitPositionPojo> {}
|
public interface RecruitPositionMapper extends MpBaseMapper<RecruitPositionPojo> {}
|
||||||
|
@ -11,10 +11,6 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wangjx
|
|
||||||
* @data 2025.2.21
|
|
||||||
*/
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user