From 6c1194a66ce35b35daf649456e945d0dadeaa751 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 2 Aug 2024 16:06:22 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=80=9A=E7=94=A8=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E4=BF=AE=E6=94=B9activiti=E5=92=8CframeWo?= =?UTF-8?q?rk=E4=B8=A4=E4=B8=AA=E6=A8=A1=E5=9D=97=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96=E5=85=B3=E7=B3=BB=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=85=A8=E5=B1=80=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=8D=95=E8=8E=B7activiti=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=BC=82=E5=B8=B8=20=E4=BF=AE=E6=94=B9=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E4=BF=AE=E6=94=B9=E5=8D=95=E6=96=B0=E5=A2=9E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=BC=80=E5=8F=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8D=95=E6=8F=90=E4=BA=A4=E6=8C=89=E9=92=AE=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=B8=A6=E6=98=9F=E5=8F=B7?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E9=9C=80=E8=A6=81=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D=E5=A1=AB=E5=B0=B1=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-activiti/pom.xml | 11 +++++++---- .../templates/erp/developModifyOrder/add.html | 2 ++ ruoyi-framework/pom.xml | 5 +++++ .../web/exception/GlobalExceptionHandler.java | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ruoyi-activiti/pom.xml b/ruoyi-activiti/pom.xml index 3d8e1309..eb863aef 100644 --- a/ruoyi-activiti/pom.xml +++ b/ruoyi-activiti/pom.xml @@ -16,10 +16,13 @@ activiti-spring-boot-starter-rest-api ${activiti.version} - - com.ruoyi - ruoyi-framework - + + + + + + + com.ruoyi ruoyi-system diff --git a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html index 99928923..2d724d2b 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html @@ -110,6 +110,7 @@ // 新增提交 function submitHandler() { + if ($.validate.form()) { // 获取表单数据 const developModifyOrderData = $("#form-developModifyOrder-add").serializeArray().reduce((obj, item) => { obj[item.name] = item.value; @@ -174,6 +175,7 @@ const jsonData = JSON.stringify(combinedData); // 发送 AJAX 请求到后端接口 $.operate.saveJson(prefix + "/add", jsonData); + } } diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index 4785ff9e..7382826f 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -77,6 +77,11 @@ ruoyi-system + + com.ruoyi + ruoyi-activiti + 4.6.1 + \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index 2ff35774..64a7ef43 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -1,6 +1,8 @@ package com.ruoyi.framework.web.exception; import javax.servlet.http.HttpServletRequest; + +import org.activiti.engine.ActivitiException; import org.apache.shiro.authz.AuthorizationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -113,4 +115,16 @@ public class GlobalExceptionHandler { return AjaxResult.error("演示模式,不允许操作"); } + + + + /** + * 工作流异常 + * */ + @ExceptionHandler(ActivitiException.class) + public AjaxResult activitiException(org.activiti.engine.ActivitiException e) + { + log.error(e.getMessage(), e); + return AjaxResult.error("请正确使用审批流程上的角色进行操作"); + } }