public async Task <ActionResult <bool> > SaveTralvel(TravelSaveQuery query) { TravelEntity entity = _mapper.Map <TravelEntity>(query); entity.createDate = DateTime.Now; entity.isShow = true; entity.operatorId = -1; bool flag = await _travelService.AddEntityAsync(entity); //保存附件关联 if (query.fileList.Length > 0) { foreach (var item in query.fileList) { await _travelFileAttachmentService.AddEntityAsync(new TravelFileAttachmentEntity { createDate = DateTime.Now, fileAttachmentId = item, travelId = entity.id, operatorId = -1 }); } } return(Ok(flag)); }