|
|
@@ -1120,26 +1120,29 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- Map<String, String> params=new HashMap<>();
|
|
|
- params.put("payType", "1".equals(order.getPayType()) ? "alipay" : "wechatPay");
|
|
|
- params.put("outTradeNo",order.getAlipayNo());
|
|
|
- params.put("totalAmount", String.valueOf(order.getOrderAmount()));
|
|
|
+ if (order.getOrderStatus() == 1 ) {
|
|
|
+ Map<String, String> params=new HashMap<>();
|
|
|
+ params.put("payType", "1".equals(order.getPayType()) ? "alipay" : "wechatPay");
|
|
|
+ params.put("outTradeNo",order.getAlipayNo());
|
|
|
+ params.put("totalAmount", String.valueOf(order.getOrderAmount()));
|
|
|
|
|
|
params.put("refundAmount", String.valueOf(order.getOrderAmount()));
|
|
|
- if ("1".equals( order.getPayType())){
|
|
|
- params.put("refundAmount", new BigDecimal(order.getOrderAmount()).divide(new BigDecimal(100)).toString());
|
|
|
- }
|
|
|
+ if ("1".equals( order.getPayType())){
|
|
|
+ params.put("refundAmount", new BigDecimal(order.getOrderAmount()).divide(new BigDecimal(100)).toString());
|
|
|
+ }
|
|
|
|
|
|
- if ("2".equals( order.getPayType())){
|
|
|
- params.put("refundReason", "用户取消订单");
|
|
|
- }
|
|
|
+ if ("2".equals( order.getPayType())){
|
|
|
+ params.put("refundReason", "用户取消订单");
|
|
|
+ }
|
|
|
|
|
|
- String refundResult =paymentStrategyFactory.getStrategy(params.get("payType")).handleRefund(params);
|
|
|
+ String refundResult =paymentStrategyFactory.getStrategy(params.get("payType")).handleRefund(params);
|
|
|
|
|
|
- if (!"调用成功".equals(refundResult)){
|
|
|
- log.warn("取消订单失败:订单取消失败,订单ID={}, 订单编号={}", id, order.getOrderNumber());
|
|
|
- return false;
|
|
|
+ if (!"调用成功".equals(refundResult)){
|
|
|
+ log.warn("取消订单失败:订单取消失败,订单ID={}, 订单编号={}", id, order.getOrderNumber());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// 3. 订单状态校验
|
|
|
Integer orderStatus = order.getOrderStatus();
|
|
|
String orderNumber = order.getOrderNumber();
|