提交 9ac670b8 作者: zhenjie

修改关闭订单

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