| | |
| | |  |
| | | using AutoMapper; |
| | | using NPOI.SS.UserModel; |
| | | using NPOI.XSSF.UserModel; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.Helper; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_ITaskInfo_HtyRepository; |
| | | using WIDESEAWCS_ITaskInfo_HtyService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | public Task_HtyService(ITask_HtyRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | public override WebResponseContent Export(PageDataOptions options) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string savePath = AppDomain.CurrentDomain.BaseDirectory + "ExcelExport"; |
| | | |
| | | // ç¡®ä¿ç®å½åå¨ |
| | | if (!Directory.Exists(savePath)) |
| | | Directory.CreateDirectory(savePath); |
| | | |
| | | // è·åæ°æ® |
| | | ISugarQueryable<Dt_Task_Hty> query = BaseDal.Db.Queryable<Dt_Task_Hty>(); |
| | | var dataList = query.ToList(); |
| | | var properties = typeof(Dt_Task_Hty).GetProperties(); |
| | | string filePath = TExportHelper.GetExport(savePath, properties, dataList); |
| | | return WebResponseContent.Instance.OK(data: filePath); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |