기타근무자 관련 코드 수정
This commit is contained in:
108
Project/Web/Controller/CommonController.cs
Normal file
108
Project/Web/Controller/CommonController.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using FCM0000;
|
||||
using Microsoft.Owin;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Project.Web.Controllers
|
||||
{
|
||||
public class CommonController : BaseController
|
||||
{
|
||||
[HttpGet]
|
||||
public HttpResponseMessage GetList(string grp=null)
|
||||
{
|
||||
var sql = string.Empty;
|
||||
sql = "select *" +
|
||||
" from common" +
|
||||
" where gcode = @gcode" +
|
||||
" and grp = @grp" +
|
||||
" order by code,svalue";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||
cmd.Parameters.AddWithValue("gcode", FCOMMON.info.Login.gcode);
|
||||
|
||||
// 날짜 파라미터가 없으면 기본값 사용 (현재 월)
|
||||
var grpCode = !string.IsNullOrEmpty(grp) ? grp : "99";
|
||||
cmd.Parameters.AddWithValue("grp", grpCode);
|
||||
|
||||
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
||||
var dt = new System.Data.DataTable();
|
||||
da.Fill(dt);
|
||||
da.Dispose();
|
||||
cmd.Dispose();
|
||||
cn.Dispose();
|
||||
|
||||
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
});
|
||||
|
||||
var resp = new HttpResponseMessage()
|
||||
{
|
||||
Content = new StringContent(
|
||||
txtjson,
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage Index()
|
||||
{
|
||||
// 직접 파일을 읽어서 반환
|
||||
var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "Common.html");
|
||||
var contents = string.Empty;
|
||||
|
||||
if (System.IO.File.Exists(filePath))
|
||||
{
|
||||
contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 파일이 없으면 404 에러 페이지 또는 기본 메시지
|
||||
contents = "<html><body><h1>404 - File Not Found</h1><p>The requested file was not found: " + filePath + "</p></body></html>";
|
||||
}
|
||||
|
||||
|
||||
var resp = new HttpResponseMessage()
|
||||
{
|
||||
Content = new StringContent(
|
||||
contents,
|
||||
System.Text.Encoding.UTF8,
|
||||
"text/html")
|
||||
};
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class CommonModel
|
||||
{
|
||||
|
||||
|
||||
public int idx { get; set; } // 데이터고유번호
|
||||
public string gcode { get; set; } // 그룹코드(데이터 그룹간 식별)
|
||||
public string grp { get; set; } // 코드그룹
|
||||
public string code { get; set; } // 코드
|
||||
public string svalue { get; set; } // 값(문자열)
|
||||
public int ivalue { get; set; } // 값(숫자)
|
||||
public float fvalue { get; set; } // 값(실수)
|
||||
public string memo { get; set; } // 비고
|
||||
public string svalue2 { get; set; } // 값2(문자열)
|
||||
public string wuid { get; set; } // 데이터기록자 사원번호
|
||||
public string wdate { get; set; } // 데이터를기록한일시
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Project.Web.Controllers
|
||||
public string TodayCountH()
|
||||
{
|
||||
|
||||
var sql = "select count(*) from EETGW_HolydayRequest " +
|
||||
var sql = "select count(*) from EETGW_HolydayRequest WITH (nolock) " +
|
||||
" where gcode = @gcode and isnull(conf,0) = 1 " +
|
||||
" and sdate <= convert(varchar(10),GETDATE(),120) and edate >= convert(varchar(10),GETDATE(),120)";
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
var cn = DBM.getCn();
|
||||
|
||||
var sql = "select count(*) from EETGW_HolydayRequest" +
|
||||
var sql = "select count(*) from EETGW_HolydayRequest WITH (nolock) " +
|
||||
" where gcode = @gcode" +
|
||||
" and isnull(conf,0) = 0";
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
var sql = string.Empty;
|
||||
sql = $" select uid,cate,sdate,edate,HolyReason,Users.name,holydays,holytimes,remark " +
|
||||
$" from EETGW_HolydayRequest INNER JOIN " +
|
||||
$" from EETGW_HolydayRequest WITH (nolock) INNER JOIN " +
|
||||
$" Users ON EETGW_HolydayRequest.uid = Users.id " +
|
||||
$" where EETGW_HolydayRequest.gcode = @gcode" +
|
||||
$" and isnull(conf,0) = 0 ";
|
||||
@@ -129,7 +129,7 @@ namespace Project.Web.Controllers
|
||||
public HttpResponseMessage GetJobData(string startDate = "", string endDate = "")
|
||||
{
|
||||
var sql = string.Empty;
|
||||
|
||||
|
||||
// 기본값 설정 (이번 달)
|
||||
if (string.IsNullOrEmpty(startDate) || string.IsNullOrEmpty(endDate))
|
||||
{
|
||||
@@ -142,7 +142,7 @@ namespace Project.Web.Controllers
|
||||
|
||||
sql = $" select idx,pdate,status,projectName, uid, requestpart, package,type,process,description," +
|
||||
" hrs,ot,otStart,otEnd" +
|
||||
" from JobReport" +
|
||||
" from JobReport WITH (nolock)" +
|
||||
" where gcode = @gcode and uid = @uid" +
|
||||
" and pdate between @startDate and @endDate" +
|
||||
" order by pdate desc, wdate desc";
|
||||
@@ -188,10 +188,12 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
var cn = DBM.getCn();
|
||||
|
||||
var sql = "select count(*) " +
|
||||
" from EETGW_GroupUser" +
|
||||
" where gcode = @gcode" +
|
||||
" and useUserState = 1 and useJobReport =1";
|
||||
|
||||
|
||||
var sql = "select count(*) from vGroupUser WITH (nolock) " +
|
||||
" where gcode = @gcode and useUserState = 1 and useJobReport = 1" +
|
||||
" and id not in (select uid from vEETGW_TodayNoneWorkUser where gcode = @gcode and kunmu = 0)";
|
||||
|
||||
|
||||
cn.Open();
|
||||
|
||||
@@ -276,12 +278,9 @@ namespace Project.Web.Controllers
|
||||
public HttpResponseMessage GetholyUser()
|
||||
{
|
||||
var sql = string.Empty;
|
||||
sql = $" select uid,cate,sdate,edate,HolyReason,Users.name " +
|
||||
$" from EETGW_HolydayRequest INNER JOIN " +
|
||||
$" Users ON EETGW_HolydayRequest.uid = Users.id " +
|
||||
$" where EETGW_HolydayRequest.gcode = @gcode" +
|
||||
$" and conf = 1 " +
|
||||
$" and sdate <= convert(varchar(10),GETDATE(),120) and edate >= convert(varchar(10),GETDATE(),120)";
|
||||
sql = $" select uid,type,cate,sdate,edate,title,dbo.getusername(uid) as name " +
|
||||
$" from vEETGW_TodayNoneWorkUser WITH (nolock)" +
|
||||
$" where gcode = @gcode and kunmu=0";
|
||||
|
||||
//sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
||||
|
||||
@@ -317,7 +316,9 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = "select * from vGroupUser where gcode = @gcode and useUserState = 1 and useJobReport = 1";
|
||||
var sql = "select * from vGroupUser WITH (nolock) " +
|
||||
" where gcode = @gcode and useUserState = 1 and useJobReport = 1" +
|
||||
" and id not in (select uid from vEETGW_TodayNoneWorkUser where gcode = @gcode and kunmu = 0)";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||
@@ -360,7 +361,7 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = "select pdate, process, pumname, pumscale, pumunit, pumqtyreq, pumprice, pumamt from Purchase where gcode = @gcode and state = '---' order by pdate desc";
|
||||
var sql = "select pdate, process, pumname, pumscale, pumunit, pumqtyreq, pumprice, pumamt from Purchase WITH (nolock) where gcode = @gcode and state = '---' order by pdate desc";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||
@@ -385,7 +386,6 @@ namespace Project.Web.Controllers
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
|
||||
return resp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -403,7 +403,10 @@ namespace Project.Web.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = "select pdate, process, pumname, pumscale, pumunit, pumqtyreq, pumprice, pumamt from EETGW_PurchaseCR where gcode = @gcode and state = '---' order by pdate desc";
|
||||
var sql = "select pdate, process, pumname, pumscale, pumunit, pumqtyreq, pumprice, pumamt " +
|
||||
" from EETGW_PurchaseCR WITH (nolock) " +
|
||||
" where gcode = @gcode and state = '---'" +
|
||||
" order by pdate desc";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||
|
||||
30
Project/Web/wwwroot/Common.html
Normal file
30
Project/Web/wwwroot/Common.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title>공용코드관리</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#3B82F6',
|
||||
secondary: '#6B7280',
|
||||
success: '#10B981',
|
||||
danger: '#EF4444',
|
||||
warning: '#F59E0B'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
intro file
|
||||
</body>
|
||||
</html>
|
||||
@@ -144,7 +144,7 @@
|
||||
<div class="glass-effect rounded-2xl p-6 card-hover animate-slide-up cursor-pointer" onclick="showPresentUserModal()">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-white/70 text-sm font-medium">출근</p>
|
||||
<p class="text-white/70 text-sm font-medium">출근(대상)</p>
|
||||
<p class="text-3xl font-bold text-white" id="presentCount">0</p>
|
||||
</div>
|
||||
<div class="w-12 h-12 bg-success-500/20 rounded-full flex items-center justify-center">
|
||||
@@ -225,7 +225,7 @@
|
||||
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
|
||||
</svg>
|
||||
휴가자 현황
|
||||
휴가/기타 현황
|
||||
</h2>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
@@ -233,7 +233,8 @@
|
||||
<thead class="bg-white/10">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">이름</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">휴가 종류</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">형태</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">종류</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">시작일</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">종료일</th>
|
||||
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">사유</th>
|
||||
@@ -483,17 +484,35 @@
|
||||
let tableRows = '';
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(item => {
|
||||
// 형태에 따른 색상 결정
|
||||
const typeColorClass = (item.type === '휴가') ? 'bg-green-500/20 text-green-300' : 'bg-warning-500/20 text-warning-300';
|
||||
|
||||
// 종류에 따른 색상 결정
|
||||
let cateColorClass = 'bg-warning-500/20 text-warning-300'; // 기본값
|
||||
if (item.cate === '휴가') {
|
||||
cateColorClass = 'bg-warning-500/20 text-warning-300'; // 노란색 계열
|
||||
} else if (item.cate === '파견') {
|
||||
cateColorClass = 'bg-purple-500/20 text-purple-300'; // 보라색 계열
|
||||
} else {
|
||||
cateColorClass = 'bg-warning-500/20 text-warning-300'; // 기타는 주황색 계열
|
||||
}
|
||||
|
||||
tableRows += `
|
||||
<tr class="hover:bg-white/5 transition-colors">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-white">${item.name || '-'}(${item.uid})</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${typeColorClass}">
|
||||
${item.type || '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-warning-500/20 text-warning-300">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${cateColorClass}">
|
||||
${item.cate || '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-white/80">${item.sdate || '-'}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-white/80">${item.edate || '-'}</td>
|
||||
<td class="px-6 py-4 text-white/80">${item.HolyReason || '-'}</td>
|
||||
<td class="px-6 py-4 text-white/80">${item.title || '-'}</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user