|
|
@ -1,6 +1,10 @@ |
|
|
|
package com.hai.service.pay.impl; |
|
|
|
package com.hai.service.pay.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
|
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
|
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
|
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
import com.hai.service.HighOrderService; |
|
|
|
import com.hai.service.HighOrderService; |
|
|
|
import com.hai.service.pay.PayService; |
|
|
|
import com.hai.service.pay.PayService; |
|
|
@ -9,6 +13,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
@ -30,10 +35,25 @@ public class GoodsOrderServiceImpl implements PayService { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (payType.equals("WechatPay")) { |
|
|
|
if (payType.equals("WechatPay")) { |
|
|
|
|
|
|
|
// 查询订单信息
|
|
|
|
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); |
|
|
|
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); |
|
|
|
if (order == null) { |
|
|
|
if (order == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
|
|
|
|
|
|
|
|
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
|
|
|
|
|
|
|
|
order.setPayTime(new Date()); // 支付时间
|
|
|
|
|
|
|
|
order.setPayModel(2); // 支付模式:1 金币,2 第三方平台,3 混合
|
|
|
|
|
|
|
|
order.setPayType(2); // 支付方式: 1:支付宝 2:微信 3:金币
|
|
|
|
|
|
|
|
order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { |
|
|
|
|
|
|
|
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
highOrderService.updateOrder(order); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|