|
@@ -35,6 +35,7 @@ import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.core.tool.utils.ResourceUtil;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
+import org.springblade.evisa.redissionUtil.DistributedRedisLock;
|
|
|
import org.springblade.evisa.vo.EVisaTaskApprovalVO;
|
|
|
import org.springblade.flow.core.constant.ProcessConstant;
|
|
|
import org.springblade.flow.core.feign.IFlowClient;
|
|
@@ -1558,11 +1559,20 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//这里发起的默认为普通流程
|
|
|
task.setType(1);
|
|
|
task.setStatus(1);
|
|
|
- //保存附表信息
|
|
|
- this.taskParallelService.saveBatch(taskParallelArray);
|
|
|
-
|
|
|
- //保存主表数据
|
|
|
- this.save(task);
|
|
|
+ try {
|
|
|
+ if (DistributedRedisLock.acquire("TaskService_StartApproval_" + task.getFormDataId(), 5)) {
|
|
|
+ long count = this.count(Wrappers.<Task>lambdaQuery().eq(Task::getFormDataId, task.getFormDataId()).ne(Task::getStatus, 3));
|
|
|
+ if (count > 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //保存附表信息
|
|
|
+ this.taskParallelService.saveBatch(taskParallelArray);
|
|
|
+ //保存主表数据
|
|
|
+ this.save(task);
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
+ DistributedRedisLock.release("TaskService_StartApproval_" + task.getFormDataId());
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|