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