From f0ffb2cf5b112d79402a401ecc9fdb86b7c2dc3e Mon Sep 17 00:00:00 2001 From: lw <532810027@qq.com> Date: Tue, 25 Jun 2024 19:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=A5=E8=81=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-druid.yml | 14 +- .../src/main/resources/application.yml | 12 +- .../controller/EntryManageController.java | 135 ++++++++++++++++++ .../controller/HomePageController.java | 23 +-- .../cn/zeroerr/domain/entity/EntryManage.java | 127 ++++++++++++++++ .../java/cn/zeroerr/domain/vo/UserVO.java | 4 +- .../cn/zeroerr/mapper/EntryManageMapper.java | 24 ++++ .../zeroerr/service/EntryManageService.java | 17 +++ .../service/impl/EntryManageServiceImpl.java | 28 ++++ .../resources/mapper/EntryManageMapper.xml | 44 ++++++ 10 files changed, 402 insertions(+), 26 deletions(-) create mode 100644 zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/EntryManageController.java create mode 100644 zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/EntryManage.java create mode 100644 zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java create mode 100644 zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java create mode 100644 zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java create mode 100644 zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml diff --git a/zeroerr_oa-admin/src/main/resources/application-druid.yml b/zeroerr_oa-admin/src/main/resources/application-druid.yml index 386e1f3..11f640a 100644 --- a/zeroerr_oa-admin/src/main/resources/application-druid.yml +++ b/zeroerr_oa-admin/src/main/resources/application-druid.yml @@ -5,14 +5,14 @@ spring: driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 - master: - url: jdbc:mysql://192.168.1.165:3306/zeoa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: zeoa - password: dHahLWNYB7tD2Mia # master: -# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 -# username: root -# password: zero +# url: jdbc:mysql://192.168.1.165:3306/zeoa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: zeoa +# password: dHahLWNYB7tD2Mia + master: + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: zero # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/zeroerr_oa-admin/src/main/resources/application.yml b/zeroerr_oa-admin/src/main/resources/application.yml index 7f2ca50..a886da0 100644 --- a/zeroerr_oa-admin/src/main/resources/application.yml +++ b/zeroerr_oa-admin/src/main/resources/application.yml @@ -7,8 +7,8 @@ ruoyi: # 版权年份 copyrightYear: 2024 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - #profile: D:/zeroerr/uploadPath - profile: /home/zeroerr_oa/uploadPath + profile: D:/zeroerr/uploadPath + #profile: /home/zeroerr_oa/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 @@ -69,15 +69,15 @@ spring: # redis 配置 redis: # 地址 - host: 192.168.1.189 - #host: localhost + #host: 192.168.1.189 + host: localhost # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: 123456 - #password: + #password: 123456 + password: # 连接超时时间 timeout: 10s lettuce: diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/EntryManageController.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/EntryManageController.java new file mode 100644 index 0000000..f31bf9f --- /dev/null +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/EntryManageController.java @@ -0,0 +1,135 @@ +package cn.zeroerr.controller; + +import cn.zeroerr.common.annotation.Log; +import cn.zeroerr.common.core.controller.BaseController; +import cn.zeroerr.common.core.domain.AjaxResult; +import cn.zeroerr.common.core.domain.entity.SysRole; +import cn.zeroerr.common.core.domain.entity.SysUser; +import cn.zeroerr.common.core.page.TableDataInfo; +import cn.zeroerr.common.enums.BusinessType; +import cn.zeroerr.common.utils.poi.ExcelUtil; +import cn.zeroerr.domain.entity.EntryManage; +import cn.zeroerr.domain.entity.ResumeFollowRecord; +import cn.zeroerr.domain.vo.UserVO; +import cn.zeroerr.service.EntryManageService; +import cn.zeroerr.service.ResumeFollowRecordService; +import cn.zeroerr.system.service.ISysRoleService; +import cn.zeroerr.system.service.ISysUserService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@RestController +@RequestMapping("/recruit/entryManage") +@Api(tags = "招聘管理-入职管理") +public class EntryManageController extends BaseController { + + @Autowired + private EntryManageService entryManageService; + + @Autowired + private ISysUserService iSysUserService; + + @Autowired + private ISysRoleService iSysRoleService; + + @Autowired + private ResumeFollowRecordService resumeFollowRecordService; + + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:add')") + @PostMapping("/add") + @ApiOperation(value = "增加入职管理的记录") + public AjaxResult addEntryManage(@Validated @RequestBody EntryManage req) { + req.setHrId(getUserId()); + SysUser sysUser = iSysUserService.selectUserById(getUserId()); + req.setHrName(sysUser.getNickName()); + req.setCreateTime(LocalDateTime.now()); + return toAjax(entryManageService.save(req)); + } + + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:edit')") + @PutMapping("/edit") + @ApiOperation(value = "修改入职管理的记录") + public AjaxResult editEntryManage(@Validated @RequestBody EntryManage req) { + return toAjax(entryManageService.updateById(req)); + } + + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:edit')") + @GetMapping("/get/{entryId}") + @ApiOperation(value = "查询某个入职管理的记录") + public AjaxResult queryEntryManage(@PathVariable("entryId") String entryId) { + return AjaxResult.success(entryManageService.getById(entryId)); + } + + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:list')") + @GetMapping("/list") + @ApiOperation(value = "入职管理的记录列表") + public TableDataInfo listEntryManage(EntryManage req) { + boolean isHr = false; + List sysRoles = iSysRoleService.rolesByUserId(getUserId()); + if (!CollectionUtils.isEmpty(sysRoles)) { + for (SysRole sysRole : sysRoles) { + //如果角色是hr + if (sysRole.getRoleKey().equals("hr") || sysRole.getRoleKey().equals("hrleader")) { + isHr = true; + } + } + } + if (isHr) { + req.setHrId(getUserId()); + } + startPage(); + List entryManageList = entryManageService.listBySelect(req); + return getDataTable(entryManageList); + } + + + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:delete')") + @DeleteMapping("/delete/{entryId}") + @ApiOperation(value = "删除某个入职管理的记录") + public AjaxResult deleteEntryManage(@PathVariable("entryId") String entryId) { + return toAjax(entryManageService.removeById(entryId)); + } + + + @PostMapping("/export") + @PreAuthorize("@ss.hasAnyPermi('recruit:entry:export')") + @ApiOperation(value = "下载入职管理记录") + @Log(title = "下载入职管理记录", businessType = BusinessType.EXPORT) + public void export(HttpServletResponse response, EntryManage req) { + boolean isHr = false; + List sysRoles = iSysRoleService.rolesByUserId(getUserId()); + if (!CollectionUtils.isEmpty(sysRoles)) { + for (SysRole sysRole : sysRoles) { + //如果角色是hr + if (sysRole.getRoleKey().equals("hr") || sysRole.getRoleKey().equals("hrleader")) { + isHr = true; + } + } + } + if (isHr) { + req.setHrId(getUserId()); + } + List entryManageList = entryManageService.listBySelect(req); + //将序号重新排列 + for (int i = 0; i < entryManageList.size(); i++) { + EntryManage entry = entryManageList.get(i); + entry.setEntryId(Long.valueOf(i)); + } + ExcelUtil util = new ExcelUtil(EntryManage.class); + util.exportExcel(response,entryManageList, "入职管理数据"); + + } +} diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java index e88949e..ea9fa72 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java @@ -204,14 +204,14 @@ public class HomePageController extends BaseController { //某月份,岗位ids List postIdsList=new ArrayList<>(); //筛除已经招聘到的岗位 - List postIdList=recruitStructureService.filterByPostIdList(uniquePostIdList); - if(!CollectionUtils.isEmpty(postIdList)){ - postIdList.forEach( - postId->{ - List resumeFollowRecordListByPostId = groupedResumeFollowRecords.get(postId); - List resumeHandleRecordListByPostId = groupedResumeHandleRecords.get(postId); + //List postIdList=recruitStructureService.filterByPostIdList(uniquePostIdList); + if(!CollectionUtils.isEmpty(uniquePostIdList)){ + uniquePostIdList.forEach( + uniquePostId->{ + List resumeFollowRecordListByPostId = groupedResumeFollowRecords.get(uniquePostId); + List resumeHandleRecordListByPostId = groupedResumeHandleRecords.get(uniquePostId); PostDetailDTO postDetailDTO = new PostDetailDTO(); - postDetailDTO.setPostId(postId); + postDetailDTO.setPostId(uniquePostId); if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ postDetailDTO.setPostName(resumeFollowRecordListByPostId.get(0).getPostName()); }else if(!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)) { @@ -230,10 +230,11 @@ public class HomePageController extends BaseController { } //封装该岗位合格简历数 - if(!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)){ - postDetailDTO.setPostQualifiedResumeCounts( resumeHandleRecordListByPostId.stream() - .mapToInt(ResumeHandleRecord::getQualifiedNum) - .sum()); + if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ +// postDetailDTO.setPostQualifiedResumeCounts( resumeHandleRecordListByPostId.stream() +// .mapToInt(ResumeHandleRecord::getQualifiedNum) +// .sum()); + postDetailDTO.setPostQualifiedResumeCounts(resumeFollowRecordListByPostId.size()); }else { postDetailDTO.setPostQualifiedResumeCounts(0); } diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/EntryManage.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/EntryManage.java new file mode 100644 index 0000000..6b993e3 --- /dev/null +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/EntryManage.java @@ -0,0 +1,127 @@ +package cn.zeroerr.domain.entity; + +import cn.zeroerr.common.annotation.Excel; +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * + * @TableName entry_manage + */ +@TableName(value ="entry_manage") +@Data +public class EntryManage implements Serializable { + /** + * + */ + @TableId(value = "entry_id",type = IdType.AUTO) + @Excel(name = "用户序号", prompt = "用户编号") + private Long entryId; + + /** + * 部门id + */ + @TableField(value = "dept_id") + private Long deptId; + + /** + * 部门名字 + */ + @TableField(value = "dept_name") + @Excel(name = "部门") + private String deptName; + + /** + * 岗位id + */ + @TableField(value = "post_id") + private Long postId; + + /** + * 岗位名字 + */ + @TableField(value = "post_name") + @Excel(name = "岗位") + private String postName; + +// /** +// * 入职者id +// */ +// @TableField(value = "user_id") +// private Long userId; + + /** + * 入职者name + */ + @TableField(value = "user_name") + @Excel(name = "姓名") + private String userName; + + /** + * hr的id + */ + @TableField(value = "hr_id") + private Long hrId; + + /** + * hr的name + */ + @TableField(value = "hr_name") + @Excel(name = "招聘HR") + private String hrName; + + /** + * 终试通过的日期 + */ + @TableField(value = "final_pass_date",updateStrategy = FieldStrategy.IGNORED) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "终试通过的日期", width = 30, dateFormat = "yyyy-MM-dd") + private LocalDate finalPassDate; + + /** + * 预计入职日期 + */ + @TableField(value = "join_date",updateStrategy = FieldStrategy.IGNORED) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计入职日期", width = 30, dateFormat = "yyyy-MM-dd") + private LocalDate joinDate; + + /** + * 实际入职日期 + */ + @TableField(value = "actual_join_date",updateStrategy = FieldStrategy.IGNORED) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "实际入职日期", width = 30, dateFormat = "yyyy-MM-dd") + private LocalDate actualJoinDate; + + /** + * 入职失败的原因 + */ + @TableField(value = "entry_fail_reason") + @Excel(name = "未入职原因") + private String entryFailReason; + + @TableField(value = "create_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @TableField(value = "update_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/UserVO.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/UserVO.java index 0a2608b..db64898 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/UserVO.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/UserVO.java @@ -8,10 +8,10 @@ import org.springframework.beans.factory.annotation.Autowired; @Data @ApiModel public class UserVO { - @ApiModelProperty(value = "hr的用户id") + @ApiModelProperty(value = "用户id") private Long userId; - @ApiModelProperty(value = "hr的名字") + @ApiModelProperty(value = "用户名字") private String name; } diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java new file mode 100644 index 0000000..f26356d --- /dev/null +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java @@ -0,0 +1,24 @@ +package cn.zeroerr.mapper; + +import cn.zeroerr.domain.entity.EntryManage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** +* @author Ze-java +* @description 针对表【entry_manage】的数据库操作Mapper +* @createDate 2024-06-25 10:07:23 +* @Entity cn.zeroerr.domain.entity.EntryManage +*/ +@Repository +public interface EntryManageMapper extends BaseMapper { + + List listBySelect(@Param("req") EntryManage req); +} + + + + diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java new file mode 100644 index 0000000..5ae7039 --- /dev/null +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java @@ -0,0 +1,17 @@ +package cn.zeroerr.service; + +import cn.zeroerr.domain.entity.EntryManage; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author Ze-java +* @description 针对表【entry_manage】的数据库操作Service +* @createDate 2024-06-25 10:07:23 +*/ +public interface EntryManageService extends IService { + + + List listBySelect(EntryManage req); +} diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java new file mode 100644 index 0000000..62d8ed2 --- /dev/null +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java @@ -0,0 +1,28 @@ +package cn.zeroerr.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.zeroerr.domain.entity.EntryManage; +import cn.zeroerr.service.EntryManageService; +import cn.zeroerr.mapper.EntryManageMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author Ze-java +* @description 针对表【entry_manage】的数据库操作Service实现 +* @createDate 2024-06-25 10:07:23 +*/ +@Service +public class EntryManageServiceImpl extends ServiceImpl + implements EntryManageService{ + + @Override + public List listBySelect(EntryManage req) { + return this.baseMapper.listBySelect(req); + } +} + + + + diff --git a/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml new file mode 100644 index 0000000..a0c45e5 --- /dev/null +++ b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + entry_id,dept_id,dept_name, + post_id,post_name, + user_name,hr_id,hr_name, + final_pass_date,join_date,actual_join_date, + entry_fail_reason + + + +