This commit is contained in:
backuppc
2025-07-11 11:30:52 +09:00
parent ed0db28b1f
commit 4f54a97ace
13 changed files with 1187 additions and 131 deletions

View File

@@ -17,26 +17,35 @@ namespace Project.Web.Controllers
}
// PUT api/values/5
public void Put(int id, [FromBody] string value)
{
}
//// PUT api/values/5
//public void Put(int id, [FromBody] string value)
//{
//}
// DELETE api/values/5
public void Delete(int id)
{
}
//// DELETE api/values/5
//public void Delete(int id)
//{
//}
[HttpGet]
public string TodayCountH()
{
var sql = "select count(*) from EETGW_HolydayRequest " +
"where gcode = 'EET1P' and conf = 1 and HolyDays > 0 and " +
"sdate <= GETDATE() and edate >= GETDATE()";
var cnt = DBM.ExecuteScalar(sql);
return cnt.ToString();
" where gcode = @gcode and isnull(conf,0) = 1 "+
" and HolyDays > 0 and " +
" sdate <= GETDATE() and edate >= GETDATE()";
var cn = DBM.getCn();
cn.Open();
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode;
var cnt1 = (int)cmd.ExecuteScalar();
cmd.Dispose();
cn.Dispose();
return cnt1.ToString();
}
[HttpGet]
@@ -47,7 +56,7 @@ namespace Project.Web.Controllers
{
var cn = DBM.getCn();
var sql = "select count(*) from EETGW_HolydayRequest" +
var sql = "select count(*) from EETGW_HolydayRequest" +
" where gcode = @gcode" +
" and conf = 0";
@@ -74,11 +83,88 @@ namespace Project.Web.Controllers
};
return CreateJsonResponse(response);
}
}
[HttpGet]
public HttpResponseMessage GetholyRequestUser()
{
var sql = string.Empty;
sql = $" select uid,cate,sdate,edate,HolyReason,Users.name,holydays,holytimes,remark " +
$" from EETGW_HolydayRequest INNER JOIN " +
$" Users ON EETGW_HolydayRequest.uid = Users.id " +
$" where EETGW_HolydayRequest.gcode = @gcode" +
$" and isnull(conf,0) = 0 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
//sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
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 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()
{
try
{
var cn = DBM.getCn();
var sql = "select count(*) " +
" from EETGW_GroupUser" +
" where gcode = @gcode" +
" and useUserState = 1 and useJobReport =1";
cn.Open();
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode;
var cnt1 = (int)cmd.ExecuteScalar();
cn.Dispose();
var response = new
{
Count = cnt1,
Message = string.Empty,
};
return CreateJsonResponse(response);
}
catch (Exception ex)
{
var response = new
{
Count = 0,
Message = ex.Message,
};
return CreateJsonResponse(response);
}
}
[HttpGet]
public HttpResponseMessage GetPurchaseWaitCount()
@@ -86,7 +172,7 @@ namespace Project.Web.Controllers
try
{
FCOMMON.DBM.GetPurchaseWaitCount(FCOMMON.info.Login.gcode, out int cnt1, out int cnt2);
FCOMMON.DBM.GetPurchaseWaitCount(FCOMMON.info.Login.gcode, out int cnt1, out int cnt2);
var response = new
{
NR = cnt1,
@@ -141,7 +227,7 @@ namespace Project.Web.Controllers
$" Users ON EETGW_HolydayRequest.uid = Users.id " +
$" where EETGW_HolydayRequest.gcode = @gcode" +
$" and conf = 1 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
//sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
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!";
@@ -171,6 +257,135 @@ namespace Project.Web.Controllers
return resp;
}
[HttpGet]
public HttpResponseMessage GetPresentUserList()
{
try
{
var sql = "select * from vGroupUser where gcode = @gcode and useUserState = 1 and useJobReport = 1";
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);
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;
}
catch (Exception ex)
{
var response = new
{
Message = ex.Message,
};
return CreateJsonResponse(response);
}
}
[HttpGet]
public HttpResponseMessage GetPurchaseNRList()
{
try
{
var sql = "select pdate, process, pumname, pumscale, pumunit, pumqtyreq, pumprice, pumamt from Purchase where gcode = @gcode and state = '---' order by pdate 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);
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;
}
catch (Exception ex)
{
var response = new
{
Message = ex.Message,
};
return CreateJsonResponse(response);
}
}
[HttpGet]
public HttpResponseMessage GetPurchaseCRList()
{
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 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);
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;
}
catch (Exception ex)
{
var response = new
{
Message = ex.Message,
};
return CreateJsonResponse(response);
}
}
[HttpGet]
public HttpResponseMessage Index()