Browse Source

[feat] 通用模块管理

修改activiti和frameWork两个模块直接的依赖关系
修改全局异常处理:新增捕获activiti全局异常
修改开发修改单新增页面:新增开发修改单提交按钮加上校验,带星号的字段需要必填,如果不填就不能提交
dev
liuxiaoxu 4 months ago
parent
commit
6c1194a66c
  1. 11
      ruoyi-activiti/pom.xml
  2. 2
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  3. 5
      ruoyi-framework/pom.xml
  4. 14
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java

11
ruoyi-activiti/pom.xml

@ -16,10 +16,13 @@
<artifactId>activiti-spring-boot-starter-rest-api</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.ruoyi</groupId>-->
<!-- <artifactId>ruoyi-framework</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>

2
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;
@ -175,6 +176,7 @@
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
}

5
ruoyi-framework/pom.xml

@ -77,6 +77,11 @@
<artifactId>ruoyi-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-activiti</artifactId>
<version>4.6.1</version>
</dependency>
</dependencies>
</project>

14
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("请正确使用审批流程上的角色进行操作");
}
}

Loading…
Cancel
Save