WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -23,13 +23,78 @@
        public string sWhere = "";
        public WebServer webserver = new WebServer();
        public DataSet ds = new DataSet();
        private json objjson = new json();
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
        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();
        WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
        #region å…¬ç”¨æ–¹æ³•
        #region èŽ·å–æœ€å¤§å•æ®ID、单据号
        /// <summary>
        /// èŽ·å–æœ€å¤§å•æ®ID、单据号
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetMaxBillNoAndID_Json")]
        [HttpGet]
        public object GetMaxBillNoAndID_Json(string HBillType)
        {
            try
            {
                string sErrMsg = "";
                Int64 HInterID = 0;
                string HBillNo = "";
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg);
                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true);
                //----------创建虚表------------------------
                DataTable dt_Main = new DataTable("Json");
                dt_Main.Columns.Add("HBillNo", typeof(string));
                dt_Main.Columns.Add("HInterID", typeof(int));
                //---------创建新行------------------------
                DataRow dr_main = dt_Main.NewRow(); //创建新行
                dt_Main.Rows.Add(dr_main);          //将新行加入到表中
                dr_main["HBillNo"] = DBUtility.ClsPub.isStrNull(HBillNo);
                dr_main["HInterID"] = DBUtility.ClsPub.isLong(HInterID);
                //返回数据
                if (HBillNo == "" || HInterID == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "最大单据ID、单据号获取失败";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取成功";
                    objJsonResult.data = dt_Main;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取最大单据ID、单据号失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region åŸºç¡€èµ„æ–™
@@ -56,6 +121,95 @@
        #endregion
        #endregion
        #region ç•Œé¢æŽ§ä»¶åŠŸèƒ½è°ƒç”¨æ–¹æ³•
        #region æ ¹æ®å•据类型获取单据子类型
        /// <summary>
        /// æ ¹æ®å•据类型获取单据子类型
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetBillSubType_Json")]
        [HttpGet]
        public Object GetBillSubType_Json(string HBillType, Int64 HStockOrgID)
        {
            try
            {
                ds = oWebs.get_BillSubType(HBillType, HStockOrgID);
                if (ds == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询不到单据子类型信息!";
                    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;
            }
        }
        #endregion
        #endregion
        #region ç¼“存列表    ç¼–辑功能调用
        /// <summary>
        /// ç¼“存列表选择编辑时,判断所选单据是否已存在上传记录,启用先进先出功能的,回填先进先出临时表状态(更新 HlineStatus =0)
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/TempList_Modify_Json")]
        [HttpGet]
        public object TempList_Modify_Json(long HInterID, string HBillNo, string HBillType)
        {
            try
            {
                if (oWebs.TempList_Modify(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "缓存列表编辑前判断失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -146,6 +300,38 @@
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "撤销单据已上传记录失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ¡ç å‡ºå…¥åº“缓存列表模块  åˆ é™¤ç¼“存列表单据
        /// <summary>
        /// åˆ é™¤ç¼“存列表单据
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DelPonderationBillMain_Temp_Json")]
        [HttpGet]
        public object set_DelPonderationBillMain_Temp_Json(long HInterID, string HBillType)
        {
            try
            {
                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除条码出入库缓存列表单据失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
@@ -518,6 +704,94 @@
        #endregion
        #region ç›´æŽ¥è°ƒæ‹¨    ä¸Šä¼ ç”Ÿå•
        #region æ¢æ‰˜è°ƒæ‹¨å•
        /// <summary>
        /// ä¸Šä¼ ç”Ÿæˆæ¢æ‰˜è°ƒæ‹¨å•
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMoveStockBill_HuanTuo_Json")]
        [HttpGet]
        public object set_SaveMoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                if (oWebs.set_SaveMoveStockBill_HuanTuo(HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    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
        #region ç”Ÿäº§ç»„托单    ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// ä¸Šä¼ ç”Ÿæˆç”Ÿäº§ç»„托单
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SavePackUnionBill_Json")]
        [HttpGet]
        public object set_SavePackUnionBill_Json(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                if (oWebs.set_SavePackUnionBill_Add(HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    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
@@ -565,8 +839,132 @@
        #endregion
        #region é‡‡è´­å…¥åº“    æ‰«ææºå•条码
        /// <summary>
        /// é‡‡è´­å…¥åº“    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_POStockIn_Json")]
        [HttpGet]
        public object get_SourceBarCode_POStockIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_POStockIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, 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 å…¶ä»–入库    æ‰«ææºå•条码
        /// <summary>
        /// å…¶ä»–入库    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_OtherIn_Json")]
        [HttpGet]
        public object get_SourceBarCode_OtherIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_OtherIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, 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 ç”Ÿäº§é¢†æ–™    æ‰«ææºå•条码
        /// <summary>
        /// é¢†æ–™å‡ºåº“    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_MateOut_Json")]
        [HttpGet]
        public object get_SourceBarCode_MateOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Double HPTQty, Int64 HPlanMode, Int64 HFIFOWhID, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_MateOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HPTQty, HPlanMode, HFIFOWhID, HStockOrgID, 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
@@ -614,6 +1012,43 @@
        #region å§”外出库    æ‰«ææºå•条码
        /// <summary>
        /// å§”外出库    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_EntrustOut_Json")]
        [HttpGet]
        public object get_SourceBarCode_EntrustOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_EntrustOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HStockOrgID, 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
@@ -703,11 +1138,85 @@
        #region åˆ†æ­¥å¼è°ƒå‡º    æ‰«ææºå•条码
        /// <summary>
        /// åˆ†æ­¥å¼è°ƒå‡º    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_MoveStockStepOut_Json")]
        [HttpGet]
        public object get_SourceBarCode_MoveStockStepOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockInOrgID, Int64 HStockOutOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_MoveStockStepOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HStockInOrgID, HStockOutOrgID, 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 åˆ†æ­¥å¼è°ƒå…¥    æ‰«ææºå•条码
        /// <summary>
        /// åˆ†æ­¥å¼è°ƒå…¥    æ‰«ææºå•条码
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_SourceBarCode_MoveStockStepIn_Json")]
        [HttpGet]
        public object get_SourceBarCode_MoveStockStepIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockInOrgID, Int64 HStockOutOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_SourceBarCode_MoveStockStepIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockInOrgID, HStockOutOrgID, 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
@@ -789,23 +1298,198 @@
        [HttpGet]
        public Object get_BarCode_MoveStock_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)
        {
            try
            string sErrMsg = "";
            string sJXCode = "";
            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
            {
                WebSoBar = oWebs.get_BarCode_MoveStock(sBarCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                     sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker);
                    SourceFlag = true;
                }
                else
                {
                    sJXCode = sBarCode;
                }
                try
                {
                    string HCustom1 = "", HCustom2 = "";
                    WebSoBar = oWebs.get_BarCode_MoveStock(sJXCode, 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 = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.Message = "扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
            //try
            //{
            //    var sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker);
            //    WebSoBar = oWebs.get_BarCode_MoveStock(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, 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 ç‰©æ–™æ¡ç å¤„理方法    è°ƒæ‹¨ç›˜ç‚¹æ¨¡å—
        /// <summary>
        /// ç‰©æ–™æ¡ç æ–‡æœ¬æ¡† æ‰«ç è°ƒç”¨
        /// </summary>
        /// <returns></returns>
        //[Route("WEBSController/get_BarCode_MoveStock_PD")]
        //[HttpGet]
        //public Object get_BarCode_MoveStock_PD(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 sErrMsg = "";
        //    string sJXCode = "";
        //    if (oSystemParameter.ShowBill(ref sErrMsg) == true)
        //    {
        //        if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
        //        {
        //            sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker);
        //            SourceFlag = true;
        //        }
        //        else
        //        {
        //            sJXCode = sBarCode;
        //        }
        //        try
        //        {
        //            WebSoBar = oWebs.get_BarCode_MoveStock_PD(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, 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;
        //        }
        //    }
        //    else
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        #endregion
        #region æ‰«ç æ¨¡å—调用方法
        #region ä»Žç¼“存列表页面返回信息
        /// <summary>
        /// ä»Žç¼“存列表页面返回信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetSourceBill_Temp_Json")]
        [HttpGet]
        public object GetSourceBill_Temp_Json(Int64 HInterID, string HBillType)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_SourceBill_Temp " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_SourceBill_Temp");
                if (ds == null)
                {
                    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 = WebSoBar;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
@@ -813,14 +1497,13 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描条码失败!" + e.ToString();
                objJsonResult.Message = "返回缓存列表单据信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å•据新增模块  èŽ·å–å•æ®åˆ—è¡¨ä¿¡æ¯å¤„ç†æ–¹æ³•
@@ -881,6 +1564,8 @@
                return objJsonResult;
            }
        }
        #endregion
        #endregion
@@ -986,6 +1671,13 @@
            string sJXCode = "";
            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
            {
                string sSourceBarCodeCtl = "N";   //校验-是否进行源单对应条码核对('Y'为核对)
                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
                {
                    //销售出库单
                    sSourceBarCodeCtl = "Y";
                }
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                    sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker);
@@ -996,22 +1688,47 @@
                }
                try
                {
                    WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                    if (WebSoBar == null)
                    //原单据为扫码生成,校验时不生成条码记录,只对原扫描的条码进行核对
                    if (sSourceBarCodeCtl == "Y")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                        WebSoBar = oWebs.get_BillBarCode_Verify(HBillID, HBillNo, HBillType, sJXCode, HQty, HMaker, HStockOrgID, 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;
                        }
                    }
                    //原单据非扫码生成,校验时生成条码记录
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "成功";
                        objJsonResult.data = WebSoBar;
                        return objJsonResult;
                        WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, 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)
@@ -1086,7 +1803,71 @@
        #endregion
        #region è¿”回缓存列表信息
        #region æ‰«ç æ¨¡å—,删除选中行条码出入库临时表记录
        /// <summary>
        /// æ‰«ç æ¨¡å—,删除选中行条码出入库临时表记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DeleteBarCodeByEntryID_BillCheck_Json")]
        [HttpGet]
        public object set_DeleteBarCodeByEntryID_BillCheck_Json(long HInterID, string HBillType, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, Int64 HStockOrgID)
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID,ref sErrMsg) == true)
            {
                string sSourceBarCodeCtl = "N";   //校验-是否进行源单对应条码核对('Y'为核对)
                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
                {
                    //销售出库单
                    sSourceBarCodeCtl = "Y";
                }
                //原单据为扫码生成,对原扫描的条码进行核对
                if (sSourceBarCodeCtl == "Y")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "校验条码,删除功能不可用! ";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //原单据非扫码生成
                else
                {
                    try
                    {
                        oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HMaterID=" + HMaterID.ToString() + " and HAuxPropID=" + HAuxPropID.ToString() + " and HMTONo='" + HMTONo + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo);
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功";
                        objJsonResult.data = null;
                        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>
        /// è¿”回缓存列表信息    æ ¡éªŒæ¨¡å¼
@@ -1137,6 +1918,814 @@
        #endregion
        #region ç¼“存模块    æ ¹æ®å•据ID,删除临时表记录
        /// <summary>
        /// æ ¹æ®å•据ID,删除临时表记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/DeleteBillList_BillCheck_Json")]
        [HttpGet]
        public object DeleteBillList_BillCheck_Json(long HInterID, string HBillType, Int64 HStockOrgID)
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
            {
                string sSourceBarCodeCtl = "N";   //校验-是否进行源单对应条码核对('Y'为核对)
                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
                {
                    //销售出库单
                    sSourceBarCodeCtl = "Y";
                }
                //原单据为扫码生成,对原扫描的条码进行核对,删除条码出入库校验缓存记录
                if (sSourceBarCodeCtl == "Y")
                {
                    try
                    {
                        oCn.RunProc("Delete from KF_PonderationBillMain_Temp_Verify where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    catch (Exception e)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除所选单据条码出入库临时表记录失败!" + e.ToString();
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                //原单据非扫码生成,删除条码出入库缓存列表记录
                else
                {
                    try
                    {
                        oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功";
                        objJsonResult.data = null;
                        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>
        /// å·²ä¸Šä¼ åˆ—表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/DeleteICStockBillAndWMS_BillCheck_Json")]
        [HttpGet]
        public object DeleteICStockBillAndWMS_BillCheck_Json(Int64 HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
            {
                string sSourceBarCodeCtl = "N";   //校验-是否进行源单对应条码核对('Y'为核对)
                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
                {
                    //销售出库单
                    sSourceBarCodeCtl = "Y";
                }
                //原单据为扫码生成,对原扫描的条码进行核对
                if (sSourceBarCodeCtl == "Y")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "校验条码,撤销功能不可用! ";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //原单据非扫码生成
                else
                {
                    try
                    {
                        if (oWebs.DeleteICStockBillAndWMS(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                            objJsonResult.data = null;
                            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
        #endregion
        #region ç”Ÿäº§ç»„托单模块调用方法
        #region ç”Ÿäº§ç»„托单模块 æ‰«ææ‰˜æ¡ç 
        /// <summary>
        /// ç”Ÿäº§ç»„托单模块 æ‰«ææ‰˜æ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_PackBarCode_PackUnionBill_Json")]
        [HttpGet]
        public object get_PackBarCode_PackUnionBill_Json(Int64 HInterID, string HBillNo, string HBillType, string HBarCode_Pack, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                WebS.ClsGy_BarCodeBill_WMS_Model WebSoBarModel = new WebS.ClsGy_BarCodeBill_WMS_Model();
                WebSoBarModel = oWebs.get_PackBarCode_PackUnionBill(HInterID, HBillNo, HBillType, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBarModel == 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 = WebSoBarModel;
                    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_PackUnionBill_Json")]
        [HttpGet]
        public object get_BarCode_PackUnionBill_Json(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                if (oWebs.get_BarCode_PackUnionBill(HBarCode, HInterID, HBillType, HBillNo, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    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/GetBillEntry_Tmp_Pack_Json")]
        [HttpGet]
        public object GetBillEntry_Tmp_Pack_Json(long HInterID, string HBillNo, string HBillType)
        {
            try
            {
                ds = oWebs.GetBillEntry_Tmp_Pack(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null)
                {
                    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 åˆ é™¤æ˜Žç»†è¡¨ä½“选中行记录
        /// <summary>
        /// åˆ é™¤æ˜Žç»†è¡¨ä½“选中行记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DelPackUnionBill_Temp_Pack_Json")]
        [HttpGet]
        public object set_DelPackUnionBill_Temp_Pack_Json(Int64 HInterID, string HBarCode, string HBillType)
        {
            try
            {
                if (oWebs.set_DelPackUnionBill_Temp_Pack(HInterID, HBarCode, HBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除组托记录失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç»„托缓存列表模块调用方法
        #region è¿”回组托缓存列表信息
        /// <summary>
        /// è¿”回组托缓存列表信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetSc_PackUnionBill_TempList_Json")]
        [HttpGet]
        public object GetSc_PackUnionBill_TempList_Json(string HBillType, string HMaker, long HStockOrgID)
        {
            try
            {
                ds = oWebs.GetSc_PackUnionBill_TempList(HBillType, HMaker, HStockOrgID);
                if (ds == null)
                {
                    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 åˆ é™¤ç»„托缓存列表单据
        /// <summary>
        /// åˆ é™¤ç»„托缓存列表单据
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/DeleteTemp_PackUnionBill_Json")]
        [HttpGet]
        public object DeleteTemp_PackUnionBill_Json(Int64 HInterID)
        {
            try
            {
                if (oWebs.DeleteTemp_PackUnionBill(HInterID, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    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
        #endregion
        #region åˆ æ‰˜æ¨¡å—调用方法
        #region åˆ æ‰˜æ¨¡å— æ‰«ææ‰˜æ¡ç 
        /// <summary>
        /// åˆ æ‰˜æ¨¡å— æ‰«ææ‰˜æ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_PackBarCode_DeletePackUnionBill_Json")]
        [HttpGet]
        public object Get_PackBarCode_DeletePackUnionBill_Json(string HBarCode_Pack, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_DeletePackUnionBill '" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_DeletePackUnionBill");
                if (ds == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描托条码判断失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0)
                    {
                        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;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "扫描托条码失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.data = null;
                        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/GetDeletePackUnionBill_Json")]
        [HttpGet]
        public object GetDeletePackUnionBill_Json(long HInterID, string HBillType, string HMaker)
        {
            try
            {
                oCn.RunProc("exec h_p_WMS_PackUnionBill_Delete " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "删托成功";
                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
        #region æ¢æ‰˜è°ƒæ‹¨å•模块调用方法
        #region æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æè°ƒå…¥æ‰˜æ¡ç 
        /// <summary>
        /// æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æè°ƒå…¥æ‰˜æ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_BarCodePack_In_MoveStockBill_HuanTuo_Json")]
        [HttpGet]
        public object get_BarCodePack_In_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillNo, string HBarCode_Pack, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_BarCodePack_In_MoveStockBill_HuanTuo(HInterID, HBillNo, HBarCode_Pack, HStockOrgID, 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 æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æè°ƒå‡ºæ¡ç 
        /// <summary>
        /// æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æè°ƒå‡ºæ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_BarCode_MoveStockBill_HuanTuo_Json")]
        [HttpGet]
        public object get_BarCode_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBillNo, string HBillType, string HBarCode, string HBarCode_Pack, Int64 HPackUnionInterID_In, Int64 HWhID, Int64 HSPID, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                if (oWebs.get_BarCode_MoveStockBill_HuanTuo(HInterID, HBillNo, HBillType, HBarCode, HBarCode_Pack, HPackUnionInterID_In, HWhID, HSPID, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    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/GetBillEntry_Temp_MoveStockBill_HuanTuo_Json")]
        [HttpGet]
        public object GetBillEntry_Temp_MoveStockBill_HuanTuo_Json(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
        {
            try
            {
                ds = oWebs.GetBillEntry_Temp_MoveStockBill_HuanTuo(HInterID, HBillNo, HBillType, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null)
                {
                    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 æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æåˆ é™¤æ˜Žç»†è¡¨ä½“行记录
        /// <summary>
        /// æ¢æ‰˜è°ƒæ‹¨å•模块 æ‰«æåˆ é™¤æ˜Žç»†è¡¨ä½“行记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo_Json")]
        [HttpGet]
        public object set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo_Json(Int64 HInterID, string HBarCode, string HBillType)
        {
            try
            {
                if (oWebs.set_DelPackUnionBill_Temp_MoveStockBill_HuanTuo(HInterID, HBarCode, HBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    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/GetKF_MoveStockBill_TempList_HuanTuo_Json")]
        [HttpGet]
        public object GetKF_MoveStockBill_TempList_HuanTuo_Json(Int64 HInterID, string HBillType)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_MoveStockBill_TempList_HuanTuo " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_KF_MoveStockBill_TempList_HuanTuo");
                if (ds == null)
                {
                    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 æ¢æ‰˜è°ƒæ‹¨å•缓存列表模块    è¿”回缓存列表信息
        /// <summary>
        /// è¿”回换托调拨单缓存列表信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetPonderationBillMain_TempList_HuanTuo_Json")]
        [HttpGet]
        public object GetPonderationBillMain_TempList_HuanTuo_Json(string HBillType, string HMaker, long HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_HuanTuo '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_KF_PonderationBillMain_TempList_HuanTuo");
                if (ds == null)
                {
                    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
@@ -1146,5 +2735,256 @@
        #endregion
        #region æŠ¥è¡¨æ•°æ®èŽ·å–æ–¹æ³•
        #region æ¡ç å‡ºå…¥åº“记录报表
        #region èŽ·å–å•æ®ç±»åž‹ä¿¡æ¯
        /// <summary>
        /// èŽ·å–å•æ®ç±»åž‹ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetBarCodeReport_BillType_Json")]
        [HttpGet]
        public object GetBarCodeReport_BillType_Json()
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeReport_BillType ", "h_p_WMS_BarCodeReport_BillType");
                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;
            }
        }
        #endregion
        #region èŽ·å–æ¡ç å‡ºå…¥åº“è®°å½•
        /// <summary>
        /// èŽ·å–æ¡ç å‡ºå…¥åº“è®°å½•
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_BarCodeOutInReport_Json")]
        [HttpGet]
        public object GetKf_BarCodeOutInReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Kf_BarCodeOutInReport_New " + sWhere, "h_p_Kf_BarCodeOutInReport_New");
                if (ds == null)
                {
                    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 æ¡ç åº“存查询报表
        #region èŽ·å–æ¡ç åº“å­˜ä¿¡æ¯
        /// <summary>
        /// èŽ·å–æ¡ç åº“å­˜ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_BarCodeICInventoryReport_Json")]
        [HttpGet]
        public object GetKf_BarCodeICInventoryReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeICInventoryReport " + sWhere, "h_p_WMS_BarCodeICInventoryReport");
                if (ds == null)
                {
                    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 WMS物料出入库记录报表
        #region èŽ·å–WMS物料出入库记录
        /// <summary>
        /// èŽ·å–WMS物料出入库记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_MaterOutInReport_Json")]
        [HttpGet]
        public object GetKf_MaterOutInReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_MaterOutInReport " + sWhere, "h_p_WMS_MaterOutInReport");
                if (ds == null)
                {
                    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 = "查询WMS物料出入库记录信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region WMS物料库存查询报表
        #region èŽ·å–WMS物料库存信息
        /// <summary>
        /// èŽ·å–WMS物料库存信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_MaterICInventoryReport_Json")]
        [HttpGet]
        public object GetKf_MaterICInventoryReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_MaterICInventoryReport " + sWhere, "h_p_WMS_MaterICInventoryReport");
                if (ds == null)
                {
                    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 = "查询WMS物料库存信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #endregion
    }
}