From 61345a899aba3fd99f0cabc601f7bea06b641059 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期一, 19 六月 2023 14:21:17 +0800
Subject: [PATCH] 新增删托单模块调用方法

---
 WebAPI/Controllers/条码管理/WEBSController.cs | 1891 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 1,795 insertions(+), 96 deletions(-)

diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index c787026..f5e05df 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -23,7 +23,6 @@
         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();
@@ -32,6 +31,391 @@
         Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
 
 
+        WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
+
+
+        #region 鍏敤鏂规硶
+
+        #region 鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
+
+        /// <summary>
+        /// 鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
+        /// </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 = "鏈�澶у崟鎹甀D銆佸崟鎹彿鑾峰彇澶辫触";
+                    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 = "鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+
+        #endregion
+
+
+        #region 鍩虹璧勬枡
+
+        #region 浠撳簱璧勬枡
+
+        //鏍规嵁浠撳簱ID銆佺粍缁嘔D锛岃繑鍥炰粨搴撲俊鎭�
+        public Model.ClsGy_Warehouse_Model GetWhInfoByIDandOrg(long sHWhID, long HUSEORGID, ref string sErr)
+        {
+            DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View();
+            if (dal.GetInfoByIDandOrgID(sHWhID, HUSEORGID))
+            {
+                return dal.omodel;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        #endregion
+
+        #region 浠撲綅璧勬枡
+
+
+        #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>
+        /// 宸蹭笂浼犳煡璇㈢晫闈紝鏍规嵁鍗曟嵁鍙枫�佹簮鍗曞彿鏌ヨ宸蹭笂浼犲崟鎹俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_ICStockBillQueryList_Json")]
+        [HttpGet]
+        public object GetKf_ICStockBillQueryList_Json(string HBillType, string HBillNo, string HSourceBillNo)
+        {
+            try
+            {
+                ds = oWebs.GetKf_ICStockBillQueryList(HBillType, HBillNo, HSourceBillNo);
+                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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄥ拰鏈湴鍑哄叆搴撳崟璁板綍锛屽苟鏇存柊TEMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0
+
+        /// <summary>
+        /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄥ拰鏈湴鍑哄叆搴撳崟璁板綍锛屽苟鏇存柊TEMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/DeleteICStockBillAndWMS_Json")]
+        [HttpGet]
+        public object DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType)
+        {
+            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;
+            }
+        }
+
+        #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;
+            }
+        }
+
+        #endregion
+
+
+        #region 鍒犻櫎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍
+
+        /// <summary>
+        /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json")]
+        [HttpGet]
+        public object set_DelPonderationBillMain_Temp_InterIDAndSource_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string HBillType)
+        {
+            try
+            {
+                if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, 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;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍗曟嵁ID,鍒犻櫎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/DeleteBillList_Json")]
+        [HttpGet]
+        public object DeleteBillList_Json(long HInterID)
+        {
+            try
+            {
+                if (oWebs.DeleteBillList(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
+
+
+        #region 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛�
+
+        /// <summary>
+        /// 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json")]
+        [HttpGet]
+        public object set_DelPonderationBillMain_Temp_FIFO_Json(long HInterID, string HBillType)
+        {
+            try
+            {
+                if (oWebs.set_DelPonderationBillMain_Temp_FIFO(HInterID, 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 = "鏇存柊鍏堣繘鍏堝嚭涓存椂琛℉lineStatus鍊煎け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
 
 
         #region 鎻愪氦鐢熷崟澶勭悊鏂规硶
@@ -96,6 +480,275 @@
 
         #endregion
 
+
+        #region 濮斿棰嗘枡    涓婁紶鐢熷崟
+
+        #region 濮斿棰嗘枡    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 濮斿棰嗘枡鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveEntrustOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveEntrustOutBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_EntrustOutBillMain> lsmain = new List<Model.ClsKf_EntrustOutBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getEntrustOutBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_EntrustOutBillMain websLsmain = new WebS.ClsKf_EntrustOutBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1211";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveEntrustOutBill_BillCheck(websLsmain, 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 鐢熶骇琛ユ枡    涓婁紶鐢熷崟
+
+        #region 鐢熶骇琛ユ枡    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 鐢熶骇琛ユ枡鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveMateReplenishOutBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_MateReplenishOutBillMain> lsmain = new List<Model.ClsKf_MateReplenishOutBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getMateReplenishOutBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_MateReplenishOutBillMain websLsmain = new WebS.ClsKf_MateReplenishOutBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1254";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveMateReplenishOutBill_BillCheck(websLsmain, 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 濮斿琛ユ枡    涓婁紶鐢熷崟
+
+        #region 濮斿琛ユ枡    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 濮斿琛ユ枡鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveEntrustReplenishOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveEntrustReplenishOutBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_EntrustReplenishOutBillMain> lsmain = new List<Model.ClsKf_EntrustReplenishOutBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getEntrustReplenishOutBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_EntrustReplenishOutBillMain websLsmain = new WebS.ClsKf_EntrustReplenishOutBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1255";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveEntrustReplenishOutBill_BillCheck(websLsmain, 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 鐩存帴璋冩嫧    涓婁紶鐢熷崟
+
+        #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
 
 
@@ -142,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 鐢熶骇棰嗘枡    鎵弿婧愬崟鏉$爜
 
@@ -195,37 +893,19 @@
 
         #endregion
 
-        #region 鐩存帴璋冩嫧    鎵弿婧愬崟鏉$爜
-
-
-        #endregion
-
-        #region 鍒嗘寮忚皟鍑�    鎵弿婧愬崟鏉$爜
-
-
-        #endregion
-
-        #region 鍒嗘寮忚皟鍏�    鎵弿婧愬崟鏉$爜
-
-
-        #endregion
-
-        #endregion
-
-
-        #region 鐗╂枡鏉$爜澶勭悊鏂规硶
+        #region 鍏朵粬鍑哄簱    鎵弿婧愬崟鏉$爜
 
         /// <summary>
-        /// 鐗╂枡鏉$爜鏂囨湰妗� 鎵爜璋冪敤
+        /// 鍏朵粬鍑哄簱    鎵弿婧愬崟鏉$爜
         /// </summary>
         /// <returns></returns>
-        [Route("WEBSController/Get_BarCode_Json")]
+        [Route("WEBSController/get_SourceBarCode_OtherOut_Json")]
         [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)
+        public object get_SourceBarCode_OtherOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID)
         {
             try
             {
-                WebSoBar = oWebs.get_BarCode(sBarCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo);
+                WebSoBar = oWebs.get_SourceBarCode_OtherOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
                 if (WebSoBar == null)
                 {
                     objJsonResult.code = "0";
@@ -247,11 +927,294 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
         }
+
+        #endregion
+
+        #region 鐩存帴璋冩嫧    鎵弿婧愬崟鏉$爜
+
+        /// <summary>
+        /// 鐩存帴璋冩嫧    鎵弿婧愬崟鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/get_SourceBarCode_MoveStock_Json")]
+        [HttpGet]
+        public object get_SourceBarCode_MoveStock_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID)
+        {
+            try
+            {
+                WebSoBar = oWebs.get_SourceBarCode_MoveStock(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+                if (WebSoBar == null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = WebSoBar;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鍒嗘寮忚皟鍑�    鎵弿婧愬崟鏉$爜
+
+
+        #endregion
+
+        #region 鍒嗘寮忚皟鍏�    鎵弿婧愬崟鏉$爜
+
+
+        #endregion
+
+        #endregion
+
+
+        #region 鐗╂枡鏉$爜澶勭悊鏂规硶    鍏朵粬鍑哄簱搴撴ā鍧�
+
+        /// <summary>
+        /// 鐗╂枡鏉$爜鏂囨湰妗� 鎵爜璋冪敤
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/Get_BarCode_Json")]
+        [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)
+        {
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            string sJXCode = "";
+            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+            {
+                if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                {
+                    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 = 0;
+                    objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+         }
+
+        #endregion
+
+        #region 鐗╂枡鏉$爜澶勭悊鏂规硶    璋冩嫧妯″潡
+
+        /// <summary>
+        /// 鐗╂枡鏉$爜鏂囨湰妗� 鎵爜璋冪敤
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/get_BarCode_MoveStock_Json")]
+        [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)
+        {
+            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
+                {
+                    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 = "鎵弿鏉$爜澶辫触锛�" + 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
 
@@ -264,86 +1227,45 @@
         /// <returns></returns>
         [Route("WEBSController/GetBillEntryTmpList_Json")]
         [HttpGet]
-        public object GetBillEntryTmpList(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID, string sMouldManagerCtl, string sFIFOCtl)
+        public object GetBillEntryTmpList(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
         {
             try
             {
-                string sSimpleMode = "N";  //鏄惁鍚敤鎵爜绠�鏄撴ā寮忥紝鍙樉绀哄凡鎵爜婧愬崟璁板綍(Y,N)
-                string sReturn = "";
-
-                //鑾峰彇绯荤粺鍙傛暟
-                if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sReturn) == true)
+                string sMouldManagerCtl = "N";  //鏄惁鍚敤鍣ㄥ叿绠$悊
+                string sFIFOCtl = "N";          //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊
+                ds = oWebs.GetBillEntryTmpList(HInterID, HBillNo, HBillType, HStockOrgID, ref sMouldManagerCtl, ref sFIFOCtl, ref DBUtility.ClsPub.sErrInfo);
+                if (ds == null)
                 {
-                    //鍒ゆ柇鏄惁鍚敤鍣ㄥ叿绠$悊(Y,N)
-                    if (oSystemParameter.omodel.WMS_MouldManagerCtl == "Y")   //鍚敤妯℃不鍏风鐞�
-                    {
-                        sMouldManagerCtl = "Y";
-                    }
-
-                    //鍒ゆ柇鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊(Y,N)锛屾槸鍚﹀惎鐢ㄦ壂鐮佺畝鏄撴ā寮忥紝鍙樉绀哄凡鎵爜婧愬崟璁板綍(Y,N)
-                    if (HBillType == "1204")   //鐢熶骇棰嗘枡鍗�
-                    {
-                        if (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_MateOutBill_FIFOList == "Y")   //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
-                        {
-                            sFIFOCtl = "Y";
-                        }
-                        if (oSystemParameter.omodel.Kf_MateOutBill_SimpleMode == "Y")   //鐢熶骇棰嗘枡鍗�-鎵爜绠�鏄撴ā寮�
-                        {
-                            sSimpleMode = "Y";
-                        }
-                    }
-                    else if (HBillType == "1205" && (oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_SellOutBill_FIFOList == "Y"))   //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗
-                    {
-                        sFIFOCtl = "Y";
-                    }
-                    else if (HBillType == "1211" && (oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_EntrustOutBill_FIFOList == "Y"))   //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗
-                    {
-                        sFIFOCtl = "Y";
-                    }
-                    else if (HBillType == "1207" && (oSystemParameter.omodel.Kf_MoveStockBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_MoveStockBill_FIFOList == "Y"))   //鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗
-                    {
-                        sFIFOCtl = "Y";
-                    }
-                    else if (HBillType == "1250" && (oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOList == "Y"))   //鍒嗘寮忚皟鍑哄崟-鍏堣繘鍏堝嚭鎺у埗
-                    {
-                        sFIFOCtl = "Y";
-                    }
-
-                    DataSet ds = oCn.RunProcReturn("exec h_p_WMS_BillEntryTmpList_LayUI " + HInterID.ToString() + ",'" + HBillType + "','" + sMouldManagerCtl + "','" + sFIFOCtl + "','" + sSimpleMode + "'", "h_p_WMS_BillEntryTmpList_LayUI");
-
+                    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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                     }
-
-                    if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                    {
-                        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;
-                        objJsonResult.list = columnNameList;
-                        return objJsonResult;
-                    }
-                }
-                else
-                {
                     objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涜繑鍥炵墿鏂欐槑缁嗗垪琛ㄦ椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sReturn;
-                    objJsonResult.data = null;
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.data = new
+                    {
+                        Materlist = ds.Tables[0],           //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛�
+                        Mouldlist = ds.Tables[1],           //杩斿洖妯℃不鍏峰垪琛ㄤ俊鎭紙1锛�
+                        FIFOlist = ds.Tables[2],            //杩斿洖鍏堣繘鍏堝嚭鍒楄〃淇℃伅锛�2锛�
+                        BarCodelist = ds.Tables[3],         //杩斿洖鏉$爜鏄庣粏鍒楄〃淇℃伅锛�3锛�
+                        ICMOReportlist = ds.Tables[4],      //杩斿洖婧愬崟鐢熶骇姹囨姤鍗曟潯鐮佹槑缁嗗垪琛ㄤ俊鎭紙4锛�
+                        BarCodeDetailslist = ds.Tables[5]   //杩斿洖褰撳墠鎵�鎵弿鏉$爜鏄庣粏淇℃伅锛�5锛�
+                    };
+                    objJsonResult.list = columnNameList;
                     return objJsonResult;
                 }
             }
@@ -456,9 +1378,556 @@
         [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)
         {
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            string sJXCode = "";
+            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+            {
+                if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                {
+                    sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker);
+                }
+                else
+                {
+                    sJXCode = sBarCode;
+                }
+                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 = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 杩斿洖鍗曟嵁鍒楄〃淇℃伅
+
+        /// <summary>
+        /// 杩斿洖鍗曟嵁鍒楄〃淇℃伅    鏍¢獙妯″紡
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_Json")]
+        [HttpGet]
+        public object GetKf_PonderationBillMain_Temp_BillCheck_Json(long HInterID, string HBillType, string sWhere)
+        {
             try
             {
-                WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
+                ds = oWebs.GetKf_PonderationBillMain_Temp_BillCheck(HInterID, HBillType, sWhere);
+                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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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/GetKf_PonderationBillMain_TempList_BillCheck_Json")]
+        [HttpGet]
+        public object GetKf_PonderationBillMain_TempList_BillCheck_Json(string HBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oWebs.GetKf_PonderationBillMain_TempList_BillCheck(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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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/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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                        }
+                        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";
@@ -480,7 +1949,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏍¢獙妯″紡锛屾壂鎻忔潯鐮佸け璐ワ紒" + e.ToString();
+                objJsonResult.Message = "鎵弿璋冨叆鎵樻潯鐮佸け璐ワ紒" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -488,8 +1957,238 @@
 
         #endregion
 
-        #region 澶勭悊鏂规硶
+        #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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    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
 

--
Gitblit v1.9.1