프로젝트 시스템 통합 및 전반적인 개선사항
- 솔루션 설정 및 프로젝트 파일 업데이트 - BaseController 최적화 (HtmlAgilityPack 의존성 제거) - CommonController 네비게이션 메뉴에 프로젝트 추가 - JobreportController 사용자 조회 기능 및 필터링 개선 - 모든 웹 화면 UI/UX 통합 및 일관성 개선 - 프로그램 시작 시 중복 실행 감지 개선 - 각종 폼 및 데이터셋 디자이너 업데이트 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Web.Http;
|
||||
using agi = HtmlAgilityPack;
|
||||
using Project.Web.Model;
|
||||
|
||||
namespace Project.Web.Controllers
|
||||
@@ -159,33 +158,7 @@ namespace Project.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
agi.HtmlDocument doc = new agi.HtmlDocument();
|
||||
doc.LoadHtml(contents);
|
||||
|
||||
//파일참조 태그를 모두 가져옴
|
||||
var tags_include = doc.QuerySelectorAll("include");
|
||||
foreach (var item in tags_include)
|
||||
{
|
||||
var filename = item.InnerText;
|
||||
|
||||
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
||||
load_file = load_file.Replace("\\\\", "\\");
|
||||
String fileContents;// = String.Empty;
|
||||
|
||||
Console.WriteLine("## " + item.OuterHtml);
|
||||
if (System.IO.File.Exists(load_file))
|
||||
{
|
||||
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
||||
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
||||
}
|
||||
contents = contents.Replace(item.OuterHtml, fileContents);
|
||||
}
|
||||
|
||||
//콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
|
||||
|
||||
|
||||
//시스템변수 replace
|
||||
@@ -242,31 +215,7 @@ namespace Project.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
agi.HtmlDocument doc = new agi.HtmlDocument();
|
||||
doc.LoadHtml(contents);
|
||||
|
||||
//파일참조 태그를 모두 가져옴
|
||||
var tags_include = doc.QuerySelectorAll("include");
|
||||
foreach (var item in tags_include)
|
||||
{
|
||||
var filename = item.InnerText;
|
||||
|
||||
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
||||
load_file = load_file.Replace("\\\\", "\\");
|
||||
String fileContents;// = String.Empty;
|
||||
|
||||
Console.WriteLine("## " + item.OuterHtml);
|
||||
if (System.IO.File.Exists(load_file))
|
||||
{
|
||||
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
||||
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
||||
}
|
||||
contents = contents.Replace(item.OuterHtml, fileContents);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,23 +16,16 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
var sql = string.Empty;
|
||||
|
||||
if (string.IsNullOrEmpty(grp))
|
||||
{
|
||||
// grp가 없으면 모든 그룹의 데이터를 가져옴
|
||||
sql = "select *" +
|
||||
" from common" +
|
||||
" where gcode = @gcode" +
|
||||
" order by grp, code, svalue";
|
||||
}
|
||||
else
|
||||
{
|
||||
//코드그룹이 없다면 전체 목록을 조회할 수 있도록 99를 조회한다
|
||||
if (string.IsNullOrEmpty(grp)) grp = "99";
|
||||
|
||||
// 특정 그룹의 데이터만 가져옴
|
||||
sql = "select *" +
|
||||
" from common" +
|
||||
" where gcode = @gcode" +
|
||||
" and grp = @grp" +
|
||||
" order by code,svalue";
|
||||
}
|
||||
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||
@@ -216,7 +209,7 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = "select code, svalue from common WITH (nolock) " +
|
||||
var sql = "select code, svalue, memo from common WITH (nolock) " +
|
||||
"where gcode = @gcode and grp = '99' " +
|
||||
"order by code";
|
||||
|
||||
@@ -381,6 +374,14 @@ namespace Project.Web.Controllers
|
||||
icon = "M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2M12 12l2 2 4-4",
|
||||
isVisible = true,
|
||||
sortOrder = 5
|
||||
},
|
||||
new {
|
||||
key = "project",
|
||||
title = "프로젝트",
|
||||
url = "/Project/",
|
||||
icon = "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10",
|
||||
isVisible = true,
|
||||
sortOrder = 6
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
using Microsoft.Owin;
|
||||
using Project.Web.Controllers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Data;
|
||||
using System.Web.Http.Results;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace Project.Web.Controllers
|
||||
{
|
||||
@@ -641,6 +645,90 @@ namespace Project.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage GetUsers()
|
||||
{
|
||||
try
|
||||
{
|
||||
string connectionString = Properties.Settings.Default.gwcs;
|
||||
var users = new List<dynamic>();
|
||||
|
||||
using (var connection = new System.Data.SqlClient.SqlConnection(connectionString))
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
string selectSql = @"
|
||||
SELECT name, id, processs
|
||||
FROM vGroupUser
|
||||
WHERE gcode = @gcode AND useJobReport = 1 AND useUserState = 1
|
||||
ORDER BY name";
|
||||
|
||||
using (var command = new System.Data.SqlClient.SqlCommand(selectSql, connection))
|
||||
{
|
||||
command.Parameters.AddWithValue("@gcode", FCOMMON.info.Login.gcode);
|
||||
|
||||
using (var reader = command.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
users.Add(new
|
||||
{
|
||||
name = reader["name"],
|
||||
id = reader["id"],
|
||||
process = reader["processs"]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 디버깅 로그 추가
|
||||
System.Diagnostics.Debug.WriteLine($"GetUsers: Found {users.Count} users for gcode {FCOMMON.info.Login.gcode}");
|
||||
|
||||
// JSON 형태로 변환
|
||||
var jsonData = "[";
|
||||
bool first = true;
|
||||
|
||||
foreach (var user in users)
|
||||
{
|
||||
if (!first) jsonData += ",";
|
||||
first = false;
|
||||
|
||||
var name = EscapeJsonString(user.name?.ToString() ?? "");
|
||||
var id = EscapeJsonString(user.id?.ToString() ?? "");
|
||||
var process = EscapeJsonString(user.process?.ToString() ?? "");
|
||||
|
||||
jsonData += "{";
|
||||
jsonData += $"\"name\":\"{name}\",";
|
||||
jsonData += $"\"id\":\"{id}\",";
|
||||
jsonData += $"\"process\":\"{process}\"";
|
||||
jsonData += "}";
|
||||
}
|
||||
jsonData += "]";
|
||||
|
||||
var resp = new HttpResponseMessage()
|
||||
{
|
||||
Content = new StringContent(
|
||||
jsonData,
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
|
||||
return resp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var errorResp = new HttpResponseMessage()
|
||||
{
|
||||
Content = new StringContent(
|
||||
$"{{\"error\":\"{ex.Message}\"}}",
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
return errorResp;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage GetJobData()
|
||||
{
|
||||
@@ -649,9 +737,11 @@ namespace Project.Web.Controllers
|
||||
var gets = Request.GetQueryNameValuePairs();
|
||||
var startDateParam = gets.Where(t => t.Key == "startDate").FirstOrDefault();
|
||||
var endDateParam = gets.Where(t => t.Key == "endDate").FirstOrDefault();
|
||||
var userParam = gets.Where(t => t.Key == "user").FirstOrDefault();
|
||||
|
||||
var startDate = startDateParam.Key != null ? startDateParam.Value : null;
|
||||
var endDate = endDateParam.Key != null ? endDateParam.Value : null;
|
||||
var selectedUser = userParam.Key != null ? userParam.Value : null;
|
||||
|
||||
// 날짜 파라미터 처리
|
||||
string sd, ed;
|
||||
@@ -683,13 +773,17 @@ namespace Project.Web.Controllers
|
||||
description, '' as ww, otStart, otEnd, ot as ot2, '' as otReason,
|
||||
'' as grade, '' as indate, '' as outdate, pidx
|
||||
FROM JobReport WITH (NOLOCK)
|
||||
WHERE gcode = @gcode AND uid = @uid AND pdate BETWEEN @startDate AND @endDate
|
||||
ORDER BY pdate DESC";
|
||||
WHERE gcode = @gcode AND pdate BETWEEN @startDate AND @endDate";
|
||||
|
||||
// 사용자 필터가 있으면 해당 사용자, 없으면 로그인한 사용자
|
||||
selectSql += " AND uid = @uid";
|
||||
|
||||
selectSql += " ORDER BY pdate DESC";
|
||||
|
||||
using (var command = new System.Data.SqlClient.SqlCommand(selectSql, connection))
|
||||
{
|
||||
command.Parameters.AddWithValue("@gcode", FCOMMON.info.Login.gcode);
|
||||
command.Parameters.AddWithValue("@uid", FCOMMON.info.Login.no);
|
||||
command.Parameters.AddWithValue("@uid", !string.IsNullOrEmpty(selectedUser) ? selectedUser : FCOMMON.info.Login.no);
|
||||
command.Parameters.AddWithValue("@startDate", sd);
|
||||
command.Parameters.AddWithValue("@endDate", ed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user