From 186e6a59e89eef7d7d9d328a789040932cbf45bc Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Tue, 3 Jun 2025 10:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=9A=84=E8=B4=B9=E7=8E=87=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E9=95=BF=E6=9C=9F=E8=BA=AB=E4=BB=BD=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E5=8F=B7=E7=A0=81=E4=B8=BA9999-12-31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/GlobalExceptionHandler.java | 33 +++++------------- .../service/impl/LakalaApiServiceImpl.java | 8 ++--- .../lakala/service/impl/LklTkServiceImpl.java | 7 ++-- .../service/impl/ShopMchEntryServiceImpl.java | 34 +++++++++++++++---- .../src/main/resources/bootstrap-dev.yml | 1 + .../src/main/resources/bootstrap-local.yml | 1 + .../src/main/resources/bootstrap-prod.yml | 1 + .../src/main/resources/bootstrap-test.yml | 1 + .../src/main/resources/bootstrap-uat.yml | 1 + 9 files changed, 49 insertions(+), 38 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/exception/GlobalExceptionHandler.java b/mall-common/src/main/java/com/suisung/mall/common/exception/GlobalExceptionHandler.java index 0f7d1f78..cd615e1e 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/exception/GlobalExceptionHandler.java +++ b/mall-common/src/main/java/com/suisung/mall/common/exception/GlobalExceptionHandler.java @@ -21,8 +21,6 @@ public class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) public CommonResult exceptionHandler(HttpServletRequest req, Exception e) { - - // 获取异常的第一帧堆栈信息 StackTraceElement[] stackTrace = e.getStackTrace(); String location = "未知位置"; @@ -42,28 +40,17 @@ public class GlobalExceptionHandler { location, e); - return CommonResult.failed("系统异常:" + location); - -// logger.error("Exception全局异常捕获-" + e.getMessage(), e); -// return CommonResult.failed(); + return CommonResult.failed("系统异常:" + e.getMessage()); } @ExceptionHandler(value = ApiException.class) public CommonResult exceptionHandler(HttpServletRequest req, ApiException e) { -// IErrorCode errorCode = e.getErrorCode(); -// String message = e.getMessage(); -// logger.error("ApiException全局异常捕获-" + e.getMessage(), e); -// if (errorCode != null) { -// return CommonResult.failed(errorCode); -// } else if (StrUtil.isNotBlank(message)) { -// return CommonResult.failed(message); -// } else { -// return CommonResult.failed(ResultCode.FAILED); -// } - // 获取异常位置信息 StackTraceElement[] stackTrace = e.getStackTrace(); - String location = "未知位置"; + String location = "未知错误位置"; + + IErrorCode errorCode = e.getErrorCode(); + String message = e.getMessage(); if (stackTrace.length > 0) { StackTraceElement element = stackTrace[0]; // 第一个异常抛出点 @@ -74,20 +61,18 @@ public class GlobalExceptionHandler { ); } - IErrorCode errorCode = e.getErrorCode(); - String message = e.getMessage(); - logger.error("Exception全局异常捕获 URI: {} - Method: {} - Error: {} at {}", + logger.error("Exception全局异常捕获 URI:{} - Method:{} - Error:{} at {}", req.getRequestURI(), req.getMethod(), - e.getMessage(), + message, location, e); if (errorCode != null) { - return CommonResult.failed(errorCode); + return CommonResult.failed(message); } else if (StrUtil.isNotBlank(message)) { - return CommonResult.failed("业务异常:" + message + " [" + location + "]"); + return CommonResult.failed("系统异常:" + message + " [" + location + "]"); } else { return CommonResult.failed(ResultCode.FAILED); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java index e0dcd8ce..9783f394 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java @@ -89,6 +89,8 @@ public class LakalaApiServiceImpl implements LakalaApiService { private String orgCode; @Value("${lakala.tk.split_lowest_ratio}") private String splitLowestRatio; + @Value("${lakala.tk.wx_fee}") + private String wxFee; @Value("${project.domain}") private String projectDomain; @Value("${spring.profiles.active}") @@ -546,13 +548,9 @@ public class LakalaApiServiceImpl implements LakalaApiService { String signDate = today.getYear() + "-" + today.getMonthValue() + "-" + today.getDayOfMonth(); String platformName = "桂平发发网络有限公司"; - String ratioNum = "0.6"; - if (isLklProd) { - ratioNum = "0.25"; - } JSONObject ecParams = new JSONObject(); ecParams.put("A1", isQy ? shopMchEntry.getBiz_license_company() : shopMchEntry.getAccount_holder_name()); - ecParams.put("A30", ratioNum); // 测试环境微信费率0.6 + ecParams.put("A30", wxFee); // 测试环境微信费率0.6 ecParams.put("A96", "1"); ecParams.put("A97", "是"); ecParams.put("A100", "是"); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index c4f7e15f..e64e38e5 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -68,6 +68,9 @@ public class LklTkServiceImpl { @Value("${lakala.tk.notify_pub_key_path}") private String notifyPubKeyPath; + @Value("${lakala.tk.wx_fee}") + private String wxFee; + @Value("${spring.profiles.active}") private String profile; @@ -398,7 +401,7 @@ public class LklTkServiceImpl { formData.put("countyCode", areaCode.get("countyCode")); } - //结算信息省市信息 + //银行结算信息省市信息 if (StrUtil.isBlank(shopMchEntry.getBank_district()) || StrUtil.isBlank(shopMchEntry.getBank_area())) { Map bankInfo = lklBanksService.GetLklBankByBranchBankNo(shopMchEntry.getOpenning_bank_code()); if (ObjectUtil.isNotEmpty(bankInfo)) { @@ -439,7 +442,7 @@ public class LklTkServiceImpl { put(new JSONObject() { { put("feeCode", "WECHAT"); - put("feeValue", 0.6); + put("feeValue", wxFee); } }); }}); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java index 8cc91495..c76c2195 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java @@ -166,16 +166,26 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl