This commit is contained in:
2023-05-31 10:19:05 +08:00
parent 1b65a7a9e5
commit 9c621c75cd
238 changed files with 9905 additions and 4034 deletions

View File

@@ -54,6 +54,7 @@ public class FlowLaunchService : IDynamicApiController, ITransient
var entity = _flowTaskRepository.GetTaskFirstOrDefault(id);
if (entity == null)
throw Oops.Oh(ErrorCode.COM1005);
if (entity.Suspend == 1) throw Oops.Oh(ErrorCode.WF0046);
if (!entity.ParentId.Equals("0") && entity.ParentId.IsNotEmptyOrNull())
throw Oops.Oh(ErrorCode.WF0003, entity.FullName);
if (entity.FlowType == 1)
@@ -75,6 +76,8 @@ public class FlowLaunchService : IDynamicApiController, ITransient
public async Task Revoke(string id, [FromBody] FlowHandleModel flowHandleModel)
{
var flowTaskParamter = await _flowTaskRepository.GetTaskParamterByTaskId(id, flowHandleModel);
if (flowTaskParamter.flowTaskEntity.Suspend == 1) throw Oops.Oh(ErrorCode.WF0046);
if (await _flowTaskRepository.AnyFlowTask(x => flowTaskParamter.flowTaskEntity.Id == x.ParentId && x.DeleteMark == null && x.Suspend == 1)) throw Oops.Oh(ErrorCode.WF0046);
if (flowTaskParamter.flowTaskEntity.Status != 1)
throw Oops.Oh(ErrorCode.WF0011);
if (flowTaskParamter.flowTaskEntity.ParentId.IsNotEmptyOrNull()&& !flowTaskParamter.flowTaskEntity.ParentId.Equals("0"))
@@ -91,6 +94,7 @@ public class FlowLaunchService : IDynamicApiController, ITransient
public async Task Press(string id)
{
var flowTaskParamter = await _flowTaskRepository.GetTaskParamterByTaskId(id, null);
if (flowTaskParamter.flowTaskEntity.Suspend == 1) throw Oops.Oh(ErrorCode.WF0046);
await _flowTaskManager.Press(flowTaskParamter);
}
#endregion