yusijie
2025-07-09 5505d694e0e7e33f0a312a0e077d49fa25ab00e3
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -4409,7 +4409,7 @@
        /// å°è½¦é”å®šå•新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveTrolleyPositionBill_Json2")]
        [Route("WEBSController/set_SaveTrolleyPositionBill_Json")]
        [HttpPost]
        public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg)
        {
@@ -8570,7 +8570,7 @@
        #endregion
        #region ä¸Šæž¶ã€ä¸‹æž¶å•模块调用方法     20250520
        #region ä¸Šæž¶ã€ä¸‹æž¶å•、小车锁定模块调用方法     20250520
        #region ä¸‹æž¶å•扫码模块  æ‰«ææºå•条码调用方法
        /// <summary>
@@ -8767,6 +8767,147 @@
        }
        #endregion
        #region ä¸‹æž¶å•模块,扫源单条码查询物料库存信息
        /// <summary>
        /// èŽ·å–å•æ®åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/MaterialLowerBill_MaterInv")]
        [HttpGet]
        public object MaterialLowerBill_MaterInv(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Kf_MaterialInventory " + HInterID + "," + HBillType + "," + HStockOrgID, "h_p_Kf_MaterialInventory");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取列表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å°è½¦æ‰«ç ç»‘定时,判断其是否已绑定库位信息
        [Route("WEBSController/CarIsused")]
        [HttpGet]
        public object CarIsused(string HCarBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("select * from h_v_Gy_MouldIsUsed where å°è½¦æ¡ç ='" + HCarBarCode + "'" , "h_v_Gy_MouldIsUsed");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "小车条码:" + HCarBarCode + ",不在系统中,请核对!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询小车在库状态失败err!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å°è½¦ç»‘定机台时,判断所扫机台(设备)条码是否存在于设备档案
        [Route("WEBSController/IsExistEquip")]
        [HttpGet]
        public object IsExistEquip(string HEquipBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("select * from h_v_Gy_EquipIsExist where æœºå°æ¡ç ='" + HEquipBarCode + "'", "h_v_Gy_EquipIsExist");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "机台条码:" + HEquipBarCode + ",不在系统中,请核对!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询机台信息失败err!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion