yxj
2023-06-13 a1757ed4d0a21ae1df5a184da8466d5f663fae17
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 åŸºç¡€èµ„æ–™
@@ -59,6 +124,52 @@
        #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 å·²ä¸Šä¼ æŸ¥è¯¢ç•Œé¢ï¼Œæ ¹æ®å•据号、源单号查询已上传单据信息
@@ -146,6 +257,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 +661,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
@@ -564,6 +795,51 @@
        }
        #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 ç”Ÿäº§é¢†æ–™    æ‰«ææºå•条码
@@ -724,37 +1000,58 @@
        [HttpGet]
        public Object get_BarCode_Json(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, string HScanStyle, string HCustom1, string HCustom2)
        {
            try
            //获取系统参数
            string sErrMsg = "";
            string sJXCode = "";
            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
            {
                var sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo,HMaker);
                SourceFlag = true;
                WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                    sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker);
                    SourceFlag = true;
                }
                else
                {
                    sJXCode = sBarCode;
                }
                try
                {
                    WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, 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 = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描条码失败!" + e.ToString();
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
         }
        #endregion
@@ -768,35 +1065,156 @@
        [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 == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                     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 = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描条码失败!" + e.ToString();
                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
@@ -960,32 +1378,53 @@
        [HttpGet]
        public Object get_CheckTypeByBarCode_BillCheck_Json(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, Int64 HStockOrgID)
        {
            try
            //获取系统参数
            string sErrMsg = "";
            string sJXCode = "";
            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
            {
                var sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker);
                WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                    sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker);
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                    sJXCode = sBarCode;
                }
            }
            catch (Exception e)
                try
                {
                    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)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                    }
                }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString();
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
@@ -1098,6 +1537,566 @@
        #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_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
        #region å¤„理方法