From aa51348d3501aa3a9bbda287929f3c8a05825063 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 03 十二月 2025 18:14:31 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 2560108..af1c550 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -292,7 +292,7 @@
                     //鍒ゆ柇褰撳墠宸ュ崟鏄惁寮�宸�
                     else if (oSystemParameter.omodel.MES_StationOutBill_MustBeginWorkCtl == "Y")
                     {
-                        ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceID = '" + HSourceID + "' and HICMOBillNo = '" + HICMOBillNo + "' and HInterID = '" + HICMOInterID + "' and hicmostatus =1", "Sc_ICMOBillStatus_Tmp");
+                        ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp with(nolock) where HSourceID = '" + HSourceID + "' and HICMOBillNo = '" + HICMOBillNo + "' and HInterID = '" + HICMOInterID + "' and hicmostatus =1", "Sc_ICMOBillStatus_Tmp");
                         if (ds.Tables[0].Rows[0]["HICMOStatus"].ToString() != "1")
                         {
                             objJsonResult.code = "0";
@@ -437,7 +437,7 @@
                 else if ("Modify".Equals(eventType))
                 {
                     num = 2;
-                    oCN.RunProc("UpDate Sc_StationOutBillMain set  " +
+                    oCN.RunProc("UpDate a set  " +
                     "HUpDater='" + HMaker + "'" +
                     ",HUpDateDate=getdate()" +
                     ",HSourceName='" + HSourceName + "'" +
@@ -479,6 +479,7 @@
                     //",HIsTimeFlag=" + HIsTimeFlag +
                     //",HRelBeginTime='" + HRelBeginTime + "'" +
                     //",HRelEndTime='" + HRelEndTime + "'" +
+                    " from Sc_StationOutBillMain a with(nolock)" +
                     " where HInterID=" + HInterID);
 
                     LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo);
@@ -534,8 +535,8 @@
                 oCN.RunProc("exec h_p_Mes_StationOutBillBackBarCode  " + HInterID + " ");
                 LogService.Write($"7.瀛樺偍杩囩▼缁撴潫锛岀敤鏃�" + sw.Elapsed);
                 //鍒ゆ柇鏄惁鏄� 鏈亾宸ュ簭
-                ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a  " +
-                                    " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID  " +
+                ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a with(nolock) " +
+                                    " inner join Sc_ProcessExchangeBillSub b with(nolock) on a.HInterID=b.HInterID  " +
                                     " Where a.HInterID=" + HProcExchInterID + " and b.HEntryID=" + HProcExchEntryID + " ", "Sc_ProcessExchangeBillMain");
                 LogService.Write($"7.1.鏌ヨ锛岀敤鏃�" + sw.Elapsed);
                 //鍒ゆ柇鏄惁鏄柊澧�
@@ -648,8 +649,8 @@
                 //娴嬭瘯璇彞===========================================================================================================
                 string msg_str = "";
                 string sql_str = "select a.HQty HQty_Main,b.HQty HQty_Sub " +
-                            "from Sc_ProcessExchangeBillMain as a " +
-                            "inner join Sc_ProcessExchangeBillSub as b on a.HInterID = b.HInterID " +
+                            "from Sc_ProcessExchangeBillMain as a with(nolock)" +
+                            "inner join Sc_ProcessExchangeBillSub as b with(nolock) on a.HInterID = b.HInterID " +
                             "where a.HInterID = " + HProcExchInterID;
                 DataSet ds_str = oCN.RunProcReturn(sql_str, "Sc_ProcessExchangeBillMain");
                 if (ds_str.Tables[0].Rows.Count > 0)
@@ -951,7 +952,7 @@
                 Int64 HInterID = DBUtility.ClsPub.CreateBillID("3711", ref DBUtility.ClsPub.sExeReturnInfo);
                 string HBillNo = DBUtility.ClsPub.CreateBillCode("3711", ref DBUtility.ClsPub.sExeReturnInfo, true);
                 //鑾峰彇缁勭粐浠g爜
-                string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString();
+                string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS with(nolock) where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString();
                 //鏍规嵁宸ュ簭姹囨姤鍗曚富ID鑾峰彇宸ュ簭姹囨姤鍏ュ簱鍗曠殑鏁版嵁
                 DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc");
                 if (ds.Tables[0].Rows.Count <= 0)
@@ -966,7 +967,7 @@
 
                 //淇濆瓨
                 //oCN.BeginTran();
-                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain");
+                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain with(nolock) where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain");
                 if (DsTable.Tables[0].Rows.Count > 0)
                 {
                     objJsonResult.code = "0";
@@ -1128,7 +1129,7 @@
                     return objJsonResult;
                 }
 
-                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
+                oCN.RunProc("update a set HRelationQty=1 from Sc_StationOutBillMain a with(nolock) where  HBillNo='" + BillNo + "'");
 
                 //oCN.Commit();
                 objJsonResult.code = "0";
@@ -1344,7 +1345,7 @@
                     return objJsonResult;
                 }
 
-                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
+                oCN.RunProc("update a set HRelationQty=1 from Sc_StationOutBillMain a with(nolock) where  HBillNo='" + BillNo + "'");
 
                 //oCN.Commit();
                 objJsonResult.code = "0";
@@ -3099,21 +3100,21 @@
                 string HChecker = CurUserName;
                 string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                 oCN.BeginTran();
-                ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain");
+                ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain");
                 if (ds.Tables[0].Rows.Count == 0)
                 {
                     sReturn = "鍗曟嵁鏈壘鍒帮紒";
                     return false;
                 }
-                oCN.RunProc(" Update Sc_StationOutBillMain set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+                oCN.RunProc(" Update a set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey.ToString());
                 oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1");
                 //鍒ゆ柇鏄惁鏄� 鏈亾宸ュ簭
                 DataSet ds1;
                 ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " +
-                    " from Sc_ProcessExchangeBillMain a " +
-                    " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
-                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ") " +
-                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain");
+                    " from Sc_ProcessExchangeBillMain a with(nolock)" +
+                    " inner join Sc_ProcessExchangeBillSub b with(nolock) on a.HInterID=b.HInterID " +
+                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey + ") " +
+                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain");
                 if (ds1 == null || ds1.Tables[0].Rows.Count == 0 || HLastSubProc ==false)
                 {
                 }
@@ -3121,8 +3122,8 @@
                 {
                 }
 
-                DataSet dataSet = oCN.RunProcReturn(@"select a.HProcExchBillNo,a.HQty,b.HQty HProcExchQty  from Sc_StationOutBillMain a
-inner join Sc_ProcessExchangeBillMain b on a.HProcExchInterID = b.HInterID
+                DataSet dataSet = oCN.RunProcReturn(@"select a.HProcExchBillNo,a.HQty,b.HQty HProcExchQty  from Sc_StationOutBillMain a with(nolock) 
+inner join Sc_ProcessExchangeBillMain b with(nolock) on a.HProcExchInterID = b.HInterID
 where a.HInterID = " + lngBillKey, "Sc_ProcessExchangeBillMain");
 
                 if (dataSet.Tables[0].Rows.Count > 0)

--
Gitblit v1.9.1