From f782426e6efdc4a2e2439ca542f89a67f73de9ad Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 05 十二月 2025 09:08:37 +0800
Subject: [PATCH] 小卫香囊标签生成,蓝牙测试数据对接;根据检验方案主内码获取检验项目,注释方案为0判断
---
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 215 insertions(+), 1 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 2ce7e9e..b173f53 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -2875,7 +2875,7 @@
#endregion
#region 宸ュ簭鍗曞搧杩囩珯 鍏抽敭浠剁粦瀹氶厤浠朵俊鎭复鏃跺瓨鍌�
- [Route("Cj_SingleStation/BarCodeBillBomMatch_XW")]
+ [Route("Cj_SingleStation/BarCodeBillBomBind_XW")]
[HttpGet]
public object PartsBardCode_JX(string HBillNo,string HBarCode, string HBarCode_P, int HProcID, string user, int HOrgID)
{
@@ -2936,6 +2936,130 @@
}
}
#endregion
+
+ #region 宸ュ簭鍗曞搧杩囩珯 SN闀洉鐮佹煡璇㈠叧閿欢娓呭崟(鏍规嵁娴佽浆鍗″彿)
+ [Route("Cj_SingleStation/HBardCodeBomListByHProcExch_XW")]
+ [HttpGet]
+ public object HBardCodeBomListByHProcExch_XW(string HBillNo, string HBarCode, int HProcID, int HOrgID, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-068]鏃犳煡璇㈡潈闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鏉$爜妗f涓凡鏈夋湰娆℃壂鎻忕殑鏉$爜锛屽尮閰嶇敤鏂欐竻鍗曪紙鎵爜鏁版嵁鍐欏叆涓存椂琛級
+ ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomMatchByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HProcID + "'," + HOrgID, "h_p_Gy_BarCodeBillBomMatchByHProcExch_XW");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = "";
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹�";
+ objJsonResult.data = "";
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宸ュ簭鍗曞搧杩囩珯 鍏抽敭浠剁粦瀹氶厤浠朵俊鎭复鏃跺瓨鍌紙鏍规嵁娴佽浆鍗″彿锛�
+ [Route("Cj_SingleStation/BarCodeBillBomBindByHProcExch_XW")]
+ [HttpGet]
+ public object BarCodeBillBomBindByHProcExch_XW(string HBillNo, string HBarCode, string HBarCode_P, int HProcID, string user, int HOrgID)
+ {
+ try
+ {
+ //鍒ゆ柇鎵�鎵潯鐮佹槸鍚﹀瓨鍦ㄦ潯鐮佹。妗堝綋涓�
+ ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ //鏉$爜妗f涓病鏈夋湰娆℃壂鎻忕殑鏉$爜锛屽垯鏍规嵁瑙勫垯瑙f瀽鐢熸垚鏉$爜
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇ユ潯鐮佷笉瀛樺湪锛�" + HBarCode;
+ objJsonResult.data = "";
+ return objJsonResult;
+
+ }
+
+ //鏉$爜妗f涓凡鏈夋湰娆℃壂鎻忕殑鏉$爜锛屾煡璇㈤厤浠朵俊鎭紙鎵弿鏉$爜淇℃伅鍐欏叆涓存椂琛級
+ ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomBindByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HBarCode_P + "','" + HProcID + "','" + HOrgID + "'", "h_p_Gy_BarCodeBillBomBindByHProcExch_XW");
+
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = "";
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "";
+ objJsonResult.data = "娌℃湁鏌ヨ鍒版暟鎹�";
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "ERROR锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 宸ュ簭鍗曞搧杩囩珯 鎵玈N鐮佸嚭绔欎繚瀛�(淇濆瓨鍒板嚭绔欐眹鎶ラ噷(+鍏抽敭浠剁粦瀹�))
[Route("Cj_SingleStation/AddStationOutBillAndAssemblyBill")]
@@ -3446,6 +3570,96 @@
}
#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/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