This commit is contained in:
backuppc
2025-07-14 16:30:03 +09:00
parent 032f6e4c4e
commit 479a736b80
8 changed files with 1201 additions and 75 deletions

View File

@@ -32,7 +32,7 @@ namespace Project.Web.Controllers
{
var sql = "select count(*) from EETGW_HolydayRequest " +
" where gcode = @gcode and isnull(conf,0) = 1 "+
" where gcode = @gcode and isnull(conf,0) = 1 " +
" and sdate <= convert(varchar(10),GETDATE(),120) and edate >= convert(varchar(10),GETDATE(),120)";
var cn = DBM.getCn();
@@ -84,7 +84,7 @@ namespace Project.Web.Controllers
}
}
[HttpGet]
public HttpResponseMessage GetholyRequestUser()
{
@@ -93,8 +93,8 @@ namespace Project.Web.Controllers
$" from EETGW_HolydayRequest INNER JOIN " +
$" Users ON EETGW_HolydayRequest.uid = Users.id " +
$" where EETGW_HolydayRequest.gcode = @gcode" +
$" and isnull(conf,0) = 0 ";
//" and sdate <= convert(varchar(10),GETDATE(),120) and edate >= convert(varchar(10),GETDATE(),120)";
$" and isnull(conf,0) = 0 ";
//" and sdate <= convert(varchar(10),GETDATE(),120) and edate >= convert(varchar(10),GETDATE(),120)";
//sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
@@ -125,6 +125,60 @@ namespace Project.Web.Controllers
return resp;
}
[HttpGet]
public HttpResponseMessage GetJobData(string startDate = "", string endDate = "")
{
var sql = string.Empty;
// 기본값 설정 (이번 달)
if (string.IsNullOrEmpty(startDate) || string.IsNullOrEmpty(endDate))
{
var now = DateTime.Now;
var firstDayOfMonth = new DateTime(now.Year, now.Month, 1);
var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);
startDate = firstDayOfMonth.ToString("yyyy-MM-dd");
endDate = lastDayOfMonth.ToString("yyyy-MM-dd");
}
sql = $" select idx,pdate,status,projectName, uid, requestpart, package,type,process,description," +
" hrs,ot,otStart,otEnd" +
" from JobReport" +
" where gcode = @gcode and uid = @uid" +
" and pdate between @startDate and @endDate" +
" order by pdate desc, wdate desc";
var cs = Properties.Settings.Default.gwcs;
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);
cmd.Parameters.AddWithValue("uid", FCOMMON.info.Login.no);
cmd.Parameters.AddWithValue("startDate", startDate);
cmd.Parameters.AddWithValue("endDate", endDate);
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 GetCurrentUserCount()