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/Services/AdmSigninService.cs |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/zhengcaioa/Services/AdmSigninService.cs b/zhengcaioa/Services/AdmSigninService.cs
index 59502a8..8fed0f5 100644
--- a/zhengcaioa/Services/AdmSigninService.cs
+++ b/zhengcaioa/Services/AdmSigninService.cs
@@ -20,6 +20,7 @@
         }
 
         #region 鑰冨嫟鎵撳崱
+
         public ResultEntity save(string id, int signinType)
         {
             ResultEntity resultEntity = new ResultEntity();
@@ -83,6 +84,20 @@
             AdmSignInDTO signin = _mapper.Map<AdmSignInDTO>(entity);
             return signin;
         }
+
+        public AdmSignInDTO GetByUserAndDate(string userid, DateTime sgninDate)
+        {
+            AdmSignIn entity = _context.AdmSignIns.Where(x=>x.RecStatus == "A" &&  x.UserId == userid && x.SgninDate == sgninDate).FirstOrDefault();
+            AdmSignInDTO signin = null;
+            if (entity != null)
+            {
+                signin = _mapper.Map<AdmSignInDTO>(entity);
+            }
+            
+            return signin;
+        }
+
+        
 
         public AdmSignInDTO GetTodaySignin(string userId)
         {
@@ -208,7 +223,7 @@
                           Afternoon = virtity(a.AfternoonIn, a.AfternoonOut),
                           Overtime = virtity(a.OvertimeIn, a.OvertimeOut)
                       }).ToList();
-            if (searchEntity.totalrows == 0)
+            //if (searchEntity.totalrows == 0)
                 searchEntity.totalrows = dt.Count();
             var signinList = dt.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
             list = _mapper.Map<List<SigninListDTO>>(signinList);
@@ -344,7 +359,25 @@
             return leaveDTO;
 
         }
-       
+
+        public List<AdmAskLeaveDTO> GetAskLeaveByUserId(string UserId)
+        {
+            List<AdmAskLeave> admAskLeaveDTOs = _context.AdmAskLeaves.Where(e => e.RecStatus == "A" && e.ShenpiStatus == "A" && e.Creater == UserId).ToList();
+
+            List<AdmAskLeaveDTO> leaveDTOs = _mapper.Map< List <AdmAskLeaveDTO>  >(admAskLeaveDTOs);
+            return leaveDTOs;
+
+        }
+
+        public List<AdmAskLeaveOffDTO> GetAskLeaveOffByUserId(string UserId)
+        {
+            List<AdmAskLeaveOff> admAskLeaveOffs = _context.AdmAskLeaveOffs.Where(e => e.RecStatus == "A" && e.ShenpiStatus == "A" && e.Creater == UserId).ToList();
+
+            List<AdmAskLeaveOffDTO> leaveDTOs = _mapper.Map<List<AdmAskLeaveOffDTO>>(admAskLeaveOffs);
+            return leaveDTOs;
+
+        }
+
         public AdmAskLeaveOffDTO GetAskLeaveOff(string Id)
         {
             AdmAskLeaveOff entity = _context.AdmAskLeaveOffs.Where(e => e.RecStatus == "A" && e.Id == Id ).FirstOrDefault();

--
Gitblit v1.9.1