From 6db857c2480bd8d2d86069da92e4892de94d1c8a Mon Sep 17 00:00:00 2001 From: pzy <2829717936@qq.com> Date: 星期二, 13 八月 2024 16:09:21 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 29 +++++++++++++---------------- 1 files changed, 13 insertions(+), 16 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index bf61a5a..1db60e5 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -3683,28 +3683,25 @@ { try { - string sql = @"SELECT b.HMouldID,c.HMouldNo 妯″叿缂栫爜,c.HName 妯″叿鍚嶇О,c.HModel 妯″叿鍨嬪彿 FROM Sc_ICMOBillStatus_Tmp a - LEFT JOIN( - SELECT *, ROW_NUMBER() OVER(PARTITION BY HSourceID ORDER BY HScanDate DESC) AS RowNum FROM Sc_MouldUpperBillSub - ) b ON a.HSourceID = b.HSourceID AND b.RowNum = 1 - left join Gy_MouldFileMain c on b.HMouldID = c.HInterID - where a.HSourceInterID ='" + HInterID + "' and a.HSourceEntryID ='" + HEntryID + "' and a.HSourceBillNo ='" + HBillNo + "'"; - ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp"); + ds = oCN.RunProcReturn("exec h_p_StationOutBill_Model '" + HInterID + "','"+ HEntryID + "' ,'" + HBillNo + "'", "h_p_StationOutBill_Model"); - if (ds.Tables[0].Rows.Count == 0) + if (ds.Tables[0].Rows.Count != 0 && ds != null) { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "褰撳墠璁惧娌℃湁妯″叿杩涜缁戝畾!"; + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; objJsonResult.data = ds.Tables[0]; return objJsonResult; } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + return objJsonResult; + } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = ""; - objJsonResult.data = ds.Tables[0]; - return objJsonResult; + } catch (Exception e) { -- Gitblit v1.9.1