Commit d8436659db6269ffaa8dee46792bfc197d46719c
Committed by
Gitee
!1359 fix(mall):用户余额充值(虚拟物品)订单上传发货信息到微信小程序订单
Merge pull request !1359 from SuchJack/master-jdk17-dev2
Showing
1 changed file
with
14 additions
and
0 deletions
yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import cn.hutool.core.date.LocalDateTimeUtil; |
| 4 | 4 | import cn.hutool.core.lang.Assert; |
| 5 | 5 | import cn.hutool.core.util.ObjectUtil; |
| 6 | 6 | import cn.hutool.extra.spring.SpringUtil; |
| 7 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 7 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 8 | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 10 | import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; |
| ... | ... | @@ -22,6 +23,7 @@ import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; |
| 22 | 23 | import cn.iocoder.yudao.module.pay.framework.pay.config.PayProperties; |
| 23 | 24 | import cn.iocoder.yudao.module.pay.service.order.PayOrderService; |
| 24 | 25 | import cn.iocoder.yudao.module.system.api.social.SocialClientApi; |
| 26 | +import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaOrderUploadShippingInfoReqDTO; | |
| 25 | 27 | import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; |
| 26 | 28 | import jakarta.annotation.Resource; |
| 27 | 29 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -167,6 +169,18 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { |
| 167 | 169 | .addMessage("amount2", fenToYuanStr(walletRecharge.getTotalPrice())) // 充值金额 |
| 168 | 170 | .addMessage("time3", LocalDateTimeUtil.formatNormal(walletRecharge.getCreateTime())) // 充值时间 |
| 169 | 171 | .addMessage("phrase4", "充值成功")); // 充值状态 |
| 172 | + // 3. 调用接口上传虚拟物品发货信息 | |
| 173 | + PayOrderDO payOrder = payOrderService.getOrder(payOrderId); | |
| 174 | + SocialWxaOrderUploadShippingInfoReqDTO reqDTO = new SocialWxaOrderUploadShippingInfoReqDTO() | |
| 175 | + .setTransactionId(payOrder.getChannelOrderNo()) | |
| 176 | + .setOpenid(payOrder.getChannelUserId()) | |
| 177 | + .setItemDesc(payOrder.getSubject()) | |
| 178 | + .setLogisticsType(SocialWxaOrderUploadShippingInfoReqDTO.LOGISTICS_TYPE_VIRTUAL); // 虚拟物品发货类型 | |
| 179 | + try { | |
| 180 | + socialClientApi.uploadWxaOrderShippingInfo(UserTypeEnum.MEMBER.getValue(), reqDTO); | |
| 181 | + } catch (Exception ex) { | |
| 182 | + log.error("[sendWalletRechargerPaidMessage][订单({}) 上传订单物流信息到微信小程序失败]", payOrder, ex); | |
| 183 | + } | |
| 170 | 184 | } |
| 171 | 185 | |
| 172 | 186 | @Override | ... | ... |