|
|
@ -246,7 +246,7 @@ WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); |
|
|
|
var sql = @$" SELECT *
|
|
|
|
var sql = @$" SELECT *
|
|
|
|
FROM Ghrh_HumanRequestSummary_V A";
|
|
|
|
FROM Ghrh_HumanRequestSummary_V A";
|
|
|
|
|
|
|
|
|
|
|
|
string conditions = " WHERE 1=1 "; |
|
|
|
string conditions = " WHERE 1=1 "; |
|
|
|
|
|
|
|
|
|
|
|
var properties = entityType.GetGenericProperties(); |
|
|
|
var properties = entityType.GetGenericProperties(); |
|
|
|
|
|
|
|
|
|
|
@ -281,7 +281,7 @@ WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); |
|
|
|
var tags = await Db.Queryable<Ghrh_ResumeTag>().Where(x => tagIds.Contains(x.Id)).ToListAsync(); |
|
|
|
var tags = await Db.Queryable<Ghrh_ResumeTag>().Where(x => tagIds.Contains(x.Id)).ToListAsync(); |
|
|
|
for (int i = 0; i < list.Count; i++) |
|
|
|
for (int i = 0; i < list.Count; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -362,4 +362,60 @@ WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult<ExcelData>> ExportSummaryExcel(QueryExport body) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QueryBody filter = new QueryBody(); |
|
|
|
|
|
|
|
filter.pageNum = 1; |
|
|
|
|
|
|
|
filter.jsonParam = body.jsonParam; |
|
|
|
|
|
|
|
filter.pageSize = 1000000; |
|
|
|
|
|
|
|
filter.langId = body.langId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var condition = "1=1"; |
|
|
|
|
|
|
|
if (body.exportSet.SelectRowKeys != null && body.exportSet.SelectRowKeys.Any()) |
|
|
|
|
|
|
|
condition += $" AND Id IN({string.Join(",", body.exportSet.SelectRowKeys)})"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = await QueryFilterSummaryPage(filter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string sql = $@"SELECT *
|
|
|
|
|
|
|
|
FROM Ghrs_PageSettingQuery |
|
|
|
|
|
|
|
WHERE IsEnable = 1 |
|
|
|
|
|
|
|
AND PageNo = '{body.menuName}' |
|
|
|
|
|
|
|
AND (defaultHidden = 'false' OR defaultHidden is null) |
|
|
|
|
|
|
|
ORDER BY SortNo ASC";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var columns = DbAccess.QueryList<QueryExportColumn>(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fieldDescs = new Dictionary<string, string>(); |
|
|
|
|
|
|
|
if (body.exportSet.ExFields.Any()) |
|
|
|
|
|
|
|
body.exportSet.ExFields.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (columns.Any(o => o.field == x)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var label = columns.FirstOrDefault(o => o.field == x)?.label; |
|
|
|
|
|
|
|
if (!fieldDescs.ContainsKey(x)) |
|
|
|
|
|
|
|
fieldDescs.Add(x, label); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
fieldDescs = columns.ToDictionary(item => item.field, item => item.label); |
|
|
|
|
|
|
|
var dt = ToDataTable(data.result.DT_TableDataT1, fieldDescs, null); |
|
|
|
|
|
|
|
// 获取所有列名 |
|
|
|
|
|
|
|
var dtColumns = dt.Columns; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id = SnowFlakeSingle.instance.getID(); |
|
|
|
|
|
|
|
var physicsPath = $"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}wwwroot"; |
|
|
|
|
|
|
|
var path = $"{$"{Path.DirectorySeparatorChar}files{Path.DirectorySeparatorChar}export{Path.DirectorySeparatorChar}{id}{Path.DirectorySeparatorChar}"}"; |
|
|
|
|
|
|
|
if (!Directory.Exists(physicsPath + path)) |
|
|
|
|
|
|
|
Directory.CreateDirectory(physicsPath + path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path = path + body.exportSet.TitleName + ".xlsx"; |
|
|
|
|
|
|
|
NPOIHelper.ExportExcel(dt, body.exportSet.TitleName, "sheet1", physicsPath + path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = new ExcelData(); |
|
|
|
|
|
|
|
result.filePath = "/Advanced" + path; |
|
|
|
|
|
|
|
result.fileName = body.exportSet.TitleName + ".xlsx"; |
|
|
|
|
|
|
|
return ServiceResult<ExcelData>.OprateSuccess("导出成功", result); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |