|
|
@ -26,9 +26,11 @@ import com.hai.config.UnionPayConfig; |
|
|
|
import com.hai.entity.HighCoupon; |
|
|
|
import com.hai.entity.HighCoupon; |
|
|
|
import com.hai.entity.HighRefundAudit; |
|
|
|
import com.hai.entity.HighRefundAudit; |
|
|
|
import com.hai.entity.OutRechargeOrder; |
|
|
|
import com.hai.entity.OutRechargeOrder; |
|
|
|
|
|
|
|
import com.hai.entity.OutRechargeOrderRecord; |
|
|
|
import com.hai.model.*; |
|
|
|
import com.hai.model.*; |
|
|
|
import com.hai.service.HighRefundAuditService; |
|
|
|
import com.hai.service.HighRefundAuditService; |
|
|
|
import com.hai.service.HighUserService; |
|
|
|
import com.hai.service.HighUserService; |
|
|
|
|
|
|
|
import com.hai.service.OutRechargeOrderRecordService; |
|
|
|
import com.hai.service.OutRechargeOrderService; |
|
|
|
import com.hai.service.OutRechargeOrderService; |
|
|
|
import com.hai.service.pay.impl.GoodsOrderServiceImpl; |
|
|
|
import com.hai.service.pay.impl.GoodsOrderServiceImpl; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
@ -70,6 +72,9 @@ public class OutRechargeOrderController { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighUserService highUserService; |
|
|
|
private HighUserService highUserService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private OutRechargeOrderRecordService rechargeOrderRecordService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getOrderById", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/getOrderById", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
@ -575,24 +580,36 @@ public class OutRechargeOrderController { |
|
|
|
@RequestParam(name = "orderId", required = true) Long orderId) { |
|
|
|
@RequestParam(name = "orderId", required = true) Long orderId) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderId(orderId); |
|
|
|
OutRechargeOrderRecord rechargeOrderRecord = rechargeOrderRecordService.findByOrderId(orderId); |
|
|
|
|
|
|
|
if (rechargeOrderRecord == null) { |
|
|
|
|
|
|
|
rechargeOrderRecord = new OutRechargeOrderRecord(); |
|
|
|
|
|
|
|
// 查询订单
|
|
|
|
|
|
|
|
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); |
|
|
|
|
|
|
|
if (order.getRechargeType() != null) { |
|
|
|
String orderNo = "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5); |
|
|
|
String orderNo = "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5); |
|
|
|
|
|
|
|
JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , orderNo , order.getRechargeType()); |
|
|
|
JSONObject object = outRechargeOrderService.getMobile(outRechargeOrder.getRechargeContent(),outRechargeOrder.getOrderPrice().intValue(),orderNo , outRechargeOrder.getRechargeType()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (object.getInteger("code") != 200) { |
|
|
|
if (object.getInteger("code") != 200) { |
|
|
|
log.error("getMobileRechargeByOrderId error!", "充值失败"); |
|
|
|
order.setRechargeStatus(1); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); |
|
|
|
order.setAbnormalMsg(object.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
outRechargeOrderService.updateOrder(order); |
|
|
|
|
|
|
|
rechargeOrderRecord.setRechargeOrderId(order.getId()); |
|
|
|
|
|
|
|
rechargeOrderRecord.setRechargeOrderNo(orderNo); |
|
|
|
|
|
|
|
rechargeOrderRecord.setCreateTime(new Date()); |
|
|
|
|
|
|
|
rechargeOrderRecord.setStatus(1); |
|
|
|
|
|
|
|
rechargeOrderRecordService.insertOrder(rechargeOrderRecord); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 查询订单
|
|
|
|
|
|
|
|
OutRechargeOrder order = outRechargeOrderService.findByOrderId(rechargeOrderRecord.getRechargeOrderId()); |
|
|
|
|
|
|
|
if (order.getStatus() == 2) { |
|
|
|
|
|
|
|
outRechargeOrderService.rechargeOrderToRefund(order.getId()); |
|
|
|
|
|
|
|
order.setStatus(5); |
|
|
|
|
|
|
|
outRechargeOrderService.updateOrder(order); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
outRechargeOrder.setRechargeStatus(2); |
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
|
|
|
|
|
|
|
|
outRechargeOrder.setOrderNo(orderNo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outRechargeOrderService.updateOrder(outRechargeOrder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("请求成功"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); |
|
|
|
log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); |
|
|
|