Ejemplo n.º 1
0
        public void CompleteRejectProject(Guid instanceId)
        {
            var stopModel          = _projectAuditStopRepository.Get(instanceId);
            var singleProjectModel = _singleProjectInfoRepository.Get(stopModel.ProjectId);

            singleProjectModel.IsStop = ProjectStopTypeEnum.NoStop;
            _singleProjectInfoRepository.Update(singleProjectModel);
            var noticeService = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IProjectNoticeAppService>();
            var noticeInput   = new NoticePublishInputForWorkSpaceInput();

            noticeInput.ProjectId = singleProjectModel.Id;
            noticeInput.Content   = "停滞结束";
            noticeInput.UserType  = 1;
            noticeInput.Title     = $"项目:{singleProjectModel.SingleProjectName} 停滞结束";
            noticeService.CreateProjectWorkSpaceNoticeSync(noticeInput);

            StopProjectInWorkFlow(singleProjectModel.Id, AuditFlowId.ToGuid(), false);
        }
Ejemplo n.º 2
0
        public async Task <InitWorkFlowOutput> CreateStopAsync(CreateProjectAuditStopInput input)
        {
            var projectModel = await _singleProjectInfoRepository.GetAsync(input.ProjectBaseId);

            if (projectModel == null)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "项目已被删除");
            }

            var exitprojectStopModelCount = await _projectAuditStopRepository.GetAll().Where(r => r.Status >= 0 && r.ProjectId == input.ProjectBaseId).CountAsync();

            if (exitprojectStopModelCount > 0)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "存在未解除的停滞申请。");
            }
            var model = new ProjectAuditStop()
            {
                Id        = Guid.NewGuid(),
                Status    = 0,
                ProjectId = input.ProjectBaseId,
                Remark    = input.Remark,
                DelayDay  = input.DelayDay,
            };
            await _projectAuditStopRepository.InsertAsync(model);

            projectModel.IsStop = ProjectStopTypeEnum.AapplyStop;
            await _singleProjectInfoRepository.UpdateAsync(projectModel);

            await StopProjectInWorkFlowAsync(input.ProjectBaseId, AuditFlowId.ToGuid());

            var noticeService = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IProjectNoticeAppService>();
            var noticeInput   = new NoticePublishInputForWorkSpaceInput();

            noticeInput.ProjectId = input.ProjectBaseId;
            noticeInput.Content   = "提交停滞申请";
            noticeInput.UserType  = 1;
            noticeInput.Title     = $"项目:{projectModel.SingleProjectName} 停滞申请";
            await noticeService.CreateProjectWorkSpaceNotice(noticeInput);

            return(new InitWorkFlowOutput()
            {
                InStanceId = model.Id.ToString()
            });
        }