/// <summary> /// 验证数据库参数 /// </summary> /// <param name="returnInfo">返回信息</param> /// <param name="flowIn">流程输入</param> /// <param name="workflow">工作流</param> /// <param name="connectionId">连接ID</param> /// <param name="currUser">当前用户</param> private void ValiDbParam(ReturnInfo <bool> returnInfo, FlowInInfo <FlowInitInfo <PersonTimeInfo <int> > > flowIn, out WorkflowInfo workflow, string connectionId = null, BasicUserInfo <int> currUser = null) { workflow = null; ReturnInfo <WorkflowDefineInfo> reWorkFlowConfig = WorkflowConfigReader.ReaderAllConfig(flowIn.Flow.WorkflowCode, connectionId, currUser); if (reWorkFlowConfig.Failure()) { returnInfo.FromBasic(reWorkFlowConfig); return; } var user = UserTool <int> .GetCurrUser(currUser); if (flowIn.Flow.Id > 0) { var reInfo = WorkflowService.Find(flowIn.Flow.Id, connectionId, currUser); if (reInfo.Failure()) { returnInfo.FromBasic(reInfo); return; } if (reInfo.Data == null) { returnInfo.SetFailureMsg($"找不到工作流ID[{flowIn.Flow.Id}]的数据"); return; } if (reInfo.Data.CreaterId != user.Id) { returnInfo.SetFailureMsg($"Sorry,此流程不是您创建的,无权限操作"); return; } workflow = reInfo.Data; flowIn.Flow.Id = workflow.Id; flowIn.Flow.ApplyNo = workflow.ApplyNo; } else { ReturnInfo <bool> reInfo = WorkflowService.ExistsByApplyNo(flowIn.Flow.ApplyNo, connectionId, currUser); if (reInfo.Failure()) { returnInfo.FromBasic(reInfo); return; } if (reInfo.Data) { returnInfo.SetFailureMsg($"申请单号[{flowIn.Flow.ApplyNo}]已存在"); return; } } }