From d4a6d65f5e449c3e5464aa18ae97bf8953987217 Mon Sep 17 00:00:00 2001
From: LR-20210131IOQH\Administrator <jackcold@163.com>
Date: 星期二, 10 八月 2021 15:44:14 +0800
Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/zhengcaioa

---
 zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs b/zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs
index 55d12c3..253e624 100644
--- a/zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs
+++ b/zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs
@@ -48,7 +48,8 @@
         private readonly IDtChannelArticleNewsService _dtChannelArticleNewsService;
         private readonly IConfiguration _configuration;
         private readonly IHttpClientFactory _clientFactory;
-        private readonly IAskService _askService; 
+        private readonly IAskService _askService;
+        private readonly IAdmEvaluateService _admEvaluateService;
 
         private readonly decimal jiabangongzibiaozhun = new decimal(21.5);
         public TimedBackgroundService(ILogger<TimedBackgroundService> logger, IServiceScopeFactory factory)
@@ -81,6 +82,7 @@
             _configuration = factory.CreateScope().ServiceProvider.GetRequiredService<IConfiguration>();
             _clientFactory = factory.CreateScope().ServiceProvider.GetRequiredService<IHttpClientFactory>();
             _askService= factory.CreateScope().ServiceProvider.GetRequiredService<IAskService>();
+            _admEvaluateService = factory.CreateScope().ServiceProvider.GetRequiredService<IAdmEvaluateService>();
         }
         protected override async Task ExecuteAsync(CancellationToken stoppingToken)
         {
@@ -1336,8 +1338,10 @@
                 searchEntity.AttendanceId = admAttendanceDTO.Id;
                 List<AdmAttendanceDtlDTO> admAttendanceDtlDTOs = _admAttendanceDtlService.GetList(searchEntity).OrderBy(x => x.SgninDate).ToList();
 
+                //鏌ヨ鏄惁鏈変笉绉拌亴鐨勫伐浣滆�冭瘎
+               var admEvaluateDTOs = _admEvaluateService.GetListsalary(userList[i].Id, dateminkaoqin, datemaxkaoqin).Where(x=>x.EvaluateValue == "03").ToList();
                 //褰撴湀鍑哄嫟鐜�
-                decimal chuqinlv = Math.Round(admAttendanceDTO.Shijichuqin / admAttendanceDTO.Yingchuqin,4); 
+                decimal chuqinlv = Math.Round((admAttendanceDTO.Shijichuqin- admEvaluateDTOs.Count) / admAttendanceDTO.Yingchuqin,4); 
 
                 //鏌ヨ褰撳墠鍛樺伐鑱屽姟鐨勫熀鏈伐璧勯厤缃�
 
@@ -1392,7 +1396,12 @@
                                     }
                             }
                         }
-                        shiyongqichuqinlv = Math.Round(shiyongqichuqintianshu / admAttendanceDTO.Yingchuqin, 4);
+
+                        //鏌ヨ鏄惁鏈変笉绉拌亴鐨勫伐浣滆�冭瘎
+                        var admEvaluateDTOsshiyongqi = _admEvaluateService.GetListsalary(userList[i].Id, dateminkaoqin, userList[i].ShiyongDateEnd.Value.AddDays(1)).Where(x => x.EvaluateValue == "03").ToList();
+
+
+                        shiyongqichuqinlv = Math.Round((shiyongqichuqintianshu- admEvaluateDTOsshiyongqi.Count) / admAttendanceDTO.Yingchuqin, 4);
                     }
                     else
                     {
@@ -3433,7 +3442,7 @@
                 decimal jiucuo = hrSalaryDTO.Jiucuo.HasValue ? hrSalaryDTO.Jiucuo.Value : 0;
 
                 //璁$畻淇濆簳骞磋柂
-                if (userList[i].Indate.HasValue && userList[i].miniyearsalary.HasValue)
+                if (userList[i].Indate.HasValue && userList[i].miniyearsalary.HasValue && userList[i].miniyearsalary.Value>0)
                 {
                     DateTime jixinue = userList[i].Indate.Value;
                     if (userList[i].Indate.Value.Day != 1)
@@ -3579,7 +3588,7 @@
 
                 hrSalaryDTO.Yufagongzi = userList[i].advancewages;
 
-                if (userList[i].advancewages.HasValue)
+                if (userList[i].advancewages.HasValue && userList[i].advancewages.Value>0)
                 {
                     hrSalaryDTO.Yufagongziheji = 0;
                     HrSalaryDTO hrSalaryDTOlast = _hrSalaryService.GetListByUser(userList[i].Id, dateminkaoqin.AddMonths(-1).Year, dateminkaoqin.AddMonths(-1).Month);

--
Gitblit v1.9.1