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