提交 b25eb1a6 authored 作者: wangmenglong's avatar wangmenglong

增加消息发送

上级 ef1225f6
......@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
import com.jxjy.system.service.MessageRecordService;
import com.jxjy.system.service.MessageService;
import com.jxjy.system.service.PersonService;
import com.jxjy.system.service.RecruitService;
import com.jxjy.system.util.weixin.TencentMessageUtil;
import data.system.Message;
import data.system.MessageRecord;
import data.system.Recruit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
......@@ -35,6 +37,9 @@ public class MessageSchedule {
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private RecruitService recruitService;
@Value("${weixin.appid}")
String AppId;
@Value("${weixin.secret}")
......@@ -58,6 +63,7 @@ public class MessageSchedule {
if(message!=null){
Recruit recruit = recruitService.getDetails(message.getRecruitId());
List<data.system.Person> personList = personService.getRecruitMessageList(message.getRecruitId());
......@@ -76,12 +82,12 @@ public class MessageSchedule {
//发送微信消息
JSONObject json = new JSONObject();
json.put("thing6", JSONObject.parseObject("{'value':'预支工资提醒'}"));
json.put("thing2", JSONObject.parseObject("{'value':'预支已发放'}"));
json.put("time9", JSONObject.parseObject("{'value':'" + DateUtil.now() + "'}"));
json.put("thing5", JSONObject.parseObject("{'value':'点击查看详情'}"));
json.put("thing1", JSONObject.parseObject("{'value':'"+recruit.getOrg().getName()+"'}"));
json.put("thing2", JSONObject.parseObject("{'value':'"+recruit.getName()+"'}"));
//json.put("time9", JSONObject.parseObject("{'value':'" + DateUtil.now() + "'}"));
json.put("thing3", JSONObject.parseObject("{'value':'点击查看详情'}"));
//发送消息并减少数量
//TencentMessageUtil.send(stringRedisTemplate, AppId, Secret, MPTId, "/pages/home/advanceLog/index", MMP, person.getOpenId(), json);
TencentMessageUtil.send(stringRedisTemplate, AppId, Secret, MPTId, "/pages/notice/index", MMP, person.getOpenId(), json);
}
if(personList.size()==0){
......
......@@ -205,7 +205,9 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
Industry industry = industryService.getDetails(recruit.getIndustryId());
recruit.setIndustryCode(industry.getCode());
if(industry!=null){
recruit.setIndustryCode(industry.getCode());
}
}catch (Exception e){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论