Example #1
0
        public async Task <InitWorkFlowOutput> Create(OABidSelfAuditCreateInput input)
        {
            var ret            = new InitWorkFlowOutput();
            var oABidSelfAudit = new OABidSelfAudit();

            input.MapTo(oABidSelfAudit);
            oABidSelfAudit.Id = Guid.NewGuid();
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oABidSelfAudit.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.OA投标资格自审申请附件,
                    Files        = fileList
                });
            }
            await _oABidSelfAuditRepository.InsertAsync(oABidSelfAudit);

            ret.InStanceId = oABidSelfAudit.Id.ToString();
            return(ret);
        }
Example #2
0
        //[Microsoft.AspNetCore.Mvc.ServiceFilter(typeof(WorkFlowRunFilterAttribute))]
        public async Task <InitWorkFlowOutput> Create(SupplyCreateInput input)
        {
            var ret    = new InitWorkFlowOutput();
            var Supply = new SupplyBase();

            input.MapTo(Supply);
            var id = Guid.NewGuid();

            Supply.Id            = id;
            Supply.Status        = (int)SupplyStatus.在库;
            Supply.CreatorUserId = AbpSession.UserId;
            Supply.PutInDate     = input.PutInDate;
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.用品附件,
                    Files        = fileList
                });
            }
            await _supplyRepository.InsertAsync(Supply);

            ret.InStanceId = id.ToString();
            return(ret);
        }
Example #3
0
        //[Microsoft.AspNetCore.Mvc.ServiceFilter(typeof(WorkFlowRunFilterAttribute))]
        public async Task <InitWorkFlowOutput> Create(OAFixedAssetsCreateInput input)
        {
            var ret           = new InitWorkFlowOutput();
            var oAFixedAssets = new OAFixedAssets();

            input.MapTo(oAFixedAssets);
            var id = Guid.NewGuid();

            oAFixedAssets.Id     = id;
            oAFixedAssets.Status = (int)OAFixedAssetsStatus.在库;
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.固定资产附件,
                    Files        = fileList
                });
            }
            await _oAFixedAssetsRepository.InsertAsync(oAFixedAssets);

            ret.InStanceId = id.ToString();
            return(ret);
        }
Example #4
0
        public async Task <InitWorkFlowOutput> Create(OAFixedAssetsScrapCreateInput input)
        {
            var ret = new InitWorkFlowOutput();
            var oAFixedAssetsScrap = new OAFixedAssetsScrap();

            input.MapTo(oAFixedAssetsScrap);
            oAFixedAssetsScrap.Id = Guid.NewGuid();
            //var oaFxApplyModel = await _oAFixedAssetsUseApplyRepository.GetAsync(input.ApplyUserId);
            //oAFixedAssetsScrap.FAId = oaFxApplyModel.FAId;
            //oAFixedAssetsScrap.FAName = oaFxApplyModel.FAName;
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oAFixedAssetsScrap.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.固定资产报废申请附件,
                    Files        = fileList
                });
            }
            await _oAFixedAssetsScrapRepository.InsertAsync(oAFixedAssetsScrap);

            ret.InStanceId = oAFixedAssetsScrap.Id.ToString();
            return(ret);
        }
Example #5
0
        public async Task <InitWorkFlowOutput> Create(CreateCuringProcurementEditInput input)
        {
            var exit_Flag = _repository.GetAll().Any(r => r.MainId == input.MainId && r.Status != -1);

            if (exit_Flag)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "存在未完成的固化采购整改");
            }
            var ret      = new InitWorkFlowOutput();
            var newmodel = new CuringProcurementEdit()
            {
                MainId         = input.MainId,
                Code           = input.Code,
                NeedMember     = input.NeedMember,
                Type           = input.Type,
                ExecuteSummary = input.ExecuteSummary,
                Remark         = input.Remark,
                Status         = input.Status
            };
            await _repository.InsertAsync(newmodel);

            foreach (var item in input.Plans)
            {
                var entity = item.MapTo <CuringProcurementPlan>();
                entity.Id           = Guid.NewGuid();
                entity.MainId       = newmodel.Id;
                entity.BusinessType = (int)CuringProcurementType.固化采购调整;
                _curingProcurementPlanRepository.Insert(entity);

                if (item.FileList != null)
                {
                    var fileList = new List <AbpFileListInput>();
                    foreach (var ite in item.FileList)
                    {
                        fileList.Add(new AbpFileListInput()
                        {
                            Id = ite.Id, Sort = ite.Sort
                        });
                    }
                    await _abpFileRelationAppService.UpdateAsync(new CreateFileRelationsInput()
                    {
                        BusinessId   = entity.Id.ToString(),
                        BusinessType = (int)AbpFileBusinessType.固化采购计划整改附件,
                        Files        = fileList
                    });
                }
            }
            ret.InStanceId = newmodel.Id.ToString();
            return(ret);
        }
