|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.hai.service.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.hai.common.QRCodeGenerator; |
|
|
|
@ -283,12 +284,10 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
@Override |
|
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW) |
|
|
|
|
public void hltUnionCardPay(Long userCardId, Long orderId) throws Exception { |
|
|
|
|
|
|
|
|
|
HighUserCard userCard = highUserCardService.getDetailById(userCardId); |
|
|
|
|
if(userCard == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户绑定的卡号信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询订单信息
|
|
|
|
|
HighOrder order = getOrderById(orderId); |
|
|
|
|
if (order == null) { |
|
|
|
@ -296,9 +295,11 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
} |
|
|
|
|
String goodsDesc = ""; |
|
|
|
|
String tranDesc = ""; |
|
|
|
|
String instCode = "11101290"; |
|
|
|
|
String businessType = "hisen_consume"; |
|
|
|
|
|
|
|
|
|
if (order.getHighChildOrderList().get(0).getGoodsType() == 1) { |
|
|
|
|
instCode = "11101291"; |
|
|
|
|
businessType = "sinopec_oil_code"; |
|
|
|
|
goodsDesc = "购买加油券"; |
|
|
|
|
tranDesc = order.getHighChildOrderList().get(0).getGoodsName(); |
|
|
|
@ -310,14 +311,13 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) { |
|
|
|
|
goodsDesc = "加油站加"+order.getPayPrice()+"元油"; |
|
|
|
|
tranDesc = "【"+order.getHighChildOrderList().get(0).getGoodsName()+"】加油"+order.getPayPrice()+"元"; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,请使用其他支付方式"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 工会卡支付
|
|
|
|
|
JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, goodsDesc, tranDesc); |
|
|
|
|
System.out.println(consumption); |
|
|
|
|
JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc); |
|
|
|
|
System.out.println("工会卡支付响应参数" + consumption.toJSONString()); |
|
|
|
|
if(!consumption.getString("respCode").equals("0000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); |
|
|
|
|
} |
|
|
|
|