public async Task <InitWorkFlowOutput> Create(CreateCWGLBorrowMoneyInput input) { 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 }); var id = Guid.NewGuid(); var newmodel = new CWGLBorrowMoney() { Id = id, UserId = AbpSession.UserId.Value, OrgId = userOrgModel.OrgId, TypeId = input.TypeId, Money = input.Money, Mode = input.Mode, IsPayBack = false, BankName = input.BankName, CardNumber = input.CardNumber, BankOpenName = input.BankOpenName, Note = input.Note, RepaymentTime = input.RepaymentTime, Nummber = input.Nummber }; newmodel.Status = 0; await _repository.InsertAsync(newmodel); 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 }); } return(new InitWorkFlowOutput() { InStanceId = newmodel.Id.ToString() }); }
/// <summary> /// 添加一个CWGLBorrowMoney /// </summary> /// <param name="input">实体</param> /// <returns></returns> public async Task <InitWorkFlowOutput> CreateTest() { var input = new CreateCWGLBorrowMoneyInput() { BankName = "1", BankOpenName = "2", CardNumber = "3", FlowId = Guid.Parse("384c41b8-9d13-429b-ab62-fcc22e8639ee"), FlowTitle = "查询效率测试", Mode = MoneyMode.现金, Money = 12312, Note = "测试", Nummber = 1, TypeId = BorrowMoney.普通借款, }; 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 }); var id = Guid.NewGuid(); var newmodel = new CWGLBorrowMoney() { Id = id, UserId = AbpSession.UserId.Value, OrgId = userOrgModel.OrgId, TypeId = input.TypeId, Money = input.Money, Mode = input.Mode, IsPayBack = false, BankName = input.BankName, CardNumber = input.CardNumber, BankOpenName = input.BankOpenName, Note = input.Note, Nummber = input.Nummber }; newmodel.Status = 0; await _repository.InsertAsync(newmodel); 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 }); } var service1 = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IWorkFlowWorkTaskAppService>(); service1.InitWorkFlowInstance(new InitWorkFlowInput() { FlowId = input.FlowId, FlowTitle = input.FlowTitle, InStanceId = newmodel.Id.ToString() }); return(new InitWorkFlowOutput() { InStanceId = newmodel.Id.ToString() }); }