From 8b44f5cdbc947529bc3552cceeae64b354687c08 Mon Sep 17 00:00:00 2001 From: sushuai <sushuai@tsugami.com.cn> Date: 星期二, 10 九月 2024 12:05:08 +0800 Subject: [PATCH] 修复:工作流中(我的待办、我的已办、我的抄送默认)的分页查询语句不兼容sqlserver的问题 --- ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/SysUserImportListener.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/SysUserImportListener.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/SysUserImportListener.java index c20a4ec..1ea8f2d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/SysUserImportListener.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/SysUserImportListener.java @@ -5,8 +5,11 @@ import cn.hutool.crypto.digest.BCrypt; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.SpringUtils; +import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.excel.core.ExcelListener; import org.dromara.common.excel.core.ExcelResult; @@ -80,7 +83,11 @@ } catch (Exception e) { failureNum++; String msg = "<br/>" + failureNum + "銆佽处鍙� " + userVo.getUserName() + " 瀵煎叆澶辫触锛�"; - failureMsg.append(msg).append(e.getMessage()); + String message = e.getMessage(); + if (e instanceof ConstraintViolationException cvException) { + message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", "); + } + failureMsg.append(msg).append(message); log.error(msg, e); } } -- Gitblit v1.9.3