From 072169e3c5446f94e2cf4e570e5c7952bb5b15b9 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 27 七月 2021 14:47:44 +0800 Subject: [PATCH] 今日开发 考勤规则里增加 公司安排加班 调整请假时间计算 加班日考勤计算 --- zhengcaioa/zhengcaioa/Controllers/ProjectController.cs | 77 ++++++++++++++++++++++++++++++++++---- 1 files changed, 69 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs index ee71b47..02a69c9 100644 --- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs @@ -24,15 +24,17 @@ private readonly ILiaotianService _liaotianService; private readonly IIntentionCustomerService _intentionCustomerService; private readonly IUserService _userService; + private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; - - public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService) + public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService + , ICooperatecustomCustomerService cooperatecustomCustomerService) { _logger = logger; _projectService = projectService; _liaotianService = liaotianService; _intentionCustomerService = intentionCustomerService; _userService = userService; + _cooperatecustomCustomerService = cooperatecustomCustomerService; } [CheckLogin] public IActionResult Index() @@ -68,6 +70,7 @@ { projectDTO = _projectService.GetLiaotianEntity(id); var intentionCustomerDTOs = _intentionCustomerService.GetList(); + var cooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList(); if (projectDTO.Projectzhongbiaos!=null && projectDTO.Projectzhongbiaos.Count > 0) { @@ -75,6 +78,11 @@ { var intt = intentionCustomerDTOs.Count(x=>x.Name == projectDTO.Projectzhongbiaos[i].Names); + if (intt > 0) + { + projectDTO.Projectzhongbiaos[i].ProjectId = "yes"; + } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Projectzhongbiaos[i].Names); if (intt > 0) { projectDTO.Projectzhongbiaos[i].ProjectId = "yes"; @@ -89,12 +97,22 @@ { projectDTO.Drcunzai = "yes"; } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Drhx); + if (intt > 0) + { + projectDTO.Drcunzai = "yes"; + } } if (!string.IsNullOrWhiteSpace(projectDTO.Dshx)) { var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Dshx); + if (intt > 0) + { + projectDTO.Dscunzai = "yes"; + } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Dshx); if (intt > 0) { projectDTO.Dscunzai = "yes"; @@ -106,6 +124,11 @@ { var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.projectreasons[i].Reasonname); + if (intt > 0) + { + projectDTO.projectreasons[i].ProjectId = "yes"; + } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.projectreasons[i].Reasonname); if (intt > 0) { projectDTO.projectreasons[i].ProjectId = "yes"; @@ -123,6 +146,41 @@ { projectDTO.Projectyouxiaos[i].ProjectId = "yes"; } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Projectyouxiaos[i].Namesyouxiao); + if (intt > 0) + { + projectDTO.Projectyouxiaos[i].ProjectId = "yes"; + } + } + } + + if (!string.IsNullOrWhiteSpace(projectDTO.Caigourenname)) + { + var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Caigourenname); + + if (intt > 0) + { + projectDTO.Caigourennamecunzai = "yes"; + } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Caigourenname); + if (intt > 0) + { + projectDTO.Caigourennamecunzai = "yes"; + } + } + + if (!string.IsNullOrWhiteSpace(projectDTO.Dailiname)) + { + var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Dailiname); + + if (intt > 0) + { + projectDTO.Dailinamecunzai = "yes"; + } + intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Dailiname); + if (intt > 0) + { + projectDTO.Dailinamecunzai = "yes"; } } @@ -140,8 +198,8 @@ Projectyouxiaolist.Add(new Projectyouxiao()); projectDTO.Projectyouxiaos = Projectyouxiaolist; - var Projectzhongbiaoslist = new List<Projectzhongbiao>(); - Projectzhongbiaoslist.Add(new Projectzhongbiao()); + var Projectzhongbiaoslist = new List<ProjectzhongbiaoDTO>(); + Projectzhongbiaoslist.Add(new ProjectzhongbiaoDTO()); projectDTO.Projectzhongbiaos = Projectzhongbiaoslist; projectDTO.StartTime = DateTime.Now; } @@ -242,7 +300,8 @@ ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList(); ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); - + ViewBag.flbx = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + ViewBag.ShiFouyReasonname = _liaotianService.GetSYScode("Project", "ShiFouyReasonname").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } @@ -328,7 +387,7 @@ } else if (select != null && select.TextContent.IndexOf("涓爣锛堟垚浜わ級淇℃伅") >= 0) { - projectDTO.Projectzhongbiaos = new List<Projectzhongbiao>(); + projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>(); if (table[i + 1] != null) { @@ -341,7 +400,7 @@ var surpliernames = surpliername.Split(','); for(int j = 0;j< surpliernames.Length; j++) { - var projectzhongbiao = new Projectzhongbiao(); + var projectzhongbiao = new ProjectzhongbiaoDTO(); projectzhongbiao.Names = surpliernames[j].Trim(); //if (table[i + 2] != null) //{ @@ -450,7 +509,9 @@ var td1 = table[i + 1].QuerySelector("td"); if (td1 != null) { - projectDTO.Zhuanjia = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml + string ssss = table[i + 1].QuerySelector("td").TextContent.Trim(); + ssss = ssss.Replace("锛堢粍闀匡級", "").Replace("(缁勯暱)", "").Replace(",", "銆�").Replace("锛堣瘎瀹$粍闀匡級", "").Replace("(璇勫缁勯暱)", "").Replace("锛�", "銆�").Replace("璇勫缁勯暱锛�", "").Replace("缁勯暱锛�", "").Replace("缁勫憳锛�",""); + projectDTO.Zhuanjia = ssss;//OuterHtml } } -- Gitblit v1.9.1