From c2ef1e65edb97ddbd00cc130e9f4dd9d47e0252d Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期三, 07 八月 2024 16:22:40 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 38 insertions(+), 12 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs index 94b9d8a..1ec1af4 100644 --- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs +++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs @@ -736,7 +736,7 @@ { if (HBarCode.Length == 29) { - string str1 = HBarCode.Substring(23, 3); + string str1 = HBarCode.Substring(18, 8); DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID @@ -745,11 +745,27 @@ if (dataSet.Tables[0].Rows.Count == 0) { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!"; - objJsonResult.data = null; - return objJsonResult; + str1 = HBarCode.Substring(23, 3); + + dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) +left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID +left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID +where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); + + if (dataSet.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + ClsPub.CurUserName = user; + //鏉$爜鐢熸垚 + return get_HBardBillSave(HProcExchBillNo, HBarCode); + } } else { ClsPub.CurUserName = user; @@ -768,7 +784,7 @@ } else { - string str1 = HBarCode.Substring(23, 3); + string str1 = HBarCode.Substring(18, 8); DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID @@ -777,11 +793,21 @@ if (dataSet.Tables[0].Rows.Count == 0) { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!"; - objJsonResult.data = null; - return objJsonResult; + str1 = HBarCode.Substring(23, 3); + + dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) +left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID +left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID +where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); + + if (dataSet.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!"; + objJsonResult.data = null; + return objJsonResult; + } } if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") -- Gitblit v1.9.1