From 57556b16aafbafebc7f9fc86745ac2ea83e7616d Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 01 七月 2021 14:26:35 +0800
Subject: [PATCH] 流程  请假  销假  待办 已办  我得申请

---
 zhengcaioa/Services/HrSalaryService.cs |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/zhengcaioa/Services/HrSalaryService.cs b/zhengcaioa/Services/HrSalaryService.cs
index 684d074..656f00c 100644
--- a/zhengcaioa/Services/HrSalaryService.cs
+++ b/zhengcaioa/Services/HrSalaryService.cs
@@ -93,7 +93,7 @@
             return resultEntity;
         }
 
-        public ResultEntity SaveCheckSalary(HrSalaryDTO dto)
+        public ResultEntity SaveCheckSalary(HrSalaryUpDTO dto)
         {
             ResultEntity resultEntity = new ResultEntity();
             try
@@ -101,6 +101,13 @@
                 var updatepltRole = _context.HrSalaries.Where(c=>c.Id==dto.Id).SingleOrDefault();
                 if(updatepltRole!=null)
                 {
+                    //鏇存柊鐢佃瘽璐圭敤鐘舵��
+                    var sim = _context.SimCost.Where(c => c.bill_year == updatepltRole.Year && c.bill_month <= updatepltRole.Month && c.user_id == updatepltRole.Userid && c.status == "0").ToList();
+                    foreach(var item in sim)
+                    {
+                        item.status = "1";
+                    }
+
                     var user = _context.PltUsers.Where(c => c.Id == updatepltRole.Userid).SingleOrDefault();
 
                     updatepltRole.Jiangjin = dto.Jiangjin;
@@ -178,7 +185,7 @@
                         }
                     }
 
-                    updatepltRole.Islock = "Q";
+                    updatepltRole.Islock = "H";
                     updatepltRole.Modifier = dto.Modifier;
                     updatepltRole.Modifytime =DateTime.Now;
                     var count= _context.SaveChanges();
@@ -578,7 +585,7 @@
             var entity = (from a in _context.HrSalaries
                           join b in _context.PltUsers on a.Userid equals b.Id
                           join c in _context.HrDepts on b.DeptId equals c.Id
-                          where a.RecStatus=="A" && a.Userid == userid && a.Year == year && a.Month==month
+                          where a.RecStatus=="A" && a.Islock!="D" && a.Userid == userid && a.Year == year && a.Month==month
                           select new HrSalaryDTO()
                           {
                               Id = a.Id,
@@ -819,5 +826,17 @@
             data.LoadData(searchEntity, rolelist);
             return data;
         }
+
+        public void AutoCheck()
+        {
+            try
+            {
+                var salary = _context.Database.ExecuteSqlRaw("update [hr_salary] set islock='Q',[modifier]='e4c93811-b9b1-4998-89f5-c416ebab0c07',modifytime=getdate() where islock = 'H' and DATEDIFF(hh,[modifytime], getdate()) > 72");
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
     }
 }

--
Gitblit v1.9.1