根据用户期望岗位,生成岗位推送消息
This commit is contained in:
@@ -46,4 +46,6 @@ public class JobCron {
|
||||
public void updateCronJobContactEncrypt(){SpringUtils.getBean(JobContactService.class).updateCronJobContactEncrypt();}
|
||||
//批量处理网格员
|
||||
public void updateAppUserWgyEncrypt(){SpringUtils.getBean(IAppUserService.class).updateAppUserWgyEncrypt();}
|
||||
//给用户批量推送期望岗位到消息中
|
||||
public void selectUserRecommendJobNotic(){SpringUtils.getBean(IJobService.class).selectUserRecommendJobNotic();}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Notice extends BaseEntity
|
||||
@ApiModelProperty("日期")
|
||||
private Date date;
|
||||
|
||||
@ApiModelProperty("通知类型 1系统通知(包括录用) 2职位上新")
|
||||
@ApiModelProperty("通知类型 1系统通知(包括录用) 2职位上新,4定时任务通过期望岗位生成的(职位上新)")
|
||||
private String noticeType;
|
||||
|
||||
@ApiModelProperty("公告内容")
|
||||
@@ -48,4 +48,8 @@ public class Notice extends BaseEntity
|
||||
|
||||
@ApiModelProperty("业务id")
|
||||
private Long bussinessId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("业务idEncrypt")
|
||||
private String bussinessIdEncrypt;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
import com.ruoyi.common.core.domain.entity.Company;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
@@ -68,4 +71,6 @@ public interface JobMapper extends BaseMapper<Job>
|
||||
List<Long> getJobDownList();
|
||||
|
||||
void updateJobDown(List<Long> list);
|
||||
|
||||
List<Notice> selectUserRecommendJobNotic(Date tenMinutesAgo);
|
||||
}
|
||||
|
||||
@@ -119,4 +119,6 @@ public interface IJobService
|
||||
public int jobUp(Long jobId);
|
||||
|
||||
void updateJobDown();
|
||||
|
||||
void selectUserRecommendJobNotic();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.ruoyi.cms.mapper.*;
|
||||
import com.ruoyi.cms.service.IAppNoticeService;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import com.ruoyi.cms.util.StringUtil;
|
||||
import com.ruoyi.common.constant.SM4Constants;
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
import com.ruoyi.common.utils.SM4Utils;
|
||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -159,6 +161,9 @@ public class AppNoticeServiceImpl implements IAppNoticeService
|
||||
|
||||
Long userId = SiteSecurityUtils.getUserId();
|
||||
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, userId).eq(Notice::getRemark,"notice_bar").orderByDesc(Notice::getCreateTime));
|
||||
sysNoticeList.forEach(it->{if(StringUtil.NOTICE_TYPE_ENCRYPT.equals(it.getNoticeType()))
|
||||
it.setBussinessIdEncrypt(SM4Utils.encryptEcb(SM4Constants.SM4_KET,String.valueOf(it.getBussinessId())));
|
||||
});
|
||||
return sysNoticeList;
|
||||
}
|
||||
|
||||
|
||||
@@ -1430,4 +1430,18 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
iesJobSearchService.updateJob(it);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectUserRecommendJobNotic() {
|
||||
try {
|
||||
// Date tenMinutesAgo = DateUtils.parseDate("2026-04-10", "yyyy-MM-dd");
|
||||
Date tenMinutesAgo = DateUtils.addMinutes(new Date(), -10);
|
||||
List<Notice> list=jobMapper.selectUserRecommendJobNotic(tenMinutesAgo);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
noticeMapper.batchInsert(list);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,11 @@ public class StringUtil {
|
||||
*/
|
||||
public static final Map<String, String> REGION_CODE_CODE_MAP;
|
||||
|
||||
/**
|
||||
* 消息id加密标记
|
||||
*/
|
||||
public static final String NOTICE_TYPE_ENCRYPT="4";
|
||||
|
||||
//批量条数
|
||||
public static final int BATCH_SIZE = 1000;
|
||||
|
||||
|
||||
@@ -412,4 +412,22 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<select id="selectUserRecommendJobNotic" resultType="com.ruoyi.cms.domain.Notice">
|
||||
SELECT
|
||||
u.user_id,
|
||||
j.job_id as bussiness_id,
|
||||
j.job_title as sub_title,
|
||||
j.company_name|| ',发布了'||j.job_title ||'岗位,薪资'||j.min_salary||'-'||j.max_salary||',快去看看吧' as notice_content,
|
||||
'职位上新' as title,
|
||||
'4' as notice_type,
|
||||
0 as is_read,
|
||||
'admin' as create_by,
|
||||
'notice_bar' as remark
|
||||
FROM job j
|
||||
JOIN job_title t ON ( t.job_name LIKE '%' || j.job_title || '%' OR j.job_category = t.job_name)
|
||||
JOIN app_user u ON t.job_id = ANY( string_to_array(u.job_title_id, ',') )
|
||||
LEFT JOIN notice um ON um.user_id = u.user_id AND um.bussiness_id = j.job_id
|
||||
WHERE j.posting_date >= #{tenMinutesAgo} AND um.notice_id IS NULL
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.title}, #{item.noticeType}, #{item.noticeContent},#{item.isRead},#{item.userId},#{item.subTitle},
|
||||
#{item.notReadCount},sysdate(),#{item.bussinessId},
|
||||
#{item.notReadCount},now (),#{item.bussinessId},
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
Reference in New Issue
Block a user