From 8decac88e38ab9c9da7cc7e47b53323680b8f8ef Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 18 Mar 2026 13:24:08 +0900 Subject: [PATCH] =?UTF-8?q?260318=5F01=5FENH:=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=EC=A7=80=EB=82=98=EB=8F=84=20=ED=8A=B9?= =?UTF-8?q?=EC=A0=95=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KART_API/Services/ProjectService.cs | 34 +++++++++++++++++++++++++++-- KART_API/Utils/Common.cs | 16 ++++++++++---- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/KART_API/Services/ProjectService.cs b/KART_API/Services/ProjectService.cs index 2dce1af..0cc9458 100644 --- a/KART_API/Services/ProjectService.cs +++ b/KART_API/Services/ProjectService.cs @@ -30,6 +30,8 @@ namespace KART_API.Services for (int i = 0; i < 2; i++) { + DataTable mustViewProject = getMustViewProject(i); + string konSqlString = "select '" + verArray[i]+ "' as [ver], '' AS ROWN,"; if (i == 1) { @@ -52,14 +54,19 @@ namespace KART_API.Services konSqlString += " (" + Environment.NewLine; konSqlString += " SELECT PKEY, GKEY, MKEY, JSON_QUERY(PROJECTJSON, '$.must') as PROJECTJSON, create_date" + Environment.NewLine; konSqlString += " FROM PROJECT with(nolock) where PKEY <> ''" + Environment.NewLine; - konSqlString += " and (create_date >= CONVERT(CHAR(10), DATEADD(YEAR, -1, GETDATE()), 23)"; + konSqlString += " and (create_date >= CONVERT(CHAR(10), DATEADD(YEAR, -1, GETDATE()), 23)"; if (i == 1) { konSqlString += " or JSON_VALUE(PROJECTJSON, '$.must.surveyclass') = '1'"; } - + if (mustViewProject.Rows.Count > 0) + { + string mustViewPkeys = string.Join(",", mustViewProject.Rows.OfType().Select(r => "'" + r["pkey"].ToString() + "'")); + konSqlString += " or PKEY in (" + mustViewPkeys + ")"; + } konSqlString += ")"; + konSqlString += " and JSON_VALUE(PROJECTJSON, '$.must.title_inner') not like '%사례비%'" + Environment.NewLine; konSqlString += " and JSON_VALUE(PROJECTJSON, '$.must.companytype') not in ('4', '5')" + Environment.NewLine; @@ -168,6 +175,29 @@ namespace KART_API.Services return returnTable; } + public DataTable getMustViewProject(int iskiwi) + { + + DataTable returnTable = new DataTable(); + MSDAL dal = new MSDAL(); + var connection = dal.ConnectReport(); + + try + { + returnTable = dal.GetDataTable($"SELECT pkey FROM REPORT_MUST_VIEW_PROJECT WHERE is_kiwi = {iskiwi}", connection); + } + catch (Exception ex) + { + logger.Fatal(this.GetType().Name + " > " + System.Reflection.MethodBase.GetCurrentMethod().Name + " : " + ex.Message); + } + finally + { + dal.Disconnect(connection); + } + + return returnTable; + } + /// /// User에게 배정된 프로젝트 Key들 반환 /// diff --git a/KART_API/Utils/Common.cs b/KART_API/Utils/Common.cs index df60ae2..170d94e 100644 --- a/KART_API/Utils/Common.cs +++ b/KART_API/Utils/Common.cs @@ -651,11 +651,19 @@ namespace KART_API.Utils /// 접속IP public static string GetRemoteIP() { - HttpContextAccessor hcAccessor = new HttpContextAccessor(); - var ip = hcAccessor.HttpContext.Connection.RemoteIpAddress.ToString(); - ip = ip.Split(',').Last().Trim(); + try + { + HttpContextAccessor hcAccessor = new HttpContextAccessor(); + var ip = hcAccessor.HttpContext.Connection.RemoteIpAddress.ToString(); + ip = ip.Split(',').Last().Trim(); - return ip; + return ip; + } + catch (Exception ex) + { + logger.Fatal("Common" + " > " + System.Reflection.MethodBase.GetCurrentMethod().Name + " : " + ex.Message); + return string.Empty; + } } ///