251209_01_ENH: net ver 8로 높임, Contact 조회용 프로젝트 조회 API 추가
This commit is contained in:
@@ -18,6 +18,12 @@ namespace REPORT_API_ver6.Services
|
||||
{
|
||||
static readonly log4net.ILog logger = log4net.LogManager.GetLogger(typeof(Common));
|
||||
|
||||
public static IConfiguration GetConfiguration()
|
||||
{
|
||||
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request 변수값 반환
|
||||
/// </summary>
|
||||
|
||||
@@ -11,16 +11,6 @@ namespace REPORT_API_ver6.Services
|
||||
{
|
||||
static readonly log4net.ILog logger = log4net.LogManager.GetLogger(typeof(DAL));
|
||||
|
||||
/// <summary>
|
||||
/// Config 파일 로드
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IConfiguration GetConfiguration()
|
||||
{
|
||||
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report DB 연결
|
||||
/// </summary>
|
||||
@@ -30,7 +20,7 @@ namespace REPORT_API_ver6.Services
|
||||
SqlConnection connection = new SqlConnection();
|
||||
try
|
||||
{
|
||||
var configuration = GetConfiguration();
|
||||
var configuration = Common.GetConfiguration();
|
||||
connection.ConnectionString = configuration.GetSection("ConnectionStrings").GetSection("ReportString").Value;
|
||||
connection.Open();
|
||||
}
|
||||
@@ -52,7 +42,7 @@ namespace REPORT_API_ver6.Services
|
||||
string connectionString = string.Empty;
|
||||
try
|
||||
{
|
||||
var configuration = GetConfiguration();
|
||||
var configuration = Common.GetConfiguration();
|
||||
|
||||
if (isKiwi == 0)
|
||||
{
|
||||
@@ -82,7 +72,7 @@ namespace REPORT_API_ver6.Services
|
||||
SqlConnection connection = new SqlConnection();
|
||||
try
|
||||
{
|
||||
var configuration = GetConfiguration();
|
||||
var configuration = Common.GetConfiguration();
|
||||
connection.ConnectionString = configuration.GetSection("ConnectionStrings").GetSection("IntraString").Value;
|
||||
connection.Open();
|
||||
}
|
||||
|
||||
@@ -117,6 +117,59 @@ namespace REPORT_API_ver6.Services
|
||||
return returnTable;
|
||||
}
|
||||
|
||||
public DataTable getProjectList(string intranetCd, string gkey, int iskiwi, string keyword)
|
||||
{
|
||||
DataTable returnTable = new DataTable();
|
||||
|
||||
DAL dal = new DAL();
|
||||
var connection = dal.ConnectKonKiwi(iskiwi);
|
||||
try
|
||||
{
|
||||
string sqlString = "";
|
||||
sqlString += $" SELECT pkey," + Environment.NewLine;
|
||||
sqlString += $" JSON_VALUE(PROJECTJSON, '$.must.title_inner') as title," + Environment.NewLine;
|
||||
sqlString += $" JSON_VALUE(PROJECTJSON, '$.must.surveytype') as [surveyType]," + Environment.NewLine;
|
||||
sqlString += $" JSON_VALUE(PROJECTJSON, '$.must.status') as [status]," + Environment.NewLine;
|
||||
sqlString += $" gkey, mkey, create_date as createDate " + Environment.NewLine;
|
||||
sqlString += $" FROM PROJECT with(nolock) " + Environment.NewLine;
|
||||
sqlString += $" WHERE PKEY <> '' " + Environment.NewLine;
|
||||
|
||||
if (gkey.StartsWith("R"))
|
||||
{
|
||||
sqlString += $" AND GKEY = '{gkey}' " + Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlString += $" AND GKEY <> 'M101'" + Environment.NewLine;
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(keyword))
|
||||
{
|
||||
sqlString += $" AND PKEY like '%{intranetCd}%' " + Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlString += $" AND ( " + Environment.NewLine;
|
||||
sqlString += $" PKEY like '%{keyword}%'" + Environment.NewLine;
|
||||
sqlString += $" OR JSON_VALUE(PROJECTJSON, '$.must.title_inner') like '%{keyword}%'" + Environment.NewLine;
|
||||
sqlString += $" )" + Environment.NewLine;
|
||||
}
|
||||
sqlString += " ORDER BY create_date DESC" + Environment.NewLine;
|
||||
|
||||
returnTable = dal.GetDataTable(sqlString, connection);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Fatal(this.GetType().Name + " > " + System.Reflection.MethodBase.GetCurrentMethod().Name + " : " + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
dal.Disconnect(connection);
|
||||
}
|
||||
|
||||
return returnTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// KON 프로젝트 상세 정보 반환
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user