Your Name 8 luni în urmă
părinte
comite
7d421a9930
21 a modificat fișierele cu 560 adăugiri și 114 ștergeri
  1. 12 5
      src/main/java/com/sqx/modules/firstLogin/control/HrController.java
  2. 96 40
      src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java
  3. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/EduDao.java
  4. 1 2
      src/main/java/com/sqx/modules/firstLogin/entity/Department.java
  5. 32 0
      src/main/java/com/sqx/modules/firstLogin/entity/Edu.java
  6. 9 1
      src/main/java/com/sqx/modules/firstLogin/entity/HrEntity.java
  7. 18 5
      src/main/java/com/sqx/modules/firstLogin/entity/WorkExp.java
  8. 7 0
      src/main/java/com/sqx/modules/firstLogin/service/EduService.java
  9. 11 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/EduServiceImpl.java
  10. 30 34
      src/main/java/com/sqx/modules/post/controller/PostController.java
  11. 44 0
      src/main/java/com/sqx/modules/post/controller/ViewPostController.java
  12. 9 0
      src/main/java/com/sqx/modules/post/dao/ViewPostDao.java
  13. 22 0
      src/main/java/com/sqx/modules/post/dto/SelectAllDto.java
  14. 101 0
      src/main/java/com/sqx/modules/post/dto/SelectOneDto.java
  15. 8 3
      src/main/java/com/sqx/modules/post/entity/PostEntity.java
  16. 25 0
      src/main/java/com/sqx/modules/post/entity/ViewPost.java
  17. 4 0
      src/main/java/com/sqx/modules/post/mapper/PostMapper.java
  18. 12 0
      src/main/java/com/sqx/modules/post/service/ViewPostService.java
  19. 44 0
      src/main/java/com/sqx/modules/post/service/impl/ViewPostServiceImpl.java
  20. 2 13
      src/main/java/com/sqx/modules/resumes/entity/Resumes.java
  21. 64 11
      src/main/resources/mapper/post/PostDetailVO.xml

+ 12 - 5
src/main/java/com/sqx/modules/firstLogin/control/HrController.java

@@ -1,11 +1,12 @@
 package com.sqx.modules.firstLogin.control;
 
