|
@@ -69,6 +69,7 @@ public class GiftOrderService {
|
|
|
private GeneralProperties generalProperties;
|
|
private GeneralProperties generalProperties;
|
|
|
private SnowflakeIdWorker snowflakeIdWorker;
|
|
private SnowflakeIdWorker snowflakeIdWorker;
|
|
|
private ErrorOrderRepo errorOrderRepo;
|
|
private ErrorOrderRepo errorOrderRepo;
|
|
|
|
|
+ private GiftOrderService giftOrderService;
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public GiftOrder gift(Long userId, Long assetId, Long toUserId) {
|
|
public GiftOrder gift(Long userId, Long assetId, Long toUserId) {
|
|
@@ -131,7 +132,8 @@ public class GiftOrderService {
|
|
|
|
|
|
|
|
assetService.transfer(asset, asset.getPrice(), newOwner, "转赠", null);
|
|
assetService.transfer(asset, asset.getPrice(), newOwner, "转赠", null);
|
|
|
} else {
|
|
} else {
|
|
|
- log.error("转赠回调出错 状态错误 orderid={} transactionid={} status={}", orderId, transactionId, giftOrder.getStatus());
|
|
|
|
|
|
|
+ log.error("转赠回调出错 状态错误 orderid={} transactionid={} status={}", orderId, transactionId, giftOrder
|
|
|
|
|
+ .getStatus());
|
|
|
errorOrderRepo.save(ErrorOrder.builder()
|
|
errorOrderRepo.save(ErrorOrder.builder()
|
|
|
.orderId(orderId)
|
|
.orderId(orderId)
|
|
|
.transactionId(transactionId)
|
|
.transactionId(transactionId)
|
|
@@ -223,6 +225,9 @@ public class GiftOrderService {
|
|
|
throw new BusinessException("不支持此渠道");
|
|
throw new BusinessException("不支持此渠道");
|
|
|
}
|
|
}
|
|
|
GiftOrder order = giftOrderRepo.findById(id).orElseThrow(new BusinessException("订单不存在"));
|
|
GiftOrder order = giftOrderRepo.findById(id).orElseThrow(new BusinessException("订单不存在"));
|
|
|
|
|
+ if (order.getGasPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
+ giftOrderService.giftNotify(id, PayMethod.ALIPAY, id.toString());
|
|
|
|
|
+ }
|
|
|
User invitor = null;
|
|
User invitor = null;
|
|
|
if (order.getStatus() != OrderStatus.NOT_PAID) {
|
|
if (order.getStatus() != OrderStatus.NOT_PAID) {
|
|
|
throw new BusinessException("订单状态错误");
|
|
throw new BusinessException("订单状态错误");
|
|
@@ -268,7 +273,8 @@ public class GiftOrderService {
|
|
|
case "alipay_qr":
|
|
case "alipay_qr":
|
|
|
return MapUtils.getString(MapUtils.getMap(response, "expend"), "qrcode_url");
|
|
return MapUtils.getString(MapUtils.getMap(response, "expend"), "qrcode_url");
|
|
|
case "wx_pub":
|
|
case "wx_pub":
|
|
|
- JSONObject payParams = JSON.parseObject(MapUtils.getString(MapUtils.getMap(response, "expend"), "pay_info"));
|
|
|
|
|
|
|
+ JSONObject payParams = JSON
|
|
|
|
|
+ .parseObject(MapUtils.getString(MapUtils.getMap(response, "expend"), "pay_info"));
|
|
|
payParams.put("timestamp", payParams.get("timeStamp"));
|
|
payParams.put("timestamp", payParams.get("timeStamp"));
|
|
|
payParams.remove("timeStamp");
|
|
payParams.remove("timeStamp");
|
|
|
return payParams;
|
|
return payParams;
|