家医消息通知接口修改
This commit is contained in:
parent
7dd7d1c2d7
commit
c399e2e922
@ -15,12 +15,24 @@ import lombok.Data;
|
|||||||
@ApiModel(value = "消息推送请求对象")
|
@ApiModel(value = "消息推送请求对象")
|
||||||
public class MessagePushBody {
|
public class MessagePushBody {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知")
|
||||||
|
private String messageCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型(1: 默认 9:申请 10:用药提醒通知)
|
* 业务类型(1: 默认 9:申请 10:用药提醒通知)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "务类型(1: 家医默认通知 10:申请通知 9:用药提醒通知)")
|
@ApiModelProperty(value = "务类型(1: 家医默认通知 10:申请通知 9:用药提醒通知)")
|
||||||
private String busType;
|
private String busType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "cardNo")
|
||||||
|
private String cardNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* openid
|
* openid
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.xinelu.familydoctor.applet.pojo.dto;
|
package com.xinelu.familydoctor.applet.pojo.dto;
|
||||||
|
|
||||||
import com.xinelu.familydoctor.applet.pojo.dto.FDMessageExtentDto;
|
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -60,4 +60,7 @@ public class FDMessageDto extends FDMessageExtentDto {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "模版类型(MessageTemplateType枚举)", required = true)
|
@ApiModelProperty(value = "模版类型(MessageTemplateType枚举)", required = true)
|
||||||
private String templateType;
|
private String templateType;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息记录对象")
|
||||||
|
ChatRecordDTO chatRecord;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,13 +81,16 @@ public class ResidentRescindApplyServiceImpl implements IResidentRescindApplySer
|
|||||||
residentRescindApplyMapper.insert(entity);
|
residentRescindApplyMapper.insert(entity);
|
||||||
|
|
||||||
MessagePushBody messagePushBody = new MessagePushBody();
|
MessagePushBody messagePushBody = new MessagePushBody();
|
||||||
|
messagePushBody.setMessageCategory("4");
|
||||||
messagePushBody.setBusType("10");
|
messagePushBody.setBusType("10");
|
||||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||||
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
||||||
messagePushBody.setText1(body.getOrgName());
|
messagePushBody.setText1(body.getOrgName());
|
||||||
messagePushBody.setText2("解约申请");
|
messagePushBody.setText2("解约申请");
|
||||||
|
messagePushBody.setSendTitle("解约申请");
|
||||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||||
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交申请");
|
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交申请");
|
||||||
|
messagePushBody.setCardNo(body.getIdentity());
|
||||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,13 +96,17 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
|||||||
residentServiceApplyMapper.insert(entity);
|
residentServiceApplyMapper.insert(entity);
|
||||||
|
|
||||||
MessagePushBody messagePushBody = new MessagePushBody();
|
MessagePushBody messagePushBody = new MessagePushBody();
|
||||||
|
messagePushBody.setMessageCategory("4");
|
||||||
messagePushBody.setBusType("10");
|
messagePushBody.setBusType("10");
|
||||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||||
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
||||||
messagePushBody.setText1(body.getOrgName());
|
messagePushBody.setText1(body.getOrgName());
|
||||||
messagePushBody.setText2(body.getFormName().length() >= 20? body.getFormName().substring(0,17) + "...": body.getFormName());
|
messagePushBody.setText2(body.getFormName().length() >= 20? body.getFormName().substring(0,17) + "...": body.getFormName());
|
||||||
|
messagePushBody.setText3(body.getFormName());
|
||||||
|
messagePushBody.setSendTitle("服务预约");
|
||||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||||
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交服务申请");
|
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交服务申请");
|
||||||
|
messagePushBody.setCardNo(body.getIdentity());
|
||||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,13 +98,16 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
|||||||
residentSignApplyMapper.insert(entity);
|
residentSignApplyMapper.insert(entity);
|
||||||
|
|
||||||
MessagePushBody messagePushBody = new MessagePushBody();
|
MessagePushBody messagePushBody = new MessagePushBody();
|
||||||
|
messagePushBody.setMessageCategory("4");
|
||||||
messagePushBody.setBusType("10");
|
messagePushBody.setBusType("10");
|
||||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||||
messagePushBody.setReceiveName(body.getResidentName());
|
messagePushBody.setReceiveName(body.getResidentName());
|
||||||
messagePushBody.setText1(body.getOrgName());
|
messagePushBody.setText1(body.getOrgName());
|
||||||
messagePushBody.setText2("签约申请");
|
messagePushBody.setText2("签约申请");
|
||||||
|
messagePushBody.setSendTitle("签约申请");
|
||||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||||
messagePushBody.setSendContent(body.getResidentName() + "已提交申请");
|
messagePushBody.setSendContent(body.getResidentName() + "已提交申请");
|
||||||
|
messagePushBody.setCardNo(body.getIdentity());
|
||||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,12 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
|||||||
@NotNull(message = "聊天记录业务主键不能为空", groups = {Insert.class})
|
@NotNull(message = "聊天记录业务主键不能为空", groups = {Insert.class})
|
||||||
private Long consultationId;
|
private Long consultationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人
|
||||||
|
*/
|
||||||
|
@NotNull(message = "发送人信息不能为空", groups = {Insert.class})
|
||||||
|
private String messageNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送人
|
* 发送人
|
||||||
*/
|
*/
|
||||||
@ -62,7 +68,6 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
|||||||
@NotNull(message = "消息类型不能为空", groups = {Insert.class})
|
@NotNull(message = "消息类型不能为空", groups = {Insert.class})
|
||||||
private String messageType;
|
private String messageType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息内容,图片内容时内容为:图片路径
|
* 消息内容,图片内容时内容为:图片路径
|
||||||
*/
|
*/
|
||||||
@ -70,5 +75,14 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
|||||||
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知
|
||||||
|
*/
|
||||||
|
private String messageCategory;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,11 @@ package com.xinelu.applet.service.messagepush.Impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||||
import com.xinelu.applet.dto.messagepush.FDMessagePushDto;
|
import com.xinelu.applet.dto.messagepush.FDMessagePushDto;
|
||||||
import com.xinelu.applet.dto.messagepush.FDWxMegDto;
|
import com.xinelu.applet.dto.messagepush.FDWxMegDto;
|
||||||
import com.xinelu.applet.dto.messagepush.TemplateData;
|
import com.xinelu.applet.dto.messagepush.TemplateData;
|
||||||
|
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||||
import com.xinelu.common.config.AppletChatConfig;
|
import com.xinelu.common.config.AppletChatConfig;
|
||||||
import com.xinelu.common.config.AppletPageConfig;
|
import com.xinelu.common.config.AppletPageConfig;
|
||||||
@ -15,6 +17,7 @@ import com.xinelu.common.enums.*;
|
|||||||
import com.xinelu.common.utils.AppletChatUtil;
|
import com.xinelu.common.utils.AppletChatUtil;
|
||||||
import com.xinelu.common.utils.http.HttpUtils;
|
import com.xinelu.common.utils.http.HttpUtils;
|
||||||
import com.xinelu.common.utils.map.MapUtil;
|
import com.xinelu.common.utils.map.MapUtil;
|
||||||
|
import com.xinelu.common.utils.uuid.IdUtils;
|
||||||
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||||
import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo;
|
import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo;
|
||||||
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
|
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
|
||||||
@ -52,6 +55,8 @@ public class MessagePushServiceImpl implements MessagePushService {
|
|||||||
private AppletPageConfig appletPageConfig;
|
private AppletPageConfig appletPageConfig;
|
||||||
@Resource
|
@Resource
|
||||||
private IPatientInfoService patientInfoService;
|
private IPatientInfoService patientInfoService;
|
||||||
|
@Resource
|
||||||
|
private IChatRecordService chatRecordService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信消息推送url
|
* 微信消息推送url
|
||||||
@ -232,50 +237,82 @@ public class MessagePushServiceImpl implements MessagePushService {
|
|||||||
@Override
|
@Override
|
||||||
@Async("asyncThreadServiceExecutor")
|
@Async("asyncThreadServiceExecutor")
|
||||||
public void fdApprovePush(JSONObject body) {
|
public void fdApprovePush(JSONObject body) {
|
||||||
AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret());
|
if (body.containsKey("cardNo") && !StringUtils.isBlank(body.getString("cardNo"))) {
|
||||||
if (Objects.isNull(appletAccessToken)) {
|
PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(body.getString("cardNo"));
|
||||||
log.error("获取微信小程序accessToken信息失败!");
|
if (patientInfo == null) {
|
||||||
}
|
log.error("接收方未注册 {}", body.getString("cardNo"));
|
||||||
if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != AppletSubscriptionMessageEnum.SUCCESS_ERRCODE.getValue()) {
|
}
|
||||||
log.error("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201);
|
AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret());
|
||||||
}
|
if (Objects.isNull(appletAccessToken)) {
|
||||||
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
|
log.error("获取微信小程序accessToken信息失败!");
|
||||||
log.error("accessToken信息为空!");
|
}
|
||||||
}
|
if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != AppletSubscriptionMessageEnum.SUCCESS_ERRCODE.getValue()) {
|
||||||
|
log.error("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
|
||||||
|
log.error("accessToken信息为空!");
|
||||||
|
}
|
||||||
|
ChatRecordDTO chatRecord = new ChatRecordDTO();
|
||||||
|
// 查询居民注册信息
|
||||||
|
if(!body.containsKey("patientId") || body.getLong("patientId") == null) {
|
||||||
|
chatRecord.setRecipientId(patientInfo.getId());
|
||||||
|
} else {
|
||||||
|
chatRecord.setRecipientId(body.getLong("patientId"));
|
||||||
|
}
|
||||||
|
|
||||||
//模板内容
|
//模板内容
|
||||||
Map<String, MessageValueEntity> messageValueEntityMap = new LinkedHashMap<>();
|
Map<String, MessageValueEntity> messageValueEntityMap = new LinkedHashMap<>();
|
||||||
switch (body.getString("busType")) {
|
switch (body.getString("busType")) {
|
||||||
// 申请
|
// 申请
|
||||||
case "10":
|
case "10":
|
||||||
messageValueEntityMap.put("name2", new MessageValueEntity(body.getString("receiveName")));
|
messageValueEntityMap.put("name2", new MessageValueEntity(body.getString("receiveName")));
|
||||||
messageValueEntityMap.put("thing6", new MessageValueEntity(body.getString("text1")));
|
messageValueEntityMap.put("thing6", new MessageValueEntity(body.getString("text1")));
|
||||||
messageValueEntityMap.put("thing5", new MessageValueEntity(body.getString("text2")));
|
messageValueEntityMap.put("thing5", new MessageValueEntity(body.getString("text2")));
|
||||||
messageValueEntityMap.put("thing8", new MessageValueEntity(body.getString("sendTime")));
|
messageValueEntityMap.put("thing8", new MessageValueEntity(body.getString("sendTime")));
|
||||||
messageValueEntityMap.put("thing9", new MessageValueEntity(body.getString("sendContent")));
|
messageValueEntityMap.put("thing9", new MessageValueEntity(body.getString("sendContent")));
|
||||||
break;
|
chatRecord.setContent(body.getString("receiveName") + "在" + body.getString("text1") + "提交服务申请,服务内容:" + (body.containsKey("text3") && !StringUtils.isBlank(body.getString("text3"))? body.getString("text3"): body.getString("text2")));
|
||||||
// 用药
|
chatRecord.setRecipientName(body.getString("receiveName"));
|
||||||
case "9":
|
chatRecord.setSenderName(body.getString("text1"));
|
||||||
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("text1")));
|
break;
|
||||||
messageValueEntityMap.put("thing2", new MessageValueEntity(body.getString("text2")));
|
// 用药
|
||||||
messageValueEntityMap.put("time3", new MessageValueEntity(body.getString("sendTime")));
|
case "9":
|
||||||
messageValueEntityMap.put("thing4", new MessageValueEntity(body.getString("sendContent")));
|
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("text1")));
|
||||||
break;
|
messageValueEntityMap.put("thing2", new MessageValueEntity(body.getString("text2")));
|
||||||
// 默认
|
messageValueEntityMap.put("time3", new MessageValueEntity(body.getString("sendTime")));
|
||||||
default:
|
messageValueEntityMap.put("thing4", new MessageValueEntity(body.getString("sendContent")));
|
||||||
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName")));
|
chatRecord.setContent(body.getString("sendContent"));
|
||||||
messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime")));
|
chatRecord.setRecipientName(body.getString("receiveName"));
|
||||||
messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendContent")));
|
chatRecord.setSenderName(body.getString("senderName"));
|
||||||
break;
|
break;
|
||||||
}
|
// 默认
|
||||||
|
default:
|
||||||
|
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName")));
|
||||||
|
messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime")));
|
||||||
|
messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendContent")));
|
||||||
|
chatRecord.setContent(body.getString("sendContent"));
|
||||||
|
chatRecord.setRecipientName(body.getString("receiveName"));
|
||||||
|
chatRecord.setSenderName(body.getString("senderName"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> paramsMap = new HashMap<>();
|
Map<String, Object> paramsMap = new HashMap<>();
|
||||||
paramsMap.put("touser", body.getString("openid"));
|
paramsMap.put("touser", body.getString("openid"));
|
||||||
paramsMap.put("template_id", MessageTemplateType.getFolllowupTypeByCode(body.getString("busType")).getTemplateId());
|
paramsMap.put("template_id", MessageTemplateType.getFolllowupTypeByCode(body.getString("busType")).getTemplateId());
|
||||||
paramsMap.put("page", appletPageConfig.getIntegralPageUrl());
|
paramsMap.put("page", appletPageConfig.getIntegralPageUrl());
|
||||||
paramsMap.put("data", messageValueEntityMap);
|
paramsMap.put("data", messageValueEntityMap);
|
||||||
//发送
|
//发送
|
||||||
this.sendPosts(appletAccessToken, paramsMap);
|
this.sendPosts(appletAccessToken, paramsMap);
|
||||||
|
|
||||||
|
// 记录通知消息
|
||||||
|
if(body.containsKey("messageCategory") && !StringUtils.isBlank(body.getString("messageCategory"))) {
|
||||||
|
chatRecord.setMessageType("1");
|
||||||
|
chatRecord.setTitle(body.getString("sendTitle"));
|
||||||
|
chatRecord.setMessageNo(IdUtils.fastSimpleUUID());
|
||||||
|
chatRecord.setSendTime(new Date());
|
||||||
|
chatRecord.setMessageCategory(body.getString("messageCategory"));
|
||||||
|
chatRecordService.insertChatRecord(chatRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -305,8 +342,62 @@ public class MessagePushServiceImpl implements MessagePushService {
|
|||||||
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
|
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
|
||||||
log.error("accessToken信息为空!");
|
log.error("accessToken信息为空!");
|
||||||
}
|
}
|
||||||
|
ChatRecordDTO chatRecord = new ChatRecordDTO();
|
||||||
|
// 查询居民注册信息
|
||||||
|
if(!req.containsKey("patientId") || req.getLong("patientId") == null) {
|
||||||
|
chatRecord.setRecipientId(patientInfo.getId());
|
||||||
|
} else {
|
||||||
|
chatRecord.setRecipientId(req.getLong("patientId"));
|
||||||
|
}
|
||||||
|
|
||||||
|
FDWxMegDto wxMegDto = new FDWxMegDto();
|
||||||
|
wxMegDto.setTouser(patientInfo.getOpenid());
|
||||||
|
wxMegDto.setTemplate_id(MessageTemplateType.getFolllowupTypeByCode(body.getTemplateType()).getTemplateId());
|
||||||
|
Map<String, TemplateData> meg = new HashMap<>();
|
||||||
|
switch (body.getTemplateType()) {
|
||||||
|
// 用药提醒
|
||||||
|
case "9":
|
||||||
|
meg.put("thing1", new TemplateData(body.getDrugName()));
|
||||||
|
meg.put("thing2", new TemplateData(body.getDrugUsage()));
|
||||||
|
meg.put("time3", new TemplateData(body.getHandleDate()));
|
||||||
|
meg.put("thing4", new TemplateData((!StringUtils.isBlank(body.getRecipientName())? body.getRecipientName(): "") + body.getContent()));
|
||||||
|
break;
|
||||||
|
// 筛查预约成功
|
||||||
|
case "10":
|
||||||
|
meg.put("name2", new TemplateData(body.getRecipientName()));
|
||||||
|
meg.put("thing5", new TemplateData(body.getApplyContent()));
|
||||||
|
meg.put("thing6", new TemplateData(body.getHospitalName()));
|
||||||
|
meg.put("thing8", new TemplateData(body.getHandleDate()));
|
||||||
|
meg.put("thing9", new TemplateData(body.getContent()));
|
||||||
|
break;
|
||||||
|
// 家庭医生消息通知
|
||||||
|
default:
|
||||||
|
meg.put("thing1", new TemplateData(body.getDoctorName()));
|
||||||
|
meg.put("time2", new TemplateData(body.getSendTime()));
|
||||||
|
meg.put("thing3", new TemplateData(body.getContent()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
wxMegDto.setPage(MessageTypePath.getPathByType(body.getMessageType()).getPath() + (StringUtils.isBlank(body.getContentId()) ? "" : body.getContentId()));
|
||||||
|
wxMegDto.setData(meg);
|
||||||
|
|
||||||
//发送
|
//发送
|
||||||
this.sendPosts(appletAccessToken, MapUtil.object2Map(getTemplate(body, patientInfo.getOpenid())));
|
this.sendPosts(appletAccessToken, MapUtil.object2Map(wxMegDto));
|
||||||
|
|
||||||
|
// 记录通知消息
|
||||||
|
if(req.containsKey("messageCategory") && !StringUtils.isBlank(req.getString("messageCategory")) && req.containsKey("chatRecord")) {
|
||||||
|
ChatRecordDTO chat = req.getJSONObject("chatRecord").toJavaObject(ChatRecordDTO.class);
|
||||||
|
if(chat != null) {
|
||||||
|
chatRecord.setMessageType("1");
|
||||||
|
chatRecord.setMessageNo(IdUtils.fastSimpleUUID());
|
||||||
|
chatRecord.setSendTime(new Date());
|
||||||
|
chatRecord.setTitle(chat.getTitle());
|
||||||
|
chatRecord.setContent(chat.getContent());
|
||||||
|
chatRecord.setSenderName(chat.getSenderName());
|
||||||
|
chatRecord.setRecipientName(patientInfo.getPatientName());
|
||||||
|
chatRecord.setMessageCategory(req.getString("messageCategory"));
|
||||||
|
chatRecordService.insertChatRecord(chatRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -140,10 +140,14 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
|
|||||||
result.put("receiveName", registerVo.getPatientName());
|
result.put("receiveName", registerVo.getPatientName());
|
||||||
result.put("text1", body.getHospitalName());
|
result.put("text1", body.getHospitalName());
|
||||||
result.put("text2", (body.getProjectName().length() >= 17? (body.getProjectName().substring(0, 17) + "..."): body.getProjectName()));
|
result.put("text2", (body.getProjectName().length() >= 17? (body.getProjectName().substring(0, 17) + "..."): body.getProjectName()));
|
||||||
|
result.put("text3", body.getProjectName());
|
||||||
|
result.put("sendTitle", "筛查预约");
|
||||||
result.put("sendTime", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
result.put("sendTime", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||||
result.put("busType", "10");
|
result.put("busType", "10");
|
||||||
result.put("sendContent", registerVo.getPatientName() + "预约筛查成功");
|
result.put("sendContent", registerVo.getPatientName() + "预约筛查成功");
|
||||||
result.put("messageType", "5");
|
result.put("messageType", "5");
|
||||||
|
result.put("messageCategory", "4");
|
||||||
|
result.put("cardNo", registerVo.getCardNo());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user