From 1327b93cc2554d33413036193477c5fdd3781a89 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 29 Aug 2021 19:50:19 +0800 Subject: [PATCH] =?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-cweb/src/main/java/com/cweb/config/AuthConfig.java | 1 - .../java/com/cweb/controller/HighTestController.java | 2 +- .../java/com/cweb/controller/pay/OrderController.java | 10 +++++----- .../main/java/com/hai/common/security/UserCenter.java | 1 - .../com/hai/service/impl/HighOrderServiceImpl.java | 6 ++++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index 999e0d88..9f9be337 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -109,7 +109,6 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/order/orderToH5Pay") .excludePathPatterns("/order/orderToPay") .excludePathPatterns("/test/*") - .excludePathPatterns("/highUserCard/*") .excludePathPatterns("/cmsContent/*") .excludePathPatterns("/highGas/*") .excludePathPatterns("/outRechargeOrder/*") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index da1b6528..e8c42ca4 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -223,7 +223,7 @@ public class HighTestController { public ResponseData test3() { try { // return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse("T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDMmj1rv5nOrkawWt8fskSihNw0wugKUT1x\\nWjHhIN8af7NylRVfhJvbeja2Zjjxnwk3FEKgyvIvJnk3QgiY4aghqQcGKxDOlAxT/kjrkDd2ESu1\\nIWkpi+0HGnG3rKSL6+a1Nu7aW+rPHwXUOmHSgWFZFb9HhlfKI/jml3GhMZBWsZFirayyMMi8UKrd\\nYN7ANPEB/6uV9iVtpLF5Kz8M2+GpI0EqRhPFAH2u3Q/RSgW8ei2ZbOY9NnbkdwuOjU93wgJxdY1Y\\n93hvLYNe1i9QkSM1")); - return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.queryCardByMobile("15185028745")); + return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.refund("HF2021061600273071609", new Date().getTime() + "")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 0c0d85e8..32f011ea 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -279,9 +279,9 @@ public class OrderController { @ApiOperation(value = "汇联通工会卡支付") public ResponseData hltUnionCardPay(@RequestBody String reqBodyStr,HttpServletRequest request) { try { - // 用户 + /* // 用户 SessionObject sessionObject = userCenter.getSessionObject(request); - HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();*/ if (StringUtils.isBlank(reqBodyStr)) { log.error("orderToPay error!", "参数错误"); @@ -292,7 +292,7 @@ public class OrderController { Long orderId = jsonObject.getLong("orderId"); String password = jsonObject.getString("password"); - if (StringUtils.isBlank(cardNo) || orderId == null) { +/* if (StringUtils.isBlank(cardNo) || orderId == null) { log.error("orderToPay error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } @@ -310,10 +310,10 @@ public class OrderController { if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) { log.error("orderToPay error!", ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, ""); - } + }*/ // 查询用户与卡号的关系 - HighUserCard userCard = highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), cardNo); + HighUserCard userCard = highUserCardService.getDetailByUserCardNo(1L, cardNo); if (userCard == null) { log.error("OrderController --> orderToPay() ERROR", "未绑定卡号"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定卡号"); diff --git a/hai-service/src/main/java/com/hai/common/security/UserCenter.java b/hai-service/src/main/java/com/hai/common/security/UserCenter.java index 3ab19a9c..612a566b 100644 --- a/hai-service/src/main/java/com/hai/common/security/UserCenter.java +++ b/hai-service/src/main/java/com/hai/common/security/UserCenter.java @@ -1,6 +1,5 @@ package com.hai.common.security; -import com.fasterxml.jackson.core.JsonParseException; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; 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 d46a1bfc..9108ca36 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 @@ -279,6 +279,7 @@ 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); @@ -310,6 +311,7 @@ public class HighOrderServiceImpl implements HighOrderService { // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayPrice(), businessType, goodsDesc, tranDesc); + System.out.println(consumption); if(!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } @@ -324,11 +326,11 @@ public class HighOrderServiceImpl implements HighOrderService { order.setMemCardId(userCard.getId()); order.setMemCardNo(userCard.getCardNo()); order.setMemCardType(userCard.getType()); - order.setPaySerialNo(consumption.getString("orderId")); // 支付流水号 + order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号 order.setPayRealPrice(order.getPayPrice()); // 实付金额 order.setPayTime(new Date()); // 支付时间 order.setPayModel(2); // 支付模式:1 金币,2 第三方平台,3 混合 - order.setPayType(2); // 支付方式: 1:支付宝 2:微信 3:金币 + order.setPayType(4); // 支付方式: 1:支付宝 2:微信 3:金币 4:汇联通支工会卡 order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 for (HighChildOrder highChildOrder : order.getHighChildOrderList()) {