1.添加确认时保存app用户录用消息
2.添加岗位发布时给收藏此企业用户移动用户新岗位消息
This commit is contained in:
@@ -5,7 +5,7 @@ import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.cms.domain.vo.NoticeTotal;
|
||||
import com.ruoyi.cms.service.IAppNoticeService;
|
||||
import com.ruoyi.cms.service.IAppUserService;
|
||||
import com.ruoyi.cms.util.NoticeUtils;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import com.ruoyi.cms.util.RoleUtils;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
@@ -154,7 +154,7 @@ public class CmsNoticeController extends BaseController
|
||||
}
|
||||
startPage();
|
||||
notice.setIsRead(NoticeUtils.NOTICE_YD);
|
||||
notice.setRemark(NoticeUtils.NOTICE_TYPE);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
List<Notice> notices = noticeService.selectListAppNotices(notice);
|
||||
return getDataTable(notices);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.cms.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
import com.ruoyi.common.core.domain.entity.Company;
|
||||
import com.ruoyi.cms.domain.CompanyCollection;
|
||||
|
||||
@@ -22,4 +23,6 @@ public interface CompanyCollectionMapper extends BaseMapper<CompanyCollection>
|
||||
public List<CompanyCollection> selectCompanyCollectionList(CompanyCollection companyCollection);
|
||||
|
||||
List<Company> collectionJob(Long userId);
|
||||
|
||||
List<AppUser> selectAppuserList(Long companyId);
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ public interface CompanyMapper extends BaseMapper<Company>
|
||||
List<Company> label(@Param("companyNature") String companyNature, @Param("targ")String targ,@Param("companyName")String companyName);
|
||||
|
||||
List<Company> selectLikeCompanyList(Company company);
|
||||
|
||||
Company selectCompanyByJobId(Long jobId);
|
||||
}
|
||||
|
||||
@@ -51,4 +51,11 @@ public interface JobMapper extends BaseMapper<Job>
|
||||
VectorJob selectVectorJob(Long jobId);
|
||||
|
||||
List<AppUser> selectApplyJobUserList(Long jobId);
|
||||
|
||||
/**
|
||||
*查询单条岗位信息
|
||||
* @param jobId
|
||||
* @return
|
||||
*/
|
||||
Job getJobInfo(Long jobId);
|
||||
}
|
||||
|
||||
@@ -13,4 +13,6 @@ public interface NoticeMapper extends BaseMapper<Notice>
|
||||
List<Notice> getNoticlist(Notice notice);
|
||||
|
||||
NoticeTotal noticTotal(Notice notice);
|
||||
|
||||
int batchInsert(List<Notice> list);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.ruoyi.cms.domain.*;
|
||||
import com.ruoyi.cms.domain.vo.NoticeTotal;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
import com.ruoyi.cms.service.IAppNoticeService;
|
||||
import com.ruoyi.cms.util.NoticeUtils;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import com.ruoyi.cms.util.StringUtil;
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||
@@ -204,7 +204,7 @@ public class AppNoticeServiceImpl implements IAppNoticeService
|
||||
|
||||
@Override
|
||||
public List<Notice> selectListAppNotRead(Notice notice) {
|
||||
notice.setRemark(NoticeUtils.NOTICE_TYPE);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
//List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, notice.getUserId()).eq(Notice::getRemark,"notice_bar").eq(Notice::getIsRead,0).orderByDesc(Notice::getCreateTime));
|
||||
return noticeInfoMapper.getNoticlist(notice);
|
||||
@@ -235,7 +235,7 @@ public class AppNoticeServiceImpl implements IAppNoticeService
|
||||
|
||||
@Override
|
||||
public List<Notice> selectListAppNotics(Notice notice) {
|
||||
notice.setRemark(NoticeUtils.NOTICE_TYPE);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
return noticeInfoMapper.getNoticlist(notice);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.ruoyi.cms.domain.EmployeeConfirm;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.JobApply;
|
||||
import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.cms.mapper.EmployeeConfirmMapper;
|
||||
import com.ruoyi.cms.mapper.JobApplyMapper;
|
||||
import com.ruoyi.cms.mapper.JobMapper;
|
||||
import com.ruoyi.cms.mapper.NoticeMapper;
|
||||
import com.ruoyi.cms.service.EmployeeConfirmService;
|
||||
import com.ruoyi.cms.util.NoticeUtils;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -24,6 +26,8 @@ public class EmployeeConfirmServiceImpl implements EmployeeConfirmService {
|
||||
private JobApplyMapper jobApplyMapper;
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
@Autowired
|
||||
private JobMapper jobMapper;
|
||||
|
||||
@Override
|
||||
public List<EmployeeConfirm> getEmployeeConfirmList(EmployeeConfirm employeeConfirm) {
|
||||
@@ -39,12 +43,9 @@ public class EmployeeConfirmServiceImpl implements EmployeeConfirmService {
|
||||
apply.setHire("0");
|
||||
jobApplyMapper.updateById(apply);
|
||||
}
|
||||
Job job=jobMapper.getJobInfo(employeeConfirm.getJobId());
|
||||
//添加消息
|
||||
Notice notice=new Notice();
|
||||
notice.setUserId(employeeConfirm.getUserId());
|
||||
notice.setBussinessId(employeeConfirm.getId());
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
notice.setTitle("");
|
||||
Notice notice=NoticeUtils.createLytzNotice(employeeConfirm,job);
|
||||
noticeMapper.insert(notice);
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ public class JobApplyServiceImpl extends ServiceImpl<JobApplyMapper,JobApply> im
|
||||
jobApplyMapper.deleteBatchIds(ids);
|
||||
}
|
||||
jobApplyMapper.insert(jobApply);
|
||||
//添加消息说明
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.cms.domain.*;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import com.ruoyi.common.core.domain.entity.File;
|
||||
import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||
@@ -33,6 +34,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
@@ -84,6 +86,10 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
private FileMapper fileMapper;
|
||||
@Autowired
|
||||
private IAppUserService appUserService;
|
||||
@Autowired
|
||||
private CompanyCollectionMapper companyCollectionMapper;
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
|
||||
/**
|
||||
* 更新工作地址的经纬度信息
|
||||
@@ -287,16 +293,28 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateJob(Job job)
|
||||
{
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
//修改岗位状态
|
||||
//修改岗位状态
|
||||
if(job.getIsPublish()!=null) {
|
||||
if(job.getIsPublish()==1){
|
||||
job.setPostingDate(formattedDate);
|
||||
//修改es缓存
|
||||
iesJobSearchService.updateJob(job.getJobId());
|
||||
//添加岗位上新
|
||||
Job parmJob=null;
|
||||
if(job.getCompanyId()==null){
|
||||
//传递job消息不完整
|
||||
parmJob=jobMapper.getJobInfo(job.getJobId());
|
||||
}
|
||||
List<AppUser> users=companyCollectionMapper.selectAppuserList(parmJob.getCompanyId());
|
||||
if(users!=null&&users.size()>0){
|
||||
List<Notice> notices= NoticeUtils.createGwsxNotice(users,parmJob);
|
||||
noticeMapper.batchInsert(notices);
|
||||
}
|
||||
}else {
|
||||
job.setPostingDate(null);
|
||||
iesJobSearchService.deleteJob(job.getJobId());
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.ruoyi.cms.util;
|
||||
|
||||
public class NoticeUtils {
|
||||
/**
|
||||
* 消息已读
|
||||
*/
|
||||
public static final String NOTICE_YD="1";
|
||||
/**
|
||||
* 消息未读
|
||||
*/
|
||||
public static final String NOTICE_WD="0";
|
||||
|
||||
public static final String NOTICE_TYPE="notice_bar";
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.cms.util.notice;
|
||||
|
||||
import com.ruoyi.cms.domain.EmployeeConfirm;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NoticeUtils {
|
||||
/**
|
||||
* 消息已读
|
||||
*/
|
||||
public static final String NOTICE_YD="1";
|
||||
/**
|
||||
* 消息未读
|
||||
*/
|
||||
public static final String NOTICE_WD="0";
|
||||
|
||||
public static final String NOTICE_REMARK="notice_bar";
|
||||
|
||||
public static final String NOTICE_COMENT_ZH="衷心祝贺您通过";
|
||||
|
||||
public static final String NOTICE_COMENT_LY="全流程招聘考核,正式被录用,岗位为【";
|
||||
|
||||
public static final String NOTICE_COMENT_FF="】";
|
||||
|
||||
public static final String NOTICE_TYPE_LY="录用通知";
|
||||
|
||||
public static final String NOTICE_TYPE_GWSX="您收藏的公司有新的职位发布";
|
||||
|
||||
public static final String NOTICE_TYPE_XTLX="1";
|
||||
|
||||
public static final String NOTICE_TYPE_SXLX="2";
|
||||
|
||||
/**
|
||||
* 拼装岗位
|
||||
*/
|
||||
public static final String JOB_NEW="刚刚发布职位";
|
||||
public static final String JOB_XZ="薪资";
|
||||
public static final String JOB_KKB="快去看看吧";
|
||||
public static final String JOB_QFH="“";
|
||||
public static final String JOB_HFH="”";
|
||||
public static final String JOB_ZJG="-";
|
||||
public static final String JOB_DH=",";
|
||||
|
||||
|
||||
/**
|
||||
* 录用通知
|
||||
* @param companyName
|
||||
* @param jobName
|
||||
* @return
|
||||
*/
|
||||
public static String appUserLytz(String companyName,String jobName){
|
||||
return NoticeUtils.NOTICE_COMENT_ZH+companyName+NoticeUtils.NOTICE_COMENT_LY+jobName+NoticeUtils.NOTICE_COMENT_FF;
|
||||
}
|
||||
|
||||
/**
|
||||
* “海尔集团”刚刚发布职位“产品性能分析工程师”薪资“1.5-2.5k,快去看看吧
|
||||
* @param job
|
||||
* @return
|
||||
*/
|
||||
public static String appUserGwsx(Job job){
|
||||
return JOB_QFH+job.getCompanyName()+JOB_HFH+JOB_NEW+JOB_QFH+job.getJobTitle()+JOB_HFH+JOB_XZ+job.getMinSalary()+JOB_ZJG+job.getMaxSalary()+JOB_DH+JOB_KKB;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核确认界面拼装消息
|
||||
*/
|
||||
public static Notice createLytzNotice(EmployeeConfirm employeeConfirm, Job job) {
|
||||
Notice notice = new Notice();
|
||||
notice.setUserId(employeeConfirm.getUserId());
|
||||
notice.setBussinessId(job.getJobId());
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
notice.setTitle(NoticeUtils.NOTICE_TYPE_LY);
|
||||
notice.setSubTitle(NoticeUtils.NOTICE_TYPE_LY);
|
||||
notice.setNoticeType(NoticeUtils.NOTICE_TYPE_XTLX);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
String content = appUserLytz(job.getCompanyName(), job.getJobTitle());
|
||||
notice.setNoticeContent(content);
|
||||
return notice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位上新
|
||||
*/
|
||||
public static List<Notice> createGwsxNotice(List<AppUser> appUserList, Job job) {
|
||||
List<Notice> add=new ArrayList<>();
|
||||
appUserList.forEach(appUser -> {
|
||||
String content = appUserGwsx(job);
|
||||
Notice notice = new Notice();
|
||||
notice.setUserId(appUser.getUserId());
|
||||
notice.setBussinessId(job.getJobId());
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
notice.setTitle(NoticeUtils.NOTICE_TYPE_GWSX);
|
||||
notice.setSubTitle(content);
|
||||
notice.setNoticeType(NoticeUtils.NOTICE_TYPE_SXLX);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
notice.setNoticeContent(content);
|
||||
add.add(notice);
|
||||
});
|
||||
return add;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user