1
wtt
2025-05-30 696e2c6b5e43bc2f379eda5f4abae6d82fdd42f5
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -32,6 +32,7 @@
        public WebS.WebService1 oWebs = new WebS.WebService1();
        public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        DBUtility.ClsXt_BaseBill oBaseBill = new DBUtility.ClsXt_BaseBill();
        string ComputerName = SystemInformation.ComputerName;   //设备名称
@@ -951,11 +952,18 @@
        /// <returns></returns>
        [Route("WEBSController/GetEquipList_Json")]
        [HttpGet]
        public object GetEquipList_Json(string Equip)
        public object GetEquipList_Json(string Equip,int HCenterID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill");
                if (HCenterID !=0)
                {
                    ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName,HCenterID from h_v_Gy_EquipFileBill where HCenterID='"+HCenterID+"' and ( HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%')", "h_v_Gy_EquipFileBill");
                }
                else
                {
                    ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -1536,6 +1544,53 @@
            try
            {
                ds = oWebs.GetKf_PonderationBillMain_TempList_New(HBillType, HMaker, HStockOrgID);
                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;
            }
        }
        /// <summary>
        /// ç¼“存列表界面,返回缓存列表信息     20250513
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_PonderationBillMain_TempList_Other_Json")]
        [HttpGet]
        public object GetKf_PonderationBillMain_TempList_Other_Json(string HBillType, string HMaker, Int64 HStockOrgID, string HSubBillType)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_Other '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + HSubBillType + "'", "h_p_KF_GetPonderationBillMain_TempList_Other");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -4146,6 +4201,208 @@
        #endregion
        #region è½¦é—´ä¸Šæž¶å•    ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// è½¦é—´ä¸Šæž¶å•新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMaterialUpperBill_Json")]
        [HttpPost]
        public object set_SaveMaterialUpperBill_Json([FromBody] JObject oMain)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                string sMainStr = "[" + msg1.ToString() + "]";
                List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr);
                //单据号是否重复
                if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据号重复!不允许保存!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCn.BeginTran();
                //生成单据
                //插入主表
                oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain   " +
                "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" +
                ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" +
                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                ",HMangerID,HSecManagerID,HKeeperID,HDeptID" +
                ") " +
                " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" +
                ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() +
                ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" +
                ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() +
                ") ");
                //插入子表
                ds = oCn.RunProcReturn("exec h_p_Kf_MaterialUpperBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialUpperBillSub_Insert");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据保存失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK")
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //更新车间物料库存
                    oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'");
                    //更新车间条码库存
                    oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',1");
                    oCn.Commit();
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "单据号:" + mainList[0].HBillNo + " æ–°å¢žæˆåŠŸï¼";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "车间上架单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è½¦é—´ä¸‹æž¶å•    ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// è½¦é—´ä¸‹æž¶å•新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMaterialLowerBill_Json")]
        [HttpPost]
        public object set_SaveMaterialLowerBill_Json([FromBody] JObject oMain)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                string sMainStr = "[" + msg1.ToString() + "]";
                List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr);
                //单据号是否重复
                if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据号重复!不允许保存!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCn.BeginTran();
                //生成单据
                //插入主表
                oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain   " +
                "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" +
                ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" +
                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                ",HMangerID,HSecManagerID,HKeeperID,HDeptID" +
                ") " +
                " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" +
                ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() +
                ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" +
                ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() +
                ") ");
                //插入子表
                ds = oCn.RunProcReturn("exec h_p_Kf_MaterialLowerBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialLowerBillSub_Insert");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据保存失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK")
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //更新车间物料库存
                    oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'");
                    //更新车间条码库存
                    oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',-1");
                    oCn.Commit();
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "单据号:" + mainList[0].HBillNo + " æ–°å¢žæˆåŠŸï¼";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "车间下架单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
@@ -4635,6 +4892,44 @@
            }
        }
        /// <summary>
        /// å¤å®ä¸“用调拨    æ‰«ææºå•条码    20250513
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_SourceBarCode_MoveStock_XiaBao_Json")]
        [HttpGet]
        public object get_SourceBarCode_MoveStock_XiaBao_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_MoveStock_XiaBao(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描源单条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region åˆ†æ­¥å¼è°ƒå‡º    æ‰«ææºå•条码
@@ -5082,6 +5377,44 @@
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
        }
        /// <summary>
        /// ç‰©æ–™æ¡ç æ–‡æœ¬æ¡† è°ƒæ‹¨æ‰«ç è°ƒç”¨  å¤å®  æ‰«æç‰©æ–™æ¡ç è‡ªåŠ¨å¸¦å‡ºæºå•ä¿¡æ¯    20250506
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_BarCode_MoveStock_AddSource_Json")]
        [HttpGet]
        public Object get_BarCode_MoveStock_AddSource_Json(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockInOrgID, Int64 HStockOutOrgID, string HScanStyle, string HCustom1, string HCustom2)
        {
            try
            {
                WebSoBar = oWebs.get_BarCode_MoveStock_AddSource(sBarCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo, HCustom1, HCustom2);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -8129,6 +8462,207 @@
        #endregion
        #region ä¸Šæž¶ã€ä¸‹æž¶å•模块调用方法     20250520
        #region ä¸‹æž¶å•扫码模块  æ‰«ææºå•条码调用方法
        /// <summary>
        /// æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_MaterialLower_Json")]
        [HttpGet]
        public object get_SourceBarCode_MaterialLower_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MaterialLower " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddSourceBarCode_MaterialLower");
                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]["HBack"]) == 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    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 ä¸Šæž¶ã€ä¸‹æž¶å•扫码模块  æ‰«æç‰©æ–™æ¡ç è°ƒç”¨æ–¹æ³•
        /// <summary>
        /// æ‰«æç‰©æ–™æ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_BarCode_WorkShop_Json")]
        [HttpGet]
        public object Get_BarCode_WorkShop_Json(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool SourceFlag, string HSourceBillType, string HCarBarCode, Int64 HStockOrgID)
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
            {
                string sBatchNoCtl = "N";             //是否进行批号核对('Y'为核对批号)
                string sMustQtyCtl = "小于等于应收";  //应收数量控制(小于等于应收、完全等于应收、不控制)
                //下架单
                if (HBillType == "1252")
                {
                    //是否进行批号核对('Y'为核对批号)
                    if (oSystemParameter.omodel.Kf_MaterialLowerBill_BatchNoCtl.ToUpper() == "Y")
                    {
                        sBatchNoCtl = "Y";
                    }
                    //扫码数量能否可超单据数量控制(小于等于应收、完全等于应收、不控制)
                    if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "小于等于应收")
                    {
                        sMustQtyCtl = "小于等于应收";
                    }
                    else if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "完全等于应收")
                    {
                        sMustQtyCtl = "完全等于应收";
                    }
                    else
                    {
                        sMustQtyCtl = "不控制";
                    }
                }
                try
                {
                    ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_WorkShop " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "'," + HQty.ToString() + ",'" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "'," + HStockOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + sBatchNoCtl + "','" + sMustQtyCtl + "'", "h_p_WMS_AddBarCode_WorkShop");
                    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]["HBack"]) == 1)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "成功!";
                        objJsonResult.data = ds.Tables[0];
                        return objJsonResult;
                    }
                }
                catch (Exception e)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描物料条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
        #endregion
        #region è½¦é—´ç‰©æ–™åº“存查询调用方法
        /// <summary>
        /// èŽ·å–è½¦é—´ç‰©æ–™æ‰€åœ¨ä½ç½®
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetICInventory_WorkShop_Json")]
        [HttpGet]
        public object GetICInventory_WorkShop_Json(string HBillType, Int64 HMaterID, Int64 HAuxPropID, string HBatchNo, Int64 HProcessExchangeInterID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_ICInventory_WorkShop '" + HBillType + "'," + HMaterID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HProcessExchangeInterID.ToString(), "h_p_KF_ICInventory_WorkShop");
                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
        #endregion
        #region ç‰©æ–™æ¡ç æŸ¥è¯¢è°ƒç”¨æ–¹æ³•
        /// <summary>
        /// èŽ·å–æ¡ç ä¿¡æ¯