| | |
| | | try |
| | | { |
| | | //判断所扫条码是否存在条码档案当中 |
| | | ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //条码档案中没有本次扫描的条码,则根据规则解析生成条码 |
| | | //ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill"); |
| | | //if (ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // //条码档案中没有本次扫描的条码,则根据规则解析生成条码 |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "该条码不存在:" + HBarCode; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "该条码不存在:" + HBarCode; |
| | | // objJsonResult.data = ""; |
| | | // return objJsonResult; |
| | | |
| | | } |
| | | //} |
| | | |
| | | //条码档案中已有本次扫描的条码,查询配件信息(扫描条码信息写入临时表) |
| | | ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomBindByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HBarCode_P + "','" + HProcID + "','" + HOrgID + "'", "h_p_Gy_BarCodeBillBomBindByHProcExch_XW"); |
| | |
| | | } |
| | | #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] |
| | |
| | | |
| | | oCN.RunProc(sql);//插入蓝牙测试数据 |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.code = "success"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "蓝牙测试数据接收成功!lotSn:" + lotSn; |
| | | objJsonResult.data = null; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.code = "error"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "发生异常!" + e.ToString(); |
| | | objJsonResult.data = null; |