From 2369258bc0b452cf3cab2dd5e8e2d9fde112b8d0 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 26 七月 2021 16:17:25 +0800
Subject: [PATCH] 今日开发   加班申请·                统计报表:没有任何工作的人,不显示。显示人员的      部门  职位  姓名   工作时间                   在计算考勤的时候只有有加班申请的加班才算加班

---
 zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 113 insertions(+), 2 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
index 347ea6c..e668754 100644
--- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
@@ -104,7 +104,7 @@
 
 
         /// <summary>
-        /// 淇濆瓨鐢宠瘔
+        /// 淇濆瓨璐圭敤鐢宠
         /// </summary>
         /// <param name="data"></param>
         /// <returns></returns>
@@ -215,7 +215,7 @@
 
 
         /// <summary>
-        /// 淇濆瓨鐢宠瘔
+        /// 淇濆瓨鐗╁搧鐢抽
         /// </summary>
         /// <param name="data"></param>
         /// <returns></returns>
@@ -272,5 +272,116 @@
             }
             return new JsonResult(resultEntity);
         }
+
+
+
+        public IActionResult Askovertime(string id = "")
+        {
+            AdmAskovertimeDTO dto = new AdmAskovertimeDTO();
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+
+
+            //娴佺▼鐩稿叧
+            string shifoubiaoji = "A";
+            string sifoudangqian = "A";
+            string dangqianbuzhou = "鎻愪氦";
+            var lishiyijian = new List<WfHistoryDTO>();
+
+            if (string.IsNullOrEmpty(id))
+            {
+                dto.CreaterName = curentuser.UserName;
+                dto.Tittle = "鍔犵彮鐢宠锛�" + curentuser.UserName + "锛�";
+            }
+            else if (dto != null)
+            {
+                dto = _askService.GetAskovertime(id);
+                dto.OvertimeName = dto.Overtime.Value.ToString("0.##");
+                dto.JiabantimeName = dto.Jiabantime.Value.ToString("yyyy-MM-dd");
+
+                var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "10").FirstOrDefault();
+                if (wfRunProcessDTO == null)
+                {
+                    shifoubiaoji = "D";
+                    sifoudangqian = "D";
+                }
+                else
+                {
+                    dangqianbuzhou = wfRunProcessDTO.Step;
+                    //鏌ヨ鍘嗗彶鎰忚
+                    lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
+                    if (wfRunProcessDTO.Step != "鎻愪氦")
+                    {
+                        shifoubiaoji = "D";
+                    }
+
+                    //鏌ヨ寰呭姙
+                    var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x => x.DeelUserId == curentuser.Id).ToList();
+                    if (chaxundaiban != null && chaxundaiban.Count > 0)
+                    {
+                        sifoudangqian = "A";
+                    }
+                    else
+                    {
+                        sifoudangqian = "D";
+                    }
+
+                }
+
+
+
+
+            }
+
+            ViewBag.shifoubiaoji = shifoubiaoji;
+            ViewBag.sifoudangqian = sifoudangqian;
+            ViewBag.lishiyijian = lishiyijian;
+            ViewBag.dangqianbuzhou = dangqianbuzhou;
+
+            ViewData.Model = dto;
+            return View();
+        }
+
+
+        /// <summary>
+        /// 淇濆瓨璐圭敤鐢宠
+        /// </summary>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult Askovertime(AdmAskovertimeDTO data)
+        {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ResultEntity resultEntity = new ResultEntity();
+            using (TransactionScope scope = new TransactionScope())
+            {
+                if (data.Step == "鎻愪氦")
+                {
+
+                    data.ShenpiStatus = "D";
+                    data.RecStatus = "A";
+                    data.Creater = curentuser.Id;
+                    data.Createtime = DateTime.Now;
+                    data.Modifier = data.Creater;
+                    data.Modifytime = data.Createtime;
+
+                    resultEntity = _askService.SaveAskovertime(data);
+                    if (!resultEntity.Result)
+                    {
+                        return new JsonResult(resultEntity);
+                    }
+                }
+
+
+                //鍙戣捣娴佺▼鐩稿叧
+
+                resultEntity = _wfRunProcessService.WfAskovertime(data.Id, data.Step, data.Tongguojujue, curentuser.Id, data.Content, data.Tittle, "v1");
+                if (!resultEntity.Result)
+                {
+                    return new JsonResult(resultEntity);
+                }
+                scope.Complete();
+            }
+            return new JsonResult(resultEntity);
+        }
     }
 }

--
Gitblit v1.9.1