예제 #1
0
        public async Task <ActionResult> DealActivity(DealActivityModel model)
        {
            var jsonModel = await WorkflowSvc.DealProcess(model.ProcessInstanceId,
                                                          model.ActivityInstanceId,
                                                          model.ClickButton,
                                                          model.Comment,
                                                          model.NextStepId,
                                                          model.AssignToUserIds,
                                                          model.AssignToUserNames,
                                                          model.BackStepId);

            return(Json(jsonModel));
        }
        private async Task DealProcess(WfApplyBase model, long srcId, JsonModel result, string conditions = null)
        {
            if (model.ProcessInstanceId != 0)
            {
                var processInstance = await WorkflowSvc.GetProcessInstanceAsync(model.ProcessInstanceId);

                if (processInstance == null)
                {
                    result.statusCode = 300;
                    result.message    = $"找不到id为{model.ProcessInstanceId}的流程实例!";
                    return;
                }
                processInstance.Conditions = conditions;
                result = await WorkflowSvc.DealProcess(model.ProcessInstanceId,
                                                       model.CurrActInsId,
                                                       WfActivityButton.Send,
                                                       "重新提交信息",
                                                       model.NextStepId,
                                                       model.AssignToUserIds,
                                                       model.AssignToUserNames);

                return;
            }
            //创建流程
            result = await WorkflowSvc.StartProcess(model.ProcessId,
                                                    srcId,
                                                    conditions,
                                                    model.NextStepId,
                                                    model.AssignToUserIds,
                                                    model.AssignToUserNames);

            if (result.statusCode == 200)
            {
                result.message = "申请成功,请等待审批!";
            }
        }