示例#1
0
        async public Task PassBudgetProjectOfExecute([FromBody] StepDone <PredefindedModelList <BudgetProjectOfExecute, PackageOfExcuteBudget> > stepDone)
        {
            //TODO:这个SPBudgetProjectOfExecuteMerge里面,估计也需要判断是否超预算;
            stepDone.Data.Model.CreatorId = CurrentUser.Id;
            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPBudgetProjectOfExecuteMerge()
            {
                List = stepDone.Data.Model.ToDataTable(),
                PackageOfExcuteBudgetList = stepDone.Data.List.ToDataTable()
            });
            spList.AddItem(
                new SPExecuteProjectInit()
            {
                SourceBudgetProjectId = stepDone.Data.Model.Id,
                CreatorId             = CurrentUser.Id
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList, false);

            //18-11-6 暂时取消暂存
            //await MyWorkFlowBusiness.DoneStep(
            //    stepDone.ToSimple((int)StepState.Forward),
            //    CurrentUser.Id,
            //    spList, stepDone.IsHold);
        }
        async public Task <bool> PassPackageOfAcceptanceCheckAndAcceptance([FromBody] StepDone <IEnumerable <PackageOfAcceptanceCheckAndAcceptance> > stepDone)
        {
            var result = await Db.QuerySpAsync <SPIsPackageOfAcceptanceCheckAndAcceptanceWillDone, bool>(new SPIsPackageOfAcceptanceCheckAndAcceptanceWillDone()
            {
                IdList = stepDone.Data.Select(i => i.Id).ToPredefindedKeyFieldsList().ToDataTable()
            });

            //返回false表示还没有完全结束,则需要hold
            var isHold = !result.FirstOrDefault();

            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPPackageOfAcceptanceCheckAndAcceptanceMerge()
            {
                List = stepDone.Data.ToDataTable(),
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList,
                isHold || stepDone.IsHold);

            //如果全部结束了,返回true,方便前台跳转/刷新
            return(!isHold);
        }
示例#3
0
        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 PassPackageOfContractPublicity([FromBody] StepDone <IEnumerable <PackageOfContractPublicity> > stepDone)
        {
            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPPackageOfContractPublicityMerge()
            {
                List = stepDone.Data.ToDataTable(),
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList,
                stepDone.IsHold);
        }
示例#5
0
        async public Task EditDeclareProject([FromBody] StepDone <PredefindedModelList <DeclareProject, Package> > stepDone)
        {
            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(new SPDeclareProjectMerge
            {
                List        = stepDone.Data.Model.ToDataTable(),
                PackageList = stepDone.Data.List.ToDataTable()
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList,
                stepDone.IsHold
                );
        }
示例#6
0
        async public Task PassAuditDeclareProject([FromBody] StepDoneSimple stepDone)
        {
            //SPBudgetProjectInit
            //这里感觉不应该用StepDoneSimple而是应该用带BudgetProjectId的StepDone<int>
            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(new SPBudgetProjectInit
            {
                StepId    = stepDone.StepId,
                CreatorId = CurrentUser.Id
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList);
        }
        async public Task PassExecuteProjectOfConfirm([FromBody] StepDone <ExecuteProjectOfConfirm> stepDone)
        {
            stepDone.Data.CreatorId = CurrentUser.Id;

            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPExecuteProjectOfConfirmMerge()
            {
                List = stepDone.Data.ToDataTable(),
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList, stepDone.IsHold);
        }
        async public Task PassExecuteProjectExperts([FromBody] StepDone <EMExecuteProjectExperts> stepDone)
        {
            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPExecuteProjectExpertsMerge()
            {
                ExecuteProjectId = stepDone.Data.ExecuteProjectId,
                IdListOfExecuteProjectExperts       = stepDone.Data.IdListOfExecuteProjectExperts.ToPredefindedKeyFieldsList().ToDataTable(),
                BackupIdListOfExecuteProjectExperts = stepDone.Data.BackupIdListOfExecuteProjectExperts.ToPredefindedKeyFieldsList().ToDataTable()
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList,
                stepDone.IsHold);
        }
        async public Task PassExecuteProjectOfInvitation(
            [FromBody] StepDone <PredefindedModelList <ExecuteProjectOfInvitation, PackageOfInvitation> > stepDone)
        {
            stepDone.Data.Model.CreatorId = CurrentUser.Id;

            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPExecuteProjectOfInvitationMerge()
            {
                List = stepDone.Data.Model.ToDataTable(),
                ListOfPackageOfInvitation = stepDone.Data.List.ToDataTable()
            });

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList, stepDone.IsHold);
        }
        async public Task PassExecuteProjectOfGetRunMode([FromBody] StepDone <ExecuteProjectOfGetRunMode> stepDone)
        {
            stepDone.Data.CreatorId = CurrentUser.Id;

            var spList = new List <PredefindedSPStructure>();

            spList.AddItem(
                new SPExecuteProjectOfGetRunModeMerge()
            {
                List = stepDone.Data.ToDataTable(),
            });

            //await Db.ExecuteSpAsync(
            //    new SPExecuteProjectOfGetRunModeMerge()
            //    {
            //        List = stepDone.Data.ToDataTable(),
            //    });
            //var spList = new List<PredefindedSPStructure>();

            #region 暂时放到[FNIsEmployeeCanOperateStep]去做了;
            ////TODO:日后考虑移到sp
            //var executeProject = await Db.GetModelByIdSpAsync<ExecuteProject>(stepDone.Data.Id);
            //如果是自主采购or非集采,则指定执行人为申报相关人
            //if (stepDone.Data.ExecutionModeId == 1 || !executeProject.ISCenterPurchase)
            //{
            //    var listOfPackageOfExecute = await Db.GetListSpAsync<VPackageOfExcuteBudget, PackageOfExecuteProjectFilter>(
            //        new PackageOfExecuteProjectFilter() { WhereInExecuteProjectId = stepDone.Data.Id.ToString() }
            //        );
            //    spList.AddItem(new SPStepAssignedEmployeeAdd()
            //    {
            //        //NextStepId
            //        EmpIdList = listOfPackageOfExecute.Select(i => i.DeclareCreatorId).ToPredefindedKeyFieldsList().ToDataTable()
            //    });
            //}
            #endregion

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList, stepDone.IsHold);
        }
