From 9df92e3f84c7ea42333a8f8b18590947406856c0 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 10 Jan 2022 10:29:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hai/service/impl/HighCouponAgentServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java index 346fdd80..c23d15e9 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java @@ -429,7 +429,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { } HighCouponCode couponCode = codeList.get(0); couponCode.setIsAssignAgent(true); - couponCode.setAgentId(couponCode.getAgentId()); + couponCode.setAgentId(convertCode.getAgentId()); couponCode.setReceiveTime(new Date()); couponCode.setStatus(2); highCouponCodeService.updateCouponCode(couponCode); From 7c3207e6b2708ee10d4cad5b3d7ce2702d92fa60 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 10 Jan 2022 11:26:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hai/service/OutRechargeOrderService.java | 2 +- .../service/impl/HighOrderServiceImpl.java | 2 +- .../impl/OutRechargeOrderServiceImpl.java | 106 +++++++++--------- 3 files changed, 53 insertions(+), 57 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java index 2ee2d377..257d5905 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java @@ -112,7 +112,7 @@ public interface OutRechargeOrderService { * 汇联通支付 * @param orderId */ - void hltUnionCardPay(Long userCardId, Long orderId); + void hltUnionCardPay(Long userCardId, Long orderId) throws Exception; /** * 积分支付 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index a0d2571d..e216cd39 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -450,7 +450,7 @@ public class HighOrderServiceImpl implements HighOrderService { } JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } // 查询用户 diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index 30396e80..45651e07 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -262,62 +262,58 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { } @Override - public void hltUnionCardPay(Long userCardId, Long orderId) { - try { - HighUserCard userCard = highUserCardService.getDetailById(userCardId); - if(userCard == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户绑定的卡号信息"); - } - OutRechargeOrder order = findByOrderId(orderId); - if (order == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); - } - - String goodsDesc = "充值话费"; - String tranDesc = order.getRechargeContent() + "充值" + order.getPayPrice() +"元话费"; - String instCode = "11101290"; - String businessType = "hisen_consume"; - - // 工会卡支付 - JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc); - System.out.println("工会卡支付响应参数" + consumption.toJSONString()); - - Map dataMap = new HashMap<>(); - dataMap.put("orderNo", order.getOrderNo()); - dataMap.put("cardType", "ghk"); - dataMap.put("cardNo", userCard.getCardNo()); - dataMap.put("checkPassword", "N"); - dataMap.put("tranAmount", order.getPayPrice()); - dataMap.put("tranChannel", "HiSen"); - dataMap.put("businessType", businessType); - dataMap.put("instCode", instCode); - dataMap.put("goodsDesc", goodsDesc); - dataMap.put("tranDesc", tranDesc); - HighGasOrderPush payPush = new HighGasOrderPush(); - payPush.setType(OrderPushType.type5.getType()); - payPush.setOrderNo(userCard.getCardNo()); - payPush.setCreateTime(new Date()); - payPush.setCode(consumption.getString("respCode")); - payPush.setRequestContent(JSON.toJSONString(dataMap)); - payPush.setReturnContent(consumption.toJSONString()); - highGasOrderPushMapper.insert(payPush); - - if(!consumption.getString("respCode").equals("0000")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); - } - JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); - if (consumptionResult.getBoolean("success") != true) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); - } - order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号 - order.setPayRealPrice(order.getPayPrice()); // 实付金额 - order.setStatus(2); - order.setPayType(2); - order.setPayTime(new Date()); // 支付时间 - updateOrder(order); - } catch (Exception e) { - e.printStackTrace(); + 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, "未找到用户绑定的卡号信息"); + } + OutRechargeOrder order = findByOrderId(orderId); + if (order == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); + } + + String goodsDesc = "充值话费"; + String tranDesc = order.getRechargeContent() + "充值" + order.getPayPrice() +"元话费"; + String instCode = "11101290"; + String businessType = "hisen_consume"; + + // 工会卡支付 + JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, instCode, goodsDesc, tranDesc); + System.out.println("工会卡支付响应参数" + consumption.toJSONString()); + + Map dataMap = new HashMap<>(); + dataMap.put("orderNo", order.getOrderNo()); + dataMap.put("cardType", "ghk"); + dataMap.put("cardNo", userCard.getCardNo()); + dataMap.put("checkPassword", "N"); + dataMap.put("tranAmount", order.getPayPrice()); + dataMap.put("tranChannel", "HiSen"); + dataMap.put("businessType", businessType); + dataMap.put("instCode", instCode); + dataMap.put("goodsDesc", goodsDesc); + dataMap.put("tranDesc", tranDesc); + HighGasOrderPush payPush = new HighGasOrderPush(); + payPush.setType(OrderPushType.type5.getType()); + payPush.setOrderNo(userCard.getCardNo()); + payPush.setCreateTime(new Date()); + payPush.setCode(consumption.getString("respCode")); + payPush.setRequestContent(JSON.toJSONString(dataMap)); + payPush.setReturnContent(consumption.toJSONString()); + highGasOrderPushMapper.insert(payPush); + + if(!consumption.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } + JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); + if (consumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); + } + order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号 + order.setPayRealPrice(order.getPayPrice()); // 实付金额 + order.setStatus(2); + order.setPayType(2); + order.setPayTime(new Date()); // 支付时间 + updateOrder(order); } @Override