From 74ab9465837f8a6f9eae854059e9783eff24e173 Mon Sep 17 00:00:00 2001
From: sjz <1240968267@qq.com>
Date: 星期一, 14 七月 2025 18:06:24 +0800
Subject: [PATCH] 多组织修改

---
 MES.Service/service/BasicData/MesStaffManager.cs |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/MES.Service/service/BasicData/MesStaffManager.cs b/MES.Service/service/BasicData/MesStaffManager.cs
index d0eb8b7..c92bcf4 100644
--- a/MES.Service/service/BasicData/MesStaffManager.cs
+++ b/MES.Service/service/BasicData/MesStaffManager.cs
@@ -42,14 +42,15 @@
     }
 
     // 鏇存柊鍛樺伐鐘舵�佺殑鏂规硶
-    private bool UpdateStaffStatus(SqlSugarScope db, decimal staffId,string status)
+    private bool UpdateStaffStatus(SqlSugarScope db, decimal staffId,
+        string status)
     {
         var result = db.Updateable<MesStaff>().SetColumns(s => s.FforbidStatus == status).Where(s => s.Id == staffId).ExecuteCommand();
         return true;
     }
 
     // 鎻掑叆鎴栨洿鏂板憳宸ョ殑鏂规硶
-    private bool InsertOrUpdateStaff(SqlSugarScope db,MesStaff entity)
+    private bool InsertOrUpdateStaff(SqlSugarScope db, MesStaff entity)
     {
         var exists = db.Queryable<MesStaff>().Any(e => e.Id == entity.Id);
         if (exists)
@@ -90,9 +91,8 @@
         };
 
         if (staff.FStaffStartDate != null)
-        {
-            entity.StartDate = DateTime.ParseExact(staff.FStaffStartDate, "yyyy-MM-dd HH:mm:ss", null);
-        }
+            entity.StartDate = DateTime.ParseExact(staff.FStaffStartDate,
+                "yyyy-MM-dd HH:mm:ss", null);
 
         return entity;
     }
@@ -108,15 +108,17 @@
                 switch (staffGroup.Key)
                 {
                     case "0":
-                        if (!UpdateStaffStatusBatch(db, staffGroup.Value,"A")) // 鎵归噺鍚敤鍛樺伐
+                        if (!UpdateStaffStatusBatch(db, staffGroup.Value,
+                                "A")) // 鎵归噺鍚敤鍛樺伐
                             throw new NotImplementedException("鍚敤澶辫触");
                         break;
                     case "1":
-                        if (!UpdateStaffStatusBatch(db, staffGroup.Value,"B")) // 鎵归噺绂佺敤鍛樺伐
+                        if (!UpdateStaffStatusBatch(db, staffGroup.Value,
+                                "B")) // 鎵归噺绂佺敤鍛樺伐
                             throw new NotImplementedException("绂佺敤澶辫触");
                         break;
                     case "2":
-                        if (!InsertStaffBatch(db,staffGroup.Value)) // 鎵归噺鎻掑叆鍛樺伐
+                        if (!InsertStaffBatch(db, staffGroup.Value)) // 鎵归噺鎻掑叆鍛樺伐
                             throw new NotImplementedException("鎻掑叆澶辫触");
                         break;
                     case "3":
@@ -124,11 +126,13 @@
                             throw new NotImplementedException("鍒犻櫎澶辫触");
                         break;
                     case "4":
-                        if (!InsertOrUpdateBatch(db,staffGroup.Value)) // 鎵归噺鎻掑叆鎴栨洿鏂板憳宸�
+                        if (!InsertOrUpdateBatch(db,
+                                staffGroup.Value)) // 鎵归噺鎻掑叆鎴栨洿鏂板憳宸�
                             throw new NotImplementedException("鍚屾澶辫触");
                         break;
                     default:
-                        throw new ArgumentNullException($"type娌℃湁{staffGroup.Key}杩欎釜绫诲瀷鐨勫弬鏁�");
+                        throw new ArgumentNullException(
+                            $"type娌℃湁{staffGroup.Key}杩欎釜绫诲瀷鐨勫弬鏁�");
                 }
 
             return 1;
@@ -136,7 +140,8 @@
     }
 
     // 鎵归噺鏇存柊鍛樺伐鐘舵�佺殑鏂规硶
-    private bool UpdateStaffStatusBatch(SqlSugarScope db,List<MesStaff> staffList, string status)
+    private bool UpdateStaffStatusBatch(SqlSugarScope db,
+        List<MesStaff> staffList, string status)
     {
         var ids = staffList.Select(it => it.Id).ToArray();
         var result = db.Updateable<MesStaff>().SetColumns(s => s.FforbidStatus == status).Where(s => ids.Contains(s.Id)).ExecuteCommand();
@@ -145,7 +150,7 @@
     }
 
     // 鎵归噺鎻掑叆鍛樺伐鐨勬柟娉�
-    private bool InsertStaffBatch(SqlSugarScope db,List<MesStaff> staffList)
+    private bool InsertStaffBatch(SqlSugarScope db, List<MesStaff> staffList)
     {
         foreach (var entity in staffList)
         {

--
Gitblit v1.9.3