Example #6
0
        public async Task Send(Guid projectId)
        {
            var project  = _singleProjectRepository.Get(projectId);
            var newmodel = new ProjectProgressComplate()
            {
                ProjectBaseId = project.Id,
            };

            newmodel.Id = Guid.NewGuid();
            var task = new InitWorkFlowOutput();
            await _repository.InsertAsync(newmodel);

            task = _workFlowWorkTaskAppService.InitWorkFlowInstance(new InitWorkFlowInput()
            {
                FlowId     = new Guid("812eed79-c3dc-4381-9eab-f0c424c3049d"),
                FlowTitle  = $"{project.SingleProjectName}完成进度",
                InStanceId = newmodel.Id.ToString()
            });
            CurrentUnitOfWork.SaveChanges();
            var flower = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IWorkFlowAppService>();
            var next   = await flower.GetNextStepForRun(new GetNextStepForRunInput()
            {
                TaskId = task.TaskId
            });

            var run = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IWorkFlowWorkTaskAppService>();
            //var defaultUserId = "";//根据项目评审组获取第一联系人为默认接受者
            var steps = next.Steps.Select(ite => new ExecuteWorkChooseStep()
            {
                id = ite.NextStepId.ToString(), member = ite.DefaultUserId
            }).ToList();
            var ret = await run.ExecuteTask(new ExecuteWorkFlowInput()
            {
                ActionType     = "submit",
                FlowId         = task.FlowId,
                GroupId        = task.GroupId,
                InstanceId     = task.InStanceId,
                IsHideNextTask = true,
                StepId         = task.StepId,
                Steps          = steps,
                TaskId         = task.TaskId,
                Title          = $"{project.SingleProjectName}【{project.ProjectStatus.ToString()}阶段】完成进度"
            });

            ChangeProjectStatus(task.TaskId, Guid.Parse(task.InStanceId));
        }
Example #7
0
        public async Task <InitWorkFlowOutput> Create(OAMeetingCreateInput input)
        {
            var ret       = new InitWorkFlowOutput();
            var oAMeeting = new OAMeeting();

            input.MapTo(oAMeeting);
            oAMeeting.Id = Guid.NewGuid();
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oAMeeting.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.OA会议附件,
                    Files        = fileList
                });
            }
            var userHostInfo = await UserManager.GetUserByIdAsync(input.HostUser);

            var notuser = await UserManager.GetUserByIdAsync(input.NoteUser);

            var manager = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <WorkFlowOrganizationUnitsManager>();
            var users   = manager.GetAllUsers(input.ParticipateUser);

            foreach (var user in users)
            {
                var entity = new OAMeetingUser();
                entity.Id          = Guid.NewGuid();
                entity.OAMeetingId = oAMeeting.Id;
                entity.UserId      = user.Id;
                await _oAMeetingUserRepository.InsertAsync(entity);
            }
            oAMeeting.NotifyUsers = oAMeeting.ParticipateUser + ",u_" + userHostInfo + ",u_" + notuser;
            await _oAMeetingRepository.InsertAsync(oAMeeting);

            ret.InStanceId = oAMeeting.Id.ToString();
            return(ret);
        }
Example #8
0
        public async Task <InitWorkFlowOutput> Create(OATaskCreateInput input)
        {
            var ret    = new InitWorkFlowOutput();
            var oATask = new OATask();

            input.MapTo(oATask);
            oATask.Id = Guid.NewGuid();
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oATask.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.OA任务附件,
                    Files        = fileList
                });
            }
            oATask.NotifyUsers = oATask.ExecutorUser;
            var manager = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <WorkFlowOrganizationUnitsManager>();
            var users   = manager.GetAllUsers(input.ExecutorUser);

            foreach (var user in users)
            {
                var entity = new OATaskUser();
                entity.Id       = Guid.NewGuid();
                entity.OATaskId = oATask.Id;
                entity.UserId   = user.Id;
                await _oATaskUserRepository.InsertAsync(entity);
            }

            oATask.ValUser1    = "u_" + input.ValUser.ToString();
            oATask.NotifyUsers = oATask.ExecutorUser + ",u_" + oATask.ValUser;
            await _oATaskRepository.InsertAsync(oATask);

            ret.InStanceId = oATask.Id.ToString();
            return(ret);
        }