示例#11
0
 async public Task BackAuditDeclareProject([FromBody] StepDoneSimple stepDone)
 {
     await MyWorkFlowBusiness.DoneStep(
         stepDone.ToSimple((int)StepState.Back),
         CurrentUser.Id);
 }
        async public Task <bool> PassExecuteProjectOfResultNotice(
            [FromBody] StepDone <ModelOfPassExecuteProjectOfResultNotice> stepDone)
        {
            stepDone.Data.ModelOfExecuteProjectOfResultNotice.CreatorId = CurrentUser.Id;

            //是否在这次操作后,处理完这个项目所有包的结果信息;
            //var listOfId = stepDone.Data.ListOfPackageOfResultNotice.Select(i => i.Id).Union(stepDone.Data.ListOfRejectPackageId);
            var isAllWillBeDone = (await Db.QuerySpAsync <SPIsPackageOfResultNoticeWillDone, bool>(new SPIsPackageOfResultNoticeWillDone()
            {
                IdList = stepDone.Data.ListOfPackageOfResultNotice.Select(i => i.Id).ToPredefindedKeyFieldsList().ToDataTable()
            })).FirstOrDefault();

            var isAllWillBeRejected = (await Db.QuerySpAsync <SPIsPackageOfResultNoticeWillDone, bool>(new SPIsPackageOfResultNoticeWillDone()
            {
                IdList = stepDone.Data.ListOfRejectPackageId.ToPredefindedKeyFieldsList().ToDataTable()
            })).FirstOrDefault();

            bool isHold = (!isAllWillBeDone) || isAllWillBeRejected;

            var spList = new List <PredefindedSPStructure>();

            //2018-11-16 所有的包都可以继续增改
            spList.AddItem(
                new SPExecuteProjectOfResultNoticeMerge()
            {
                List = stepDone.Data.ModelOfExecuteProjectOfResultNotice.ToDataTable(),
                ListOfPackageOfResultNotice = stepDone.Data.ListOfPackageOfResultNotice.ToDataTable()
            });

            //如果有废包
            if (stepDone.Data.ListOfRejectPackageId.Count() > 0)
            {
                spList.AddItem(
                    new SPRejectPackage()
                {
                    EmpId            = CurrentUser.Id,
                    ExecuteProjectId = stepDone.Data.ModelOfExecuteProjectOfResultNotice.Id,
                    PackageIdList    = stepDone.Data.ListOfRejectPackageId.ToPredefindedKeyFieldsList().ToDataTable()
                });
            }

            //2018-11-16 所有的包都可以继续增改
            ////如果有正常包.则完成这个步骤
            ////如果没有正常包,则意味着所有的包都被废了,也会造成项目废标.这里继续执行只会提示错误;
            //if (stepDone.Data.ListOfPackageOfResultNotice.Count() > 0)
            //{
            //    spList.AddItem(
            //        new SPExecuteProjectOfResultNoticeMerge()
            //        {
            //            List = stepDone.Data.ModelOfExecuteProjectOfResultNotice.ToDataTable(),
            //            ListOfPackageOfResultNotice = stepDone.Data.ListOfPackageOfResultNotice.ToDataTable()
            //        });
            //}

            await MyWorkFlowBusiness.DoneStep(
                stepDone.ToSimple((int)StepState.Forward),
                CurrentUser.Id,
                spList,
                isHold);

            //项目是否被推进了;
            return(isHold);
        }