|
@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
using MiniExcelLibs;
|
|
|
using NPOI.HPSF;
|
|
|
+using SqlSugar;
|
|
|
using System.Net.Http;
|
|
|
using System.Reflection;
|
|
|
using XF.Domain.Dependency;
|
|
@@ -79,7 +80,21 @@ namespace Hotline.Application.ExportExcel
|
|
|
dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(columnInfos);
|
|
|
|
|
|
var dtos = items
|
|
|
- .Select(item => _mapper.Map(item, typeT, dynamicClass))
|
|
|
+ .Select(item =>
|
|
|
+ {
|
|
|
+ var mappedItem = _mapper.Map(item, typeT, dynamicClass);
|
|
|
+ foreach (var prop in mappedItem.GetType().GetProperties())
|
|
|
+ {
|
|
|
+ if (prop.PropertyType == typeof(string))
|
|
|
+ {
|
|
|
+ if((string)prop.GetValue(mappedItem) == "True")
|
|
|
+ prop.SetValue(mappedItem, "是");
|
|
|
+ if((string)prop.GetValue(mappedItem) == "False")
|
|
|
+ prop.SetValue(mappedItem, "否");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mappedItem;
|
|
|
+ })
|
|
|
.Cast<object>()
|
|
|
.ToList();
|
|
|
|