提交代码

yy_dev
胡锐 2 years ago
parent b5bcaabcc3
commit 042cbff3d4
  1. 4
      cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java
  2. 6
      service/src/main/java/com/hfkj/service/BsTradeOrderService.java
  3. 12
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java

@ -71,11 +71,11 @@ public class BsStoreDiscountActivityPartakeUserController {
if (StringUtils.isBlank(response.getString("return_data"))) { if (StringUtils.isBlank(response.getString("return_data"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败");
} }
BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNo(outTradeNo); BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNoOrPlatformTradeNo(outTradeNo);
if (tradeNo == null) { if (tradeNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单");
} }
String param = outTradeNo; String param = tradeNo.getOutTradeNo();
String fileUrl = "/share/" + System.currentTimeMillis() + ".png"; String fileUrl = "/share/" + System.currentTimeMillis() + ".png";
// type 生成类型 // type 生成类型
// 1:支付交易成功后 // 1:支付交易成功后

@ -48,6 +48,12 @@ public interface BsTradeOrderService {
*/ */
BsTradeOrder getOrderByOutTradeNo(String tradeNo); BsTradeOrder getOrderByOutTradeNo(String tradeNo);
/**
* 查询交易订单
* @param tradeNo 交易流水或渠道平台交易流水
* @return
*/
BsTradeOrder getOrderByOutTradeNoOrPlatformTradeNo(String tradeNo);
/** /**
* 根据交易订单id查询 * 根据交易订单id查询
* @param tradeOrderId * @param tradeOrderId

@ -262,6 +262,18 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
return null; return null;
} }
@Override
public BsTradeOrder getOrderByOutTradeNoOrPlatformTradeNo(String tradeNo) {
BsTradeOrderExample example = new BsTradeOrderExample();
example.createCriteria().andOutTradeNoEqualTo(tradeNo);
example.or().andPlatformTradeNoEqualTo(tradeNo);
List<BsTradeOrder> list = tradeOrderMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override @Override
public BsTradeOrder getOrderByTradeNoId(Long tradeOrderId) { public BsTradeOrder getOrderByTradeNoId(Long tradeOrderId) {
return tradeOrderMapper.selectByPrimaryKey(tradeOrderId); return tradeOrderMapper.selectByPrimaryKey(tradeOrderId);

Loading…
Cancel
Save