From c4c02944532a9bfda6de9a0cd85a9dfa631ed003 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期六, 17 五月 2025 15:28:19 +0800
Subject: [PATCH] 1

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

diff --git a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
index bfffd0d..f0ac05c 100644
--- a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
@@ -283,7 +283,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 +388,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 +456,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