-import com.sqx.modules.app.annotation.Login;
+import com.sqx.common.utils.Result;
 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.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -16,14 +17,20 @@ public class HrController {
 @Autowired
 private  HrService hrService;
 
-    @Login
-    @PostMapping("hr")
+    @PostMapping("addHr")
     @ApiOperation("hr设置名片信息")
-    public  void  hr (Integer userId , String hrImg , String hrName){
+    public Result addHr (Integer userId , String hrImg , String hrName){
         HrEntity hr = new HrEntity();
         hr.setUserId(userId);
         hr.setHrImg(hrImg);
         hr.setHrName(hrName);
-        hrService.updateById(hr);
+        hrService.save(hr);
+        return  Result.success();
+    }
+    @PostMapping("updateHr")
+    @ApiOperation("hr设置名片信息")
+    public Result updateHr (@RequestBody  HrEntity hr){
+        hrService.saveOrUpdate(hr);
+        return  Result.success();
     }
 }

+ 96 - 40
src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java

@@ -1,21 +1,21 @@
 package com.sqx.modules.firstLogin.control;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.firstLogin.entity.Department;
+import com.sqx.modules.firstLogin.entity.Edu;
 import com.sqx.modules.firstLogin.entity.PostSkill;
 import com.sqx.modules.firstLogin.entity.WorkExp;
 import com.sqx.modules.firstLogin.service.DepartmentService;
+import com.sqx.modules.firstLogin.service.EduService;
 import com.sqx.modules.firstLogin.service.WorkExpService;
 import com.sqx.modules.firstLogin.service.PostSkillService;
 import com.sqx.modules.resumes.entity.Resumes;
 import com.sqx.modules.resumes.service.ResumesService;
 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;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/app/userFirst" )
@@ -28,11 +28,14 @@ public class UserFirstRegistController {
     private WorkExpService workExpService;
     @Autowired
     private PostSkillService postSkillService;
+    @Autowired
+    private EduService eduService;
+
 
     @Login
     @PostMapping("regist")
     @ApiOperation("初次加载信息")
-    public void  userFirstRegist(Long userId, String minWage, String maxWages, String city,Integer ifExp){
+    public void userFirstRegist(Long userId, String minWage, String maxWages, String city, Integer ifExp) {
         Resumes resumes1 = resumesService.selectResumesByUserId(userId);
         resumes1.setCity(city);
         resumes1.setIfExp(ifExp);
@@ -40,46 +43,99 @@ public class UserFirstRegistController {
         resumes1.setMaxWage(maxWages);
         resumesService.updateById(resumes1);
     }
-    @PostMapping ("getDepartment" )
+
+    @PostMapping("getDepartment")
     @ApiOperation("获取工作部门列表")
-    public  Result  getDepartment(Department department){
+    public Result getDepartment(Department department) {
 
-        return Result.success().put("data",departmentService.getDepartmentList(department));
-}
-    @GetMapping ("getPostSkill" )
+        return Result.success().put("data", departmentService.getDepartmentList(department));
+    }
+
+    @GetMapping("getPostSkill")
     @ApiOperation("获取专业技能")
-    public  Result getPostSkill(PostSkill postSkill){
-        return  Result.success().put("data",postSkillService.getPostSkill(postSkill));
+    public Result getPostSkill(PostSkill postSkill) {
+        return Result.success().put("data", postSkillService.getPostSkill(postSkill));
     }
 
     @PostMapping("workExp")
     @ApiOperation("工作经验")
-    public  void workExp(Long userId,WorkExp workExp){
-    Resumes resumes1 = resumesService.selectResumesByUserId(userId);
-    WorkExp workExp1 = new WorkExp();
-    resumes1.setWorkExpId(Math.toIntExact(workExp1.getWorkExpId()));
-    resumesService.updateById(resumes1);
-    workExp1.setType(workExp.getType());
-    workExp1.setDepartment(workExp.getDepartment());
-    workExp1.setPostSkills(workExp.getPostSkills());
-    workExp1.setPostLevel(workExp.getPostLevel());
-    workExp1.setWorkContent(workExp.getWorkContent());
-    workExp1.setWorkAchieve(workExp.getWorkAchieve());
-    workExp1.setIndustry(workExp.getIndustry());
-    workExpService.updateById(workExp1);
-}
-@PostMapping("registe")
-@ApiOperation("补充详细信息")
-    public  void  registe(Resumes resumes){
-    Resumes resumes1 = resumesService.selectResumesByUserId(resumes.getUserId());
-    resumes1.setPicture(resumes.getPicture());
-    resumes1.setResumesName(resumes.getResumesName());
-    resumes1.setResumesSex(resumes.getResumesSex());
-    resumes1.setResumesPhone(resumes.getResumesPhone());
-    resumes1.setBirthday(resumes.getBirthday());
-    resumes1.setResumesStatus(resumes.getResumesStatus());
-    resumes1.setEdu(resumes.getEdu());
-    resumes1.setAdv(resumes.getAdv());
-    resumesService.updateById(resumes1);
-}
+    public Result workExp(@RequestBody  WorkExp workExp) {
+        workExpService.save(workExp);
+        return Result.success();
+    }
+
+    @PostMapping("registe")
+    @ApiOperation("补充详细信息")
+    public void registe(Resumes resumes) {
+        Resumes resumes1 = resumesService.selectResumesByUserId(resumes.getUserId());
+        resumes1.setPicture(resumes.getPicture());
+        resumes1.setResumesName(resumes.getResumesName());
+        resumes1.setResumesSex(resumes.getResumesSex());
+        resumes1.setResumesPhone(resumes.getResumesPhone());
+        resumes1.setBirthday(resumes.getBirthday());
+        resumes1.setResumesStatus(resumes.getResumesStatus());
+        resumes1.setAdv(resumes.getAdv());
+        resumesService.updateById(resumes1);
+    }
+
+    @PostMapping("addEdu")
+    @ApiOperation("增加学历")
+    public Result addEdu(@RequestBody  Edu edu) {
+        eduService.save(edu);
+        return Result.success();
+
+    }
+
+    @GetMapping("selectEdu")
+    @ApiOperation("查找学历")
+    public Result selectEdu(Integer userId) {
+        QueryWrapper<Edu> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId).eq("is_use",1);
+        queryWrapper.orderByAsc("start_time");
+        return Result.success().put("data", eduService.getBaseMapper().selectList(queryWrapper));
+    }
+
+    @GetMapping("selectWorkExp")
+    @ApiOperation("查找工作经历")
+    public Result selectWorkExp(Integer userId) {
+        QueryWrapper<WorkExp> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId).eq("is_use",1);
+        queryWrapper.orderByAsc("work_start_time");
+        return Result.success().put("data", workExpService.getBaseMapper().selectList(queryWrapper));
+    }
+
+    @PostMapping("updateWorkExp")
+    @ApiOperation("更新工作经历")
+    public Result updateWorkExp(@RequestBody WorkExp workExp) {
+
+        workExpService.updateById(workExp);
+        return Result.success();
+    }
+
+    @PostMapping("updateEdu")
+    @ApiOperation("更新教育经历")
+    public Result updateEdu(@RequestBody Edu edu) {
+
+        eduService.updateById(edu);
+        return Result.success();
+    }
+
+    @PostMapping("deleteWorkExp")
+    @ApiOperation("删除工作经历")
+    public Result deleteExp(Integer workExpId) {
+        WorkExp workExp = workExpService.getById(workExpId);
+        workExp.setIsUse(0);
+        workExpService.saveOrUpdate(workExp);
+        return Result.success();
+    }
+
+    @PostMapping("deleteEdu")
+    @ApiOperation("删除教育经历")
+    public Result deleteEdu( Integer eduId) {
+        Edu edu = eduService.getById(eduId);
+        edu.setIsUse(0);
+        eduService.saveOrUpdate(edu);
+        return Result.success();
+
+    }
 }

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

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

+ 1 - 2
src/main/java/com/sqx/modules/firstLogin/entity/Department.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.sqx.modules.industry.entity.Industry;
 import lombok.Data;
-import org.joda.time.DateTime;
 
 import java.io.Serializable;
 import java.util.List;
@@ -39,7 +38,7 @@ public class Department implements Serializable {
     /**
      * 更新时间
      */
-    private DateTime  updateTime;
+    private  String  updateTime;
 
     @TableField(exist = false)
     private List<Industry> childrenList;

+ 32 - 0
src/main/java/com/sqx/modules/firstLogin/entity/Edu.java

@@ -0,0 +1,32 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+@TableName("edu")
+public class Edu implements Serializable {
+    private static final long serialVersionUID = 1L;
+    //教育经历id
+    @TableId(value = "edu_id", type = IdType.AUTO)
+    private Integer eduId;
+    // 学校名称
+    private String school;
+    // 用户id
+    private Integer userId;
+    // 专业
+    private String profession;
+    // 起始时间
+    private String startTime;
+    // 结束时间
+    private String endTime;
+    // 学位
+    private String degree;
+    // 详细内容
+    private String detail;
+    //是否启用
+    private  Integer isUse;
+}

+ 9 - 1
src/main/java/com/sqx/modules/firstLogin/entity/HrEntity.java

@@ -1,9 +1,17 @@
 package com.sqx.modules.firstLogin.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
+import java.io.Serializable;
+
 @Data
-public class HrEntity {
+@TableName("hr")
+public class HrEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "hr_id", type = IdType.AUTO)
     private  Integer hrId;
     private  Integer userId;
     private  String  hrImg;

+ 18 - 5
src/main/java/com/sqx/modules/firstLogin/entity/WorkExp.java

@@ -2,18 +2,20 @@ package com.sqx.modules.firstLogin.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
-import org.joda.time.DateTime;
 
 import java.io.Serializable;
 @Data
+@TableName("work_exp")
 public class WorkExp implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     /**
      * 工作经验id
      */
     @TableId(value = "work_exp_id", type = IdType.AUTO)
-    private Long workExpId;
+    private Integer workExpId;
     /**
      * 工作经验种类 0.跨境电商经验 1.国内电贸 2.外贸 3. 其他
      */
@@ -25,7 +27,7 @@ private  String department;
     /**
      * 历史工作技能
      */
-private  String postSkills;
+private  String postSkill;
     /**
      * 历史工作资质
      */
@@ -39,12 +41,23 @@ private  String workContent;
      */
 private  String workAchieve;
     /**
-     * 历史工作时间
+     * 历史工作开始时间
      */
-private DateTime workTime;
+private String workStartTime;
+    /**
+     * 历史工作结束时间
+     */
+    private String workEndTime;
     /**
      * 历史工作岗位id
      */
 private  String industry;
+    /**
+     * 用户id
+     */
+private  Integer userId;
+
+    private  Integer isUse;
+
 
 }

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

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

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/EduServiceImpl.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.EduDao;
+import com.sqx.modules.firstLogin.entity.Edu;
+import com.sqx.modules.firstLogin.service.EduService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class EduServiceImpl extends ServiceImpl<EduDao, Edu> implements EduService {
+}

+ 30 - 34
src/main/java/com/sqx/modules/post/controller/PostController.java

@@ -1,66 +1,62 @@
 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 com.sqx.modules.post.service.ViewPostService;
 import io.swagger.annotations.ApiOperation;
+import org.joda.time.LocalDateTime;
 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;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/app/post")
 public class PostController {
     @Autowired
-    private  PostService postService;
+    private PostService postService;
+    @Autowired
+    private ViewPostService viewPostService;
 
 
-    @Login
     @GetMapping("getPostListOfUser")
     @ApiOperation("获取岗位列表")
-    public Result getPostListOfUser(){
-        return Result.success().put("data",postService.getPostListOfUser());
+    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));
+    public Result getPostListOne(Integer postId,Integer userId) {
+        viewPostService.addViewPost(postId,userId);
+        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);
+    public void addPost(@RequestBody PostEntity postEntity) {
+        postService.saveOrUpdate(postEntity);
 
     }
+
     @PostMapping("changePostStatus")
     @ApiOperation("更改岗位状态岗位列表")
-    public  void changePostStatus(Integer postId,Integer status){
-        PostEntity postEntity1 =postService.getById(postId);
+    public void changePostStatus(Integer postId, Integer status) {
+        PostEntity postEntity1 = postService.getById(postId);
         postEntity1.setStatus(status);
         postService.updateById(postEntity1);
     }
-    @PostMapping("findPost")
+
+    @GetMapping("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));
+    public Result findPost(String address, String wage, String exp, String companyPeople, String key) {
+        return Result.success().put("data", postService.findPost(address, wage, exp, companyPeople, key));
+    }
+    @PostMapping("changePost")
+    @ApiOperation("更改岗位状态岗位列表")
+    public Result changePost(@RequestBody PostEntity postEntity) {
+        postEntity.setUpdateTime(String.valueOf(LocalDateTime.now()));
+        postService.saveOrUpdate(postEntity);
+        return  Result.success();
     }
 }

+ 44 - 0
src/main/java/com/sqx/modules/post/controller/ViewPostController.java

@@ -0,0 +1,44 @@
+package com.sqx.modules.post.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.post.entity.ViewPost;
+import com.sqx.modules.post.service.ViewPostService;
+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/viewPost")
+public class ViewPostController {
+    @Autowired
+    private ViewPostService viewPostService;
+    @Login
+    @GetMapping("getViewPost")
+    @ApiOperation("获取查看的岗位列表")
+    public Result getViewPost(Integer userId){
+
+        return  Result.success().put("data",viewPostService.getViewPostList(userId));
+
+    }
+    @GetMapping("getCollectPost")
+    @ApiOperation("获取收藏的岗位列表")
+    public Result getCollectPost(Integer userId) {
+
+        return  Result.success().put("data",viewPostService.getCollectPost(userId));
+    }
+    @PostMapping("collectPost")
+    @ApiOperation("是否收藏岗位")
+    public Result  collectPost(Integer userId,Integer postId,Integer isCollect){
+        QueryWrapper<ViewPost> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("post_id",postId);
+        ViewPost viewPost = viewPostService.getOne(queryWrapper);
+        viewPost.setIsCollect(isCollect);
+        viewPostService.saveOrUpdate(viewPost);
+        return  Result.success();
+    }
+}

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

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

+ 22 - 0
src/main/java/com/sqx/modules/post/dto/SelectAllDto.java

@@ -0,0 +1,22 @@
+package com.sqx.modules.post.dto;
+
+import lombok.Data;
+
+@Data
+public class SelectAllDto {
+    private Integer postId; // 对应 p.post_id AS postId(职位ID)
+    private String ruleClassifyName; // 对应 p.rule_classify_name AS ruleClassifyName(职位分类名称)
+    private String postImTag; // 对应 p.post_im_tag AS postImTag(职位标签)
+    private String wage; // 对应 p.wage AS wage(薪资)
+    private String address; // 对应 p.address AS address(工作地址)
+    private Integer ifDue; // 对应 p.if_due AS ifDue(是否到期,状态标识)
+
+    // 公司表字段(c前缀)
+    private Integer companyId; // 对应 c.company_id AS companyId(公司ID)
+    private String companyName; // 对应 c.company_name AS companyName(公司名称)
+    private String companyPeople; // 对应 c.company_people AS companyPeople(公司人数)
+
+    // HR表字段(h前缀)
+    private String hrImg; // 对应 h.hr_img AS hrImg(HR头像)
+    private String hrName; // 对应 h.hr_name AS hrName(HR姓名
+}

+ 101 - 0
src/main/java/com/sqx/modules/post/dto/SelectOneDto.java

@@ -0,0 +1,101 @@
+package com.sqx.modules.post.dto;
+
+import lombok.Data;
+
+@Data
+public class SelectOneDto {
+    /**
+     * 岗位ID
+     */
+    private Long postId;
+
+    /**
+     * 岗位类型
+     */
+    private Integer postType;  // 若为字符串类型可改为String
+
+    /**
+     * 规则分类名称
+     */
+    private String ruleClassifyName;
+
+    /**
+     * 岗位IM标签
+     */
+    private String postImTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 岗位描述
+     */
+    private String postDescribe;
+
+    /**
+     * 工作经验要求
+     */
+    private String exp;  // 例如:"1-3年"
+
+    /**
+     * 学历要求
+     */
+    private String edu;  // 例如:"本科"
+
+    /**
+     * 薪资范围
+     */
+    private String wage;  // 例如:"10k-20k"
+
+    /**
+     * 福利标签
+     */
+    private String welfareTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 福利详情
+     */
+    private String welfareDetails;
+
+    /**
+     * 评价标签
+     */
+    private String commentTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 工作地址
+     */
+    private String address;
+
+    /**
+     * 岗位状态(例如:0-未发布,1-已发布)
+     */
+    private Integer status;
+
+    /**
+     * 是否到期(例如:0-未到期,1-已到期)
+     */
+    private Integer ifDue;
+
+    /**
+     * 公司ID
+     */
+    private Long companyId;
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 公司人数
+     */
+    private String companyPeople;  // 例如:"500-1000人"
+
+    /**
+     * HR头像
+     */
+    private String hrImg;  // 通常为图片URL
+
+    /**
+     * HR姓名
+     */
+    private String hrName;
+}

+ 8 - 3
src/main/java/com/sqx/modules/post/entity/PostEntity.java

@@ -1,14 +1,19 @@
 package com.sqx.modules.post.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
-import org.joda.time.DateTime;
 
 import java.io.Serializable;
 @Data
+@TableName("post")
 public class PostEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
     /**
      * 发布岗位id
      */
+    @TableId(value = "post_id", type = IdType.AUTO)
     private Integer postId;
     /**
      * 岗位类型  0 社招全职 1 应届生校园招聘 2 实习生招聘 3 兼职招聘
@@ -25,7 +30,7 @@ public class PostEntity implements Serializable {
     /**
      * 招聘详细信息
      */
-    private String describe;
+    private String PostDescribe;
     /**
      * 招聘经验要求 0 不限 1 一年以内 2 一到三年 3 三到五年 4 五到十年 5 十年以上
      */
@@ -81,5 +86,5 @@ public class PostEntity implements Serializable {
     /**
      * 更新时间
      */
-    private DateTime updateTime;
+    private String updateTime;
 }

+ 25 - 0
src/main/java/com/sqx/modules/post/entity/ViewPost.java

@@ -0,0 +1,25 @@
+package com.sqx.modules.post.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ViewPost implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "view_post_id", type = IdType.AUTO)
+    private Integer viewPostId;
+
+    /** 用户id */
+    private Integer userId;
+
+    /** 查看简历id */
+    private Integer postId;
+
+    /** 收藏状态:0=收藏,1=未收藏 */
+    private Integer isCollect;
+
+    /** 创建时间 */
+    private String creatTime;
+}

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

@@ -14,4 +14,8 @@ public interface PostMapper extends BaseMapper<PostEntity> {
     List<Object> selectPostOne(Integer postId);
 
     List<Object> findPost(String address, String wage, String exp, String companyPeople, String key);
+
+    List<Object> getViewPostList(Integer userId);
+
+    List<Object> getCollectPostList(Integer userId);
 }

+ 12 - 0
src/main/java/com/sqx/modules/post/service/ViewPostService.java

@@ -0,0 +1,12 @@
+package com.sqx.modules.post.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.post.entity.ViewPost;
+
+public interface ViewPostService extends IService<ViewPost> {
+    void addViewPost(Integer postId, Integer userId);
+
+    Object getViewPostList(Integer userId);
+
+    Object getCollectPost(Integer userId);
+}

+ 44 - 0
src/main/java/com/sqx/modules/post/service/impl/ViewPostServiceImpl.java

@@ -0,0 +1,44 @@
+package com.sqx.modules.post.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.post.dao.ViewPostDao;
+import com.sqx.modules.post.entity.ViewPost;
+import com.sqx.modules.post.mapper.PostMapper;
+import com.sqx.modules.post.service.ViewPostService;
+import org.joda.time.LocalDateTime;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ViewPostServiceImpl  extends ServiceImpl<ViewPostDao,ViewPost> implements ViewPostService {
+    private final PostMapper postMapper;
+
+    public ViewPostServiceImpl(PostMapper postMapper) {
+        this.postMapper = postMapper;
+    }
+
+    @Override
+    public void addViewPost(Integer postId, Integer userId) {
+        QueryWrapper<ViewPost> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("post_id",postId);
+        if (getBaseMapper().selectOne(queryWrapper) == null ){
+
+            ViewPost viewPost = new ViewPost();
+            viewPost.setPostId(postId);
+            viewPost.setIsCollect(0);
+            viewPost.setUserId(userId);
+            viewPost.setCreatTime(String.valueOf(LocalDateTime.now()));
+            getBaseMapper().insert(viewPost);
+        }
+    }
+
+    @Override
+    public Object getViewPostList(Integer userId) {
+        return postMapper.getViewPostList(userId);
+    }
+
+    @Override
+    public Object getCollectPost(Integer userId) {
+        return postMapper.getCollectPostList(userId);
+    }
+}

+ 2 - 13
src/main/java/com/sqx/modules/resumes/entity/Resumes.java

@@ -4,20 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.jfinal.json.Jackson;
 import lombok.Data;
 import org.joda.time.DateTime;
 
 import java.io.Serializable;
 import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.Date;
 import java.util.List;
 
 /**
  * @author fang
- * @description resumes
- * @date 2022-08-03
+ *
+ * &#064;date  2022-08-03
  */
 @Data
 public class Resumes implements Serializable {
@@ -228,14 +225,6 @@ public class Resumes implements Serializable {
      * 生日
      */
     private DateTime birthday;
-    /**
-     *工作经验id
-     */
-    private Integer workExpId;
-    /**
-     * 教育情况
-     */
-    private Jackson edu;
     /**
      * 个人优势
      */

+ 64 - 11
src/main/resources/mapper/post/PostDetailVO.xml

@@ -6,7 +6,7 @@
 <mapper namespace="com.sqx.modules.post.mapper.PostMapper">
 
 
-    <select id="selectPostWithUserAndCompany" >
+    <select id="selectPostWithUserAndCompanyByPostId" resultType="com.sqx.modules.post.dto.SelectAllDto">
         SELECT
         p.post_id AS postId,
         p.rule_classify_name AS ruleClassifyName,
@@ -23,19 +23,19 @@
         post p
         LEFT JOIN
         company c ON p.company_id = c.company_id
-        LFTE JOIN
+        LEFT JOIN
         hr h  ON  p.user_id = h.user_id
         WHERE
          p.status = 1
 
     </select>
-    <select id="selectPostOne" >
+    <select id="selectPostOne" resultType="com.sqx.modules.post.dto.SelectOneDto">
         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.post_describe AS postDescribe,
         p.exp AS exp,
         p.edu AS edu,
         p.wage AS wage,
@@ -54,11 +54,11 @@
             post p
             LEFT JOIN
             company c ON p.company_id = c.company_id
-            LFTE JOIN
+            LEFT JOIN
             hr h  ON  p.user_id = h.user_id
         WHERE post_id = #{postId}
     </select>
-    <select id="findPost" >
+    <select id="findPost" resultType="com.sqx.modules.post.dto.SelectAllDto" >
         SELECT
             p.post_id AS postId,
             p.rule_classify_name AS ruleClassifyName,
@@ -75,7 +75,7 @@
             post p
                 LEFT JOIN
             company c ON p.company_id = c.company_id
-            LFTE JOIN
+            LEFT JOIN
              hr h  ON  p.user_id = h.user_id
         WHERE
             p.status = 1
@@ -87,16 +87,69 @@
             )
         </if>
         <if test="address!=null and address!=0">
-            and p.address=#{status}
+            and p.address=#{address}
         </if>
         <if test="wage!=null and wage!=0">
-            and p.wage=#{status}
+            and p.wage=#{wage}
         </if>
         <if test="exp!=null and exp!=0">
-            and p.exp=#{status}
+            and p.exp=#{exp}
         </if>
         <if test="companyPeople!=null and companyPeople!=0">
-            and c.company_people=#{status}
+            and c.company_people=#{companyPeople}
         </if>
     </select>
+    <select id="getViewPostList" resultType="com.sqx.modules.post.dto.SelectAllDto">
+        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
+            view_post v
+                LEFT JOIN
+            post p on v.post_id = p.post_id
+                LEFT JOIN
+            company c ON p.company_id = c.company_id
+                LEFT JOIN
+            hr h  ON  p.user_id = h.user_id
+        WHERE
+            p.status = 1
+        and v.user_id = #{userId}
+
+    </select>
+    <select id="getCollectPostList" resultType="com.sqx.modules.post.dto.SelectAllDto">
+        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
+            view_post v
+                LEFT JOIN
+            post p on v.post_id = p.post_id
+                LEFT JOIN
+            company c ON p.company_id = c.company_id
+                LEFT JOIN
+            hr h  ON  p.user_id = h.user_id
+        WHERE
+            p.status = 1
+          and v.is_collect = 1
+          and v.user_id = #{userId}
+
+    </select>
 </mapper>