Compare commits

...

No commits in common. "main" and "wjx" have entirely different histories.
main ... wjx

5 changed files with 4 additions and 84 deletions

View File

@ -22,7 +22,4 @@ public class RecruitResume extends BaseModelWithTenant<RecruitResume> {
@ApiModelProperty("简历来源")
String resumeSource;
@ApiModelProperty("关联的职位ID")
String positionId; // 外键字段
}

View File

@ -24,10 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author wangjx
* @data 2025.2.21
*/
@RestController
@Api(tags = "职位管理")
@RequestMapping("recruit/position")

View File

@ -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.EditGroup;
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.toolkit.Wrappers;
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.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;
import javax.validation.Valid;
import lombok.AllArgsConstructor;
import org.springframework.lang.Nullable;
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
@ -36,7 +35,6 @@ import org.springframework.web.bind.annotation.*;
@AllArgsConstructor
public class RecruitResumeController {
RecruitResumeService service;
/**
* 分页查询
*
@ -110,67 +108,4 @@ public class RecruitResumeController {
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);
}
}

View File

@ -4,9 +4,5 @@ import cn.zgfxrc.boot.common.mybatis.base.MpBaseMapper;
import com.rsjst.hcm.recruit.api.entity.RecruitPositionPojo;
import org.apache.ibatis.annotations.Mapper;
/**
* @author wangjx
* @data 2025.2.21
*/
@Mapper
public interface RecruitPositionMapper extends MpBaseMapper<RecruitPositionPojo> {}

View File

@ -11,10 +11,6 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author wangjx
* @data 2025.2.21
*/
@Slf4j
@Service
@AllArgsConstructor