From 90858c80d9921b555119f41060c1f883f6e6ffc5 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 26 十二月 2024 12:49:35 +0800
Subject: [PATCH] 提交

---
 DocumentServiceAPI.Application/ProjectInfo/Services/SheZhiService.cs |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/DocumentServiceAPI.Application/ProjectInfo/Services/SheZhiService.cs b/DocumentServiceAPI.Application/ProjectInfo/Services/SheZhiService.cs
index fd25822..ab053ae 100644
--- a/DocumentServiceAPI.Application/ProjectInfo/Services/SheZhiService.cs
+++ b/DocumentServiceAPI.Application/ProjectInfo/Services/SheZhiService.cs
@@ -2,6 +2,7 @@
 using DocumentServiceAPI.Application.ProjectInfo.ViewMode;
 using DocumentServiceAPI.Application.Repository;
 using DocumentServiceAPI.Model.cyDocumentModel;
+using DocumentServiceAPI.Model.Permissions;
 using DocumentServiceAPI.Model.UserInfoModel;
 using DocumentServiceAPI.Utility;
 using MapsterMapper;
@@ -137,6 +138,18 @@
             }
             else
             {
+                var aaa = GetJwtInfo();
+                var tenantPermissions = _db.Queryable<TenantPermissions>().Where(x => x.IsDel == false && x.IsEn == true && x.TenantId == aaa.TEID.Value && x.PermissionsType == TenantPermissionsType.Manage).First();
+                if (tenantPermissions != null)
+                {
+                    var times = _db.Queryable<Document_TenderUnit>().Count(x => x.IsDeled == false && x.IsEn == true && x.TenantId == aaa.TEID.Value);
+                    if (tenantPermissions.UnitMaxCount > 0 && tenantPermissions.UnitMaxCount <= times)
+                    {
+                        throw new Exception("鎶曟爣鍗曚綅鏁伴噺瓒呭嚭鏈�澶у�硷紒鏃犳硶鏂板");
+                    }
+                }
+                dp.IsEn = true;
+                dp.IsDeled = false;
                 _db.Insertable<Document_TenderUnit>(dp).ExecuteCommand();
             }
 
@@ -281,7 +294,15 @@
             {
                 var aaa = GetJwtInfo();
 
-
+              var tenantPermissions =  _db.Queryable<TenantPermissions>().Where(x => x.IsDel == false && x.IsEn == true && x.TenantId == aaa.TEID.Value && x.PermissionsType == TenantPermissionsType.Manage).First();
+                if (tenantPermissions != null)
+                {
+                  var times  =  _db.Queryable<EmployeeAtTenant>().Count(x => x.IsDel == false && x.IsEn == true && x.TenantID == aaa.TEID.Value );
+                    if(tenantPermissions.EmployeeMaxCount>0 && tenantPermissions.EmployeeMaxCount<= times)
+                    {
+                        throw new Exception("鍛樺伐鏁伴噺瓒呭嚭鏈�澶у�硷紒鏃犳硶鏂板");
+                    }
+                }
 
                 dp.EmployeeId =  _db.Insertable<Document_EmployeeInfo>(document_EmployeeInfo).ExecuteReturnIdentity();
 
@@ -891,7 +912,7 @@
 
 
             result.Items = _db.Queryable<Document_LayInfo>()
-                .Where(a => a.TenantID == aaa.TEID)
+                .Where(a => (a.TenantID == aaa.TEID || a.IsSys == 1))
              //鏂囦欢鍚嶇О
              .WhereIF(!string.IsNullOrEmpty(page.LayName), a => a.LayName == page.LayName)
               .WhereIF(!string.IsNullOrEmpty(page.LayType) && page.LayType != "璇烽�夋嫨", a => a.LayType == page.LayType)

--
Gitblit v1.9.1