public async Task <IActionResult> SecondaryAdminDownloadAssetDeploy(DownloadAssetDeploy model)
        {
            byte[] reportBytes;
            using (var package = await _assetDeployService.DownloadAssetDeploy(model))
            {
                reportBytes = package.GetAsByteArray();
            }

            return(File(reportBytes, XlsxContentType, "report.xlsx"));
        }
        public async Task <ExcelPackage> DownloadAssetDeploy(DownloadAssetDeploy model)
        {
            var deploys = _assetDeployRepository.GetAll(it => it.AuthorizeOrgInfo.OrgId == _user.OrgId &&
                                                        it.CreateDateTime >= model.StartDate &&
                                                        it.CreateDateTime <= model.EndDate);

            if (model.ImportOrgId != null)
            {
                deploys = deploys.Where(it => it.ImportOrgInfo.OrgId == model.ImportOrgId.Value);
            }

            if (model.ExportOrgId != null)
            {
                deploys = deploys.Where(it => it.ExportOrgInfo.OrgId == model.ExportOrgId.Value);
            }

            var dtos = await _mapper.ProjectTo <AssetDeployDto>(deploys).ToListAsync();

            return(CreateAssetDeployExcelPackage(dtos));
        }