From 6ef126d9a9271afae02ee36469b1512e144bc555 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 17 十一月 2025 15:57:51 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |  202 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 174 insertions(+), 28 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 9233cfd..1e76dd7 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -2538,7 +2538,7 @@
                 }
 
                 //鏉$爜涓婇亾宸ュ簭鏄惁杩囩珯
-                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_S");
+                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_XW '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_XW");
                 if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                 {
                     objJsonResult.code = "0";
@@ -2547,7 +2547,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
+                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -2557,17 +2557,17 @@
                 }
 
                 //鍒ゆ柇鏉$爜鏄惁宸茬粡鍑虹珯
-                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 浜у搧鏉$爜='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
+                //ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 浜у搧鏉$爜='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
 
-                if (ds.Tables[0].Rows.Count > 0)
-                {
-                    oCN.RollBack();
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "[0000-2-039]鏉$爜:" + barCode_SN + ",宸插嚭绔�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //if (ds.Tables[0].Rows.Count > 0)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "[0000-2-039]鏉$爜:" + barCode_SN + ",宸插嚭绔�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
                 long HMainInterID = 0;
                 string BillType = "3791";
@@ -2639,7 +2639,7 @@
                 int HTemporaryAreaID = 0;//鏆傛斁鍖�
                 int HShiftsID = 0;
                 string HBatchNo = omodel.HBatchNo;
-                string HWeight = omodel.HWeight;
+                double HWeight = omodel.HWeight;
                 //鑾峰彇褰撳墠鐝
                 //DataSet set = oCN.RunProcReturn("exec h_p_Gy_GetWorkShiftInfo " + HDeptID + "," + HCenterID, "h_p_Gy_GetWorkShiftInfo");
                 //if (set.Tables[0].Rows.Count > 0)
@@ -2856,8 +2856,8 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "";
-                    objJsonResult.data = "娌℃湁鏌ヨ鍒版暟鎹�";
+                    objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹�";
+                    objJsonResult.data = "";
                     return objJsonResult;
                 }
 
@@ -2997,8 +2997,8 @@
                     return objJsonResult;
                 }
 
-                //鏉$爜涓婇亾宸ュ簭鏄惁杩囩珯
-                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_S");
+                //鏉$爜涓婇亾宸ュ簭鏄惁杩囩珯浠ュ強鏈亾鏉$爜鏄惁宸茬粡鍑虹珯
+                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_XW '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_XW");
                 if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                 {
                     objJsonResult.code = "0";
@@ -3007,7 +3007,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
+                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -3017,17 +3017,17 @@
                 }
 
                 //鍒ゆ柇鏉$爜鏄惁宸茬粡鍑虹珯
-                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 浜у搧鏉$爜='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
+                //ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 浜у搧鏉$爜='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
 
-                if (ds.Tables[0].Rows.Count > 0)
-                {
-                    oCN.RollBack();
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "[0000-2-039]鏉$爜:" + barCode_SN + ",宸插嚭绔�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //if (ds.Tables[0].Rows.Count > 0)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "[0000-2-039]鏉$爜:" + barCode_SN + ",宸插嚭绔�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
                 //澧炲姞浜х嚎缁勮杩芥函鍗�
                 DataSet ds1;
@@ -3301,6 +3301,152 @@
             }
         }
         #endregion
+
+        #region 杩囩珯瑙g粦鍒楄〃 鏌ヨ
+        [Route("Cj_SingleStation/UnbindBarList")]
+        [HttpGet]
+        public object BarList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Cj_SingleStation_UnbindBarList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList order by 鏉$爜鏃ユ湡 desc", "h_v_Sc_UnbindStation_BarList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sc_UnbindStation_BarList where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by 鏉$爜鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_UnbindStation_BarList");
+                }
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 閲嶅伐鏉$爜淇℃伅 鏌ヨ
+        [Route("Cj_SingleStation/UnbindBarInfo")]
+        [HttpGet]
+        public object UnbindBarInfo(string HBarCodeIDs, string user)
+        {
+            try
+            {
+                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "閲嶅伐鏉$爜淇℃伅鏈�掑叆锛岃閫�鍑洪噸璇�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    string sql = "exec h_p_Sc_UnbindBarInfo '" + HBarCodeIDs + "'";
+                    ds = oCN.RunProcReturn(sql, "h_p_Sc_UnbindBarInfo");
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 瑙i櫎鍖呰鍏崇郴銆佹媶闄ょ墿鏂�(1:瑙i櫎鍖呰鍏崇郴锛�2.鎷嗛櫎鐗╂枡)
+        [Route("Cj_SingleStation/DelRelation")]
+        [HttpGet]
+        public object DelRelation(string HBarCodeIDs, Int64 HICMOInterID, Int64 HICMOEntryID, Int64 HProcID, Int64 HType, string user)
+        {
+            try
+            {
+                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎷嗛櫎鏉$爜淇℃伅鏈�掑叆锛岃閫�鍑洪噸璇�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    string sql = "exec h_p_Sc_DelbindBarRelation '" + HBarCodeIDs + "'," + HICMOInterID + "," + HICMOEntryID + "," + HProcID + "," + HType;
+                    ds = oCN.RunProcReturn(sql, "h_p_Sc_DelbindBarRelation");
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() == "0")
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString();
+                    objJsonResult.data = "";
+                    return objJsonResult;
+                }
+
+               
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
         #endregion
 
     }

--
Gitblit v1.9.1