【代码优化】SYSTEM:订阅消息跳转小程序类型

This commit is contained in:
puhui999 2024-07-31 12:58:06 +08:00
parent 0e24994c92
commit 2bc96fe521
3 changed files with 11 additions and 5 deletions

View File

@ -371,11 +371,10 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
MapUtil.<String, Object>builder().put("expressName", express != null ? express.getName() : "") MapUtil.<String, Object>builder().put("expressName", express != null ? express.getName() : "")
.put("logisticsNo", express != null ? deliveryReqVO.getLogisticsNo() : "").build()); .put("logisticsNo", express != null ? deliveryReqVO.getLogisticsNo() : "").build());
// TODO @puhui999可以改成 4.1 4.2因为都算通知哈 // 4.1 发送站内信
// 4. 发送站内信
tradeMessageService.sendMessageWhenDeliveryOrder(new TradeOrderMessageWhenDeliveryOrderReqBO() tradeMessageService.sendMessageWhenDeliveryOrder(new TradeOrderMessageWhenDeliveryOrderReqBO()
.setOrderId(order.getId()).setUserId(order.getUserId()).setMessage(null)); .setOrderId(order.getId()).setUserId(order.getUserId()).setMessage(null));
// 5. 发送订阅消息 // 4.2 发送订阅消息
getSelf().sendDeliveryOrderMessage(order, deliveryReqVO); getSelf().sendDeliveryOrderMessage(order, deliveryReqVO);
} }

View File

@ -73,7 +73,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
public class SocialClientServiceImpl implements SocialClientService { public class SocialClientServiceImpl implements SocialClientService {
/** /**
* 小程序版本 * 小程序码要打开的小程序版本
* *
* 1. release正式版 * 1. release正式版
* 2. trial体验版 * 2. trial体验版
@ -81,6 +81,11 @@ public class SocialClientServiceImpl implements SocialClientService {
*/ */
@Value("${yudao.wxa-code.env-version:release}") @Value("${yudao.wxa-code.env-version:release}")
public String envVersion; public String envVersion;
/**
* 订阅消息跳转小程序类型developer为开发版trial为体验版formal为正式版
*/
@Value("${yudao.wxa-subscribe-message.miniprogram-state:formal}")
public String miniprogramState;
@Resource @Resource
private AuthRequestFactory authRequestFactory; private AuthRequestFactory authRequestFactory;
@ -307,7 +312,7 @@ public class SocialClientServiceImpl implements SocialClientService {
String templateId, String openId) { String templateId, String openId) {
// 设置订阅消息基本参数 // 设置订阅消息基本参数
WxMaSubscribeMessage subscribeMessage = new WxMaSubscribeMessage().setLang(WxMaConstants.MiniProgramLang.ZH_CN) WxMaSubscribeMessage subscribeMessage = new WxMaSubscribeMessage().setLang(WxMaConstants.MiniProgramLang.ZH_CN)
.setMiniprogramState(envVersion).setTemplateId(templateId).setToUser(openId).setPage(reqDTO.getPage()); .setMiniprogramState(miniprogramState).setTemplateId(templateId).setToUser(openId).setPage(reqDTO.getPage());
// 设置具体消息参数 // 设置具体消息参数
Map<String, String> messages = reqDTO.getMessages(); Map<String, String> messages = reqDTO.getMessages();
if (CollUtil.isNotEmpty(messages)) { if (CollUtil.isNotEmpty(messages)) {

View File

@ -223,6 +223,8 @@ yudao:
demo: false # 关闭演示模式 demo: false # 关闭演示模式
wxa-code: wxa-code:
env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop" env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop"
wxa-subscribe-message:
miniprogram-state: developer # 跳转小程序类型developer为开发版trial为体验版formal为正式版
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
justauth: justauth: