This commit is contained in:
chi
2022-05-18 16:05:58 +09:00
parent 8d83d4a768
commit 5e67caad39
14 changed files with 830 additions and 78 deletions

View File

@@ -127,12 +127,18 @@ namespace JobReportMailService
//대상 사용자 목록을 추출한다
db = new EEEntities();
var users = db.vJobReportForUser.Where(t => t.gcode == vGcode).GroupBy(t => t.id);
// db.Database.CommandTimeout = 10000;
var taUser = new DataSet1TableAdapters.vJobReportForUserTableAdapter();
var users = taUser.GetData(vGcode);
taUser.Dispose();
//var users = db.vJobReportForUser.Where(t => t.gcode == vGcode).GroupBy(t => t.id);
Dictionary<string, string> uids = new Dictionary<string, string>();
foreach (var user in users)
foreach (var userinfo in users)
{
//해당 사용자의 오늘 날짜로 등록된 자동 데이터가 있다면 대상에 넣지 않는다
var userinfo = user.FirstOrDefault();
//var userinfo = user.FirstOrDefault();
if (userinfo == null || string.IsNullOrEmpty(userinfo.id) == true) continue;
//퇴사자 확인
@@ -186,7 +192,7 @@ namespace JobReportMailService
//이사용자의 날짜별 근무시간을 확인한다.
db = new EEEntities();
var UserDatas = db.vJobReportForUser.Where(t => t.gcode == vGcode && t.id == uid.Key && t.pdate.CompareTo(str_sd) >= 0 && t.pdate.CompareTo(str_ed) < 0).ToList();
var UserDatas = db.JobReport.Where(t => t.gcode == vGcode && t.uid == uid.Key && t.pdate.CompareTo(str_sd) >= 0 && t.pdate.CompareTo(str_ed) < 0).ToList();
Dictionary<DateTime, double?> WarnList = new Dictionary<DateTime, double?>();
foreach (var dt in days.OrderBy(t => t))