Your Name 9 miesięcy temu
rodzic
commit
5aec7d0362

+ 29 - 0
src/main/java/com/sqx/modules/firstLogin/control/HrController.java

@@ -0,0 +1,29 @@
+package com.sqx.modules.firstLogin.control;
+
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import com.sqx.modules.firstLogin.service.HrService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/app/HrFirst" )
+public class HrController {
+
+@Autowired
+private  HrService hrService;
+
+    @Login
+    @PostMapping("hr")
+    @ApiOperation("hr设置名片信息")
+    public  void  hr (Integer userId , String hrImg , String hrName){
+        HrEntity hr = new HrEntity();
+        hr.setUserId(userId);
+        hr.setHrImg(hrImg);
+        hr.setHrName(hrName);
+        hrService.updateById(hr);
+    }
+}

+ 5 - 5
src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistCotroller.java → src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java

@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 @RequestMapping("/app/userFirst" )
-public class UserFirstRegistCotroller {
+public class UserFirstRegistController {
     @Autowired
     private ResumesService resumesService;
     @Autowired
@@ -40,8 +40,8 @@ public class UserFirstRegistCotroller {
         resumes1.setMaxWage(maxWages);
         resumesService.updateById(resumes1);
     }
-@GetMapping ("getDepartment" )
-@ApiOperation("获取工作部门列表")
+    @PostMapping ("getDepartment" )
+    @ApiOperation("获取工作部门列表")
     public  Result  getDepartment(Department department){
 
         return Result.success().put("data",departmentService.getDepartmentList(department));
@@ -52,8 +52,8 @@ public class UserFirstRegistCotroller {
         return  Result.success().put("data",postSkillService.getPostSkill(postSkill));
     }
 
-@PostMapping("workExp")
-@ApiOperation("工作经验")
+    @PostMapping("workExp")
+    @ApiOperation("工作经验")
     public  void workExp(Long userId,WorkExp workExp){
     Resumes resumes1 = resumesService.selectResumesByUserId(userId);
     WorkExp workExp1 = new WorkExp();

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/HrDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface HrDao extends BaseMapper<HrEntity> {
+}

+ 12 - 0
src/main/java/com/sqx/modules/firstLogin/entity/HrEntity.java

@@ -0,0 +1,12 @@
+package com.sqx.modules.firstLogin.entity;
+
+import lombok.Data;
+
+@Data
+public class HrEntity {
+    private  Integer hrId;
+    private  Integer userId;
+    private  String  hrImg;
+    private  String  hrName;
+
+}

+ 7 - 0
src/main/java/com/sqx/modules/firstLogin/service/HrService.java

@@ -0,0 +1,7 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+
+public interface HrService extends IService<HrEntity> {
+}

+ 10 - 0
src/main/java/com/sqx/modules/firstLogin/service/PostSkillService.java

@@ -0,0 +1,10 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.PostSkill;
+
+import java.util.List;
+
+public interface PostSkillService extends IService<PostSkill> {
+    List<PostSkill> getPostSkill(PostSkill postSkill);
+}

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/HrServiceImpl.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.HrDao;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import com.sqx.modules.firstLogin.service.HrService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class HrServiceImpl extends ServiceImpl<HrDao, HrEntity> implements HrService {
+}

+ 33 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/PostSkillImpl.java

@@ -0,0 +1,33 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.PostSkillDao;
+import com.sqx.modules.firstLogin.entity.PostSkill;
+import com.sqx.modules.firstLogin.service.PostSkillService;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class PostSkillImpl extends ServiceImpl<PostSkillDao,PostSkill> implements PostSkillService {
+    @Override
+    public List<PostSkill> getPostSkill(PostSkill postSkill) {
+        return getPostSkillTree(baseMapper.selectList(new QueryWrapper<>(postSkill)));
+    }
+    private List<PostSkill> getPostSkillTree(List<PostSkill> records) {
+        return records.stream()
+                .filter(e -> e.getParentId() == 0)
+                .peek((menu) -> menu.setChildrenList(getChildrenList(menu, records)))
+                .sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort())))
+                .collect(Collectors.toList());
+    }
+    private List<PostSkill> getChildrenList(PostSkill root, List<PostSkill> all) {
+        return all.stream().filter(categoryEntity -> categoryEntity.getParentId().equals(root.getPostSkillId())).peek(categoryEntity -> {
+            //1、找到子菜单(递归)
+            categoryEntity.setChildrenList(getChildrenList(categoryEntity, all));
+        }).sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))).collect(Collectors.toList());
+    }
+}

+ 66 - 0
src/main/java/com/sqx/modules/post/controller/PostController.java

