async public Task PassBudgetProjectOfEnter([FromBody] PredefindedModelList <EMBudgetProjectOfEnter, StepIdAndBudgetProjectId> data) { //批量检查一下年份,归口部门id,是否超预算; await Db.ExecuteSpAsync(new SPIsExceedBudget() { BudgetId = data.Model.BudgetId, BudgetProjectIdList = data.List.Select(i => i.BudgetProjectId).ToPredefindedKeyFieldsList().ToDataTable() }); foreach (var item in data.List) { var spList = new List <PredefindedSPStructure>(); var budgetProjectOfEnter = Tool.ModelToModel <BudgetProjectOfEnter, EMBudgetProjectOfEnter>(data.Model); budgetProjectOfEnter.Id = item.BudgetProjectId; budgetProjectOfEnter.CreatorId = CurrentUser.Id; spList.AddItem(new SPBudgetProjectOfEnterMerge { List = budgetProjectOfEnter.ToDataTable() }); var stepDone = new StepDone() { StepId = item.StepId, State = (int)StepState.Forward }; await MyWorkFlowBusiness.DoneStep(stepDone, CurrentUser.Id, spList); } }
async public Task SwitchNoctice([FromBody] PredefindedModelList <bool, int> data) { await Db.ExecuteSpAsync(new SPNoticeSwith() { IsEnabled = data.Model, NoticeIdList = data.List.ToPredefindedKeyFieldsList().ToDataTable() }); }
async public Task <object> CombineBudgetProject([FromBody] PredefindedModelList <BudgetProject, int> data) { return(await Db.ExecuteSpAsync(new SPBudgetProjectCombine() { model = data.Model.ToDataTable(), listOfSourceBudgetProjectId = data.List.ToPredefindedKeyFieldsList().ToDataTable(), CreatorId = CurrentUser.Id })); }
async public Task BeginExecuteProject([FromBody] PredefindedModelList <ExecuteProject, int> data) { await MyWorkFlowBusiness.InitFlow( FlowTemplateIdOfExecuteProject, new SPExecuteProjectMerge() { List = data.Model.ToDataTable(), ListOfMergeExecuteProjectId = data.List.ToPredefindedKeyFieldsList().ToDataTable() }, CurrentUser.Id); }
async public Task AddAndPassBudgetProjectOfArgument([FromBody] PredefindedModelList <BudgetProjectOfArgument, PackageOfArgumentBudget> data) { data.Model.CreatorId = CurrentUser.Id; await MyWorkFlowBusiness.InitFlow( FlowTemplateIdOfBudgetProject, new SPBudgetProjectOfArgumentMerge { List = data.Model.ToDataTable(), PackageOfArgumentBudgetList = data.List.ToDataTable() }, CurrentUser.Id); }
async public Task AddOrUpdateNotice([FromBody] PredefindedModelList <Notice, NoticeReceivingCondition> data) { data.Model.SendorId = CurrentUser.Id; if (data.Model.Id != 0 && data.Model.SendorId != CurrentUser.Id) { throw new Exception("只能修改自己发布的通知"); } await Db.ExecuteSpAsync(new SPNoticeMerge() { List = data.Model.ToDataTable(), ListOfNoticeReceivingCondition = data.List.ToDataTable() }); }