버그 1차 수정

This commit is contained in:
김민서 2024-02-27 11:18:26 +09:00
parent 584e47be4e
commit 82478fcf8b
2 changed files with 21 additions and 20 deletions

View File

@ -24,6 +24,17 @@ namespace Server.Git
this._type = type; this._type = type;
this._dicViewer = dicViewer; this._dicViewer = dicViewer;
} }
public Sheet(Sheet sheet)
{
this._name = new string(sheet.name);
this._variable = new List<string>(sheet.variable);
this._dataEnum = new List<string>(sheet.dataEnum);
this._type = new List<string>(type);
this._dicViewer = new Dictionary<long, Dictionary<string, object>>(dicViewer);
}
} }
class ExcelManager class ExcelManager
{ {

View File

@ -21,41 +21,31 @@ namespace Server.Git
sheets = em.sheets; sheets = em.sheets;
for (int m = 0; m < sheets.Count; m++) for (int m = 0; m < sheets.Count; m++)
{ {
Sheet sheet = sheets[m];
switch (sheets[m].dataEnum[0]) switch (sheets[m].dataEnum[0])
{ {
case "server": case "server":
serverSheetList.Add(sheet); serverSheetList.Add(new Sheet(sheets[m]));
break; break;
case "client": case "client":
clientSheetList.Add(sheet.name, sheet.dicViewer); clientSheetList.Add(sheets[m].name, sheets[m].dicViewer);
break; break;
case "all": case "all":
//수정할것 이렇게 작업되면 데이터가 2개로 나눠지는것이 아닌 한개의 데이터가 중복으로 제거됨. //수정할것 이렇게 작업되면 데이터가 2개로 나눠지는것이 아닌 한개의 데이터가 중복으로 제거됨.
string name = sheets[m].name; Sheet sheet = new Sheet(sheets[m]);
Dictionary<long, Dictionary<string, object>> serverSheet = new Dictionary<long, Dictionary<string, object>>(sheets[m].dicViewer); string name = sheet.name;
Dictionary<long, Dictionary<string, object>> clientSheet = new Dictionary<long, Dictionary<string, object>>(sheets[m].dicViewer); //서버는 다른곳에서 처리를 하기때문에 여기서는 add만 시켜줌.
for (int i = 1; i < sheets[m].dataEnum.Count; i++) serverSheetList.Add(new Sheet(sheets[m]));
Dictionary<long, Dictionary<string, object>> clientSheet = sheet.dicViewer;
for (int i = 1; i < sheet.dataEnum.Count; i++)
{ {
if (sheets[m].dataEnum[i] == "client") if (sheet.dataEnum[i] == "server")
{
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")
{ {
foreach (var item in clientSheet) 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); clientSheetList.Add(name, clientSheet);
break; break;
} }