Example #9
0
        public async Task <InitWorkFlowOutput> Create(CreateCuringProcurementInput input)
        {
            var ret      = new InitWorkFlowOutput();
            var newmodel = new CuringProcurement()
            {
                Id             = Guid.NewGuid(),
                Code           = input.Code,
                NeedMember     = input.NeedMember,
                Type           = input.Type,
                ExecuteSummary = input.ExecuteSummary,
                Remark         = input.Remark,
            };
            await _repository.InsertAsync(newmodel);

            foreach (var item in input.Plans)
            {
                var entity = item.MapTo <CuringProcurementPlan>();
                entity.Id           = Guid.NewGuid();
                entity.MainId       = newmodel.Id;
                entity.BusinessType = (int)CuringProcurementType.固化采购;
                _curingProcurementPlanRepository.Insert(entity);
                if (item.FileList != null)
                {
                    var fileList = new List <AbpFileListInput>();
                    foreach (var ite in item.FileList)
                    {
                        fileList.Add(new AbpFileListInput()
                        {
                            Id = ite.Id, Sort = ite.Sort
                        });
                    }
                    await _abpFileRelationAppService.UpdateAsync(new CreateFileRelationsInput()
                    {
                        BusinessId   = entity.Id.ToString(),
                        BusinessType = (int)AbpFileBusinessType.固化采购计划附件,
                        Files        = fileList
                    });
                }
            }


            ret.InStanceId = newmodel.Id.ToString();
            return(ret);
        }
Example #10
0
        public async Task <InitWorkFlowOutput> Create(OAFixedAssetsPurchaseCreateInput input)
        {
            var ret = new InitWorkFlowOutput();
            var oAFixedAssetsPurchase = new OAFixedAssetsPurchase();

            input.MapTo(oAFixedAssetsPurchase);
            oAFixedAssetsPurchase.Id = Guid.NewGuid();
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oAFixedAssetsPurchase.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.固定资产采购申请附件,
                    Files        = fileList
                });
            }
            await _oAFixedAssetsPurchaseRepository.InsertAsync(oAFixedAssetsPurchase);

            foreach (var item in input.FixedAssetss)
            {
                var entity = item.MapTo <OAFixedAssets>();
                entity.Id                = Guid.NewGuid();
                entity.PurchaseId        = oAFixedAssetsPurchase.Id;
                entity.PostingDate       = DateTime.Now;
                entity.BuyDate           = DateTime.Now;
                entity.DateOfManufacture = DateTime.Now;
                // entity.Status = (int)OAFixedAssetsStatus.采购;
                await _oAFixedAssetsRepository.InsertAsync(entity);
            }
            ret.InStanceId = oAFixedAssetsPurchase.Id.ToString();
            return(ret);
        }
Example #11
0
        public async Task <InitWorkFlowOutput> Create(CreateEmployeeAskForLeaveIputDto input)
        {
            if (input.RelationUserId.HasValue)
            {
                if (_roleRelationManager.IsExistence(input.RelationUserId.Value, input.BeginTime, input.EndTime))
                {
                    throw new UserFriendlyException("委托人已经被委托了。");
                }
            }
            var service      = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IWorkFlowOrganizationUnitsAppService>();
            var userOrgModel = await service.GetUserPostInfo(new NullableIdDto <long>() { Id = AbpSession.UserId.Value, }, new NullableIdDto <long>() { Id = null });

            if (_repository.Count(r => r.CreatorUserId == AbpSession.UserId.Value && r.Status == -1) != _repository.Count(r => r.CreatorUserId == AbpSession.UserId.Value &&
                                                                                                                          (r.BeginTime > input.EndTime || r.EndTime < input.BeginTime) && r.Status == -1))
            {
                throw new UserFriendlyException("已存在审批通过的请假日期");
            }

            var ret      = new InitWorkFlowOutput();
            var newmodel = new EmployeeAskForLeave()
            {
                Id             = Guid.NewGuid(),
                UserId         = AbpSession.UserId.Value,
                BeginTime      = input.BeginTime,
                EndTime        = input.EndTime,
                Reason         = input.Reason,
                Remark         = input.Remark,
                TenantId       = AbpSession.TenantId,
                OrgId          = userOrgModel.OrgId,
                RelationUserId = input.RelationUserId,
                Hours          = input.Hours,
                PostIds        = string.Join(",", userOrgModel.UserPosts.Select(r => r.PostId)),
            };

            await _repository.InsertAsync(newmodel);

            ret.InStanceId = newmodel.Id.ToString();
            return(ret);
        }
