From 042cbff3d45bd1d2abdc23ea1faa8c188f7b5ab0 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 27 Apr 2023 16:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...BsStoreDiscountActivityPartakeUserController.java | 6 +++--- .../java/com/hfkj/service/BsTradeOrderService.java | 6 ++++++ .../hfkj/service/impl/BsTradeOrderServiceImpl.java | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java b/cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java index 404c989..383a005 100644 --- a/cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java +++ b/cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java @@ -71,12 +71,12 @@ public class BsStoreDiscountActivityPartakeUserController { if (StringUtils.isBlank(response.getString("return_data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); } - BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNo(outTradeNo); + BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNoOrPlatformTradeNo(outTradeNo); if (tradeNo == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); } - String param = outTradeNo; - String fileUrl = "/share/" + System.currentTimeMillis() + ".png"; + String param = tradeNo.getOutTradeNo(); + String fileUrl = "/share/" + System.currentTimeMillis() + ".png"; // type 生成类型 // 1:支付交易成功后 // 2:分享关注公众号 diff --git a/service/src/main/java/com/hfkj/service/BsTradeOrderService.java b/service/src/main/java/com/hfkj/service/BsTradeOrderService.java index 43c171b..afc507e 100644 --- a/service/src/main/java/com/hfkj/service/BsTradeOrderService.java +++ b/service/src/main/java/com/hfkj/service/BsTradeOrderService.java @@ -48,6 +48,12 @@ public interface BsTradeOrderService { */ BsTradeOrder getOrderByOutTradeNo(String tradeNo); + /** + * 查询交易订单 + * @param tradeNo 交易流水或渠道平台交易流水 + * @return + */ + BsTradeOrder getOrderByOutTradeNoOrPlatformTradeNo(String tradeNo); /** * 根据交易订单id,查询 * @param tradeOrderId diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java index 9d723cc..c21980c 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java @@ -262,6 +262,18 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { return null; } + @Override + public BsTradeOrder getOrderByOutTradeNoOrPlatformTradeNo(String tradeNo) { + BsTradeOrderExample example = new BsTradeOrderExample(); + example.createCriteria().andOutTradeNoEqualTo(tradeNo); + example.or().andPlatformTradeNoEqualTo(tradeNo); + List list = tradeOrderMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public BsTradeOrder getOrderByTradeNoId(Long tradeOrderId) { return tradeOrderMapper.selectByPrimaryKey(tradeOrderId);