示例#1
0
        public async Task <InitWorkFlowOutput> Create(OATenderAuditInputDto input)
        {
            var model = input.MapTo <OATenderAudit>();

            model.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   = model.Id.ToString(),
                    BusinessType = (int)AbpFileBusinessType.OA投标文件审查附件,
                    Files        = fileList
                });
            }
            model.Status = 0;

            _oaTenderAuditRepository.Insert(model);
            return(new InitWorkFlowOutput()
            {
                InStanceId = model.Id.ToString()
            });
        }
示例#2
0
        public async Task Update(OATenderAuditInputDto input)
        {
            var ret = _oaTenderAuditRepository.Get(input.Id.Value);

            ret = input.MapTo(ret);
            var fileList = new List <AbpFileListInput>();

            if (input.FileList != null)
            {
                foreach (var item in input.FileList)
                {
                    fileList.Add(new AbpFileListInput()
                    {
                        Id = item.Id, Sort = item.Sort
                    });
                }
            }
            await _abpFileRelationAppService.UpdateAsync(new CreateFileRelationsInput()
            {
                BusinessId   = input.Id.ToString(),
                BusinessType = (int)AbpFileBusinessType.OA投标文件审查附件,
                Files        = fileList
            });

            _oaTenderAuditRepository.Update(ret);
        }