package cn.timer.api.controller.zpgl; import cn.timer.api.bean.zpgl.ZpglMslcLog; import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.enuminterface.JxglEnumInterface; import cn.timer.api.config.exception.CustomException; import cn.timer.api.dto.zpgl.ZpglMslcLogDto; import cn.timer.api.utils.Result; import cn.timer.api.utils.ResultUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.transaction.Transactional; import java.util.List; /** * 招聘管理 * * @author wuqingjun * @email 284718418@qq.com * @date 2022-03-08 15:14:40 */ @Api(tags = "招聘管理") @Transactional(rollbackOn = Exception.class) @RestController @RequestMapping(value = "/zpgl", produces = {"application/json"}) @Slf4j public class ZpglMslcController { /** * 招聘-招聘中 * * @param * @return */ @GetMapping(value = "/mslc_list") @ApiOperation(value = "1.招聘管理面试流程记录", httpMethod = "GET", notes = "招聘管理面试流程记录") @ApiOperationSupport(order = 1) public Result<Object> mslcList(@CurrentUser UserBean userBean, @ApiParam("人才信息ID") @RequestParam(required = false) Integer zpglRcxxId, @ApiParam("状态") @RequestParam(required = false) Integer zpglRcxxStatus) { try { QueryWrapper<ZpglMslcLog> queryWrapper = new QueryWrapper<ZpglMslcLog>(); queryWrapper.lambda().eq(ZpglMslcLog::getZpglRcxxId,zpglRcxxId); // 0全部类型,1状态变更,2面试,3Offer,4讨论,5其他 // JxglEnumInterface.MslcLogStatus if(zpglRcxxStatus>0){ queryWrapper.lambda().eq(ZpglMslcLog::getZpglRcxxStatus,zpglRcxxStatus); } queryWrapper.lambda().orderByDesc(ZpglMslcLog::getCreateTime); List<ZpglMslcLog> zpglMslcLogs = ZpglMslcLog.builder().build().selectList(queryWrapper); return ResultUtil.data(zpglMslcLogs, "搜索成功"); } catch (Exception e) { e.printStackTrace(); throw new CustomException("招聘-招聘列表失败"); } } /** * 招聘-添加讨论 * * @param * @return */ @PostMapping(value = "/mslc/save") @ApiOperation(value = "2.招聘-添加讨论", httpMethod = "POST", notes = "招聘-添加讨论") @ApiOperationSupport(order = 2) public Result<Object> save(@CurrentUser UserBean userBean, @RequestBody @Validated ZpglMslcLogDto zpglMslcLogDto) { try { ZpglMslcLog zpglMslcLog = ZpglMslcLog.builder().build(); BeanUtils.copyProperties(zpglMslcLogDto, zpglMslcLog); zpglMslcLog.setUserId(userBean.getEmpNum()); zpglMslcLog.setUserName(userBean.getQyzxEmpLogin().getUsername()); zpglMslcLog.setDetail(userBean.getQyzxEmpLogin().getUsername()+" "+zpglMslcLogDto.getDetail()); zpglMslcLog.setZpglRcxxStatus(JxglEnumInterface.MslcLogStatus.DISCUSS.getType()); return zpglMslcLog.insert() ? ResultUtil.data(zpglMslcLog) : ResultUtil.error(); } catch (Exception e) { e.printStackTrace(); throw new CustomException("招聘-添加讨论"); } } }