From f311876e3a1341c4051e0d8eb45032fd35407f3c Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 08 十二月 2025 11:23:48 +0800
Subject: [PATCH] 基础信息:在数据库表内存在创建组织与使用组织的添加默认传入值1

---
 MES.Service/service/BasicData/SysDepartmentManager.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/MES.Service/service/BasicData/SysDepartmentManager.cs b/MES.Service/service/BasicData/SysDepartmentManager.cs
index 6ba27fc..dd8c947 100644
--- a/MES.Service/service/BasicData/SysDepartmentManager.cs
+++ b/MES.Service/service/BasicData/SysDepartmentManager.cs
@@ -4,7 +4,9 @@
 using SqlSugar;
 
 namespace MES.Service.service.BasicData;
-
+/// <summary>
+/// 閮ㄩ棬淇℃伅
+/// </summary>
 public class SysDepartmentManager : Repository<SysDepartment>
 {
     // 褰撳墠绫诲凡缁忕户鎵夸簡 Repository 澧炪�佸垹銆佹煡銆佹敼鐨勬柟娉�
@@ -144,8 +146,8 @@
             Depextr3 = department.FWIPStockID,
             Depextr4 = department.FForbidStatus,
             FParentID = department.FParentID,
-            FSubsidiary = department.FUseOrgId,
-            Fumbrella = department.FCreateOrgId,
+            //FSubsidiary = department.FUseOrgId,
+            //Fumbrella = department.FCreateOrgId,
             // 濡傛灉瀛樺湪锛屼娇鐢ㄧ幇鏈夌殑CreateDate锛屽悗缁皢鍒犻櫎鍚庨噸鏂版彃鍏�
             // 濡傛灉涓嶅瓨鍦紝璁句负褰撳墠鏃堕棿
             CreateDate = existingCustomer?.CreateDate ?? DateTime.Now,
@@ -171,6 +173,9 @@
     ? existingCustomer?.Factory
     : department.Factory,
 
+
+            FSubsidiary = string.IsNullOrEmpty(department.FUseOrgId) ? "1" : department.FUseOrgId,
+            Fumbrella = string.IsNullOrEmpty(department.FCreateOrgId) ? "1" : department.FCreateOrgId,
         };
 
         // ERP: 0=鏈鐢�, 1=绂佺敤

--
Gitblit v1.9.3