|
@@ -5,6 +5,7 @@ using System.Data;
|
|
using GFGEditor;
|
|
using GFGEditor;
|
|
using OfficeOpenXml;
|
|
using OfficeOpenXml;
|
|
using System;
|
|
using System;
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
|
namespace GFGEditor
|
|
namespace GFGEditor
|
|
{
|
|
{
|
|
@@ -179,7 +180,7 @@ namespace GFGEditor
|
|
{
|
|
{
|
|
string newName = newWorksheet.Cells[3, j].Text.Trim();
|
|
string newName = newWorksheet.Cells[3, j].Text.Trim();
|
|
string newType = newWorksheet.Cells[2, j].Text.Trim();
|
|
string newType = newWorksheet.Cells[2, j].Text.Trim();
|
|
- if (name == newName && type == newType)
|
|
|
|
|
|
+ if (newWorksheet.Name != worksheet.Name && name == newName && type == newType)
|
|
{
|
|
{
|
|
needWriteColumn = false;
|
|
needWriteColumn = false;
|
|
}
|
|
}
|
|
@@ -205,21 +206,45 @@ namespace GFGEditor
|
|
|
|
|
|
int rowNum = worksheet.Dimension.End.Row;
|
|
int rowNum = worksheet.Dimension.End.Row;
|
|
int columnNum = worksheet.Dimension.End.Column;
|
|
int columnNum = worksheet.Dimension.End.Column;
|
|
|
|
+ if (worksheet.Name == "联盟题库_LeagueQuestionCfg")
|
|
|
|
+ {
|
|
|
|
+ Debug.Log("");
|
|
|
|
+ }
|
|
for (int i = 5; i <= rowNum; i++)
|
|
for (int i = 5; i <= rowNum; i++)
|
|
{
|
|
{
|
|
newRowNum = newWorksheet.Dimension == null ? 0 : newWorksheet.Dimension.End.Row;
|
|
newRowNum = newWorksheet.Dimension == null ? 0 : newWorksheet.Dimension.End.Row;
|
|
newWorksheet.InsertRow(newRowNum + 1, 1);
|
|
newWorksheet.InsertRow(newRowNum + 1, 1);
|
|
int column = 0;
|
|
int column = 0;
|
|
|
|
+ Dictionary<string, int> dicArray = new Dictionary<string, int>();
|
|
for (int j = 1; j <= columnNum; j++)
|
|
for (int j = 1; j <= columnNum; j++)
|
|
{
|
|
{
|
|
string title = worksheet.Cells[3, j].Text.Trim();
|
|
string title = worksheet.Cells[3, j].Text.Trim();
|
|
string type = worksheet.Cells[2, j].Text.Trim();
|
|
string type = worksheet.Cells[2, j].Text.Trim();
|
|
|
|
+ if (type.Contains("[]#") && !type.Contains("[][]#"))
|
|
|
|
+ {
|
|
|
|
+ if (!dicArray.ContainsKey(title))
|
|
|
|
+ {
|
|
|
|
+ dicArray[title] = 0;
|
|
|
|
+ }
|
|
|
|
+ dicArray[title] = dicArray[title] + 1;
|
|
|
|
+ }
|
|
if (string.IsNullOrEmpty(title)) continue;
|
|
if (string.IsNullOrEmpty(title)) continue;
|
|
|
|
+
|
|
|
|
+ Dictionary<string, int> newDicArray = new Dictionary<string, int>();
|
|
for (int k = 1; k <= newColumnNum; k++)
|
|
for (int k = 1; k <= newColumnNum; k++)
|
|
{
|
|
{
|
|
string newTitle = newWorksheet.Cells[3, k].Text.Trim();
|
|
string newTitle = newWorksheet.Cells[3, k].Text.Trim();
|
|
string newType = newWorksheet.Cells[2, k].Text.Trim();
|
|
string newType = newWorksheet.Cells[2, k].Text.Trim();
|
|
- if (newTitle == title && newType == type)
|
|
|
|
|
|
+ if (newType.Contains("[]#") && !newType.Contains("[][]#"))
|
|
|
|
+ {
|
|
|
|
+ if (!newDicArray.ContainsKey(newTitle))
|
|
|
|
+ {
|
|
|
|
+ newDicArray[newTitle] = 0;
|
|
|
|
+ }
|
|
|
|
+ newDicArray[newTitle] = newDicArray[newTitle] + 1;
|
|
|
|
+ }
|
|
|
|
+ bool isSame = newTitle == title && newType == type;
|
|
|
|
+ if (isSame && (dicArray.ContainsKey(title) && newDicArray.ContainsKey(newTitle) && dicArray[title] == newDicArray[newTitle] || !dicArray.ContainsKey(title) && !newDicArray.ContainsKey(newTitle)))
|
|
{
|
|
{
|
|
column = k;
|
|
column = k;
|
|
break;
|
|
break;
|