using Newtonsoft.Json; namespace Server.Git { public class XlsxToJson : AbstractGit { public override string ChangeScript() { //저장경로 : repositoryPath List fileList = GetFiles(repositoryPath, ".xlsx"); Dictionary>> clientSheetList = new Dictionary>>(); List serverSheetList = new List(); for (int n = 0; n < fileList.Count; n++) { ExcelManager em = new ExcelManager(fileList[n]); if (em.Play()) { sheets = em.sheets; for (int m = 0; m < sheets.Count; m++) { switch (sheets[m].dataEnum[0]) { case "server": serverSheetList.Add(sheets[m]); break; case "client": clientSheetList.Add(sheets[m].name, sheets[m].dicViewer); break; case "all": string name = sheets[m].name; Dictionary> clientSheet = new Dictionary>(sheets[m].dicViewer); for (int i = 1; i < sheets[m].dataEnum.Count; i++) { if (sheets[m].dataEnum[i] == "server") { foreach (var item in clientSheet) { item.Value.Remove(sheets[m].variable[i]); } } } clientSheetList.Add(name, clientSheet); serverSheetList.Add(sheets[m]); break; } } } else { //Console.WriteLine("-1 : NotUpdate"); return ""; } } //현재 서버는 PostgreSQL기준으로 쿼리를 생성하는 코드와 패키지가 세팅되어 있습니다 이점 참고바랍니다 //추가로 해당 기능을 사용하려면 서버에 excel이라는 스키마가 존재하여야 합니다. if (sheets != null && serverSheetList.Count != 0) { ExcelSQL sql = new ExcelSQL(serverSheetList); sql.DataUpdate(); } return JsonConvert.SerializeObject(clientSheetList); } } }