260318_01_ENH: 조회 기간 지나도 특정 프로젝트 조회 가능하도록 수정
This commit is contained in:
@@ -30,6 +30,8 @@ namespace KART_API.Services
|
|||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
|
DataTable mustViewProject = getMustViewProject(i);
|
||||||
|
|
||||||
string konSqlString = "select '" + verArray[i]+ "' as [ver], '' AS ROWN,";
|
string konSqlString = "select '" + verArray[i]+ "' as [ver], '' AS ROWN,";
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
{
|
{
|
||||||
@@ -52,14 +54,19 @@ namespace KART_API.Services
|
|||||||
konSqlString += " (" + Environment.NewLine;
|
konSqlString += " (" + Environment.NewLine;
|
||||||
konSqlString += " SELECT PKEY, GKEY, MKEY, JSON_QUERY(PROJECTJSON, '$.must') as PROJECTJSON, create_date" + 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 += " 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)
|
if (i == 1)
|
||||||
{
|
{
|
||||||
konSqlString += " or JSON_VALUE(PROJECTJSON, '$.must.surveyclass') = '1'";
|
konSqlString += " or JSON_VALUE(PROJECTJSON, '$.must.surveyclass') = '1'";
|
||||||
}
|
}
|
||||||
|
if (mustViewProject.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
string mustViewPkeys = string.Join(",", mustViewProject.Rows.OfType<DataRow>().Select(r => "'" + r["pkey"].ToString() + "'"));
|
||||||
|
konSqlString += " or PKEY in (" + mustViewPkeys + ")";
|
||||||
|
}
|
||||||
konSqlString += ")";
|
konSqlString += ")";
|
||||||
|
|
||||||
konSqlString += " and JSON_VALUE(PROJECTJSON, '$.must.title_inner') not like '%사례비%'" + Environment.NewLine;
|
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;
|
konSqlString += " and JSON_VALUE(PROJECTJSON, '$.must.companytype') not in ('4', '5')" + Environment.NewLine;
|
||||||
|
|
||||||
@@ -168,6 +175,29 @@ namespace KART_API.Services
|
|||||||
return returnTable;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User에게 배정된 프로젝트 Key들 반환
|
/// User에게 배정된 프로젝트 Key들 반환
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -651,11 +651,19 @@ namespace KART_API.Utils
|
|||||||
/// <returns>접속IP</returns>
|
/// <returns>접속IP</returns>
|
||||||
public static string GetRemoteIP()
|
public static string GetRemoteIP()
|
||||||
{
|
{
|
||||||
HttpContextAccessor hcAccessor = new HttpContextAccessor();
|
try
|
||||||
var ip = hcAccessor.HttpContext.Connection.RemoteIpAddress.ToString();
|
{
|
||||||
ip = ip.Split(',').Last().Trim();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user