From 7055b18b0b78b3ec42fe666e4eb5c35c6552d093 Mon Sep 17 00:00:00 2001 From: chi Date: Tue, 24 May 2022 08:50:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=AC=B4=EC=9D=BC=EC=A7=80=20?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=EC=84=9C=EB=B9=84=EC=8A=A4=20..=20=EC=9D=B4?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=20=EC=A3=BC=EC=86=8C=EA=B0=80=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=82=AC=EB=9E=8C=20=EB=A9=94=EC=9D=BC=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=ED=95=98=EA=B2=8C=20=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/AssemblyInfo.cs | 4 +- JobReportMailService/fJobReportDay.cs | 49 +++++++++++++++++-- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/JobReportMailService/Properties/AssemblyInfo.cs b/JobReportMailService/Properties/AssemblyInfo.cs index 9855473..c4fd431 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.05.21.2240")] -[assembly: AssemblyFileVersion("22.05.21.2240")] +[assembly: AssemblyVersion("22.05.24.0850")] +[assembly: AssemblyFileVersion("22.05.24.0850")] diff --git a/JobReportMailService/fJobReportDay.cs b/JobReportMailService/fJobReportDay.cs index be9d834..97e8988 100644 --- a/JobReportMailService/fJobReportDay.cs +++ b/JobReportMailService/fJobReportDay.cs @@ -137,15 +137,19 @@ namespace JobReportMailService var dtMailData = new DataSet1.MailDataDataTable(); var dtDateList = new DataSet1.JobReportDateListDataTable(); - taMailForm.Fill(dtMailForm); + + + + var gcodelist = dtMailForm.GroupBy(t => t.gcode).Select(t => t.Key).ToList(); + gcodelist = new List(); + //gcodelist.Add("EETK5"); - var gcodelist = dtMailForm.GroupBy(t => t.gcode).ToList(); foreach (var gcodedata in gcodelist) { //메일양식이 지정되어있는지 체크 - var vGcode = gcodedata.Key; + var vGcode = gcodedata; if (string.IsNullOrEmpty(vGcode)) continue; //if (vGcode.Contains("K5") == false) continue; @@ -169,6 +173,8 @@ namespace JobReportMailService continue; } + List NoMailList = new List(); + NoMailList.Add($"그룹\t사번\t성명\t경고일"); //대상 사용자 목록을 추출한다; var users = taJobReportUserList.GetData(vGcode); @@ -265,6 +271,7 @@ namespace JobReportMailService } else if (string.IsNullOrEmpty(userinfo.email)) { + NoMailList.Add($"{vGcode}\t{uid.Key}\t{uid.Value}\t{WarnList.Count}"); addmsg($"[{vGcode}] {uid.Value}({uid.Key}) 의 메일 정보가 존재하지 않습니다"); } else @@ -361,16 +368,48 @@ namespace JobReportMailService } + + //첫줄은 제목이므로 2줄이상 있어야 한다 + if (NoMailList.Count > 1) + { + using (var dt = new DataSet1.MailDataDataTable()) + { + var newdr = dt.NewMailDataRow(); + newdr.gcode = "EET1P"; + newdr.cate = "ERR"; + newdr.subject = $"[GW] {vGcode} - 업무일지 담당자 이메일 경고"; + newdr.fromlist = "chikyun.kim@amkor.co.kr"; + newdr.tolist = "chikyun.kim@amkor.co.kr"; + newdr.bcc = string.Empty; + newdr.cc = string.Empty; + newdr.pdate = DateTime.Now.ToShortDateString(); + newdr.body = string.Join("
", NoMailList.ToList()); + newdr.wuid = "dev"; + newdr.wdate = DateTime.Now; + newdr.EndEdit(); + dt.AddMailDataRow(newdr); + var cnt = taMailData.Update(dt); + if (cnt == 1) + { + addmsg($"업무일지 메일없는 대상자 생성 완료(day)"); + System.Threading.Thread.Sleep(10000); + } + } + } + + System.Threading.Thread.Sleep(500); } + dtMailForm.Dispose(); dtMailData.Dispose(); dtDateList.Dispose(); - + + taMailForm.Dispose();// = new DataSet1TableAdapters.MailFormTableAdapter(); taMailData.Dispose();// = new DataSet1TableAdapters.MailDataTableAdapter(); taJobReportUserList.Dispose();// = new DataSet1TableAdapters.vJobReportUserListTableAdapter(); @@ -378,6 +417,8 @@ namespace JobReportMailService taHolidayList.Dispose();// = new DataSet1TableAdapters.HolidayLIstTableAdapter(); taGroupUser.Dispose();// = new DataSet1TableAdapters.vGroupUserTableAdapter(); taJobReportDateList.Dispose(); + + } private void toolStripButton1_Click(object sender, EventArgs e)