From b0ef1ac05db6cdf5829902cdc5acf4f151e4e161 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 08 十二月 2025 16:51:34 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |  146 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 146 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 014336e..0f99686 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -3570,6 +3570,152 @@
         }
         #endregion
 
+        #region 棣欏泭鏍囩鐢熸垚
+        [Route("Cj_SingleStation/SachetBarCodeSave")]
+        [HttpGet]
+        public object SachetBarCodeSave(int HICMOInterID,int HICMOEntryID, string user)
+        {
+            try
+            {
+                //鐢熸垚鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潯鐮佺敓鎴愭潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "exec h_p_Cj_SachetBarCodeSave " + HICMOInterID + "," + HICMOEntryID + ",'" + user + "'";
+
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn(sql, "h_p_Cj_SachetBarCodeSave");
+                oCN.Commit();
+
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖鐩稿叧棣欏泭鏉$爜淇℃伅";
+                    objJsonResult.data = "";
+                    return objJsonResult;
+                }                                             
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 钃濈墮鏍囩鐢熸垚
+        [Route("Cj_SingleStation/BlueToothBarCodeSave")]
+        [HttpGet]
+        public object BlueToothBarCodeSave(string HBarCode, int HMaterID,int HOrgID ,string user)
+        {
+            try
+            {
+                //鐢熸垚鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潯鐮佺敓鎴愭潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "exec h_p_Cj_BlueToothBarCodeSave '" + HBarCode + "'," + HMaterID + "," + HOrgID + ",'" + user + "'";
+
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn(sql, "h_p_Cj_BlueToothBarCodeSave");
+                oCN.Commit();
+                if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触娌℃湁杩斿洖浠讳綍鍐呭!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "[0000-1-051]淇濆瓨澶辫触" + ds.Tables[0].Rows[0]["HBackRemark"].ToString() + "锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "[0000-1-050]淇濆瓨鎴愬姛!";
+                objJsonResult.data = "";//
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 钃濈墮娴嬭瘯鏁版嵁鎺ュ彛
+        [Route("Cj_SingleStation/BluetoothTestDataSave")]
+        [HttpGet]
+        public object BluetoothTestDataSave(string HBarCode_SN, string HBluetooth_Mac, string HResult)
+        {
+            try
+            {
+                //鍒ゆ柇鏈夋病鏈夎繃鎵撳嵃璁板綍锛堟潯鐮佹。妗堜腑瀛樹笉瀛樺湪钃濈墮mac鍦板潃锛�
+                ds = oCN.RunProcReturn("select 1 from Gy_BarCodeBill with(nolock) where HBarCode = '" + HBluetooth_Mac + "'", "Gy_BarCodeBill");
+                if (ds.Tables[0].Rows.Count < 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "涓婁紶鐨凥BarCode_SN锛�" + HBarCode_SN + "锛屾病鏈夋爣绛炬墦鍗拌褰曪紝璇峰厛鎵撳嵃钃濈墮mac鏍囩锛�" + HBluetooth_Mac;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = string.Format($@"insert into Gy_BluetoothTestData(HBarCode_SN,HBluetooth_Mac,HResult,HResult) values ('{HBarCode_SN}','{HBluetooth_Mac}','{HResult}',getdate() ");
+
+                oCN.RunProc(sql);//鎻掑叆钃濈墮娴嬭瘯鏁版嵁
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "钃濈墮娴嬭瘯鏁版嵁缁撴潫鎴愬姛锛丠BarCode_SN锛�" + HBarCode_SN + " 锛孒Bluetooth_Mac锛�" + HBluetooth_Mac;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙戠敓寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         #endregion
 

--
Gitblit v1.9.1