|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.hai.service.pay.impl; |
|
|
|
package com.hai.service.pay.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
@ -10,6 +11,7 @@ import com.hai.common.pay.util.sdk.WXPayConstants; |
|
|
|
import com.hai.common.utils.WxUtils; |
|
|
|
import com.hai.common.utils.WxUtils; |
|
|
|
import com.hai.config.CommonSysConst; |
|
|
|
import com.hai.config.CommonSysConst; |
|
|
|
import com.hai.config.HuiLianTongConfig; |
|
|
|
import com.hai.config.HuiLianTongConfig; |
|
|
|
|
|
|
|
import com.hai.config.HuiLianTongUnionCardConfig; |
|
|
|
import com.hai.config.TuanYouConfig; |
|
|
|
import com.hai.config.TuanYouConfig; |
|
|
|
import com.hai.dao.HighCouponCodeOtherMapper; |
|
|
|
import com.hai.dao.HighCouponCodeOtherMapper; |
|
|
|
import com.hai.dao.HighDiscountPackageRecordMapper; |
|
|
|
import com.hai.dao.HighDiscountPackageRecordMapper; |
|
|
@ -259,6 +261,8 @@ public class GoodsOrderServiceImpl implements PayService { |
|
|
|
|
|
|
|
|
|
|
|
if (highChildOrder.getGoodsType() == 2) { |
|
|
|
if (highChildOrder.getGoodsType() == 2) { |
|
|
|
highChildOrder.setChildOrdeStatus(3); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
highChildOrder.setChildOrdeStatus(3); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
|
|
|
|
order.setFinishTime(new Date()); |
|
|
|
|
|
|
|
order.setOrderStatus(3); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
// 金币 1:100
|
|
|
|
// 金币 1:100
|
|
|
|
Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); |
|
|
|
Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); |
|
|
|
highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); |
|
|
|
highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); |
|
|
@ -327,6 +331,51 @@ public class GoodsOrderServiceImpl implements PayService { |
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(actual); |
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(actual); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (highChildOrder.getGoodsType() == 8) { |
|
|
|
|
|
|
|
// 汇联通充值
|
|
|
|
|
|
|
|
String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; |
|
|
|
|
|
|
|
String tranDesc = ""; |
|
|
|
|
|
|
|
String businessType = "ghk_deposit"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 汇联通卡充值
|
|
|
|
|
|
|
|
JSONObject deposit = HuiLianTongUnionCardConfig.deposit(order.getOrderNo(), order.getMemCardNo(), order.getPayPrice(), businessType, map.get("transaction_id"), tranDesc); |
|
|
|
|
|
|
|
System.out.println("工会卡支付响应参数" + deposit.toJSONString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<>(); |
|
|
|
|
|
|
|
dataMap.put("orderNo", order.getOrderNo()); |
|
|
|
|
|
|
|
dataMap.put("cardType", "ghk"); |
|
|
|
|
|
|
|
dataMap.put("cardNo", order.getMemCardNo()); |
|
|
|
|
|
|
|
dataMap.put("checkPassword", "N"); |
|
|
|
|
|
|
|
dataMap.put("tranAmount", order.getPayPrice()); |
|
|
|
|
|
|
|
dataMap.put("tranChannel", "HiSen"); |
|
|
|
|
|
|
|
dataMap.put("businessType", businessType); |
|
|
|
|
|
|
|
dataMap.put("goodsDesc", goodsDesc); |
|
|
|
|
|
|
|
dataMap.put("tranDesc", tranDesc); |
|
|
|
|
|
|
|
HighGasOrderPush payPush = new HighGasOrderPush(); |
|
|
|
|
|
|
|
payPush.setType(OrderPushType.type5.getType()); |
|
|
|
|
|
|
|
payPush.setOrderNo(order.getOrderNo()); |
|
|
|
|
|
|
|
payPush.setCreateTime(new Date()); |
|
|
|
|
|
|
|
payPush.setCode(deposit.getString("respCode")); |
|
|
|
|
|
|
|
payPush.setRequestContent(JSON.toJSONString(dataMap)); |
|
|
|
|
|
|
|
payPush.setReturnContent(deposit.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPushMapper.insert(payPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(deposit.getString("respCode"), "0000")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , deposit.getString("respMessage")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 记录回调信息
|
|
|
|
|
|
|
|
if (!dataObject.getBoolean("success")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 修改订单状态
|
|
|
|
|
|
|
|
highChildOrder.setChildOrdeStatus(3); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
|
|
|
|
order.setFinishTime(new Date()); |
|
|
|
|
|
|
|
order.setOrderStatus(3); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
highOrderService.updateOrder(order); |
|
|
|
highOrderService.updateOrder(order); |
|
|
|