From 82ec4b4da5764185331c4009296a4330ade0d334 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 12 Dec 2022 09:54:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=BB=84=E6=88=90=E5=91=98=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activiti/controller/ActTaskController.java | 10 ++++------ .../modules/activiti/service/ActTaskService.java | 5 +++-- .../src/main/resources/db/V8.3__add_table.sql | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 renren-admin/src/main/resources/db/V8.3__add_table.sql diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index af2e5078..ef6edab0 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -1,6 +1,5 @@ package io.renren.modules.activiti.controller; -import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.renren.common.annotation.LogOperation; @@ -12,7 +11,6 @@ import io.renren.common.utils.Result; import io.renren.modules.activiti.dto.BatchCompleteDTO; import io.renren.modules.activiti.dto.TaskDTO; import io.renren.modules.activiti.service.ActTaskService; -import io.renren.modules.resource.service.impl.ResourceServiceImpl; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysUserDTO; @@ -252,7 +250,7 @@ public class ActTaskController { return new Result().error(ErrorCode.PARAMS_GET_ERROR); } actTaskService.completeTask(taskId, comment); - return new Result(); + return new Result().ok("审核通过"); } /** @@ -473,7 +471,7 @@ public class ActTaskController { return new Result().ok(resultMap); } catch (Exception e) { logger.error("浪潮数据查询异常", e); - + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } @@ -580,7 +578,7 @@ public class ActTaskController { return new Result().ok(arrayList); } catch (Exception e) { logger.error("浪潮数据查询异常", e); - + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } @@ -603,7 +601,7 @@ public class ActTaskController { return new Result().ok(list); } catch (Exception e) { logger.error("浪潮数据查询异常", e); - + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index cdef7742..4feeb584 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -497,8 +497,9 @@ public class ActTaskService extends BaseServiceImpl { public void completeTask(String taskId, String comment) { String userId = SecurityUser.getUserId().toString(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); - if (StringUtils.isNotEmpty(task.getAssignee())) { - taskService.setAssignee(taskId, userId); + if (StringUtils.isNotEmpty(task.getAssignee()) + && !task.getAssignee().equals(userId)) { + taskService.setAssignee(taskId, userId); //与原任务审核人员不一致时,换成实际通过的人 } if (StringUtils.isNotEmpty(comment)) { taskService.addComment(taskId, task.getProcessInstanceId(), comment); diff --git a/renren-admin/src/main/resources/db/V8.3__add_table.sql b/renren-admin/src/main/resources/db/V8.3__add_table.sql new file mode 100644 index 00000000..a1235511 --- /dev/null +++ b/renren-admin/src/main/resources/db/V8.3__add_table.sql @@ -0,0 +1,15 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +CREATE TABLE `sys_audit_team` ( + `id` bigint NOT NULL COMMENT '主键ID', + `creator` bigint NOT NULL COMMENT '创建人', + `create_date` datetime NOT NULL COMMENT '创建时间', + `name` longtext NOT NULL COMMENT '审核组名称', + `member` json NOT NULL COMMENT '审核组成员id数组', + `index` varchar(255) NULL COMMENT '审核组索引', + PRIMARY KEY (`id`), + INDEX `name`(`name`) USING BTREE COMMENT '审核组名称索引' +) COMMENT = '流程审核组组员'; + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file From 871862bd005d9a0267bbba402d4b8f3086111905 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 12 Dec 2022 09:54:39 +0800 Subject: [PATCH 2/2] ... --- .../src/main/resources/db/V8.3__add_table.sql | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/renren-admin/src/main/resources/db/V8.3__add_table.sql b/renren-admin/src/main/resources/db/V8.3__add_table.sql index a1235511..601dad11 100644 --- a/renren-admin/src/main/resources/db/V8.3__add_table.sql +++ b/renren-admin/src/main/resources/db/V8.3__add_table.sql @@ -1,15 +1,14 @@ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; - -CREATE TABLE `sys_audit_team` ( - `id` bigint NOT NULL COMMENT '主键ID', - `creator` bigint NOT NULL COMMENT '创建人', - `create_date` datetime NOT NULL COMMENT '创建时间', - `name` longtext NOT NULL COMMENT '审核组名称', - `member` json NOT NULL COMMENT '审核组成员id数组', - `index` varchar(255) NULL COMMENT '审核组索引', +drop table IF EXISTS `sys_audit_team`; +create TABLE `sys_audit_team` ( + `id` bigint NOT NULL comment '主键ID', + `creator` bigint NOT NULL comment '创建人', + `create_date` datetime NOT NULL comment '创建时间', + `name` longtext NOT NULL comment '审核组名称', + `member` json NOT NULL comment '审核组成员id数组', + `index` varchar(255) NULL comment '审核组索引', PRIMARY KEY (`id`), - INDEX `name`(`name`) USING BTREE COMMENT '审核组名称索引' -) COMMENT = '流程审核组组员'; - + INDEX `name`(`name`) USING BTREE comment '审核组名称索引' +) comment = '流程审核组组员'; SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file