Răsfoiți Sursa

公司认证,发布职位

Your Name 8 luni în urmă
părinte
comite
a489f4b513

+ 7 - 1
src/main/java/com/sqx/modules/firstLogin/control/HrController.java

@@ -20,6 +20,12 @@ private  HrService hrService;
     public Result addHr (@RequestAttribute Integer userId, @RequestBody HrEntity hr){
         hr.setUserId(userId);
         hrService.saveOrUpdate(hr);
-        return  Result.success();
+        return  Result.success().put("data",hr);
+    }
+    @Login
+    @GetMapping
+    @ApiOperation("获取个人hr信息")
+    public Result getHr(@RequestAttribute("userId")Long userId){
+        return  Result.success().put("data",hrService.getByUserId(String.valueOf(userId)));
     }
 }

+ 8 - 3
src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java

@@ -13,12 +13,15 @@ import com.sqx.modules.intention.service.IntentionService;
 import com.sqx.modules.resumes.entity.Resumes;
 import com.sqx.modules.resumes.service.ResumesService;
 import io.swagger.annotations.ApiOperation;
+import jodd.util.CollectionUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.hibernate.jdbc.Work;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.List;
 
 
@@ -191,13 +194,15 @@ public class UserFirstRegistController {
     @ApiOperation("更新技能")
     public Result deleteSkill(@RequestBody List<Skill> skills,@RequestAttribute("userId")Integer userId) {
         List<Skill> oldSkills = skillService.selectSkill(userId);
+        if (CollectionUtils.isNotEmpty(oldSkills)){
         oldSkills.forEach(skill -> skill.setIsUse(0));
         skillService.updateBatchById(oldSkills);
+        }
+        if (CollectionUtils.isNotEmpty(skills)){
         skills.forEach(skill -> skill.setUserId(Long.valueOf(userId)));
-        // 设置isUse为1
         skills.forEach(skill -> skill.setIsUse(1));
-        // 批量保存或更新
-        skillService.saveOrUpdateBatch(skills);
+        skillService.saveBatch(skills);
+        }
         return Result.success();
 
     }

+ 16 - 15
src/main/java/com/sqx/modules/interviewRecord/controller/InterviewRecordController.java

@@ -44,13 +44,14 @@ public class InterviewRecordController {
     @ApiOperation("获取面试记录列表")
     @GetMapping("interviewList")
     public Result interviewList(@RequestAttribute("userId")Long userId, Integer page, Integer limit, InterviewRecord interviewRecord) {
-        UserEntity userEntity = userService.getById(userId);
-        if(userEntity.getUserType()==1){
-            interviewRecord.setUserId(userId);
-        }else {
-            Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", userId));
-            interviewRecord.setCompanyId(company.getCompanyId());
-        }
+            interviewRecord.setInterviewerId(Math.toIntExact(userId));
+        return Result.success().put("data", recordService.interviewList(page, limit, interviewRecord));
+    }
+    @Login
+    @GetMapping("getHrInterviewList")
+    @ApiOperation("招聘端获取自己发布的岗位")
+    public Result getHrInterviewList(@RequestAttribute("userId")Long userId, Integer page, Integer limit, InterviewRecord interviewRecord) {
+        interviewRecord.setUserId(userId);
         return Result.success().put("data", recordService.interviewList(page, limit, interviewRecord));
     }
 
@@ -80,14 +81,14 @@ public class InterviewRecordController {
         return recordService.isSendView(postPushId,userId);
     }
 
-    @Login
-    @PostMapping("addInterview")
-    @ApiOperation("新增面试邀请")
-    public  Result addInterview(@RequestAttribute("userId")Long userId,@RequestBody InterviewRecord interviewRecord){
-        interviewRecord.setUserId(userId);
-        interviewRecordService.saveOrUpdate(interviewRecord);
-        return  Result.success();
-    }
+//    @Login
+//    @PostMapping("addInterview")
+//    @ApiOperation("新增面试邀请")
+//    public  Result addInterview(@RequestAttribute("userId")Long userId,@RequestBody InterviewRecord interviewRecord){
+//        interviewRecord.setUserId(userId);
+//        interviewRecordService.saveOrUpdate(interviewRecord);
+//        return  Result.success();
+//    }
 
     @Login
     @GetMapping("selectInterviewListOfUser")

+ 1 - 1
src/main/java/com/sqx/modules/interviewRecord/service/impl/InterviewRecordServiceImpl.java

@@ -101,7 +101,7 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             interviewRecord.setIsSendHour(0);
             interviewRecord.setCreateTime(LocalDateTime.now());
 
-            UserEntity userEntity = userService.getById(interviewRecord.getUserId());
+            UserEntity userEntity = userService.getById(interviewRecord.getInterviewerId());
             if (StringUtils.isNotEmpty(userEntity.getClientid())) {
                 userService.pushToSingle("面试邀请", "您收到一个面试邀请", userEntity.getClientid());
             }

+ 33 - 3
src/main/java/com/sqx/modules/resumes/controller/app/AppPostPushController.java

@@ -1,11 +1,16 @@
 package com.sqx.modules.resumes.controller.app;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.api.R;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.app.service.UserService;
+import com.sqx.modules.firstLogin.service.HrService;
 import com.sqx.modules.record.service.RecordService;
 import com.sqx.modules.resumes.entity.PostPush;
+import com.sqx.modules.resumes.service.CompanyService;
 import com.sqx.modules.resumes.service.PostPushService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -22,11 +27,18 @@ public class AppPostPushController {
     private PostPushService postPushService;
     @Autowired
     private RecordService recordService;
+    @Autowired
+    private HrService hrService;
+    @Autowired
+    private CompanyService companyService;
+    @Autowired
+    private UserService userService;
 
     @Login
     @PostMapping("/savePostPush")
     @ApiOperation("添加或修改招聘信息")
     public Result savePostPush(@RequestBody PostPush postPush, @RequestAttribute("userId") Long userId) {
+        postPush.setUserId(String.valueOf(userId));
         return postPushService.savePostPush(postPush, userId);
     }
 
@@ -38,10 +50,10 @@ public class AppPostPushController {
         }
         return postPushService.getPostPushList(page, limit, null, null, userId, postPush, screen,isDue);
     }
-
+    @Login
     @GetMapping("/selectPostPushDetails")
     @ApiOperation("查询招聘信息详情(通用)")
-    public Result selectPostPushDetails(Long userId, Long postPushId,Double lng,Double lat) {
+    public Result selectPostPushDetails(@RequestAttribute("userId")Long userId, Long postPushId,Double lng,Double lat) {
         return Result.success().put("data", postPushService.selectPostPushDetails(userId, postPushId,lng,lat));
     }
 
@@ -135,5 +147,23 @@ public class AppPostPushController {
     public  Result getHotList(){
         return Result.success().put("data",postPushService.getHotPost());
     }
-
+    @Login
+    @GetMapping("getMyPostPush")
+    @ApiOperation("获取我发布的岗位")
+    public Result getMyPostPush(@RequestAttribute("userId")Long userId,Integer limit,Integer page){
+        Page<PostPush> pages;
+        if (page != null && limit != null) {
+            pages = new Page<>(page, limit);
+        } else {
+            pages = new Page<>();
+            pages.setSize(-1);
+        }
+        IPage<PostPush> selectPage =postPushService.getBaseMapper().selectPage(pages,new QueryWrapper<PostPush>().eq("user_id",userId));
+        for(PostPush postPush : pages.getRecords()){
+            postPush.setHr(hrService.getByUserId(String.valueOf(userId)));
+            postPush.setCompany(companyService.getById(postPush.getCompanyId()));
+            postPush.setUser(userService.getById(userId));
+        }
+        return  Result.success().put("data",selectPage);
+    }
 }

+ 12 - 17
src/main/java/com/sqx/modules/resumes/service/impl/PostPushServiceImpl.java

@@ -513,28 +513,23 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
     @Override
     public PostPush selectPostPushDetails(Long userId, Long postPushId, Double lng, Double lat) {
         PostPush postPush = baseMapper.selectById(postPushId);
-        if (postPush != null) {
-            Company company = companyService.selectCompanyByCompanyId(postPush.getCompanyId());
-            if (company != null) {
-                if (userId != null && !company.getUserId().equals(userId)) {
-                    int count = userBrowseService.count(new QueryWrapper<UserBrowse>().eq("user_id", userId).eq("post_push_id", postPushId));
-                    if (count == 0) {
-                        UserBrowse userBrowse = new UserBrowse();
-                        userBrowse.setUserId(userId);
-                        userBrowse.setBrowseType(1);
-                        userBrowse.setPostPushId(postPushId);
-                        userBrowse.setPostPushCompanyId(company.getCompanyId());
-                        userBrowse.setUpdateTime(LocalDateTime.now());
-                        userBrowseService.save(userBrowse);
-                    }
+        Company company = companyService.getById(postPush.getCompanyId());
+        Long a = Long.valueOf(postPush.getUserId());
+            if (a.equals(userId)){
+                int count = userBrowseService.count(new QueryWrapper<UserBrowse>().eq("user_id", userId).eq("post_push_id", postPushId));
+                if (count == 0) {
+                    UserBrowse userBrowse = new UserBrowse();
+                    userBrowse.setUserId(userId);
+                    userBrowse.setBrowseType(1);
+                    userBrowse.setPostPushId(postPushId);
+                    userBrowse.setPostPushCompanyId(company.getCompanyId());
+                    userBrowse.setUpdateTime(LocalDateTime.now());
+                    userBrowseService.save(userBrowse);
                 }
                 postPush.setCompany(company);
                 postPush.setUser(userService.getById(postPush.getUserId()));
                 postPush.setHr(hrService.getByUserId(postPush.getUserId()));
             }
-        }
-
-
         return postPush;
     }