From 6226bc295311eaf83b4c9d5f272ee23c2c860da5 Mon Sep 17 00:00:00 2001 From: chi Date: Tue, 15 Feb 2022 09:32:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=9C=EA=B7=BC=EB=B6=80=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90=20=EB=AA=A9=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EETGW.sln | 10 --- .../Properties/AssemblyInfo.cs | 4 +- JobReportMailService/fJobReportDay.cs | 6 +- Project/BaseController.cs | 4 +- Project/Controller/ResourceController.cs | 41 ++++++++++++ Project/EETGW.csproj | 7 +++ Project/OWIN/Startup.cs | 8 +-- Project/fMain.cs | 1 + Project/packages.config | 1 + SubProject/FBS0000/Holiday/WorkTable.cs | 62 ++++++++++++++----- SubProject/FCOMMON/DataBaseManager.cs | 8 ++- SubProject/FPJ0000/OtConfirm/fHolyRequest.cs | 10 +-- .../FPJ0000/OtConfirm/fHolyRequestAdd.cs | 16 +++-- 13 files changed, 131 insertions(+), 47 deletions(-) diff --git a/EETGW.sln b/EETGW.sln index d71d897..59259f3 100644 --- a/EETGW.sln +++ b/EETGW.sln @@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YARTE", "Sub\YARTE\YARTE.cs EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FTPClass", "Sub\arftp\FTPClass.csproj", "{150859D3-1C5D-4E20-B324-F9EBE188D893}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FTP_DB_Adapt", "FTP_DB_Adapt\FTP_DB_Adapt\FTP_DB_Adapt.csproj", "{BECE73DE-15C8-42B0-9F93-9484D745DF3A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FPM0000", "SubProject\FPM0000\FPM0000.csproj", "{D01A7891-AD0B-489B-8C45-F598C875FE26}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "arControl", "Sub\arCtl\arControl.csproj", "{F31C242C-1B15-4518-9733-48558499FE4B}" @@ -109,14 +107,6 @@ Global {150859D3-1C5D-4E20-B324-F9EBE188D893}.Release|Any CPU.ActiveCfg = Release|Any CPU {150859D3-1C5D-4E20-B324-F9EBE188D893}.Release|Any CPU.Build.0 = Release|Any CPU {150859D3-1C5D-4E20-B324-F9EBE188D893}.Release|x86.ActiveCfg = Release|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Debug|x86.ActiveCfg = Debug|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Debug|x86.Build.0 = Debug|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Release|Any CPU.Build.0 = Release|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Release|x86.ActiveCfg = Release|Any CPU - {BECE73DE-15C8-42B0-9F93-9484D745DF3A}.Release|x86.Build.0 = Release|Any CPU {D01A7891-AD0B-489B-8C45-F598C875FE26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D01A7891-AD0B-489B-8C45-F598C875FE26}.Debug|Any CPU.Build.0 = Debug|Any CPU {D01A7891-AD0B-489B-8C45-F598C875FE26}.Debug|x86.ActiveCfg = Debug|Any CPU diff --git a/JobReportMailService/Properties/AssemblyInfo.cs b/JobReportMailService/Properties/AssemblyInfo.cs index 58a08f7..e960436 100644 --- a/JobReportMailService/Properties/AssemblyInfo.cs +++ b/JobReportMailService/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 // 기본값으로 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("22.01.11.2100")] -[assembly: AssemblyFileVersion("22.01.11.2100")] +[assembly: AssemblyVersion("22.02.09.1030")] +[assembly: AssemblyFileVersion("22.02.09.1030")] diff --git a/JobReportMailService/fJobReportDay.cs b/JobReportMailService/fJobReportDay.cs index 2bbf33d..2350df8 100644 --- a/JobReportMailService/fJobReportDay.cs +++ b/JobReportMailService/fJobReportDay.cs @@ -181,8 +181,8 @@ namespace JobReportMailService List totWarnList = new List(); foreach (var uid in uids) { - //if (uid.Key == "320854") - // Console.WriteLine("테스트"); + if (uid.Key == "71188") + Console.WriteLine("테스트"); //이사용자의 날짜별 근무시간을 확인한다. db = new EEEntities(); @@ -195,7 +195,7 @@ namespace JobReportMailService var userdata = UserDatas.Where(t => t.pdate == dtstr); //해당날짜의 데이터를 확인한다. var hrs = 0.0; if (userdata.Any()) hrs = (double)userdata.Sum(t => t.hrs); - else continue; //동작하지 않게함. + //else continue; //동작하지 않게함. //자료를 입력하지 않았거나, 입력시간이 8시간 미만이면 경고한다 if (hrs < 8.0) diff --git a/Project/BaseController.cs b/Project/BaseController.cs index 91fb05d..4cf2c56 100644 --- a/Project/BaseController.cs +++ b/Project/BaseController.cs @@ -85,13 +85,14 @@ namespace Project } - public MethodResult View() + public MethodResult View(bool nosubdir=false) { var config = RequestContext.Configuration; if (config != null) { var routeData = config.Routes.GetRouteData(Request).Values.ToList(); var name_ctrl = routeData[0].Value.ToString(); + if (nosubdir) name_ctrl = string.Empty; var name_action = routeData[1].Value.ToString(); return View(name_ctrl, name_action); } @@ -101,6 +102,7 @@ namespace Project } } + public static void ApplyCommonValue(ref string contents) { diff --git a/Project/Controller/ResourceController.cs b/Project/Controller/ResourceController.cs index 26043be..2262309 100644 --- a/Project/Controller/ResourceController.cs +++ b/Project/Controller/ResourceController.cs @@ -10,6 +10,36 @@ namespace Project { public class ResourceController : BaseController { + //[HttpGet] + //public HttpResponseMessage Index() + //{ + // //로그인이 되어있지않다면 로그인을 가져온다 + // MethodResult result; + // result = View(true); + + // var model = GetGlobalModel(); + // var getParams = Request.GetQueryNameValuePairs();// GetParameters(data); + + // //기본값을 찾아서 없애줘야한다 + // var contents = result.Content; + + // //공용값 적용 + // ApplyCommonValue(ref contents); + + // //최종문자 적용 + // result.Content = contents; + + // var resp = new HttpResponseMessage() + // { + // Content = new StringContent( + // result.Content, + // System.Text.Encoding.UTF8, + // "text/html") + // }; + + // return resp; + //} + [HttpGet] public HttpResponseMessage file() { @@ -77,6 +107,17 @@ namespace Project } HttpContent resultContent = null; + + if (v_resource.isEmpty() && v_ext.isEmpty()) + { + v_resource = "index"; + v_ext = "html"; + isBinary = false; + content_type = "text/html"; + } + + + var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", v_path, v_subdir, v_resource + "." + v_ext); if (isBinary) diff --git a/Project/EETGW.csproj b/Project/EETGW.csproj index 6e87757..57a3dcf 100644 --- a/Project/EETGW.csproj +++ b/Project/EETGW.csproj @@ -832,4 +832,11 @@ + + + + 이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. 해당 패키지를 다운로드하려면 NuGet 패키지 복원을 사용하십시오. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkID=322105를 참조하십시오. 누락된 파일은 {0}입니다. + + + \ No newline at end of file diff --git a/Project/OWIN/Startup.cs b/Project/OWIN/Startup.cs index ad5f2a0..a1b80f1 100644 --- a/Project/OWIN/Startup.cs +++ b/Project/OWIN/Startup.cs @@ -12,7 +12,7 @@ namespace Project.OWIN { public class Startup { - public void Configuration(IAppBuilder appBuilder) + public void Configuration(IAppBuilder app) { // Configure Web API for Self-Host HttpConfiguration config = new HttpConfiguration(); @@ -45,9 +45,9 @@ namespace Project.OWIN config.Routes.Add("cssRoute", cssRoute); config.Routes.Add("defaultRoute", defaultRoute); - appBuilder.UseStaticFiles(); - appBuilder.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); - appBuilder.UseWebApi(config); + app.UseStaticFiles(); + app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); + app.UseWebApi(config); //appBuilder.UseFileServer(new FileServerOptions diff --git a/Project/fMain.cs b/Project/fMain.cs index 37cd161..9495c84 100644 --- a/Project/fMain.cs +++ b/Project/fMain.cs @@ -138,6 +138,7 @@ namespace Project // Start OWIN host try { + WebApp.Start(url: "http://127.0.0.1:9000"); Console.WriteLine("start webapp"); Pub.log.AddI("웹지원 서버 준비 완료"); diff --git a/Project/packages.config b/Project/packages.config index 87f9d14..4ba495f 100644 --- a/Project/packages.config +++ b/Project/packages.config @@ -10,6 +10,7 @@ + diff --git a/SubProject/FBS0000/Holiday/WorkTable.cs b/SubProject/FBS0000/Holiday/WorkTable.cs index 71d4999..9c7f357 100644 --- a/SubProject/FBS0000/Holiday/WorkTable.cs +++ b/SubProject/FBS0000/Holiday/WorkTable.cs @@ -90,19 +90,29 @@ namespace FBS0000 //해당 기간내의 사용 //var taUser = new dsMSSQLTableAdapters.EETGW_WorkTableUserTableAdapter(); - var dtUser = JobReport.OrderBy(t => t.userProcess + t.name).GroupBy(t => t.id);// taUser.GetData(FCOMMON.info.Login.gcode, tbGrp.Text); + //var dtUser = JobReport.OrderBy(t => t.userProcess + t.name).GroupBy(t => t.id);// taUser.GetData(FCOMMON.info.Login.gcode, tbGrp.Text); + + var dtUser = FCOMMON.DBM.getUserTable(); //업무일지 미사용자로인해서 사용자 목록은 이것을 사용한다 220215 var users = new List(); var seq = 0; - foreach (var item in dtUser) + foreach (System.Data.DataRow dr in dtUser.Rows) { - var dr = item.First(); - if (string.IsNullOrEmpty(dr.indate) == false) - { - //입사일자를 체크해서. 이 날짜가 입사일 이전이면 넘어간다 - } + //var dr = item.First(); + //if (string.IsNullOrEmpty(dr.indate) == false) + //{ + // //입사일자를 체크해서. 이 날짜가 입사일 이전이면 넘어간다 + //} - users.Add(new userinfo { grade = dr.grade, name = dr.name, empno = dr.id, seq = dr.userProcess, indate = dr.indate, outdate = dr.outdate }); + users.Add(new userinfo + { + grade = dr["grade"].ToString(), + name = dr["name"].ToString(), + empno = dr["id"].ToString(), + seq = dr["process"].ToString(), + indate = dr["indate"].ToString(), + outdate = dr["outdate"].ToString() + }); seq += 1; } @@ -242,7 +252,7 @@ namespace FBS0000 var accday = 1; while (accday <= timedays) { - var remaintime = dr.CrTime - ((accday-1) * 8f); + var remaintime = dr.CrTime - ((accday - 1) * 8f); var columnindex = c + curday; var columnDate = (DateTime)this.fpSpread1_Sheet1.Columns[columnindex].Tag; @@ -270,10 +280,21 @@ namespace FBS0000 } else { - var JRUser = JobReport.Where(t => t.id == item.empno && t.pdate == curDate.ToShortDateString()); - var sum_hrs = JRUser.Sum(t => t.hrs); - var sum_ot = JRUser.Sum(t => t.ot); - var sum_ot2 = JRUser.Sum(t => t.ot2); + var pdate = curDate.ToShortDateString(); + if (pdate == "2022-02-07" && item.empno == "66630") + { + + } + var JRUser = JobReport.Where(t => t.id == item.empno && t.pdate == pdate); + var sum_hrs = 00.0; + var sum_ot = 00.0;//JRUser.Sum(t => t.ot); + var sum_ot2 = 00.0; //JRUser.Sum(t => t.ot2); + if (JRUser.Any()) + { + sum_hrs = JRUser.Sum(t => t.hrs); + sum_ot = JRUser.Sum(t => t.ot); + sum_ot2 = JRUser.Sum(t => t.ot2); + } if (bholy) //주말이다 { @@ -291,7 +312,7 @@ namespace FBS0000 else { //평일인데 근무시간이 있다 - if (sum_hrs > 0) + if (sum_hrs > 0 || sum_ot > 0) { if (sum_ot > 0 || sum_ot2 > 0) { @@ -310,7 +331,18 @@ namespace FBS0000 var celltag = fpSpread1_Sheet1.Cells[rowindex, c].Tag; if (celltag == null) //다른곳에서 지정했다면 처리하지 않는다. { - fpSpread1_Sheet1.Cells[rowindex, c].Value = string.Empty; + if (DateTime.Now.ToShortDateString().CompareTo(pdate) > 0) + { + fpSpread1_Sheet1.Cells[rowindex, c].Value = "--"; + fpSpread1_Sheet1.Cells[rowindex, c].ForeColor = Color.Red; + } + else + { + fpSpread1_Sheet1.Cells[rowindex, c].Value = string.Empty; + fpSpread1_Sheet1.Cells[rowindex, c].ForeColor = Color.Black; + } + + fpSpread1_Sheet1.Cells[rowindex, c].BackColor = Color.White; //fpSpread1_Sheet1.Cells[rowindex, c].Note = string.Empty; } diff --git a/SubProject/FCOMMON/DataBaseManager.cs b/SubProject/FCOMMON/DataBaseManager.cs index 58c09dc..80669e2 100644 --- a/SubProject/FCOMMON/DataBaseManager.cs +++ b/SubProject/FCOMMON/DataBaseManager.cs @@ -427,6 +427,12 @@ namespace FCOMMON return getTwoColumnList("vGroupUser", "id", "name", where, "name"); } + + /// + /// id,name,dispname,dept,email,level,tel,process,grade + /// + /// + /// public static System.Data.DataTable getUserTable(int baseLevel = 1) { var cn = getCn(); @@ -435,7 +441,7 @@ namespace FCOMMON var retval = new sItemInfo(); retval.idx = -1; - string sql = "select [id],[name],([name] +'(' +[id] +')') as dispName,[dept],[email],[level],[tel],isnull(processs,'') as process " + + string sql = "select [id],[name],([name] +'(' +[id] +')') as dispName,isnull([dept],'') as dept,isnull(grade,'') as grade,[email],[level],[tel],isnull(processs,'') as process,isnull(indate,'') as indate, isnull(outdate,'') as outdate " + " from vGroupUser " + " where gcode='" + FCOMMON.info.Login.gcode + "' and [id] <> 'dev' and isnull(outdate,'') = '' and useUserState = 1 order by [name]"; var cmd = new SqlCommand(sql, cn); diff --git a/SubProject/FPJ0000/OtConfirm/fHolyRequest.cs b/SubProject/FPJ0000/OtConfirm/fHolyRequest.cs index 312a9e9..41cc3e8 100644 --- a/SubProject/FPJ0000/OtConfirm/fHolyRequest.cs +++ b/SubProject/FPJ0000/OtConfirm/fHolyRequest.cs @@ -55,7 +55,7 @@ namespace FPJ0000 btSave.Visible = false;// curLevel >= 5; btEdit.Text = curLevel >= 5 ? "승인(&E)" : "편집(&E)"; - // binit = true; + // binit = true; refreshData(); } @@ -112,16 +112,16 @@ namespace FPJ0000 var ed = dtED.Text.Trim(); ta.Fill(this.dSKuntae.EETGW_HolydayRequest, FCOMMON.info.Login.gcode, sd, ed); - var sum_day = dSKuntae.EETGW_HolydayRequest.AsEnumerable().Where(t=>t.conf == 1).Sum(t => t.HolyDays); + var sum_day = dSKuntae.EETGW_HolydayRequest.AsEnumerable().Where(t => t.conf == 1).Sum(t => t.HolyDays); var sum_time = dSKuntae.EETGW_HolydayRequest.AsEnumerable().Where(t => t.conf == 1).Sum(t => t.HolyTimes); var sum_day2 = dSKuntae.EETGW_HolydayRequest.AsEnumerable().Where(t => t.conf == 0).Sum(t => t.HolyDays); var sum_time2 = dSKuntae.EETGW_HolydayRequest.AsEnumerable().Where(t => t.conf == 0).Sum(t => t.HolyTimes); sbday.Text = $"합계(일) = 승인:{sum_day}/미승인:{sum_day2}"; - sbday.ForeColor = sum_day2 == 0 ? Color.Black : Color.Red; + sbday.ForeColor = sum_day2 == 0 ? Color.Black : Color.Red; sbtime.Text = $"합계(시간) = 승인:{sum_time}/미승인:{sum_time2}"; - sbtime.ForeColor = sum_time2 == 0 ? Color.Black : Color.Red; + sbtime.ForeColor = sum_time2 == 0 ? Color.Black : Color.Red; ////색상처리 //dv1.SuspendLayout(); //foreach(DataGridViewRow dr in this.dv1.Rows) @@ -198,7 +198,7 @@ namespace FPJ0000 else { search = search.Replace("'", "''"); - var collist = new string[] { "requestpart", "package", "projectname", "process", "[type]", "description", "tag" }; + var collist = new string[] {"name", "Response", "HolyReason","remark" }; string filter = ""; // "itemna like ? or package like ? or projectname like ? or process like ? or [type] like ? or description like ?"; foreach (var col in collist) { diff --git a/SubProject/FPJ0000/OtConfirm/fHolyRequestAdd.cs b/SubProject/FPJ0000/OtConfirm/fHolyRequestAdd.cs index f9f881d..8aaacb3 100644 --- a/SubProject/FPJ0000/OtConfirm/fHolyRequestAdd.cs +++ b/SubProject/FPJ0000/OtConfirm/fHolyRequestAdd.cs @@ -189,13 +189,17 @@ namespace FPJ0000.OtConfirm } //동일날짜에 등록된 자료가있다면 오류로 처리한다. - var db = new EEEntities(); - string chkdt = tbSD.Value.ToShortDateString(); - var existdb = db.EETGW_HolydayRequest.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.uid == uid.ToString() && t.sdate == chkdt).Any(); - if(existdb) + if (dr.RowState == DataRowState.Detached) { - FCOMMON.Util.MsgE("동일 날짜에 등록된 자료가 있습니다"); - return ; + var db = new EEEntities(); + string chkdt = tbSD.Value.ToShortDateString(); + var existdb = db.EETGW_HolydayRequest.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.uid == uid.ToString() && t.sdate == chkdt).Any(); + if (existdb) + { + FCOMMON.Util.MsgE("동일 날짜에 등록된 자료가 있습니다"); + return; + } + }