From fae58e2951ccf415ad8e8098ca49f5611e410dd3 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 10 四月 2026 09:35:50 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BaseSet/Gy_UnitController.cs |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
index bfffd0d..93d1113 100644
--- a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
@@ -49,6 +49,11 @@
                 }
 
                 string sql1 = string.Format(@"select * from h_v_Gy_UnitList where 缁勭粐鍚嶇О='" + Organization + "'");
+                if (oSystemParameter.omodel.WMS_CampanyName.Contains("鍥涚淮灏�"))
+                {
+                     sql1 = string.Format(@"select * from h_v_Gy_UnitList where 1=1 ");
+
+                }
                 if (sWhere == null || sWhere.Equals(""))
                 {
                     ds = oCN.RunProcReturn(sql1 + sWhere + "order by 璁¢噺鍗曚綅浠g爜 ", "h_v_Gy_UnitList");
@@ -283,7 +288,7 @@
             Single msg_HRate = float.Parse(sArray[3]);
             Int64 HItemID = 0;
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-
+            ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter();
             //鑾峰彇鏈�澶D鍊艰祴鍊�
             DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Unit ", "Gy_Unit");
             if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
@@ -388,6 +393,18 @@
                     }
                     else//缂栬緫鏃跺垽鏂�
                     {
+                        //宸插鏍镐笉鍏佽淇敼
+                        DataSet dss;
+                        dss = oCN.RunProcReturn("select * from Gy_Unit where HItemID=" + oItem.HItemID, "Gy_Unit");
+                        //鍒ゆ柇鏄惁鍙紪杈�
+                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "姝ゅ崟鎹姸鎬佸凡缁忓鏍革紝涓嶅厑璁镐慨鏀癸紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
                         //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
                         string sParent;
                         sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -444,10 +461,37 @@
                 }
                 if (bResult)
                 {
+                    //鑷姩瀹℃牳鍔熻兘
+                    if(oBill.oModel.HItemID == 0)
+                    {
+                        ds = oCN.RunProcReturn("select * from  Gy_Unit where HStopflag=0 and HNumber='" + oBill.oModel.HNumber.Trim() + "'", "Gy_Unit");
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "淇濆瓨鎴愬姛锛佽嚜鍔ㄥ鏍稿け璐ユ壘涓嶅埌瀵瑰簲鍗曟嵁";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Gy_Unit_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo);
+                            objJsonResult.Verify = "N";
+                            if (sAutoCheck == "Y")
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 1;
+                                objJsonResult.Message = "淇濆瓨鎴愬姛";
+                                objJsonResult.data = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                                objJsonResult.Verify = "Y";
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
-                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
                     objJsonResult.data = 1;
                     return objJsonResult;
                 }

--
Gitblit v1.9.1