提交代码

dev-discount
胡锐 2 years ago
parent 44e3361d27
commit 0f29439608
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 13
      hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java

File diff suppressed because one or more lines are too long

@ -191,22 +191,25 @@ public class OrderRefundServiceImpl implements OrderRefundService {
startTime.set(Calendar.SECOND, 59); startTime.set(Calendar.SECOND, 59);
// 订单是否处于当日的订单 // 订单是否处于当日的订单
if (!DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) { if (DateUtil.format(order.getPayTime(), "yyyy-MM-dd").equals(DateUtil.format(new Date(), "yyyy-MM-dd"))) {
// 订单撤销 // 订单撤销
JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo()); JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo());
System.out.println(refund.toJSONString()); System.out.println(refund.toJSONString());
if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { if (refund.getString("resultcode").equals("00") || refund.getString("resultcode").equals("W6")) {
refundPriceModel.setRefundSuccess(true);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
} }
refundPriceModel.setRefundSuccess(true);
} else { } else {
// 订单退款 // 订单退款
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
System.out.println(refund.toJSONString()); System.out.println(refund.toJSONString());
if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { if (refund.getString("resultcode").equals("00") || refund.getString("resultcode").equals("W6")) {
refundPriceModel.setRefundSuccess(true);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
} }
refundPriceModel.setRefundSuccess(true);
} }
} else if (orderPayType.getNumber().equals(OrderPayType.PAY_TYPE7.getNumber())) { } else if (orderPayType.getNumber().equals(OrderPayType.PAY_TYPE7.getNumber())) {
// 油卡退款 // 油卡退款

Loading…
Cancel
Save