From 9fe8503bd0bb70d6563363f7fe6ceda23f1e05cb Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 30 Aug 2021 21:36:26 +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 --- .../cweb/controller/HighTestController.java | 2 +- .../controller/HighUserCardController.java | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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 e8c42ca4..d5f343ff 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.refund("HF2021061600273071609", new Date().getTime() + "")); + return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.queryCardInfo("HF2021061600273071609").getString("data")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java index 68cad0ac..187102e1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java @@ -189,6 +189,32 @@ public class HighUserCardController { } } + @RequestMapping(value = "/getHuiLianTongCardBalance", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通工会卡余额") + public ResponseData getHuiLianTongCardBalance(@RequestParam(name = "cardNo", required = true) String cardNo,HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + HighUserCard card = highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), cardNo); + if (card == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); + } + + JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); + if (StringUtils.isBlank(cardInfo.getString("data"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); + } + return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data"))); + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardBalance() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录")