From bf14008acffe7a9a7ac6e2eeb38ce3552b71b33a Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 14 三月 2023 13:43:30 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs |   98 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 81 insertions(+), 17 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs b/zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs
index 23467c6..fb87020 100644
--- a/zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs
@@ -25,10 +25,12 @@
         private readonly IWfRunProcessService _wfRunProcessService;
         private readonly IWfHistoryService _wfHistoryService;
         private readonly IWfNeeddeelService _wfNeeddeelService;
+        private readonly IPltPageService _pltPageService;
         [CheckLogin]
         public SigninController(ILogger<SigninController> logger, IAdmSigninService signinService, ISysAttachmentService sysAttachmentService
             , IAdmAttendanceRuleService attendanceRuleService, ILiaotianService liaotianService, IWfRunProcessService wfRunProcessService
-            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService)
+            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService
+             , IPltPageService pltPageService)
         {
             _logger = logger;
             _signinService = signinService;
@@ -38,6 +40,7 @@
             _wfRunProcessService = wfRunProcessService;
             _wfHistoryService = wfHistoryService;
             _wfNeeddeelService = wfNeeddeelService;
+            _pltPageService = pltPageService;
         }
 
         #region 鑰冨嫟绛惧埌鎵撳崱
@@ -201,9 +204,64 @@
             search.userId = curentuser.Id;
             return JsonConvert.SerializeObject(_signinService.SearchByPaging(search));
         }
+
+
+
+        /// <summary>
+        /// 鎴戠殑鑰冨嫟璁板綍
+        /// </summary>
+        /// <returns></returns>
+        [CheckLogin]
+        public IActionResult SigninAll(string id)
+        {
+            JArray jar = new JArray();
+            for (var i = 1; i <= 12; i++)
+            {
+                var jo = string.Format("\"code\":{0},  \"label\":\"{1}鏈圽" ", i, i);
+                jar.Add(JObject.Parse("{" + jo + "}"));
+
+            }
+            ViewBag.month = jar;
+            JArray Year = new JArray();
+            for (var i = -1; i < 2; i++)
+            {
+                var jo = string.Format("\"code\":{0},  \"label\":\"{0}骞碶" ", DateTime.Now.Year + i);
+                Year.Add(JObject.Parse("{" + jo + "}"));
+            }
+            ViewBag.year = Year;
+            ViewBag.userid = id;
+            List<ActionEntity> actionlist = new List<ActionEntity>();
+            ActionEntity actionEntity = new ActionEntity();
+            actionEntity.OpenType = 0;
+            actionEntity.ActionUrl = "";
+            actionEntity.ActionFun = "Search";
+            actionEntity.PageIco = "fa fa-search";
+            actionEntity.ActionName = "鏌ヨ";
+            actionlist.Add(actionEntity);
+            ViewData["ActionInfo"] = actionlist;
+
+            return View();
+        }
+
+
+
+        /// <summary>
+        /// 鍙栧緱鑰冨嫟璁板綍
+        /// </summary>
+        /// <returns></returns>
+
+        [CheckLogin]
+        public string GetSigninListAll(AdmSignInDTOSearch search)
+        {
+            //var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            //search.userId = curentuser.Id;
+            return JsonConvert.SerializeObject(_signinService.SearchByPaging(search));
+        }
+
+
         #endregion
         #region 璇峰亣涓庨攢鍋�
-         public IActionResult AskLeave(string id="", string StratTimeName = "", string EndTimeName = "")
+        public IActionResult AskLeave(string id="", string StratTimeName = "", string EndTimeName = "")
         {
 
             var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
@@ -342,21 +400,21 @@
             if(admAsk.Step == "鎻愪氦")
             {
                 //璇峰亣鏃堕棿涓嶈兘閲嶅彔
-              var qingjia  =   _signinService.GetAskLeaveChongdie(curentuser.Id, admAsk.StratTime.Value, admAsk.EndTime.Value);
-                if (qingjia.Count > 0)
-                {
-                    resultEntity.Result = false;
-                    resultEntity.Message = "璇ユ椂闂存宸茬粡鏈夎鍋囷紒";
-                    return JsonConvert.SerializeObject(resultEntity);
-                }
+              //var qingjia  =   _signinService.GetAskLeaveChongdie(curentuser.Id, admAsk.StratTime.Value, admAsk.EndTime.Value);
+              //  if (qingjia.Count > 0)
+              //  {
+              //      resultEntity.Result = false;
+              //      resultEntity.Message = "璇ユ椂闂存宸茬粡鏈夎鍋囷紒";
+              //      return JsonConvert.SerializeObject(resultEntity);
+              //  }
 
-            //璇峰亣瓒呰繃涓夊ぉ锛屽繀椤绘彁鍓嶄笁澶╀互涓婅鍋囷紒
-                if (admAsk.LaveDay.Value >= 3 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(3))
-                {
-                    resultEntity.Result = false;
-                    resultEntity.Message = "璇峰亣瓒呰繃涓夊ぉ锛屽繀椤绘彁鍓嶄笁澶╀互涓婅鍋囷紒";
-                    return JsonConvert.SerializeObject(resultEntity);
-                }
+            ////璇峰亣瓒呰繃涓夊ぉ锛屽繀椤绘彁鍓嶄笁澶╀互涓婅鍋囷紒
+            //    if (admAsk.LaveDay.Value >= 3 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(3))
+            //    {
+            //        resultEntity.Result = false;
+            //        resultEntity.Message = "璇峰亣瓒呰繃涓夊ぉ锛屽繀椤绘彁鍓嶄笁澶╀互涓婅鍋囷紒";
+            //        return JsonConvert.SerializeObject(resultEntity);
+            //    }
 
                 //璇峰亣瓒呰繃涓冨ぉ锛屽繀椤绘彁鍓嶄竷澶╀互涓婅鍋囷紒
                 if (admAsk.LaveDay.Value >= 7 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(7))
@@ -963,7 +1021,7 @@
                 }
 
                 //閿�鍋囧繀椤讳笁澶╀互鍐�
-                if (leaveOff.StratTime.Value.Date < DateTime.Now.Date.AddDays(-3))
+                if (leaveOff.StratTime.Value.Date < DateTime.Now.Date.AddDays(-4))
                 {
                     resultEntity.Result = false;
                     resultEntity.Message = "璇峰湪72灏忔椂鍐呰繘琛岄攢鍋囧鐞嗭紝瓒呰繃72灏忔椂鏃犳硶鎻愪氦";
@@ -1030,6 +1088,12 @@
         #region 鑰冨嫟瑙勫垯
         public IActionResult AttendanceRule()
         {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+            var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Signin/AttendanceRule/");
+            var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList();
+            ViewData["ActionInfo2"] = pageEntities2;
+
             AdmAttendanceRuleDTO admAttendanceRuleDTO =  _attendanceRuleService.Get("");
             admAttendanceRuleDTO.admAttendanceRulesDtlDTOs = _attendanceRuleService.GetDtlList("");
 

--
Gitblit v1.9.1