|
|
@ -184,11 +184,11 @@ 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.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) { |
|
|
|
// 订单撤销
|
|
|
|
// 订单撤销
|
|
|
|
JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo()); |
|
|
|
JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, 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")) { |
|
|
|
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); |
|
|
|
refundPriceModel.setRefundSuccess(true); |
|
|
@ -196,11 +196,8 @@ public class OrderRefundServiceImpl implements OrderRefundService { |
|
|
|
// 订单退款
|
|
|
|
// 订单退款
|
|
|
|
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); |
|
|
|
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, 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")) { |
|
|
|
JSONObject refund2 = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID1, UnionPayConfig.TERM_ID1, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); |
|
|
|
if (!refund2.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund2.getString("returnmsg")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
refundPriceModel.setRefundSuccess(true); |
|
|
|
refundPriceModel.setRefundSuccess(true); |
|
|
|
} |
|
|
|
} |
|
|
|