|
@@ -564,7 +564,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 客户资料数据 excel 下载
|
|
|
+ /// 客户资料数据 全信息导出 excel 下载
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
@@ -596,7 +596,63 @@ namespace OASystem.API.Controllers
|
|
|
designer.Process();
|
|
|
|
|
|
//文件名
|
|
|
- string fileName = $"公司客户资料{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
+ string fileName = $"公司客户资料(全信息导出){DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
+ designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "NewClientDataExcelDownload/" + fileName);
|
|
|
+ string url = AppSettingsHelper.Get("ExcelBaseUrl") + "Office/Excel/NewClientDataExcelDownload/" + fileName;
|
|
|
+
|
|
|
+ #region 客户资料表操作记录
|
|
|
+ var respose = JsonView(true, "成功", url);
|
|
|
+ //var paramData = new
|
|
|
+ //{
|
|
|
+ // APIName = @"MarketCustomerResources/NewClientDataExcelDownload",
|
|
|
+ // RequestParam = dto,
|
|
|
+ // ResposeParam = respose
|
|
|
+ //};
|
|
|
+ //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Download, dto.OperationUserId, 0, JsonConvert.SerializeObject(paramData));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return Ok(respose);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 客户资料数据 分权限导出 excel 下载
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ApiLog("Crm_NewClientData", OperationEnum.Download)]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> NewClientDataAuthorityExcelDownload(NewClientDataExcelDownloadDto dto)
|
|
|
+ {
|
|
|
+ #region 参数验证
|
|
|
+ if (dto.OperationUserId < 0) return Ok(JsonView(false, "请传入有效的OperationUserId参数!"));
|
|
|
+
|
|
|
+ if (dto.PortType < 0) return Ok(JsonView(false, "请传入有效的PortType参数!"));
|
|
|
+ if (dto.PageId < 0) return Ok(JsonView(false, "请传入有效的PageId参数!"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 页面操作权限验证
|
|
|
+ var pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.OperationUserId, dto.PageId);
|
|
|
+
|
|
|
+ if (pageFunAuthView.FilesDownloadAuth == 0) return Ok(JsonView(false, "您没有文件下载权!"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ var dt = await _clientDataRepository.NewClientDataExcelDownload(dto);
|
|
|
+ if (dt != null)
|
|
|
+ {
|
|
|
+ string tempPath = (AppSettingsHelper.Get("ExcelBasePath") + "Template/公司客户资料分权限导出模板.xlsx");
|
|
|
+ var designer = new WorkbookDesigner();
|
|
|
+ designer.Workbook = new Workbook(tempPath);
|
|
|
+ designer.SetDataSource("NCDDT", dt);
|
|
|
+ designer.Process();
|
|
|
+
|
|
|
+ //文件名
|
|
|
+ string fileName = $"公司客户资料(分权限导出){DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "NewClientDataExcelDownload/" + fileName);
|
|
|
string url = AppSettingsHelper.Get("ExcelBaseUrl") + "Office/Excel/NewClientDataExcelDownload/" + fileName;
|
|
|
|
|
@@ -619,6 +675,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 客户资料数据 历史记录 Init
|
|
|
/// </summary>
|