diff --git a/Server/Git/ExcelManager.cs b/Server/Git/ExcelManager.cs index 3f036c0..0525c79 100644 --- a/Server/Git/ExcelManager.cs +++ b/Server/Git/ExcelManager.cs @@ -24,6 +24,17 @@ namespace Server.Git this._type = type; this._dicViewer = dicViewer; } + + + + public Sheet(Sheet sheet) + { + this._name = new string(sheet.name); + this._variable = new List(sheet.variable); + this._dataEnum = new List(sheet.dataEnum); + this._type = new List(type); + this._dicViewer = new Dictionary>(dicViewer); + } } class ExcelManager { diff --git a/Server/Git/XlsxToJson.cs b/Server/Git/XlsxToJson.cs index 13013a8..a0fb767 100644 --- a/Server/Git/XlsxToJson.cs +++ b/Server/Git/XlsxToJson.cs @@ -21,41 +21,31 @@ namespace Server.Git sheets = em.sheets; for (int m = 0; m < sheets.Count; m++) { - Sheet sheet = sheets[m]; switch (sheets[m].dataEnum[0]) { case "server": - serverSheetList.Add(sheet); + serverSheetList.Add(new Sheet(sheets[m])); break; case "client": - clientSheetList.Add(sheet.name, sheet.dicViewer); + clientSheetList.Add(sheets[m].name, sheets[m].dicViewer); break; case "all": //수정할것 이렇게 작업되면 데이터가 2개로 나눠지는것이 아닌 한개의 데이터가 중복으로 제거됨. - string name = sheets[m].name; - Dictionary> serverSheet = new Dictionary>(sheets[m].dicViewer); - Dictionary> clientSheet = new Dictionary>(sheets[m].dicViewer); - for (int i = 1; i < sheets[m].dataEnum.Count; i++) + Sheet sheet = new Sheet(sheets[m]); + string name = sheet.name; + //서버는 다른곳에서 처리를 하기때문에 여기서는 add만 시켜줌. + serverSheetList.Add(new Sheet(sheets[m])); + Dictionary> clientSheet = sheet.dicViewer; + for (int i = 1; i < sheet.dataEnum.Count; i++) { - if (sheets[m].dataEnum[i] == "client") - { - foreach (var item in serverSheet) - { - item.Value.Remove(sheets[m].variable[i]); - } - } - } - for (int i = 1; i < sheets[m].dataEnum.Count; i++) - { - if (sheets[m].dataEnum[i] == "server") + if (sheet.dataEnum[i] == "server") { foreach (var item in clientSheet) { - item.Value.Remove(sheets[m].variable[i]); + item.Value.Remove(sheet.variable[i]); } } } - serverSheetList.Add(sheets[m]); clientSheetList.Add(name, clientSheet); break; }