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> <artifactId>activiti-spring-boot-starter-rest-api</artifactId>
<version>${activiti.version}</version> <version>${activiti.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId> <!-- <dependency>-->
<artifactId>ruoyi-framework</artifactId> <!-- <groupId>com.ruoyi</groupId>-->
</dependency> <!-- <artifactId>ruoyi-framework</artifactId>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId> <artifactId>ruoyi-system</artifactId>

2
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -110,6 +110,7 @@
// 新增提交 // 新增提交
function submitHandler() { function submitHandler() {
if ($.validate.form()) {
// 获取表单数据 // 获取表单数据
const developModifyOrderData = $("#form-developModifyOrder-add").serializeArray().reduce((obj, item) => { const developModifyOrderData = $("#form-developModifyOrder-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value; obj[item.name] = item.value;
@ -174,6 +175,7 @@
const jsonData = JSON.stringify(combinedData); const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口 // 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData); $.operate.saveJson(prefix + "/add", jsonData);
}
} }

5
ruoyi-framework/pom.xml

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

14
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java

@ -1,6 +1,8 @@
package com.ruoyi.framework.web.exception; package com.ruoyi.framework.web.exception;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.activiti.engine.ActivitiException;
import org.apache.shiro.authz.AuthorizationException; import org.apache.shiro.authz.AuthorizationException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -113,4 +115,16 @@ public class GlobalExceptionHandler
{ {
return AjaxResult.error("演示模式,不允许操作"); 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