``增加跳列功能

This commit is contained in:
路 范
2022-03-14 10:02:56 +08:00
parent 2a4132a176
commit 01b21749b8
5 changed files with 17 additions and 7 deletions

View File

@@ -78,6 +78,11 @@ namespace TempTask.WebEntry.ApiController.Dto
/// 跳过行 集合 行留空
/// </summary>
public List<int> skip_rows { get; set; }
/// <summary>
/// 跳过行 集合 行留空
/// </summary>
public List<string> skip_columns { get; set; }
}
/// <summary>
///

View File

@@ -85,7 +85,6 @@ namespace TempTask.WebEntry.Tools
int current_skip_count = 0;
for (int i = 0; i < sheet_item.null_row_count; i++)
{
var c_rowindex = startRowIndex + i;
if (sheet_item.skip_rows != null && sheet_item.skip_rows.Contains(c_rowindex + 1))
{
@@ -101,10 +100,13 @@ namespace TempTask.WebEntry.Tools
}
else
{
var column_letter = App.Configuration[$"column_name_match_{excelTypeInt}_{sheet_item.sheet_no}:{ x.ToExcelColumnName()}"];
if (string.IsNullOrWhiteSpace(column_letter))
var column_letter = x.ToExcelColumnName();
if (sheet_item.skip_columns != null && sheet_item.skip_columns.Contains(column_letter))
continue;
var jtoken = datas[i - current_skip_count][column_letter];
var api_column_name = App.Configuration[$"column_name_match_{excelTypeInt}_{sheet_item.sheet_no}:{ x.ToExcelColumnName()}"];
if (string.IsNullOrWhiteSpace(api_column_name))
continue;
var jtoken = datas[i - current_skip_count][api_column_name];
var cellvalue = string.Empty;
if (jtoken.Type == JTokenType.Null)
cellvalue = "/";

View File

@@ -18,7 +18,8 @@
"start_cell": "B",
"null_cell_count": 27,
"url": "http://10.19.94.196:81/data-system/api/bigScreen/house/totalKeyRate?months={year}{_month}&week={week2}",
"skip_rows": [ 10, 12 ]
"skip_rows": [ 10, 12 ],
},
{
"sheet_no": 2,
@@ -51,7 +52,8 @@
"null_row_count": 14,
"start_cell": "B",
"null_cell_count": 27,
"url": "http://10.19.94.196:81/data-system/api/bigScreen/house/areaKeyRate1?type=104,105,106,107,108,109&months={year}{_month}&week={week2}"
"url": "http://10.19.94.196:81/data-system/api/bigScreen/house/areaKeyRate1?type=104,105,106,107,108,109&months={year}{_month}&week={week2}",
//"skip_columns": [ "J", "S" ]
},
{
"sheet_no": 3,
@@ -93,7 +95,8 @@
"null_row_count": 13,
"start_cell": "B",
"null_cell_count": 24,
"url": "http://10.19.94.196:81/data-system/api/bigScreen/house/areaKeyRate1?type=101,102,103&months={year}{_month}&week={week2}"
"url": "http://10.19.94.196:81/data-system/api/bigScreen/house/areaKeyRate1?type=101,102,103&months={year}{_month}&week={week2}",
//"skip_columns": [ "P", "S" ]
},
{
"sheet_no": 3,