Your Name 7 月之前
父節點
當前提交
aa13cc930d

+ 3 - 2
src/main/java/com/sqx/modules/interviewRecord/controller/InterviewRecordController.java

@@ -60,10 +60,11 @@ public class InterviewRecordController {
     public Result getInterviewInfo(Long recordId){
         return Result.success().put("data", recordService.getInterviewInfo(recordId));
     }
-
+    @Login
     @ApiOperation("添加或修改面试记录")
     @PostMapping("saveInterview")
-    public Result saveInterview(@RequestBody InterviewRecord interviewRecord) {
+    public Result saveInterview(@RequestAttribute("userId")Long userId,@RequestBody InterviewRecord interviewRecord) {
+        interviewRecord.setUserId(userId);
         return recordService.saveInterview(interviewRecord);
     }
 

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

@@ -3,14 +3,12 @@ package com.sqx.modules.interviewRecord.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.sqx.common.utils.DateUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.firstLogin.service.HrService;
-import com.sqx.modules.industry.entity.Industry;
 import com.sqx.modules.interviewRecord.entity.InterviewRecord;
 import com.sqx.modules.interviewRecord.dao.InterviewRecordDao;
 import com.sqx.modules.interviewRecord.service.InterviewRecordService;
@@ -18,7 +16,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.resumes.entity.Company;
-import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.resumes.entity.Resumes;
 import com.sqx.modules.resumes.service.CompanyService;
 import com.sqx.modules.resumes.service.PostPushService;
@@ -32,7 +29,6 @@ import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -75,15 +71,10 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
         for (InterviewRecord record : records) {
             record.setCompany(companyService.getById(record.getCompanyId()));
             record.setPostPush(postPushService.getById(record.getPostPushId()));
-            UserEntity userEntity = userService.getById(record.getUserId());
-            if (userEntity != null) {
-                Resumes resumes = resumesService.getOne(new QueryWrapper<Resumes>().eq("user_id", userEntity.getUserId()));
-                if (resumes != null) {
-                    userEntity.setResumesId(resumes.getResumesId());
-                }
-                record.setUserEntity(userEntity);
+            UserEntity userEntity = userService.getById(record.getInterviewerId());
+            record.setHr(hrService.getByUserId(String.valueOf(record.getUserId())));
+            record.setUserEntity(userEntity);
             }
-        }
         return selectPage;
     }
 
@@ -93,7 +84,7 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             return Result.upStatus(baseMapper.updateById(interviewRecord));
         } else {
 
-            InterviewRecord record = baseMapper.selectOne(new QueryWrapper<InterviewRecord>().in("company_id", interviewRecord.getCompanyId()).eq("interview_user_id",interviewRecord.getInterviewerId()).eq("interview_date_time",interviewRecord.getInterviewDateTime()).eq("user_id", interviewRecord.getUserId()).eq("status", 1));
+            InterviewRecord record = baseMapper.selectOne(new QueryWrapper<InterviewRecord>().in("company_id", interviewRecord.getCompanyId()).eq("interviewer_id",interviewRecord.getInterviewerId()).eq("interview_date_time",interviewRecord.getInterviewDateTime()).eq("user_id", interviewRecord.getUserId()).eq("status", 1));
             if (record != null) {
                 return Result.error("已发送面试邀请,请等待对方处理");
             }
@@ -155,6 +146,7 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             int result = baseMapper.updateById(interview);
             if (result > 0) {
                 //给用户的通知
+
                 if (StringUtils.isNotBlank(userEntity.getOpenId())) {
                     sendInterViewMsg(userEntity, interview, 1);
                 }
@@ -166,11 +158,11 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
                 }
                 MessageInfo messageInfo = new MessageInfo();
                 messageInfo.setTitle("面试预约通知");
-                Resumes resumes = resumesService.selectResumesByUserId(interview.getUserId());
+//                Resumes resumes = resumesService.selectResumesByUserId(interview.getUserId());
                 if (type == 1) {
-                    messageInfo.setContent(resumes.getResumesName() + "同意了您的面试邀请");
+                    messageInfo.setContent(userEntity.getUserName() + "同意了您的面试邀请");
                 } else {
-                    messageInfo.setContent(resumes.getResumesName() + "拒绝了您的面试邀请");
+                    messageInfo.setContent(userEntity.getUserName() + "拒绝了您的面试邀请");
                 }
                 messageInfo.setState(String.valueOf(8));
                 messageInfo.setUserId(companyUser.getUserId().toString());
@@ -191,12 +183,6 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             return Result.error("面试邀请不存在");
         }
     }
-
-    /**
-     * @param userEntity
-     * @param interview
-     * @param userType   1用户 2企业
-     */
     private void sendInterViewMsg(UserEntity userEntity, InterviewRecord interview, Integer userType) {
         CommonInfo tempId = commonInfoService.findOne(337);
         List<String> msgList = new ArrayList<>();
@@ -254,17 +240,11 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
         return record;
     }
 
-    /**
-     * 是否能发送简历
-     *
-     * @param postPushId
-     * @param userId
-     * @return
-     */
+
     @Override
     public Result isSendView(Long postPushId, Long userId) {
         List<InterviewRecord> records = baseMapper.selectList(new QueryWrapper<InterviewRecord>().eq("user_id", userId).eq("post_push_id", postPushId).in("status", 1, 2));
-        if (records.size() > 0) {
+        if (!records.isEmpty()) {
             return Result.success().put("data", false);
         } else {
             return Result.success().put("data", true);

+ 0 - 4
src/main/java/com/sqx/modules/message/controller/app/AppMessageController.java

@@ -101,8 +101,4 @@ public class AppMessageController {
         messageService.delete(id);
         return Result.success();
     }
-
-
-
-
 }

+ 3 - 0
src/main/java/com/sqx/modules/resumes/entity/PostPush.java

@@ -230,6 +230,9 @@ public class PostPush implements Serializable {
     @TableField(exist = false)
     private Integer num;
 
+    @TableField(exist = false)
+    private String  respondTime;
+
     private Integer isDue;
     private String  welfareTag;
     private Integer type;

+ 2 - 1
src/main/java/com/sqx/modules/resumes/service/impl/CompanyServiceImpl.java

@@ -378,9 +378,10 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
         String[] companyPeople = StringUtils.isNotBlank(postPush.getCompanyPeople()) ? postPush.getCompanyPeople().split(",") : null;
         String[] salaryRange = StringUtils.isNotBlank(postPush.getSalaryRange()) ? postPush.getSalaryRange().split(",") : null;
 
-        IPage<Company> companies = companyService.getBaseMapper().selectPage(pages, new QueryWrapper<Company>().eq("is_use", 1).eq("status", 1).like(StringUtils.isNotBlank(key), "company_all_name", key));
+        IPage<Company> companies = companyService.getBaseMapper().selectPage(pages, new QueryWrapper<Company>().eq("is_use", 1).eq("status", 2).like(StringUtils.isNotBlank(key), "company_all_name", key));
 
             for (Company company : companies.getRecords()){
+                postPush.setCompanyId(company.getCompanyId());
                 company.setPostPushList(postPushDao.getPostPushListUser(lng, lat, postPush, industry, education, experience, companyPeople, salaryRange));
             }
             return companies;

+ 28 - 0
src/main/java/com/sqx/modules/resumes/service/impl/PostPushServiceImpl.java

@@ -14,6 +14,8 @@ import com.sqx.modules.app.service.UserBrowseService;
 import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserMoneyService;
 import com.sqx.modules.app.service.UserService;
+import com.sqx.modules.chat.entity.ChatContent;
+import com.sqx.modules.chat.service.ChatContentService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.firstLogin.service.HrService;
@@ -35,10 +37,13 @@ import com.sqx.modules.resumes.vo.LetterCity;
 import com.sqx.modules.utils.SenInfoCheckUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -162,6 +167,8 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
     private PayDetailsService payDetailsService;
     @Autowired
     private PostPushService postPushService;
+    @Autowired
+    private ChatContentService chatContentService;
 
     @Override
     public Result savePostPush(PostPush postPush, Long userId) {
@@ -387,6 +394,9 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
         String[] experience = StringUtils.isNotBlank(postPush.getExperience()) ? postPush.getExperience().split(",") : null;
         String[] companyPeople = StringUtils.isNotBlank(postPush.getCompanyPeople()) ? postPush.getCompanyPeople().split(",") : null;
         String[] salaryRange = StringUtils.isNotBlank(postPush.getSalaryRange()) ? postPush.getSalaryRange().split(",") : null;
+        int respondTime;
+        String mes;
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
         IPage<PostPush> selectPage = baseMapper.getPostPushList(pages, lng, lat, postPush, industry, education, experience, companyPeople, salaryRange,screen,isDue);
         List<PostPush> records = selectPage.getRecords();
@@ -395,6 +405,24 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
             record.setCompany(company);
             record.setUser(userService.getById(record.getUserId()));
             record.setHr(hrService.getByUserId(record.getUserId()));
+            ChatContent chatContent = chatContentService.getBaseMapper().selectOne(new QueryWrapper<ChatContent>().eq("user_id",userId).orderByDesc("create_time").last("limit 1"));
+            if (chatContent != null && chatContent.getCreateTime() != null) {
+                // 获取创建时间
+                LocalDateTime createTime = LocalDateTime.parse(chatContent.getCreateTime(),formatter);
+                // 获取当前时间
+                LocalDateTime now = LocalDateTime.now();
+                // 计算差值(这里以“秒”为单位,可根据需求改为分钟、毫秒等)
+                respondTime = Integer.parseInt(String.valueOf(ChronoUnit.MINUTES.between(createTime, now)));
+                if (respondTime > 60 ){
+                    mes = "不久前在线";
+                }else {
+                    mes =respondTime+"分钟前回复";
+                }
+            } else {
+                // 处理空值情况(如无记录时,响应时间设为0或其他默认值)
+                mes=null;
+            }
+            record.setRespondTime(mes);
         }
         return Result.success().put("data", selectPage);
     }

+ 6 - 5
src/main/java/com/sqx/modules/resumes/service/impl/ResumesServiceImpl.java

@@ -258,14 +258,15 @@ public class ResumesServiceImpl extends ServiceImpl<ResumesDao, Resumes> impleme
    }
     @Override
     public Result selectResumesListHr(Integer page, Integer limit, ResumesListDto resumesDto) {
-        Page<ResumesListDto> pages;
+        Page<ResumesListDto> resumesPage;
         if (page != null && limit != null) {
-            pages = new Page<>(page, limit);
+            resumesPage = new Page<>(page, limit);
         } else {
-            pages = new Page<>();
-            pages.setSize(-1);
+            resumesPage = new Page<>();
+            resumesPage.setSize(-1);
         }
-    List<ResumesListDto> resumesPage = baseMapper.selectResumesListHr(resumesDto) ;
+
+        resumesPage.setRecords(baseMapper.selectResumesListHr(resumesDto));
     return Result.success().put("data",resumesPage);
 }
 

+ 3 - 1
src/main/resources/mapper/resumes/PostPushDao.xml

@@ -31,7 +31,8 @@
     company c
     WHERE p.company_id = c.company_id
     and c.is_use = 1
-    limit 3
+      and c.status =2
+      and p.status= 2
     <if test="postPush.companyId!=null">
         and p.company_id = #{postPush.companyId}
     </if>
@@ -93,6 +94,7 @@
     <if test="postPush.county!=null and postPush.county!=''">
         and p.county like concat("%",#{postPush.county},"%")
     </if>
+    limit 3
 </select>
     <select id="getPostPushList" resultType="com.sqx.modules.resumes.entity.PostPush">
         SELECT

+ 13 - 5
src/main/resources/mapper/resumes/ResumesDao.xml

@@ -82,11 +82,11 @@
         last_work.work_content AS workContent,
         e.school AS school,
         e.degree AS degree,
-        intent.all_expected_positions AS expectedPositions,
+        intent.all_expected_positions AS expectedPosition,
         intent.all_expected_cities AS expectedCity,
         intent.min_salary AS minSalary,
         intent.max_salary AS maxSalary,
-        resumes.status AS resumesStatus,
+--         resumes.status AS resumesStatus,
         resumes.resumes_education AS resumesEducation,
         resumes.resumes_work_experience AS resumesWorkExperience,
         resumes.resumes_id AS resumesId,
@@ -96,7 +96,7 @@
         tb_user u
         INNER JOIN resumes
         ON u.user_id = resumes.user_id
-        AND resumes.`status` = 1  -- 简历状态为1(按实际业务含义)
+        AND resumes.`status` = 1
         INNER JOIN (
         SELECT
         edu.*,
@@ -135,8 +135,16 @@
         <if test="resumesListDto.resumesId !=null or resumesListDto.resumesId==''">
              AND resumes.resumes_id = #{resumesListDto.resumesId}
         </if>
-<!--        <if test="resumesListDto."-->
-
+        <if test="resumesListDto.expectedPosition != null and resumesListDto.expectedPosition != ''">
+            AND FIND_IN_SET(#{resumesListDto.expectedPosition}, intent.all_expected_positions)
+        </if>
+        <if test="resumesListDto.isRecommend != null and resumesListDto.isRecommend != ''">
+            AND resumes.is_recommend = 1
+        </if>
+        <if test="resumesListDto.resumesStatus != null and resumesListDto.resumesStatus !=''">
+            AND resumes.resumes_status = #{resumesListDto.resumesStatus}
+        </if>
+<!--        <if test=""-->
     </where>
     </select>
     <select id="selectResumesListByCompany" resultType="com.sqx.modules.resumes.entity.Resumes">