From 12583611d90b792850f6eb162483ae1b520e8951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A6=8F=E8=B4=A2?= <1471584931@qq.com> Date: Thu, 6 Nov 2025 17:16:47 +0800 Subject: [PATCH] =?UTF-8?q?--=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=B2=A1=E6=9C=89=E5=9B=9E=E6=BB=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/pictc/enums/ExceptionCommonCode.java | 11 ++++++++ .../common/db/utils/CommonCallUtils.java | 28 ++++++++++++++++--- pom.xml | 4 +-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/itc-pcitc-dependencies/itc-pcitc-dependencies-api/src/main/java/com/pictc/enums/ExceptionCommonCode.java b/itc-pcitc-dependencies/itc-pcitc-dependencies-api/src/main/java/com/pictc/enums/ExceptionCommonCode.java index 23f152d..746ecab 100644 --- a/itc-pcitc-dependencies/itc-pcitc-dependencies-api/src/main/java/com/pictc/enums/ExceptionCommonCode.java +++ b/itc-pcitc-dependencies/itc-pcitc-dependencies-api/src/main/java/com/pictc/enums/ExceptionCommonCode.java @@ -21,4 +21,15 @@ public interface ExceptionCommonCode { * 执行数据库函数失败 */ final BusinessCode DB_FUNCTION_EXEC_ERROR = BusinessCode.of(10511,"执行数据库函数失败:【{}】"); + + /** + * 执行数据库函数失败 + */ + final BusinessCode DB_FUNCTION_SAVE_EXEC_ERROR = BusinessCode.of(10512,"保存函数失败:【{}】"); + + final BusinessCode DB_FUNCTION_DELETE_EXEC_ERROR = BusinessCode.of(10513,"删除函数失败:【{}】"); + + final BusinessCode DB_FUNCTION_ENABLE_EXEC_ERROR = BusinessCode.of(10514,"启用函数失败:【{}】"); + + final BusinessCode DB_FUNCTION_DISABLE_EXEC_ERROR = BusinessCode.of(10515,"作废函数失败:【{}】"); } diff --git a/itc-pcitc-dependencies/itc-pcitc-dependencies-service/src/main/java/com/xjrsoft/module/common/db/utils/CommonCallUtils.java b/itc-pcitc-dependencies/itc-pcitc-dependencies-service/src/main/java/com/xjrsoft/module/common/db/utils/CommonCallUtils.java index 82585e5..ce62faa 100644 --- a/itc-pcitc-dependencies/itc-pcitc-dependencies-service/src/main/java/com/xjrsoft/module/common/db/utils/CommonCallUtils.java +++ b/itc-pcitc-dependencies/itc-pcitc-dependencies-service/src/main/java/com/xjrsoft/module/common/db/utils/CommonCallUtils.java @@ -3,6 +3,10 @@ package com.xjrsoft.module.common.db.utils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.pictc.enums.BusinessCode; +import com.pictc.enums.ExceptionCommonCode; +import com.pictc.utils.StringUtils; +import com.xjrsoft.common.exception.BusinessException; import com.xjrsoft.module.common.db.service.CommonCallService; /** @@ -31,7 +35,11 @@ public class CommonCallUtils { * @return String 返回类型 函数返回非空、或者数据库异常时rollback,函数返回空时commit; */ public static String saveAfter(String table,long id) { - return callService.saveAfter(table, id); + String error = callService.saveAfter(table, id); + if(StringUtils.isNotEmpty(error)) { + throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_SAVE_EXEC_ERROR,error)); + } + return error; } /** @@ -43,7 +51,11 @@ public class CommonCallUtils { * @return String 返回类型 */ public static String deleteBefore(String table,Long id) { - return callService.deleteBefore(table, id); + String error = callService.deleteBefore(table, id); + if(StringUtils.isNotEmpty(error)) { + throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR,error)); + } + return error; } @@ -56,7 +68,11 @@ public class CommonCallUtils { * @return String 返回类型 */ public static String disableBefore(String table,Long id) { - return callService.disableBefore(table, id); + String error = callService.disableBefore(table, id); + if(StringUtils.isNotEmpty(error)) { + throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DISABLE_EXEC_ERROR,error)); + } + return error; } @@ -68,7 +84,11 @@ public class CommonCallUtils { * @return String 返回类型 */ public static String enableBefore(String table,Long id) { - return callService.enableBefore(table, id); + String error = callService.enableBefore(table, id); + if(StringUtils.isNotEmpty(error)) { + throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_ENABLE_EXEC_ERROR,error)); + } + return error; } diff --git a/pom.xml b/pom.xml index 305c568..bb817c8 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ - 2.0.8 + 2.0.4 UTF-8 UTF-8 8 @@ -43,7 +43,7 @@ com.geg itc-framework-ms - 2.0.8 + ${revision} pom import