提交 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,15 +281,18 @@ public class UavOrderServiceImpl implements UavOrderService { ...@@ -281,15 +281,18 @@ public class UavOrderServiceImpl implements UavOrderService {
return resultBody; return resultBody;
} }
// 微信退款 // 微信退款
if ("wechatpay".equals(uavOrderDO.getPayType())) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO(); ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setOutTradeNo(uavOrderDO.getOrderNo()); applyRefundVO.setOutTradeNo(uavOrderDO.getOrderNo());
applyRefundVO.setReason("关闭订单"); applyRefundVO.setReason("关闭商城订单");
applyRefundVO.setRefund(uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).longValue()); applyRefundVO.setRefund(uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).longValue());
ResultBody applyRefund = paymentAppApi.applyRefund(applyRefundVO); ResultBody applyRefund = paymentAppApi.applyRefund(applyRefundVO, token);
log.info("applyRefund res:{}", applyRefund);
if (!applyRefund.getCode().equals(ResultEnum.SUCCESS.getResultCode())) { if (!applyRefund.getCode().equals(ResultEnum.SUCCESS.getResultCode())) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new BizException("关闭订单失败!"); throw new BizException("关闭订单失败!");
} }
}
return ResultBody.success(); return ResultBody.success();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论