RegisterOrderDonServiceImpl.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. package com.cyksj.service.register.impl;
  2. import cn.hutool.core.bean.BeanUtil;
  3. import cn.hutool.core.date.DateTime;
  4. import cn.hutool.core.date.DateUtil;
  5. import cn.hutool.core.util.StrUtil;
  6. import com.alipay.api.AlipayClient;
  7. import com.alipay.api.domain.AlipayTradeRefundModel;
  8. import com.alipay.api.request.AlipayTradeRefundRequest;
  9. import com.alipay.api.response.AlipayTradeRefundResponse;
  10. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  11. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12. import com.cyksj.common.exception.BusinessRuntimeException;
  13. import com.cyksj.common.snowflake.Sequence;
  14. import com.cyksj.common.util.Codec;
  15. import com.cyksj.common.util.Jsons;
  16. import com.cyksj.common.util.Xmls;
  17. import com.cyksj.config.WeChatConfig;
  18. import com.cyksj.config.zfb.AliPayClientFactory;
  19. import com.cyksj.dto.RedisKey;
  20. import com.cyksj.dto.Result;
  21. import com.cyksj.enums.GatewayResponse;
  22. import com.cyksj.mapper.AppleAutoRegisterDataMapper;
  23. import com.cyksj.mapper.RegisterOrderDonMapper;
  24. import com.cyksj.mapper.SpotifyUnLimitRecordMapper;
  25. import com.cyksj.mapper.UserMapper;
  26. import com.cyksj.mapper.channel.ShopConfigMapper;
  27. import com.cyksj.mapper.manage.coupon.CouponMapper;
  28. import com.cyksj.model.dto.H5JsPayParams;
  29. import com.cyksj.model.entity.*;
  30. import com.cyksj.model.manage.request.RegisterReq;
  31. import com.cyksj.model.request.OrderAttach;
  32. import com.cyksj.model.request.OrderRefundReq;
  33. import com.cyksj.model.views.CouponUserView;
  34. import com.cyksj.redis.RedisService;
  35. import com.cyksj.service.mange.coupon.CouponCommonService;
  36. import com.cyksj.service.register.RegisterOrderDonService;
  37. import com.cyksj.service.register.SpotifyService;
  38. import com.cyksj.service.sys.SysConfigService;
  39. import com.cyksj.service.wechat.WeChatService;
  40. import com.cyksj.task.JobManager;
  41. import com.ejlchina.searcher.BeanSearcher;
  42. import com.ejlchina.searcher.param.Operator;
  43. import com.ejlchina.searcher.util.MapUtils;
  44. import lombok.RequiredArgsConstructor;
  45. import lombok.extern.slf4j.Slf4j;
  46. import org.apache.commons.lang3.StringUtils;
  47. import org.springframework.dao.DuplicateKeyException;
  48. import org.springframework.stereotype.Service;
  49. import org.springframework.transaction.annotation.Transactional;
  50. import java.math.BigDecimal;
  51. import java.math.RoundingMode;
  52. import java.util.List;
  53. import java.util.Map;
  54. import java.util.Optional;
  55. /**
  56. * @author chan
  57. * @date 2022/11/7 2:39 PM
  58. */
  59. @Service
  60. @Slf4j
  61. @RequiredArgsConstructor
  62. public class RegisterOrderDonServiceImpl extends ServiceImpl<RegisterOrderDonMapper ,RegisterOrderDon> implements RegisterOrderDonService {
  63. private static final Sequence SEQUENCE = new Sequence(0);
  64. private static final String REGISTER_PRICE_KEY = "register_price";
  65. private final SpotifyService spotifyService;
  66. private final RedisService redisService;
  67. private final WeChatService weChatService;
  68. private final WeChatConfig weChatConfig;
  69. private final SysConfigService sysConfigService;
  70. private final UserMapper userMapper;
  71. private final AppleAutoRegisterDataMapper appleAutoRegisterDataMapper;
  72. private final JobManager jobManager;
  73. private final RegisterOrderDonMapper registerOrderDonMapper;
  74. private final CouponMapper couponMapper;
  75. private final CouponCommonService couponCommonService;
  76. private final SpotifyUnLimitRecordMapper spotifyUnLimitRecordMapper;
  77. private final BeanSearcher beanSearcher;
  78. private final ShopConfigMapper shopConfigMapper;
  79. private static final Long EXPIRY_TIME = 1000 * 60 * 5L;
  80. /**
  81. * 判断是否免费
  82. * @author chan
  83. * @date 2022-11-07 3:34 PM
  84. */
  85. @Override
  86. public boolean isFree(long userId, String platform) {
  87. int count = count(Wrappers.lambdaQuery(RegisterOrderDon.class)
  88. .eq(RegisterOrderDon::getUserId, userId)
  89. .ne(RegisterOrderDon::getStatus, RegisterOrderDon.Status.noPayment)
  90. .eq(RegisterOrderDon::getIsFree, true));
  91. if(count > 0){
  92. return false;
  93. }
  94. Long num = redisService.decr(RedisKey.SPOTIFY_FREE_NUM, 1L);
  95. if(num >= 0){
  96. return true;
  97. }else {
  98. redisService.incr(RedisKey.SPOTIFY_FREE_NUM, 1L);
  99. }
  100. return false;
  101. }
  102. /**
  103. * 保存注册资料
  104. * @author chan
  105. * @date 2022-11-07 3:34 PM
  106. */
  107. @Override
  108. @Transactional(rollbackFor = Throwable.class)
  109. public RegisterOrderDon saveOrder(long userId, RegisterReq req, boolean isFree) throws Exception {
  110. RegisterOrderDon orderDon = new RegisterOrderDon();
  111. User user = userMapper.selectById(userId);
  112. BeanUtil.copyProperties(req,orderDon);
  113. SysConfig register_price = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, "register_price").last("limit 1"));
  114. Map<String, Integer> map = Jsons.toMap(register_price.getSysValue());
  115. orderDon.setOrderNo(SEQUENCE.nextId() + "");
  116. orderDon.setUserId(userId);
  117. orderDon.setOpenId(user.getOpenId());
  118. orderDon.setIsFree(isFree);
  119. orderDon.setMoney(isFree ? BigDecimal.ZERO : BigDecimal.valueOf(("apple".equals(req.getPlatform()) && "auto".equals(req.getAppleRegisterType())) ? map.get("appleAuto") : map.get(req.getPlatform())));
  120. orderDon.setStatus(isFree ? RegisterOrderDon.Status.hasPayment : RegisterOrderDon.Status.noPayment);
  121. save(orderDon);
  122. //apple
  123. handleAppleIdAuto(userId, req, orderDon);
  124. return orderDon;
  125. }
  126. /**
  127. * Apple ID自动注册
  128. */
  129. private void handleAppleIdAuto(long userId, RegisterReq req, RegisterOrderDon orderDon) {
  130. if ("apple".equals(req.getPlatform()) && "auto".equals(req.getAppleRegisterType())) {
  131. //是否有未支付的国家或区域的订单
  132. Integer exists = appleAutoRegisterDataMapper.checkNoPayOrder(userId, req.getCountryOrArea());
  133. if (exists != null) {
  134. throw BusinessRuntimeException.getInstance(String.format("您有%s随机生成Apple ID未支付的订单", req.getCountryOrArea().getDesc()));
  135. }
  136. if (req.getCountryOrArea() == null) {
  137. throw BusinessRuntimeException.getInstance("请选择对应的国家或地区");
  138. }
  139. //查看是否有空余账号
  140. AppleAutoRegisterData appleAutoRegisterData = appleAutoRegisterDataMapper.selectOne(Wrappers.lambdaQuery(AppleAutoRegisterData.class).eq(AppleAutoRegisterData::getCountryOrArea, req.getCountryOrArea()).eq(AppleAutoRegisterData::getStatus, false).select(AppleAutoRegisterData::getId).last("limit 1"));
  141. if (appleAutoRegisterData == null) {
  142. throw BusinessRuntimeException.getInstance("自动生成Apple ID库存不足");
  143. }
  144. appleAutoRegisterData.setUserId(userId);
  145. appleAutoRegisterData.setStatus(true);
  146. appleAutoRegisterData.setOrderId(orderDon.getId());
  147. int update = appleAutoRegisterDataMapper.update(appleAutoRegisterData, Wrappers.lambdaUpdate(AppleAutoRegisterData.class).eq(AppleAutoRegisterData::getStatus, false).eq(AppleAutoRegisterData::getId, appleAutoRegisterData.getId()));
  148. if (update != 1) {
  149. throw BusinessRuntimeException.getInstance("系统异常,请重新操作");
  150. }
  151. jobManager.addJob(EXPIRY_TIME, () -> {
  152. updateAppleAutoStatus(orderDon.getId());
  153. });
  154. }
  155. }
  156. @Override
  157. public void updateAppleAutoStatus(Long orderId) {
  158. log.info("校验appleID自动注册订单 orderId:{}", orderId);
  159. RegisterOrderDon registerOrderDon = this.getById(orderId);
  160. if (registerOrderDon != null && RegisterOrderDon.Status.noPayment == registerOrderDon.getStatus()) {
  161. AppleAutoRegisterData appleAutoRegisterData = appleAutoRegisterDataMapper.selectOne(Wrappers.lambdaQuery(AppleAutoRegisterData.class).eq(AppleAutoRegisterData::getOrderId, orderId).last("limit 1"));
  162. if (appleAutoRegisterData != null) {
  163. appleAutoRegisterData.setStatus(false);
  164. appleAutoRegisterData.setUserId(0l);
  165. appleAutoRegisterData.setOrderId(0l);
  166. appleAutoRegisterDataMapper.updateById(appleAutoRegisterData);
  167. //订单关闭
  168. registerOrderDon.setStatus(RegisterOrderDon.Status.close);
  169. registerOrderDonMapper.updateById(registerOrderDon);
  170. log.info("未支付appleID自动注册订单:{},修改appleID使用状态", orderId);
  171. }
  172. }
  173. }
  174. @Override
  175. public CouponUserView spotifyUnLimit(SpotifyUnLimitRecord spotifyUnLimitRecord) {
  176. Boolean isFlag = false;
  177. Long spotifyUnLimitCouponId = null;
  178. //是否配置了优惠券
  179. SysConfig spotify_unLimit_cid = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, "spotify_unLimit_cid").last("limit 1"));
  180. if (spotify_unLimit_cid != null && StrUtil.isNotBlank(spotify_unLimit_cid.getSysValue())) {
  181. spotifyUnLimitCouponId = Long.parseLong(spotify_unLimit_cid.getSysValue());
  182. Coupon coupon = couponMapper.selectById(spotifyUnLimitCouponId);
  183. if (coupon != null) {
  184. isFlag = couponCommonService.sendCouponToUser(spotifyUnLimitRecord.getUserId(), spotifyUnLimitCouponId, null, null, null, CouponUser.Channel.manual);
  185. }
  186. }
  187. //14天内是否重复提交过该账号
  188. SpotifyUnLimitRecord exists = spotifyUnLimitRecordMapper.selectOne(Wrappers.lambdaQuery(SpotifyUnLimitRecord.class)
  189. .eq(SpotifyUnLimitRecord::getUserId, spotifyUnLimitRecord.getUserId())
  190. .eq(SpotifyUnLimitRecord::getAccount, spotifyUnLimitRecord.getAccount())
  191. .last("limit 1"));
  192. if (exists != null && exists.getUpdateTime().after(DateUtil.offsetDay(DateTime.now(), -14))) {
  193. throw BusinessRuntimeException.getInstance("您已提交过,请勿重复提交");
  194. }
  195. if (exists != null) {
  196. spotifyUnLimitRecord.setId(exists.getId());
  197. spotifyUnLimitRecord.setIsSend(false);
  198. spotifyUnLimitRecordMapper.updateById(spotifyUnLimitRecord);
  199. } else {
  200. try {
  201. spotifyUnLimitRecordMapper.insert(spotifyUnLimitRecord);
  202. } catch (DuplicateKeyException e) {
  203. log.info("用户:{}重复提交解除限制spotify账号:{}", spotifyUnLimitRecord.getUserId(), spotifyUnLimitRecord.getAccount());
  204. }
  205. }
  206. return isFlag ? beanSearcher.searchFirst(CouponUserView.class, MapUtils.builder()
  207. .field(CouponUserView::getUserId, spotifyUnLimitRecord.getUserId()).op(Operator.Equal)
  208. .field(CouponUserView::getCouponId, spotifyUnLimitCouponId).op(Operator.Equal)
  209. .build()) : null;
  210. }
  211. @Override
  212. public CouponUserView getAvailableSpotifyCoupon(long userId) {
  213. SysConfig spotify_register_success_cid = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, "spotify_register_success_cid").last("limit 1"));
  214. CouponUserView couponUserView = null;
  215. if (spotify_register_success_cid != null && StrUtil.isNotBlank(spotify_register_success_cid.getSysValue())) {
  216. DateTime now = DateTime.now();
  217. Long spotifyRegisterSucCid = Long.parseLong(spotify_register_success_cid.getSysValue());
  218. couponUserView = beanSearcher.searchFirst(CouponUserView.class, MapUtils.builder()
  219. .field(CouponUserView::getUserId, userId).op(Operator.Equal)
  220. .field(CouponUserView::getCouponId, spotifyRegisterSucCid).op(Operator.Equal)
  221. .field(CouponUserView::getCouponUserStatus, CouponUser.Status.unused.name()).op(Operator.Equal)
  222. .field(CouponUserView::getValidStartTime, now).op(Operator.LessThan)
  223. .field(Coupon::getValidEndTime, now).op(Operator.GreaterThan)
  224. .build());
  225. }
  226. return couponUserView;
  227. }
  228. @Override
  229. public void unifiedRefund(OrderRefundReq refundReq) throws Exception {
  230. Long orderId = refundReq.getOrderId();
  231. RegisterOrderDon registerOrderDon = this.getById(orderId);
  232. if (registerOrderDon == null) throw BusinessRuntimeException.getInstance("订单不存在");
  233. if (registerOrderDon.getStatus() == RegisterOrderDon.Status.refund) throw BusinessRuntimeException.getInstance("该订单已退款");
  234. if (registerOrderDon.getStatus() != RegisterOrderDon.Status.error && registerOrderDon.getStatus() != RegisterOrderDon.Status.hasPayment) {
  235. throw BusinessRuntimeException.getInstance("该订单状态不允许退款");
  236. }
  237. if (registerOrderDon.getMoney().compareTo(BigDecimal.ZERO) <= 0) {
  238. throw BusinessRuntimeException.getInstance("该订单金额为0,无需退款");
  239. }
  240. if (!redisService.setNx(String.format("%s", refundReq.getOrderId()), refundReq.getOrderId(), 10l)) {
  241. throw BusinessRuntimeException.getInstance("请勿重复点击,正在退款中..");
  242. }
  243. RegisterOrderDon.Type type = registerOrderDon.getType();
  244. if (type == RegisterOrderDon.Type.WeChat) {
  245. wxRefund(refundReq, registerOrderDon);
  246. }
  247. if (type == RegisterOrderDon.Type.ALI_PAY) {
  248. zfbRefund(refundReq, registerOrderDon);
  249. }
  250. }
  251. @Override
  252. public H5JsPayParams pay(Long orderId) throws Exception {
  253. log.info("注册 账号调起微信支付[start] orderId:{}", orderId);
  254. RegisterOrderDon orderDon = this.getById(orderId);
  255. if (orderDon.getStatus() == RegisterOrderDon.Status.close) {
  256. throw BusinessRuntimeException.getInstance("订单已关闭");
  257. }
  258. OrderAttach attach = new OrderAttach();
  259. attach.setO(orderDon.getId());
  260. //获取支付默认商户
  261. String shopId = sysConfigService.getDefaultShopConfigByType("wx");
  262. String toWechatAttach = Codec.DoBase64.custom()
  263. .setData(Jsons.toJson(attach)).encodeAsText();
  264. H5JsPayParams params = weChatService.getJsPayParams(
  265. weChatConfig.getAppid(),
  266. shopId,
  267. orderDon.getOpenId(),
  268. orderDon.getMoney().intValue(),
  269. orderDon.getOrderNo(),
  270. weChatConfig.getDomain() + "applets/register/prepay/notify",
  271. toWechatAttach,
  272. "注册服务",
  273. "JSAPI",
  274. null
  275. );
  276. log.info("微信支付成功[end]");
  277. return params;
  278. }
  279. @Override
  280. @Transactional(rollbackFor = Throwable.class)
  281. public void prepayNotify(Map<String, String> map) throws Exception {
  282. /* 此处处理订单等业务逻辑 */
  283. // 获取订单 和 微信订单号 和 支付的金额
  284. String attach = Codec.DoBase64.custom().setData(map.get("attach")).decodeAsText();
  285. OrderAttach orderAttach = Jsons.parseObject(attach, OrderAttach.class);
  286. final Long oid = orderAttach.getO();
  287. //final Long shareId = orderAttach.getShared();
  288. RegisterOrderDon order = this.getById(oid);
  289. if (null == order) {
  290. throw BusinessRuntimeException.getInstance("订单不存在.");
  291. }
  292. String appId = map.get("mch_id");
  293. // 校验签名
  294. boolean f = weChatService.checkSignWithMd5(map, shopConfigMapper.getByAppId(appId).getSecret());
  295. if (!f) {
  296. log.error("回调数据:{}", map);
  297. throw BusinessRuntimeException.getInstance("支付成功回调, 校验签名失败.");
  298. }
  299. String transactionId = map.get("transaction_id");
  300. if (order.getStatus().equals(RegisterOrderDon.Status.hasPayment)) {
  301. log.info("已回调,重复修改状态 id:{}", order.getId());
  302. return;
  303. }
  304. // 更改订单状态
  305. order.setTransactionId(transactionId);
  306. order.setStatus(RegisterOrderDon.Status.hasPayment);
  307. AppleAutoRegisterData appleAutoRegisterData = appleAutoRegisterDataMapper.selectOne(Wrappers.lambdaQuery(AppleAutoRegisterData.class).eq(AppleAutoRegisterData::getOrderId, order.getId()).eq(AppleAutoRegisterData::getStatus, true));
  308. if (appleAutoRegisterData != null) {
  309. order.setStatus(RegisterOrderDon.Status.complete);
  310. }
  311. order.setPayTime(DateUtil.parse(map.get("time_end"), "yyyyMMddHHmmss"));
  312. if (StringUtils.isBlank(order.getOpenId())) {
  313. order.setOpenId(map.get("openid"));
  314. }
  315. this.updateById(order);
  316. }
  317. @Override
  318. public Result<String> wxRefund(OrderRefundReq refundReq,RegisterOrderDon registerOrderDon) throws Exception {
  319. long time = System.currentTimeMillis();
  320. //退款订单号
  321. String outRefundNo = Codec.DoDigest.custom()
  322. .setAlgorithm(Codec.DoDigest.Algorithm.MD5)
  323. .setStringData(time + String.valueOf(registerOrderDon.getId()))
  324. .toHexString();
  325. refundReq.setRefundMoney(registerOrderDon.getMoney());
  326. weChatService.refundWxOrder(weChatConfig.getAppid(),
  327. Optional.ofNullable(registerOrderDon.getShopId()).orElse(ShopConfig.WX_DEFAULT_APP_ID),
  328. registerOrderDon.getTransactionId(),
  329. outRefundNo,
  330. registerOrderDon.getMoney(),
  331. refundReq.getRefundMoney(),
  332. weChatConfig.getDomain() + "manage/register/wx/refund/notify");
  333. //修改订单状态
  334. registerOrderDon.setStatus(RegisterOrderDon.Status.refund);
  335. this.updateById(registerOrderDon);
  336. return GatewayResponse.SUCCESS.newBuilder().toResult("退款成功");
  337. }
  338. @Override
  339. public void wxRefundNotify(Map<String, String> map) throws Exception {
  340. // 对退款数据 解密
  341. String md5Key = Codec.DoDigest.custom().setAlgorithm(Codec.DoDigest.Algorithm.MD5).setStringData(shopConfigMapper.getByAppId(map.get("mch_id")).getSecret()).toHexString();
  342. String reqInfoXml = Codec.DoCipher.custom().setAlgorithm(Codec.DoCipher.Trans.AES_ECB_PKCS7Padding).setBase64Data(map.get("req_info")).setStringKey(md5Key).ofDecrypt().toText();
  343. log.info("=== 退款数据解密: \n {}", reqInfoXml);
  344. Map<String, String> reqInfoMap = Xmls.toMap(reqInfoXml);
  345. // 退款失败
  346. if (StrUtil.equals("CHANGE", reqInfoMap.get("refund_status"))) {
  347. throw BusinessRuntimeException.getInstance("退款异常.");
  348. } else if (StrUtil.equals("REFUNDCLOSE", reqInfoMap.get("refund_status"))) {
  349. throw BusinessRuntimeException.getInstance("退款关闭.");
  350. }
  351. /* 此处处理业务逻辑 */
  352. String outRefundNo = reqInfoMap.get("out_refund_no");
  353. String transactionId = reqInfoMap.get("transaction_id");
  354. RegisterOrderDon registerOrderDon = this.getOne(Wrappers.lambdaQuery(RegisterOrderDon.class).eq(RegisterOrderDon::getTransactionId, transactionId).last("limit 1"));
  355. if (registerOrderDon == null) {
  356. log.error("退款回调,transactionId:{}订单不存在", transactionId);
  357. }
  358. if (registerOrderDon.getStatus() != RegisterOrderDon.Status.refund) {
  359. registerOrderDon.setStatus(RegisterOrderDon.Status.refund);
  360. this.updateById(registerOrderDon);
  361. }
  362. log.info("微信退款: 退款单号[{}] 退款成功.", outRefundNo);
  363. }
  364. public void zfbRefund(OrderRefundReq refundReq, RegisterOrderDon registerOrderDon) throws Exception {
  365. AlipayTradeRefundResponse response;
  366. //支付宝退款
  367. AlipayClient alipayClient = AliPayClientFactory.getAlipayClient(Optional.ofNullable(registerOrderDon.getShopId()).orElse(ShopConfig.ZFB_DEFAULT_APP_ID));
  368. AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
  369. AlipayTradeRefundModel model = new AlipayTradeRefundModel();
  370. //支付宝交易号
  371. model.setTradeNo(registerOrderDon.getTransactionId());
  372. model.setRefundAmount(refundReq.getRefundMoney().divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_EVEN).toString());
  373. model.setQueryOptions(List.of("gmt_refund_pay"));
  374. long time = System.currentTimeMillis();
  375. //退款订单号
  376. String outRefundNo = Codec.DoDigest.custom()
  377. .setAlgorithm(Codec.DoDigest.Algorithm.MD5)
  378. .setStringData(time + String.valueOf(registerOrderDon.getId()))
  379. .toHexString();
  380. //退款请求号
  381. model.setOutRequestNo(outRefundNo);
  382. request.setBizModel(model);
  383. String shopId = registerOrderDon.getShopId();
  384. ShopConfig shopConfig = shopConfigMapper.selectOne(Wrappers.lambdaQuery(ShopConfig.class).eq(ShopConfig::getAppId, registerOrderDon.getShopId()));
  385. if (shopId != null && shopConfig != null && shopConfig.getIsCert()) {
  386. response = alipayClient.certificateExecute(request);
  387. } else {
  388. response = alipayClient.execute(request);
  389. }
  390. if (!response.isSuccess()) throw BusinessRuntimeException.getInstance("退款失败,e:{0}", response.getSubMsg());
  391. }
  392. }