@@ -0,0 +1,66 @@
+package com.sqx.modules.post.controller;
+
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.post.entity.PostEntity;
+import com.sqx.modules.post.service.PostService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/app/post")
+public class PostController {
+    @Autowired
+    private  PostService postService;
+
+
+    @Login
+    @GetMapping("getPostListOfUser")
+    @ApiOperation("获取岗位列表")
+    public Result getPostListOfUser(){
+        return Result.success().put("data",postService.getPostListOfUser());
+    }
+    @GetMapping("getPostListOne")
+    @ApiOperation("获取岗位详细信息")
+    public Result getPostListOne(Integer postId){
+        return Result.success().put("data",postService.getPostListOne(postId));
+    }
+    @PostMapping("addPost")
+    @ApiOperation("增加岗位")
+    public void addPost(PostEntity postEntity){
+        PostEntity postEntity1 = new PostEntity();
+        postEntity1.setPostType(postEntity.getPostType());
+        postEntity1.setPostImTag(postEntity.getPostImTag());
+        postEntity1.setEdu(postEntity.getEdu());
+        postEntity1.setAddress(postEntity.getAddress());
+        postEntity1.setExp(postEntity.getExp());
+        postEntity1.setCompanyId(postEntity.getCompanyId());
+        postEntity1.setStatus(postEntity.getStatus());
+        postEntity1.setCommentTag(postEntity.getCommentTag());
+        postEntity1.setIfDue(postEntity.getIfDue());
+        postEntity1.setRuleClassifyName(postEntity.getRuleClassifyName());
+        postEntity1.setUserId(postEntity.getUserId());
+        postEntity1.setWage(postEntity.getWage());
+        postEntity1.setWelfareTag(postEntity.getWelfareTag());
+        postEntity1.setWelfareDetails(postEntity.getWelfareDetails());
+        postEntity1.setDescribe(postEntity.getDescribe());
+        postService.updateById(postEntity1);
+
+    }
+    @PostMapping("changePostStatus")
+    @ApiOperation("更改岗位状态岗位列表")
+    public  void changePostStatus(Integer postId,Integer status){
+        PostEntity postEntity1 =postService.getById(postId);
+        postEntity1.setStatus(status);
+        postService.updateById(postEntity1);
+    }
+    @PostMapping("findPost")
+    @ApiOperation("查找岗位列表")
+    public  Result finfPost(String address, String wage, String exp,String companyPeople,String key){
+        return  Result.success().put("data",postService.findPost(address,wage,exp,companyPeople,key));
+    }
+}

+ 9 - 0
src/main/java/com/sqx/modules/post/dao/PostDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.post.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.post.entity.PostEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PostDao extends BaseMapper<PostEntity> {
+}

+ 85 - 0
src/main/java/com/sqx/modules/post/entity/PostEntity.java

@@ -0,0 +1,85 @@
+package com.sqx.modules.post.entity;
+
+import lombok.Data;
+import org.joda.time.DateTime;
+
+import java.io.Serializable;
+@Data
+public class PostEntity implements Serializable {
+    /**
+     * 发布岗位id
+     */
+    private Integer postId;
+    /**
+     * 岗位类型  0 社招全职 1 应届生校园招聘 2 实习生招聘 3 兼职招聘
+     */
+    private Integer postType;
+    /**
+     * 招聘职位名称
+     */
+    private String ruleClassifyName;
+    /**
+     * 招聘推荐词条
+     */
+    private String postImTag;
+    /**
+     * 招聘详细信息
+     */
+    private String describe;
+    /**
+     * 招聘经验要求 0 不限 1 一年以内 2 一到三年 3 三到五年 4 五到十年 5 十年以上
+     */
+    private Integer exp;
+    /**
+     * 招聘最低学历要求  0 不限 1 专科 2 本科 3 硕士 4 博士
+     */
+    private Integer edu;
+
+    /**
+     * 薪资范围
+     */
+    private String wage;
+    /**
+     * 福利tag
+     */
+    private String welfareTag;
+
+    /**
+     * 福利详情
+     */
+    private String welfareDetails;
+
+    /**
+     * 详情tag
+     */
+    private String commentTag;
+
+    /**
+     * 公司地址
+     */
+    private String address;
+
+    /**
+     * 招聘发布人Id
+     */
+    private Integer userId;
+
+    /**
+     * 招聘公司id
+     */
+    private Integer companyId;
+
+    /**
+     * 招聘状态 0 审核未通过 1 审核通过 2 下架
+     */
+    private Integer status;
+
+    /**
+     * 是否加急 0 未加急 1 加急
+     */
+    private Integer ifDue;
+    /**
+     * 更新时间
+     */
+    private DateTime updateTime;
+}

+ 17 - 0
src/main/java/com/sqx/modules/post/mapper/PostMapper.java

@@ -0,0 +1,17 @@
+package com.sqx.modules.post.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.post.entity.PostEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+
+import java.util.List;
+@Mapper
+public interface PostMapper extends BaseMapper<PostEntity> {
+
+    List<Object> selectPostWithUserAndCompanyByPostId();
+
+    List<Object> selectPostOne(Integer postId);
+
+    List<Object> findPost(String address, String wage, String exp, String companyPeople, String key);
+}

