From 25c2291ded30737b07fb7c93e5e231cc64733d2a Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期二, 19 八月 2025 16:15:29 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index d744e43..6d98f0a 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -171,6 +171,7 @@
                 long HMainSourceEntryID = mainList[0].HICMOEntryID;
                 string HMainSourceBillNo = mainList[0].HICMOBillNo;
 
+                //鍒ゆ柇鐢熶骇璐ㄩ噺姹囨姤鍗曟槸鍚﹀瓨鍦�
                 ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain WITH(NOLOCK) where HInterID=" + HInterID + " and HBillNo='" + HBillNo + "'", "Sc_QualityReportBillMain");
                 if (ds.Tables[0].Rows.Count != 0) {
                     objJsonResult.code = "0";
@@ -307,6 +308,7 @@
             //淇敼鏉$爜琛ㄧ殑鐘舵��
             oCN.RunProc("update Gy_BarCodeBill set HStatus='"+ HResult + "' where HBarCode='"+ oSub.HBarCode + "'");
 
+            LogService.Write("绫诲瀷:" + oSub.HBadTypeID + ",鍒跺崟浜�:" + oSub.HMaker + ",鍒跺崟鏃ユ湡:" + oSub.HMakeDate);
             //淇敼鍑虹珯鍗曠殑 涓嶈壇 鎶ュ簾鏁伴噺
             if (HResult == "涓嶈壇")
             {
@@ -369,15 +371,21 @@
                 {
                     if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
                     {
+                       
                         //鍒ゆ柇褰撳墠娴佽浆鍗℃槸鍚︽槸寮�宸�
                         ds = oCN.RunProcReturn("select  * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0'", "Sc_ICMOBillStatus_Tmp");
                         if (ds.Tables[0].Rows.Count == 0)
                         {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "[3791-2-018]鍗″彿:" + HBarCode + ",娴佽浆鍗℃湭寮�宸�!";
-                            objJsonResult.data = null;
-                            return objJsonResult;
+                            //鍒ゆ柇褰撳墠娴佽浆鍗℃槸鍚﹀ⅷ瑗垮摜鐨�
+                            ds = oCN.RunProcReturn("select HPRDORGID from Sc_ProcessExchangeBillMain with(nolock) where HBillNo = '" + HBarCode + "' ", "Sc_ProcessExchangeBillMain");
+                            if (ds.Tables[0].Rows[0]["HPRDORGID"].ToString() != "7667152")
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "[3791-2-018]鍗″彿:" + HBarCode + ",娴佽浆鍗℃湭寮�宸�!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }                                                 
                         }
                     }
                 }
@@ -459,7 +467,8 @@
                 List<Model.Sc_AssemblyBill_BindSourceTemp> tempList = new List<Model.Sc_AssemblyBill_BindSourceTemp>();
                 tempList = JsonConvert.DeserializeObject<List<Model.Sc_AssemblyBill_BindSourceTemp>>(msg1);
 
-                if (tempList.Count == 0) {
+                if (msg1 != "[]" && tempList.Count == 0)
+                {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "[3791-2-026]鏃犻厤浠舵暟鎹�!";
@@ -543,7 +552,7 @@
                 List<Model.ClsSc_AssemblyBillSub> sub = new List<Model.ClsSc_AssemblyBillSub>();
                 sub = JsonConvert.DeserializeObject<List<Model.ClsSc_AssemblyBillSub>>(sSubStr);
 
-
+                //鏉$爜涓婇亾宸ュ簭鏄惁杩囩珯
                 ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + omodel.HBarCode_P + "'," + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                 if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                 {
@@ -562,6 +571,7 @@
                     return objJsonResult;
                 }
 
+                //鍒ゆ柇鏉$爜鏄惁宸茬粡鍑虹珯
                 ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 浜у搧鏉$爜='" + omodel.HBarCode_P + "' and HProcExchInterID="+ omodel .HProcExchInterID+ " and HProcExchEntryID="+ omodel.HProcExchEntryID + " and HProcID="+ omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
 
                 if (ds.Tables[0].Rows.Count > 0)
@@ -704,11 +714,13 @@
                 int HTemporaryAreaID = 0;//鏆傛斁鍖�
                 int HShiftsID = 0;
 
+                //鑾峰彇褰撳墠鐝
                 DataSet set = oCN.RunProcReturn("exec h_p_Gy_GetWorkShiftInfo " + HDeptID + "," + HCenterID, "h_p_Gy_GetWorkShiftInfo");
                 if (set.Tables[0].Rows.Count > 0)
                 {
                     HShiftsID = int.Parse(set.Tables[0].Rows[0]["HInterID"].ToString());
                 }
+                //鍒ゆ柇褰撳ぉ褰撳墠鐨勬祦杞崱鏄惁鏈夊嚭绔欏崟
                 ds = oCN.RunProcReturn("select  * from Sc_StationOutBillMain a WITH(NOLOCK) left join  Sc_StationOutBillSub_SN sn WITH(NOLOCK) on a.HInterID=sn.HInterID where a.HInterID=" + HInterID + " and HBillNo='" + HBillNo + "' and CONVERT(varchar(10),HDate,20) ='" + DateTime.Now.ToString("yyyy-MM-dd") + "' ", "Sc_StationOutBillMain");
 
                 if (ds.Tables[0].Rows.Count == 0)
@@ -1163,6 +1175,7 @@
                 ds = oCN.RunProcReturn("select * from gy_czygl WITH(NOLOCK) where czymc='" + user + "'", "gy_czygl");
                 string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
 
+                //鏌ヨ娴佽浆鍗℃墍鏈夊伐搴忎俊鎭�
                 ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBillHICOMProcessExchange WITH(NOLOCK) where 鏉$爜='" + HBarCode + "' ", "h_v_Gy_BarCodeBillHICOMProcessExchange");
 
                 if (ds.Tables[0].Rows.Count == 0)
@@ -1637,7 +1650,7 @@
 
                     Model.Sc_AssemblyBill_BindSourceTemp temp = new Model.Sc_AssemblyBill_BindSourceTemp();
                     temp = JsonConvert.DeserializeObject<Model.Sc_AssemblyBill_BindSourceTemp>(sSubStr);
-
+                    //宸ュ簭杩斾慨璁板綍鍗� 閰嶄欢琛�
                     ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub_Mater where HInterID=" + model.HInterID+ " order by HEntryID  desc", "Sc_SourceLineRepairBillSub_Mater");
 
                     oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub_Mater
@@ -1651,7 +1664,7 @@
                     oCN.RunProc("update Sc_AssemblyBillSub set HBarCode='" + temp.HBarCode + "' where HInterID=" + temp.HInterID + " and HEntryID=" + temp.HEntryID);
                     //oCN.RunProc("exec h_p_AssemblyBill_Temp '" + temp.HProcExchBillNo + "'," + model.HProcess + "," + temp.HMaterID + ",'" + temp.HBatchNo + "'");
                 }
-                else if (HResult == "NG"|| HResult == "OK") {
+                else if (HResult == "NG"|| HResult == "OK") { 
                     Model.ClsSc_SourceLineRepairBillMain model = new Model.ClsSc_SourceLineRepairBillMain();
                     model = JsonConvert.DeserializeObject<Model.ClsSc_SourceLineRepairBillMain>(sMainStr);
 
@@ -1700,7 +1713,7 @@
                         if (dataSet.Tables[0].Rows.Count > 0)
                         {
                             string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString();
-                            //鏂帿灏旂殑鎯呭喌 鍒� 宸ュ簾鏂欏簾 杩斿伐
+                            //鏂帿灏旂殑鎯呭喌 鍒� 宸ュ簾 鏂欏簾 杩斿伐
                             //宸ュ簾
                             if (subLsit[0].HBadTypeID == 3)
                             {
@@ -2163,6 +2176,7 @@
 
                 List<object> columnNameList = new List<object>();
 
+                //鏌ヨ閰嶄欢娓呭崟淇℃伅
                 string sql = @"exec h_p_GZ_BarCodeBillList '" + HMaterNumber + "','" + HBatchNo + "','" + sWhere + "'";
                 ds = oCN.RunProcReturn(sql, "h_p_GZ_BarCodeBillList");
 

--
Gitblit v1.9.1