2025-07-04 10:47:18 +08:00

81 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using MyCode.Project.Domain.Message.Act.Common;
using MyCode.Project.Domain.Repositories;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.OutSideService;
using MyCode.Project.Services.BLL.ReportExport;
namespace MyCode.Project.Services.Implementation
{
public class ReportService : ServiceBase, IReportService
{
#region
private readonly IRepository _repository;
private readonly IBfyService _bfyService;
public ReportService(IRepository repository,
IBfyService bfyService
)
{
_repository = repository;
_bfyService = bfyService;
}
#endregion
#region ReportExportAnsy()
/// <summary>
/// 异步执行导出有带websocket异步推送
/// </summary>
/// <param name="obj"></param>
public string ReportExportAnsy(object obj)
{
var act = JsonHelper.ToObject<AnsyReportExportAct>(obj.ToString());
return ReportExport(act);
}
#endregion
#region ReportExportAnsy()
/// <summary>
/// 异步执行导出有带websocket异步推送
/// </summary>
/// <param name="obj"></param>
public string ReportExport(AnsyReportExportAct act)
{
var export = ExportReportFactory.Create(act.ReportType);
export.Condition = act.Condition;
export.CurrentUser = act.CurrentUser;
export.ReportId = act.ReportId;
export.ExcelFileType = act.ExportFileType;
return export.Execute();
}
#endregion
#region HtmLToXls(html转成xls)
/// <summary>
/// 测试html转成xls
/// </summary>
public void HtmLToXls()
{
MiniExcelLibs.MiniExcel.SaveAsByTemplate(@"E:\Git\Lxm_Report_Api\MyCode.Project.WebApi\App_File\test2.xls", @"E:\Git\Lxm_Report_Api\MyCode.Project.WebApi\App_File\test.xls", new { });
}
#endregion
}
}