+ 15 - 0
src/main/java/com/sqx/modules/post/service/PostService.java

@@ -0,0 +1,15 @@
+package com.sqx.modules.post.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.post.entity.PostEntity;
+
+import java.util.List;
+
+public interface PostService extends IService<PostEntity>  {
+    List<Object> getPostListOfUser();
+
+
+    List<Object> getPostListOne(Integer postId);
+
+    List<Object> findPost(String address, String wage, String exp, String companyPeople, String key);
+}

+ 35 - 0
src/main/java/com/sqx/modules/post/service/impl/PostServiceImpl.java

@@ -0,0 +1,35 @@
+package com.sqx.modules.post.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.post.dao.PostDao;
+import com.sqx.modules.post.entity.PostEntity;
+import com.sqx.modules.post.mapper.PostMapper;
+import com.sqx.modules.post.service.PostService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+@Service
+public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements PostService {
+
+ @Autowired
+ private PostMapper postMapper;
+
+    @Override
+    public List<Object> getPostListOfUser() {
+
+    return Collections.singletonList(postMapper.selectPostWithUserAndCompanyByPostId());
+    }
+
+    @Override
+    public List<Object> getPostListOne(Integer postId) {
+        return  postMapper.selectPostOne(postId);
+    }
+
+    @Override
+    public List<Object> findPost(String address, String wage, String exp, String companyPeople, String key) {
+        return  postMapper.findPost(address,wage,exp,companyPeople,key);
+    }
+}

+ 102 - 0
src/main/resources/mapper/post/PostDetailVO.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+
+<mapper namespace="com.sqx.modules.post.mapper.PostMapper">
+
+
+    <select id="selectPostWithUserAndCompany" >
+        SELECT
+        p.post_id AS postId,
+        p.rule_classify_name AS ruleClassifyName,
+        p.post_im_tag AS postImTag,
+        p.wage AS wage,
+        p.address AS address,
+        p.if_due AS ifDue,
+        c.company_id AS companyId,
+        c.company_name AS companyName,
+        c.company_people as companyPeople,
+        h.hr_img AS hrImg,
+        h.hr_name AS hrName
+        FROM
+        post p
+        LEFT JOIN
+        company c ON p.company_id = c.company_id
+        LFTE JOIN
+        hr h  ON  p.user_id = h.user_id
+        WHERE
+         p.status = 1
+
+    </select>
+    <select id="selectPostOne" >
+        SELECT
+            p.post_id AS postId,
+            p.post_type AS postType,
+            p.rule_classify_name AS ruleClassifyName,
+            p.post_im_tag AS postImTag,
+            p.describe AS describe,
+        p.exp AS exp,
+        p.edu AS edu,
+        p.wage AS wage,
+        p.welfare_tag AS welfareTag,
+        p.welfare_details AS welfareDetails,
+        p.comment_tag AS commentTag,
+        p.address AS address,
+        p.status AS status,
+        p.if_due AS ifDue,
+        c.company_id AS companyId,
+        c.company_name AS companyName,
+        c.company_people AS companyPeople,
+        h.hr_img AS hrImg,
+        h.hr_name AS hrName
+        FROM
+            post p
+            LEFT JOIN
+            company c ON p.company_id = c.company_id
+            LFTE JOIN
+            hr h  ON  p.user_id = h.user_id
+        WHERE post_id = #{postId}
+    </select>
+    <select id="findPost" >
+        SELECT
+            p.post_id AS postId,
+            p.rule_classify_name AS ruleClassifyName,
+            p.post_im_tag AS postImTag,
+            p.wage AS wage,
+            p.address AS address,
+            p.if_due AS ifDue,
+            c.company_id AS companyId,
+            c.company_name AS companyName,
+            c.company_people as companyPeople,
+            h.hr_img AS hrImg,
+            h.hr_name AS hrName
+        FROM
+            post p
+                LEFT JOIN
+            company c ON p.company_id = c.company_id
+            LFTE JOIN
+             hr h  ON  p.user_id = h.user_id
+        WHERE
+            p.status = 1
+        <if test="key != null and key != ''">
+            AND (
+            c.company_name LIKE CONCAT('%', #{key}, '%')
+            OR
+            p.rule_classify_name LIKE CONCAT('%', #{key}, '%')
+            )
+        </if>
+        <if test="address!=null and address!=0">
+            and p.address=#{status}
+        </if>
+        <if test="wage!=null and wage!=0">
+            and p.wage=#{status}
+        </if>
+        <if test="exp!=null and exp!=0">
+            and p.exp=#{status}
+        </if>
+        <if test="companyPeople!=null and companyPeople!=0">
+            and c.company_people=#{status}
+        </if>
+    </select>
+</mapper>