feat(推流管理):后台管理功能页面优化
This commit is contained in:
+5
-3
@@ -83,11 +83,13 @@ public class WxTemplateMessageServiceImpl implements IWxTemplateMessageService {
|
|||||||
log.info("模板消息发送成功: openId={}, orderNo={}, msgId={}", openId, orderNo, msgId);
|
log.info("模板消息发送成功: openId={}, orderNo={}, msgId={}", openId, orderNo, msgId);
|
||||||
|
|
||||||
// 保存发送记录
|
// 保存发送记录
|
||||||
saveMessageRecord(openId, msgId, templateMessage);
|
saveMessageRecord(openId, msgId, templateMessage,CommonStatus.ENABLE.getId());
|
||||||
|
|
||||||
} catch (WxErrorException e) {
|
} catch (WxErrorException e) {
|
||||||
log.error("发送模板消息失败: unionId={}, orderNo={}, errorCode={}, errorMsg={}",
|
log.error("发送模板消息失败: unionId={}, orderNo={}, errorCode={}, errorMsg={}",
|
||||||
unionId, orderNo, e.getError().getErrorCode(), e.getError().getErrorMsg());
|
unionId, orderNo, e.getError().getErrorCode(), e.getError().getErrorMsg());
|
||||||
|
// 保存发送记录 @TODO
|
||||||
|
// saveMessageRecord(openId, msgId, templateMessage,CommonStatus.ENABLE.getId());
|
||||||
throw new BusinessException("发送失败:" + e.getError().getErrorMsg());
|
throw new BusinessException("发送失败:" + e.getError().getErrorMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,7 +108,7 @@ public class WxTemplateMessageServiceImpl implements IWxTemplateMessageService {
|
|||||||
return amount.setScale(2, RoundingMode.HALF_UP).toString() + "元";
|
return amount.setScale(2, RoundingMode.HALF_UP).toString() + "元";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveMessageRecord(String openId, String msgId, WxMpTemplateMessage templateMessage) {
|
private void saveMessageRecord(String openId, String msgId, WxMpTemplateMessage templateMessage,Integer status) {
|
||||||
try {
|
try {
|
||||||
// 1. 提取模板消息内容
|
// 1. 提取模板消息内容
|
||||||
String content = extractMessageContent(templateMessage);
|
String content = extractMessageContent(templateMessage);
|
||||||
@@ -117,7 +119,7 @@ public class WxTemplateMessageServiceImpl implements IWxTemplateMessageService {
|
|||||||
.templateId(templateMessage.getTemplateId())
|
.templateId(templateMessage.getTemplateId())
|
||||||
.msgId(msgId)
|
.msgId(msgId)
|
||||||
.content(content)
|
.content(content)
|
||||||
.status(CommonStatus.ENABLE.getId())
|
.status(status)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// 3. 保存记录
|
// 3. 保存记录
|
||||||
|
|||||||
Reference in New Issue
Block a user