提交 9ac670b8 作者: zhenjie

修改关闭订单

上级 88b2ff3e
......@@ -6,6 +6,7 @@ import com.mmc.oms.model.vo.ApplyRefundVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
/**
* @author: zj
......@@ -15,5 +16,5 @@ import org.springframework.web.bind.annotation.RequestBody;
public interface PaymentAppApi {
@PostMapping("wechat/applyRefund")
public ResultBody applyRefund(@RequestBody ApplyRefundVO applyRefundVO);
public ResultBody applyRefund(@RequestBody ApplyRefundVO applyRefundVO, @RequestHeader String token);
}
......@@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PaymentAppApiHystrix implements PaymentAppApi {
@Override
public ResultBody applyRefund(ApplyRefundVO applyRefundVO) {
public ResultBody applyRefund(ApplyRefundVO applyRefundVO, String token) {
log.error("PaymentAppApiHystrix applyRefund ---- param:{}", JSONObject.toJSONString(applyRefundVO));
return ResultBody.error("调用微信退款失败");
}
......
......@@ -281,14 +281,17 @@ public class UavOrderServiceImpl implements UavOrderService {
return resultBody;
}
// 微信退款
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setOutTradeNo(uavOrderDO.getOrderNo());
applyRefundVO.setReason("关闭订单");
applyRefundVO.setRefund(uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).longValue());
ResultBody applyRefund = paymentAppApi.applyRefund(applyRefundVO);
if (!applyRefund.getCode().equals(ResultEnum.SUCCESS.getResultCode())) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new BizException("关闭订单失败!");
if ("wechatpay".equals(uavOrderDO.getPayType())) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setOutTradeNo(uavOrderDO.getOrderNo());
applyRefundVO.setReason("关闭商城订单");
applyRefundVO.setRefund(uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).longValue());
ResultBody applyRefund = paymentAppApi.applyRefund(applyRefundVO, token);
log.info("applyRefund res:{}", applyRefund);
if (!applyRefund.getCode().equals(ResultEnum.SUCCESS.getResultCode())) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new BizException("关闭订单失败!");
}
}
return ResultBody.success();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论