yxj
2024-07-03 18bf65577b174d574b36c5fb5ab4364a14c7724a
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -174,12 +174,28 @@
                    entryid_PGD = arr[1];
                }
                //截取条码类型 前两位
                string BillNoType1 = BillNo_PGD.Substring(0, Math.Min(2, BillNo_PGD.Length));
                //截取条码类型 前三位
                string BillNoType = BillNo_PGD.Substring(0, Math.Min(3, BillNo_PGD.Length));
                //截取条码类型2 前四位
                string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length));
                //截取内码
                string BillNo = BillNo_PGD.Substring(3, Math.Min(BillNo_PGD.Length - 3, BillNo_PGD.Length));
                switch (BillNoType1)
                {
                    case "20"://流转卡
                        string sErr = "";
                        if (oSystemParameter.ShowBill(ref sErr))
                        {
                            if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                            {
                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                        }
                        break;
                }
                switch (BillNoType2)
                {
                    case "GXLZ"://工序流转派工
@@ -316,6 +332,82 @@
        }
        #endregion
        #region 工序进站扫配件码
        [Route("Cj_StationBill/txtHBarCode_Mater_KeyDown")]
        [HttpGet]
        public object txtHBarCode_Mater_KeyDown(string HBarCode, string HInterID)
        {
            try
            {
                if (HBarCode == null || HBarCode.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "空白码,条形码不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断条形码是否在条码档案中,判断条形码是否合理
                //先判断 临时表中是否有数据,条形码的物料是否在清单中,写入 扫码记录表
                //得到信息
                ds = oCN.RunProcReturn("exec h_p_MES_StationInBillSub_BindBarCode   " + HInterID.ToString() + " ,'" + HBarCode + "'", "h_p_MES_StationInBillSub_BindBarCode");
                //写入信息
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到条形码信息!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 2)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "错误!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet Dsplay = oCN.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay   " + HInterID.ToString() + "  ", "h_p_MES_StationInBillSub_BindDisplay");
                //写入信息
                if (Dsplay == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "刷新失败,无数据显示!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (Dsplay.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "绑定成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 指引卡扫码获取信息
        [Route("MES_SampleRecordBill_PDA/SampleRecordBillHBarCode_KeyDown")]
        [HttpGet]