|
|
@ -812,8 +812,28 @@ public class HighGasController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,未找到加油站信息"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,未找到加油站信息"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { |
|
|
|
|
|
|
|
JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent")); |
|
|
|
|
|
|
|
if (object == null || !object.getString("code").equals("200")) { |
|
|
|
|
|
|
|
log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败," + object.getString("message")); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败," + object.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
order.setOrderStatus(6); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { |
|
|
|
|
|
|
|
JSONObject object = shellGroupService.gasSyncRefund(order.getPayTime(), order.getOrderNo()); |
|
|
|
|
|
|
|
if (!object.getString("status").equals("SUCCESS")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,原因:" + object.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
order.setOrderStatus(6); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
// 来源类型 1:平台自建 2:团油
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) { |
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber()) |
|
|
|
|
|
|
|
|| store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { |
|
|
|
|
|
|
|
|
|
|
|
if (order.getPayType() == 2) { |
|
|
|
if (order.getPayType() == 2) { |
|
|
|
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getAccountMerchantNum(), order.getPayRealPrice()); |
|
|
|
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getAccountMerchantNum(), order.getPayRealPrice()); |
|
|
@ -850,6 +870,8 @@ public class HighGasController { |
|
|
|
oilCardService.refund(order.getOrderNo()); |
|
|
|
oilCardService.refund(order.getOrderNo()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 预存类型 0:非预存 1:预存门店
|
|
|
|
|
|
|
|
if (store.getPrestoreType().equals(1)) { |
|
|
|
Map<String, Object> pushParam = new HashMap<>(); |
|
|
|
Map<String, Object> pushParam = new HashMap<>(); |
|
|
|
pushParam.put("businessType", MerStoreAmountTypeEnum.type1.getType()); |
|
|
|
pushParam.put("businessType", MerStoreAmountTypeEnum.type1.getType()); |
|
|
|
pushParam.put("storeId", store.getId()); |
|
|
|
pushParam.put("storeId", store.getId()); |
|
|
@ -861,28 +883,12 @@ public class HighGasController { |
|
|
|
pushParam.put("opUserName", userInfoModel.getSecUser().getUserName()); |
|
|
|
pushParam.put("opUserName", userInfoModel.getSecUser().getUserName()); |
|
|
|
// 退款到预存余额
|
|
|
|
// 退款到预存余额
|
|
|
|
this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); |
|
|
|
this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
order.setOrderStatus(4); |
|
|
|
order.setOrderStatus(4); |
|
|
|
order.setRefundTime(new Date()); |
|
|
|
order.setRefundTime(new Date()); |
|
|
|
order.setRefundContent(body.getString("refundContent")); |
|
|
|
order.setRefundContent(body.getString("refundContent")); |
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { |
|
|
|
|
|
|
|
JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent")); |
|
|
|
|
|
|
|
if (object == null || !object.getString("code").equals("200")) { |
|
|
|
|
|
|
|
log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败," + object.getString("message")); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败," + object.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
order.setOrderStatus(6); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { |
|
|
|
|
|
|
|
JSONObject object = shellGroupService.gasSyncRefund(order.getPayTime(), order.getOrderNo()); |
|
|
|
|
|
|
|
if (!object.getString("status").equals("SUCCESS")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,原因:" + object.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
order.setOrderStatus(6); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|