| | |
| | | #region 蓝牙测试数据接口 |
| | | [Route("Cj_SingleStation/BluetoothTestDataSave")] |
| | | [HttpGet] |
| | | public object BluetoothTestDataSave(string HBarCode_SN, string HBluetooth_Mac, string HResult) |
| | | public object BluetoothTestDataSave(string lotSn, string testData) |
| | | { |
| | | try |
| | | { |
| | | //判断有没有过打印记录(条码档案中存不存在蓝牙mac地址) |
| | | ds = oCN.RunProcReturn("select 1 from Gy_BarCodeBill with(nolock) where HBarCode = '" + HBluetooth_Mac + "'", "Gy_BarCodeBill"); |
| | | ds = oCN.RunProcReturn("select 1 from Gy_BarCodeBill with(nolock) where HBarCode = '" + lotSn + "'", "Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count < 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "上传的HBarCode_SN:" + HBarCode_SN + ",没有标签打印记录,请先打印蓝牙mac标签:" + HBluetooth_Mac; |
| | | objJsonResult.Message = "上传的lotSn:" + lotSn + ",没有标签打印记录,请先打印蓝牙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() "); |
| | | string sql = string.Format($@"insert into Gy_BluetoothTestData(HBluetooth_Mac,HResult,HMakeDate) values ('{lotSn}','{testData}',getdate() ) "); |
| | | |
| | | oCN.RunProc(sql);//插入蓝牙测试数据 |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "蓝牙测试数据结束成功!HBarCode_SN:" + HBarCode_SN + " ,HBluetooth_Mac:" + HBluetooth_Mac; |
| | | objJsonResult.Message = "蓝牙测试数据接收成功!lotSn:" + lotSn; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |