ソースを参照

Merge remote-tracking branch 'origin/master' into master

yangyj 3 ヶ月 前
コミット
ca43e02b31

+ 12 - 4
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -806,9 +806,12 @@ public class TaskController extends BladeController {
                 String processInstanceId = task.getProcessInstanceId();
                 List<TaskParallel> taskParallels = jdbcTemplate.query("SELECT * FROM u_task_parallel WHERE process_instance_id = '" + processInstanceId + "' ORDER BY sort", new BeanPropertyRowMapper<>(TaskParallel.class));
                 List<String> taskParallelsUserIds = taskParallels.stream().map(TaskParallel::getTaskUser).collect(Collectors.toList());
+                //当前副任务id
+                Long currentParallelId = null;
                 List<String> name = new ArrayList<>();
                 for (TaskParallel parallel : taskParallels) {
                     if (parallel.getTaskUser().equals(SecureUtil.getUserId().toString())) {
+                        currentParallelId = parallel.getId();
                         break;
                     }
                     if (parallel.getStatus() != 2) {
@@ -818,10 +821,14 @@ public class TaskController extends BladeController {
                 if (name.size() > 0) {
                     throw new ServiceException("当前任务还有【" + StringUtils.join(name, "、") + "】未完成审批,请您稍后再试");
                 }
+                if (currentParallelId == null){
+                    throw new ServiceException("未获取到当前任务人流程id");
+                }
 
                 /*修改主任务、副任务状态*/
                 jdbcTemplate.execute("UPDATE u_task SET status = 3,meter_task_repeal_desc = '" + (ObjectUtil.isNotEmpty(taskRepealDTO.getMeterTaskRepealDesc()) ? taskRepealDTO.getMeterTaskRepealDesc() : null) + "' WHERE id = " + taskRepealDTO.getTaskId());
                 jdbcTemplate.execute("UPDATE u_task_parallel SET status = 3 WHERE process_instance_id = '" + processInstanceId + "'");
+                jdbcTemplate.execute("UPDATE u_task_parallel SET initiative = 2 WHERE id = " + currentParallelId);
 
                 /*修改业务状态=未上报,业务复制数据taskVO全部删除(存在重新上报的情况,那么如果历史复制数据存在,会导致主键冲突,因为关联数据是copy的)*/
                 if (ObjectUtil.isNotEmpty(task.getFormDataId())) {
@@ -977,7 +984,6 @@ public class TaskController extends BladeController {
 
                             /*删除单条废除的历史记录*/
                             jdbcTemplate.execute("DELETE FROM s_task_data_update_record WHERE data_id = " + taskRepealDTO.getTaskId());
-
                         }
                     }
 
@@ -1131,7 +1137,7 @@ public class TaskController extends BladeController {
         Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
         if (processInstanceIds.size() > 0) {
             String resultIds = processInstanceIds.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
-            taskParallelGroupMap = jdbcTemplate.query("select process_instance_id,task_user,task_user_name,e_visa_status,e_visa_content,status,sort from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
+            taskParallelGroupMap = jdbcTemplate.query("select process_instance_id,task_user,task_user_name,e_visa_status,e_visa_content,status,initiative,sort from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
         }
         Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
 
@@ -1181,8 +1187,10 @@ public class TaskController extends BladeController {
                 for (TaskParallel taskPa : taskParallelList) {
                     if (taskPa.getStatus() == 2 && ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 1) {
                         taskPa.setEVisaStatus(2);
-                    } else if (taskPa.getStatus() == 3 && taskPa.getTaskUser().equals(SecureUtil.getUserId().toString())) {
-                        taskPa.setEVisaStatus(3);
+                    } else if (taskPa.getStatus() == 3) {
+                        if (taskPa.getInitiative() == 2) {
+                            taskPa.setEVisaStatus(3);
+                        }
                     } else if (ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 99) {
                         taskPa.setEVisaStatus(999);
                     } else {

+ 10 - 0
blade-service/blade-websocket/src/main/resources/application-dev.yml

@@ -0,0 +1,10 @@
+#服务器端口
+server:
+  port: 9527
+
+#数据源配置
+spring:
+  datasource:
+    url: ${blade.datasource.dev.url}
+    username: ${blade.datasource.dev.username}
+    password: ${blade.datasource.dev.password}

+ 11 - 0
blade-service/blade-websocket/src/main/resources/application-prod.yml

@@ -0,0 +1,11 @@
+#服务器端口
+server:
+  port: 9527
+
+#数据源配置
+spring:
+  datasource:
+    url: ${blade.datasource.prod.url}
+    username: ${blade.datasource.prod.username}
+    password: ${blade.datasource.prod.password}
+

+ 10 - 0
blade-service/blade-websocket/src/main/resources/application-test.yml

@@ -0,0 +1,10 @@
+#服务器端口
+server:
+  port: 9527
+
+#数据源配置
+spring:
+  datasource:
+    url: ${blade.datasource.test.url}
+    username: ${blade.datasource.test.username}
+    password: ${blade.datasource.test.password}