parent
72731caed5
commit
7f380994a4
@ -0,0 +1,52 @@ |
||||
package com.hai.service.pay.impl; |
||||
|
||||
import com.hai.config.QianZhuConfig; |
||||
import com.hai.entity.HighChildOrder; |
||||
import com.hai.entity.HighOrder; |
||||
import com.hai.service.HighOrderService; |
||||
import com.hai.service.pay.PayService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hurui |
||||
* @version 1.0 |
||||
* @ClassName MobileOrderServiceImpl |
||||
* @description: TODO |
||||
* @date 2021/7/24 15:51 |
||||
*/ |
||||
@Service("mobileOrderService") |
||||
public class MobileOrderServiceImpl implements PayService { |
||||
|
||||
@Resource |
||||
private HighOrderService highOrderService; |
||||
|
||||
@Override |
||||
public void paySuccess(Map<String, String> map, String payType) throws Exception { |
||||
if (payType.equals("Alipay")) { |
||||
return; |
||||
} |
||||
if (payType.equals("WechatPay")) { |
||||
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); |
||||
if (order != null && order.getOrderStatus() == 1) { |
||||
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 childOrder : order.getHighChildOrderList()) { |
||||
childOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
||||
} |
||||
highOrderService.updateOrder(order); |
||||
// 支付给千猪
|
||||
QianZhuConfig.payMobileOrder(order.getOrderNo()); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue