llj
2025-12-05 f74a6fee9c2e2d3c8fca4fab32947ea58b2704ee
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -1496,7 +1496,7 @@
                sql = "delete from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
                oCN.RunProc(sql);
                //反写工序出站单的合格数量
                oCN.RunProc("update Sc_StationOutBillMain WITH (TABLOCKX) set HQty-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HBillNo='"+ HBillNo_bak + "'");
                oCN.RunProc("update Sc_StationOutBillMain  set HQty-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HBillNo='"+ HBillNo_bak + "'");
                oCN.Commit();
@@ -3570,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 = "上传的HBarCode_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 = "蓝牙测试数据结束成功!HBarCode_SN:" + HBarCode_SN + " ,HBluetooth_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