Example #12
0
        public async Task <InitWorkFlowOutput> Create(OAContractCreateInput input)
        {
            var ret        = new InitWorkFlowOutput();
            var oAContract = new OAContract();

            input.MapTo(oAContract);
            oAContract.Id = Guid.NewGuid();
            if (input.FileList != null)
            {
                var fileList = new List <AbpFileListInput>();
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
                await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput()
                {
                    BusinessId   = oAContract.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.OA合同附件,
                    Files        = fileList
                });
            }
            var oACustomer = new OACustomer();

            oACustomer.Id           = Guid.NewGuid();
            oACustomer.Name         = input.UnitA;
            oACustomer.Address      = input.UnitAContractAddress;
            oACustomer.Phone        = input.UnitAContractTel;
            oACustomer.Contact      = input.UnitAContract;
            oACustomer.OAContractId = oAContract.Id;
            await _oAContractRepository.InsertAsync(oAContract);

            await _oaCustomerRepository.InsertAsync(oACustomer);

            ret.InStanceId = oAContract.Id.ToString();
            return(ret);
        }
Example #13
0
        public async Task <InitWorkFlowOutput> Create(CreateNoticeDocumentInput input)
        {
            var ret = new InitWorkFlowOutput();

            var model = new NoticeDocument();

            model.Id = Guid.NewGuid();
            //model.FileInfo = Newtonsoft.Json.JsonConvert.SerializeObject(input.FileInfo);
            model.NoticeType = input.NoticeType;
            //var userorgModel = await _userOrgRepository.FirstOrDefaultAsync(r => r.UserId == AbpSession.UserId.Value && r.IsMain == true);
            //var orgModel = await _organizeRepository.GetAsync(userorgModel.OrganizationUnitId);
            model.DispatchUnitName = input.DispatchUnitName;
            //model.DispatchUnit = orgModel.Id;
            model.DispatchTime          = DateTime.Now;
            model.PrintNum              = input.PrintNum;
            model.DispatchCode          = input.DispatchCode;
            model.Urgency               = input.Urgency;
            model.SecretLevel           = input.SecretLevel;
            model.ReceiveId             = input.ReceiveId;
            model.ReceiveName           = input.ReceiveName;
            model.Reason                = input.Reason;
            model.Content               = input.Content;
            model.IsNeedRes             = input.IsNeedRes;
            model.ProjectId             = input.ProjectId;
            model.Title                 = input.Title;
            model.Status                = 0;
            model.ProjectRegistrationId = input.ProjectRegistrationId;
            model.PubilishUserName      = input.PubilishUserName;
            model.MainReceiveName       = input.MainReceiveName;
            if (input.DocumentTyep.HasValue)
            {
                model.DocumentTyep = (int)input.DocumentTyep.Value;
            }

            model.NoticeDocumentBusinessType = (int)input.NoticeDocumentBusinessType;
            model.IsNeedAddWrite             = input.IsNeedAddWrite;
            model.GW_DocumentTypeId          = input.GW_DocumentTypeId;
            var gw_Model = await _gW_DocumentTypeRepository.FirstOrDefaultAsync(input.GW_DocumentTypeId);

            if (gw_Model != null)
            {
                model.GW_DocumentTypeName = gw_Model.Name;
            }

            model.AddType        = input.AddType;
            model.WriteType      = input.WriteType;
            model.AddWriteUsers  = GetWriteUser(input);
            model.AddWriteOrgIds = input.AddWriteOrgIds;
            if (input.NoticeDocumentBusinessType == NoticeDocumentBusinessType.项目评审发文)
            {
                model.Additional           = input.Additional;
                model.AuditAmount          = input.AuditAmount;
                model.EndDate              = input.EndDate;
                model.ProjectId            = input.ProjectId;
                model.ProjectLeader        = input.ProjectLeader;
                model.ProjectReviewer      = input.ProjectReviewer;
                model.ProjectUndertakeCode = input.ProjectUndertakeCode;
                model.Reason       = input.Reason;
                model.SendUnitName = input.SendUnitName;
                model.StartDate    = input.StartDate;
            }


            await _noticeDocumentRepository.InsertAsync(model);

            await CurrentUnitOfWork.SaveChangesAsync();

            ret.InStanceId = model.Id.ToString();
            return(ret);
        }