コード例 #1
0
        public void CreateCredential(Guid flowID, string InstanceID)
        {
            var id      = Guid.Parse(InstanceID);
            var model   = _repository.Get(id);
            var service = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <ICWGLCredentialAppService>();
            var input   = new CreateCWGLCredentialInput();

            input.IsPay        = true;
            input.BusinessType = CredentialType.付款;
            input.BusinessId   = id;
            input.Name         = model.UserName;
            input.Cause        = model.Note;
            input.Money        = model.Money;
            input.FlowNumber   = model.FlowNumber;
            input.ContractNum  = model.ContractNum;
            input.Mode         = model.Mode;
            input.BankName     = model.BankName;
            input.CardNumber   = model.CardNumber;
            input.BankOpenName = model.BankOpenName;
            input.Nummber      = model.Nummber;
            var files = _abpFileRelationAppService.GetList(new GetAbpFilesInput()
            {
                BusinessId   = model.Id.ToString(),
                BusinessType = (int)AbpFileBusinessType.付款申请
            });

            input.FileList = files;
            service.Create(input);
        }
コード例 #2
0
        public void CreateCredential(Guid flowID, string InstanceID, bool isPay)
        {
            var id    = Guid.Parse(InstanceID);
            var model = _repository.Get(id);

            if (model.TypeId == BorrowMoney.备用金)
            {
                return;
            }
            var user    = _usersRepository.Get(model.UserId);
            var service = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <ICWGLCredentialAppService>();
            var input   = new CreateCWGLCredentialInput();

            input.IsPay        = isPay;
            input.BusinessType = CredentialType.借款;
            input.BusinessId   = id;
            input.Name         = user.Name;
            input.Cause        = model.Note;
            input.Money        = model.Money;
            if (isPay)
            {
                input.Mode         = model.Mode;
                input.BankName     = model.BankName;
                input.CardNumber   = model.CardNumber;
                input.BankOpenName = model.BankOpenName;
            }
            else
            {
                input.Mode         = model.RepayMode ?? model.RepayMode.Value;
                input.BankName     = model.RepayBankName;
                input.CardNumber   = model.RepayCardNumber;
                input.BankOpenName = model.RepayBankOpenName;
                input.CreationTime = model.RepayTime;
                model.IsPayBack    = true;
                _repository.Update(model);
            }
            input.Nummber = model.Nummber;
            var files = _abpFileRelationAppService.GetList(new GetAbpFilesInput()
            {
                BusinessId   = model.Id.ToString(),
                BusinessType = (int)AbpFileBusinessType.借款申请
            });

            input.FileList = files;
            service.Create(input);
        }
コード例 #3
0
        /// <summary>
        /// 添加一个CWGLCredential
        /// </summary>
        /// <param name="input">实体</param>
        /// <returns></returns>

        public async Task Create(CreateCWGLCredentialInput input)
        {
            var id       = Guid.NewGuid();
            var newmodel = new CWGLCredential()
            {
                Id           = id,
                Name         = input.Name,
                Cause        = input.Cause,
                Money        = input.Money,
                Mode         = input.Mode,
                IsPay        = input.IsPay,
                BankName     = input.BankName,
                ContractNum  = input.ContractNum,
                FlowNumber   = input.FlowNumber,
                CardNumber   = input.CardNumber,
                BankOpenName = input.BankOpenName,
                Nummber      = input.Nummber,
                BusinessId   = input.BusinessId,
                BusinessType = input.BusinessType
            };

            if (input.CreationTime.HasValue)
            {
                newmodel.CreationTime = input.CreationTime.Value;
            }

            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
                });
            }
        }