From bee26daf768522244dd0c8c29ed14ba8278dec04 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 7 Aug 2024 17:06:36 +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 --- .../com/cweb/controller/CommonController.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java index c1c8dea..dc60b0b 100644 --- a/cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -12,6 +12,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.qianzhu.channel.QianZhuService; import com.hfkj.service.CommonService; import com.hfkj.service.goods.BsOrderGoodsService; +import com.hfkj.service.hlt.HuiLianTongUnionCardService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -40,6 +41,28 @@ public class CommonController { @Resource private BsOrderGoodsService bsOrderGoodsService; + @RequestMapping(value = "/test", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "test") + public ResponseData test() { + try { + + JSONObject refundObj = HuiLianTongUnionCardService.refund("R240805090735776", "240803201355633339"); + if (!refundObj.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); + } + JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); + if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); + } + return ResponseMsgUtil.success(consumptionResult); + + } catch (Exception e) { + log.error("HighUserCardController --> oilCardRefund() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/getAllCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询所有城市")