From 4bfab3d9173fcced07cea4afb71227b83b47c469 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 25 六月 2024 12:32:22 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  999 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 997 insertions(+), 2 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 5cd01d9..e2524f9 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"
@@ -21,6 +21,7 @@
 {
     public class WEBSController : ApiController
     {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
         public string sWhere = "";
         public WebServer webserver = new WebServer();
         public DataSet ds = new DataSet();
@@ -30,6 +31,7 @@
         public WebS.WebService1 oWebs = new WebS.WebService1();
         public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
         Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+        string ComputerName = SystemInformation.ComputerName;   //璁惧鍚嶇О
 
 
         WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
@@ -126,7 +128,7 @@
                 if (oSystemParameter.ShowBill(ref sErrMsg) == true)
                 {
                     //鍒ゆ柇鏉冮檺
-                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HUserName))
+                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 3, false, HUserName))
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
@@ -905,6 +907,86 @@
 
         #endregion
 
+        #region 鐢熶骇璁惧璧勬枡
+
+        /// <summary>
+        /// 鎵爜杩斿洖鐢熶骇璁惧淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetEquip_Json")]
+        [HttpGet]
+        public object GetEquip_Json(string HBarCode)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID from h_v_Gy_EquipFileBill where HBarCode='" + HBarCode + "'", "h_v_Gy_EquipFileBill");
+                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.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "杩斿洖鐢熶骇璁惧淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇鐢熶骇璁惧鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetEquipList_Json")]
+        [HttpGet]
+        public object GetEquipList_Json(string Equip)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill");
+                if (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.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "杩斿洖鐢熶骇璁惧淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #endregion
 
 
@@ -1436,6 +1518,63 @@
         /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄥ拰鏈湴鍑哄叆搴撳崟璁板綍锛屽苟鏇存柊TEMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0
         /// </summary>
         /// <returns></returns>
+        [Route("WEBSController/set_DeleteICStockBillAndWMS_Json")]
+        [HttpGet]
+        public object set_DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
+        {
+            try
+            {
+                string WorkList = "鎾ら攢宸蹭笂浼犲崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
+                string SystemName = "WMS-" + MvarReportTitle + "妯″潡";
+                oCn.BeginTran();
+                ds = oCn.RunProcReturn("exec h_p_WMS_ICStockBillAndWMS_Delete " + HInterID + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_ICStockBillAndWMS_Delete");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    oCn.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紝鎾ら攢鍗曟嵁鍒ゆ柇閿欒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                {
+                    oCn.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;  //澶辫触锛�
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    //鍐欏叆鏃ュ織
+                    oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                        "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鎾ら攢')"
+                        );
+                    oCn.Commit();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;  //鎴愬姛锛�
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄥ拰鏈湴鍑哄叆搴撳崟璁板綍锛屽苟鏇存柊TEMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0
+        /// </summary>
+        /// <returns></returns>
         [Route("WEBSController/DeleteICStockBillAndWMS_Json")]
         [HttpGet]
         public object DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType)
@@ -1473,6 +1612,42 @@
 
 
         #region 鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄦā鍧�  鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁
+
+        /// <summary>
+        /// 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁锛屽啓鍏ユ棩蹇�   20240619
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_DelPonderationBillMain_Temp_New_Json")]
+        [HttpGet]
+        public object set_DelPonderationBillMain_Temp_New_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
+        {
+            try
+            {
+                string WorkList = "鍒犻櫎缂撳瓨鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+                string SystemName = "WMS-" + MvarReportTitle + "妯″潡";
+                oCn.BeginTran();
+                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                //鍐欏叆鏃ュ織
+                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                    "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')"
+                    );
+                oCn.Commit();
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄥ崟鎹け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
 
         /// <summary>
         /// 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁
@@ -3141,6 +3316,152 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "鐢熸垚鐢熶骇缁勬墭鍗曞け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 涓婃枡闃查敊鍗�     涓婁紶鐢熷崟
+
+        /// <summary>
+        /// 涓婃枡闃查敊鍗曟柊澧炰笂浼�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveMaterToSourceBill_Json")]
+        [HttpPost]
+        public object set_SaveMaterToSourceBill_Json([FromBody] JObject oMain)
+        {
+            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+            DAL.ClsSc_MaterToSourceBill BillNew = new DAL.ClsSc_MaterToSourceBill();
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+            try
+            {
+                string sMainStr = "[" + msg1.ToString() + "]";
+                List<Model.ClsSc_MaterToSourceBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MaterToSourceBillMain>>(sMainStr);
+
+                //鍗曟嵁鍙锋槸鍚﹂噸澶�
+                if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+                string s = "";
+                int sYear = 0;
+                int sPeriod = 0;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = s;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍥哄畾璧嬪��=================================
+                BillNew.omodel.HYear = sYear;
+                BillNew.omodel.HPeriod = sPeriod;
+                BillNew.omodel.HBillType = "3786";
+                BillNew.omodel.HInterID = mainList[0].HInterID;
+                BillNew.omodel.HBillNo = mainList[0].HBillNo;
+                BillNew.omodel.HDate = mainList[0].HDate;
+                BillNew.omodel.HRemark = mainList[0].HRemark;
+                BillNew.omodel.HMaker = mainList[0].HMaker;
+                BillNew.omodel.HSTOCKORGID = mainList[0].HSTOCKORGID;
+                DBUtility.ClsPub.CurUserName = mainList[0].HMaker;
+                //====================================================
+                BillNew.omodel.HProcExchInterID = mainList[0].HProcExchInterID;
+                BillNew.omodel.HProcExchEntryID = mainList[0].HProcExchEntryID;
+                BillNew.omodel.HProcExchBillNo = mainList[0].HProcExchBillNo;
+                BillNew.omodel.HICMOInterID = mainList[0].HICMOInterID;
+                BillNew.omodel.HICMOEntryID = mainList[0].HICMOEntryID;
+                BillNew.omodel.HICMOBillNo = mainList[0].HICMOBillNo;
+                BillNew.omodel.HSourceID = mainList[0].HSourceID;
+                BillNew.omodel.HSourceBarCode = mainList[0].HSourceBarCode;
+                BillNew.omodel.HEquipID = mainList[0].HEquipID;
+                BillNew.omodel.HWorkerID = mainList[0].HWorkerID;
+                BillNew.omodel.HWorkerBarCode = mainList[0].HWorkerBarCode;
+                BillNew.omodel.HGroupID = mainList[0].HGroupID;
+                BillNew.omodel.HMainSourceBillType = mainList[0].HMainSourceBillType;
+                if (mainList[0].HMainSourceBillType == "3772")
+                {
+                    BillNew.omodel.HMainSourceInterID = mainList[0].HProcExchInterID;
+                    BillNew.omodel.HMainSourceEntryID = mainList[0].HProcExchEntryID;
+                    BillNew.omodel.HMainSourceBillNo = mainList[0].HProcExchBillNo;
+                }
+                else
+                {
+                    BillNew.omodel.HMainSourceInterID = mainList[0].HICMOInterID;
+                    BillNew.omodel.HMainSourceEntryID = mainList[0].HICMOEntryID;
+                    BillNew.omodel.HMainSourceBillNo = mainList[0].HICMOBillNo;
+                }
+                //瀛愯〃璧嬪��
+                ds = oCn.RunProcReturn("exec h_p_Sc_GetMaterToSourceBill_Temp " + BillNew.omodel.HInterID.ToString() + ",'" + BillNew.omodel.HBillType + "'", "h_p_Sc_GetMaterToSourceBill_Temp");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
+                    {
+                        Model.ClsSc_MaterToSourceBillSub oSub = new Model.ClsSc_MaterToSourceBillSub();
+                        //鍥哄畾璧嬪��========================================
+                        oSub.HEntryID = i + 1;
+                        oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
+                        oSub.HSourceInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceInterID"]);
+                        oSub.HSourceEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceEntryID"]);
+                        oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillType"]);
+                        oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillNo"]);
+                        oSub.HRelationQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationQty"]);
+                        oSub.HRelationMoney = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationMoney"]);
+                        oSub.HBillNo_bak = mainList[0].HBillNo;
+                        //=============================
+                        oSub.HMaterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]);
+                        oSub.HUnitID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HUnitID"]);
+                        oSub.HQty = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["HQty"]);
+                        oSub.HPieceQty = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["HPieceQty"]);
+                        oSub.HScanDate = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["HScanDate"]);
+                        oSub.HBarCode = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBarCode"]);
+                        oSub.HBarCode_Pack = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBarCode_Pack"]);
+                        BillNew.DetailColl.Add(oSub);
+                    }
+                }
+                //淇濆瓨
+                bool bResult;
+                bResult = BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //鎴愬姛锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "涓婃枡闃查敊鍗曚笂浼犲け璐ワ紒" + e.Message;
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -5597,8 +5918,495 @@
         #endregion
 
 
-        #region 澶勭悊鏂规硶
+        #region 涓婃枡闃查敊鍗曟ā鍧楄皟鐢ㄦ柟娉�     20240528
 
+        #region 涓婃枡闃查敊鍗曟壂鐮佹ā鍧�  鎵弿婧愬崟鏉$爜璋冪敤鏂规硶
+        /// <summary>
+        /// 鎵弿婧愬崟鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/get_SourceBarCode_MaterToSource_Json")]
+        [HttpGet]
+        public object get_SourceBarCode_MaterToSource_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MaterToSource " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "','" + HMaker + "'", "h_p_WMS_AddSourceBarCode_MaterToSource");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵弿婧愬崟鏉$爜锛屽啓鍏ユ簮鍗曚复鏃惰〃澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 涓婃枡闃查敊鍗曟壂鐮佹ā鍧�  鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶
+        /// <summary>
+        /// 鎵弿鐗╂枡鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/get_BarCode_MaterToSource_Json")]
+        [HttpGet]
+        public object get_BarCode_MaterToSource_Json(Int64 HInterID, string HBillNo, string HBillType, string HBarCode, string HMaker)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarcode='" + HBarCode + "'", "Gy_BarCodeBill");
+                if (ds.Tables[0].Rows.Count == 0) {
+                    DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
+                    string sErrMsg = "";
+                    oSystemParameter.ShowBill(ref sErrMsg);
+
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
+                    {
+                        if (!dal.GetInfoByNumber(HBarCode))
+                        {
+                            //鏉$爜瑙f瀽
+                            string[] str = HBarCode.Split('@');
+
+                            if (str[0] != "CMR" && str[0] != "SRM")
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮佹槸鍚︽纭�!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+
+                            int HOrgIDs = 0;
+                            //鏌ヨ缁勭粐
+                            DataSet ds = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + str[1] + "' ", "Xt_ORGANIZATIONS");
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮佺粍缁囨槸鍚︽纭�!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                HOrgIDs = int.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString());
+                            }
+
+                            string HMaterNames = "";
+                            string HMaterModels = "";
+                            string HMaterIDs = "0";
+                            //鏌ヨ鐗╂枡
+                            ds = oCn.RunProcReturn("select  * from Gy_Material where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs, "Gy_Material");
+
+
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮佺墿鏂欐槸鍚︽纭�!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                HMaterIDs = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                                HMaterNames = ds.Tables[0].Rows[0]["HName"].ToString();
+                                HMaterModels = ds.Tables[0].Rows[0]["HModel"].ToString();
+
+                            }
+                            string HSupIDs = "0";
+                            //鏌ヨ渚涘簲鍟�
+                            ds = oCn.RunProcReturn("select * from Gy_Supplier where HNumber='" + str[2] + "' and HUSEORGID=" + HOrgIDs, "Gy_Supplier");
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                //sErrMsg = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮佷緵搴斿晢鏄惁姝g‘!";
+                                //return null;
+                            }
+                            else
+                            {
+                                HSupIDs = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                            }
+
+                            string HSourceInterIDs = "0";
+                            string HSourceEntryIDs = "0";
+                            string HSourceBillNos = "0";
+                            string HUnitIDs = "0";
+                            //鏌ヨ閲囪喘璁㈠崟
+                            ds = oCn.RunProcReturn(@"select  a.HInterID,b.HEntryID,a.HBillNo,b.HUnitID from Cg_POOrderBillMain a
+inner join Cg_POOrderBillSub b on a.HInterID = b.HInterID where HBillNo='" + str[3] + "' and b.HMaterID=" + HMaterIDs, "Cg_POOrderBillMain");
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                //sErrMsg = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮侀噰璐鍗曟槸鍚︽纭�!";
+                                //return null;
+                            }
+                            else
+                            {
+                                HSourceInterIDs = ds.Tables[0].Rows[0]["HInterID"].ToString();
+                                HSourceEntryIDs = ds.Tables[0].Rows[0]["HEntryID"].ToString();
+                                HSourceBillNos = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+                                HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString();
+                            }
+
+                            string HInnerBillNos = "";
+                            //鏌ヨ鍐呴儴閲囪喘璁㈠崟鍙�
+                            ds = oCn.RunProcReturn(@" select * from h_v_IF_POInStockList where 閲囪喘璁㈠崟鍙�= '" + str[3] + "' ", "h_v_IF_POInStockList");
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                //sErrMsg = "鏉$爜瑙f瀽澶辫触,璇风‘璁ゆ潯鐮佸唴閮ㄩ噰璐鍗曞彿鏄惁姝g‘!";
+                                //return null;
+                                HInnerBillNos = str[3];
+                            }
+                            else
+                            {
+                                HInnerBillNos = ds.Tables[0].Rows[0]["鍐呴儴閲囪喘璁㈠崟鍙�"].ToString();
+                            }
+                            double HQty = double.Parse(str[6]);
+
+                            //鏃ユ湡鑾峰彇鏂瑰紡
+                            string sDate = DateTime.Now.ToString();
+                            string HWei = "0";      //灏炬暟
+                            string HBarCodeType = "鎵规鏉$爜";
+                            Int64 HMaterID = int.Parse(HMaterIDs);
+                            Int64 HAuxPropID = 0;
+                            Int64 HUnitID = int.Parse(HUnitIDs);
+                            double HQty2 = HQty;
+                            string HBatchNo2 = str[5];
+                            Int64 HSupID = int.Parse(HSupIDs);
+                            Int64 HGroupID = 0;
+                            int HPrintQty = 0;
+                            Int64 HSourceInterID = int.Parse(HSourceInterIDs);
+                            Int64 HSourceEntryID = int.Parse(HSourceEntryIDs);
+                            string HSourceBillNo = HSourceBillNos;
+                            //HSourceBillType = "1102";
+                            Int64 HBarcodeNo = 0;       //鎵樺彿
+                            Int64 HBarcodeQtys = 0;     //鎬绘墭鏁�
+                            Int64 HDeptID = 0;
+                            //Int64 HWhID = 0;
+                            //Int64 HSPID = 0;
+                            string HRemark = "鏉$爜瑙f瀽";
+                            string HMaterName = HMaterNames;
+                            string HMaterModel = HMaterModels;
+                            string HPinfan = "";
+                            string HMTONo = "";
+                            Int64 HCusID = 0;
+                            string HCusType = "";
+                            DateTime HEndDate = DateTime.Now;
+                            string HWorkLineName = "";
+                            string HSeOrderBillNo = "";
+                            string HInnerBillNo = HInnerBillNos;
+                            bool HGiveAwayFlag = false;
+                            Int64 HEntryID = 1;
+                            Int64 HInterIDs = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
+                            int HOrgID = HOrgIDs;
+                            string HSourceBillType = "";
+
+
+                            oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+                                               ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
+                                               ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
+                                               ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
+                                               ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
+                                               ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
+                                               ",HGiveAwayFlag " +
+                                               ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+                                               ",HProduceDate,HExpiryDate " +
+                                               ") values ("
+                                               + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+                                               + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
+                                               + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
+                                               + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + ",0,0,'" + HRemark + "'"
+                                               + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
+                                               + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterIDs.ToString() + "," + HEntryID.ToString() + ""
+                                               + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
+                                               + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','','')");
+
+
+                        }
+                    }
+                }
+
+                ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_MaterToSource " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HMaker + "'", "h_p_WMS_AddBarCode_MaterToSource");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵弿鐗╂枡鏉$爜锛屽啓鍏ョ墿鏂欐潯鐮佷复鏃惰〃澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿鐗╂枡鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 涓婃枡闃查敊鍗曟壂鐮佹ā鍧�  鑾峰彇鎵爜妯″潡鍒楄〃淇℃伅璋冪敤鏂规硶
+        /// <summary>
+        /// 鑾峰彇鎵爜妯″潡鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetBillEntryTmpList_MaterToSource_Json")]
+        [HttpGet]
+        public object GetBillEntryTmpList_MaterToSource_Json(Int64 HInterID, string HBillNo, string HBillType)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_WMS_BillEntryTmpList_MaterToSource " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_BillEntryTmpList_MaterToSource");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉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_DelStationInBillSub_BindBarCodeTemp_Json")]
+        [HttpGet]
+        public object set_DelStationInBillSub_BindBarCodeTemp_Json(Int64 HInterID, string HBillType, string HBarCode)
+        {
+            try
+            {
+                oCn.RunProc("Delete from Sc_StationInBillSub_BindBarCodeTemp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + HBarCode + "'", 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/GetSourceBill_Temp_MaterToSource_Json")]
+        [HttpGet]
+        public object GetSourceBill_Temp_MaterToSource_Json(Int64 HInterID, string HBillType)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_WMS_SourceBill_Temp_MaterToSource " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_SourceBill_Temp_MaterToSource");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠庣紦瀛樺垪琛ㄨ繑鍥炴椂锛屾病鏈夎繑鍥炰换浣曡褰曪紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉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 涓婃枡闃查敊鍗曠紦瀛樺垪琛ㄦā鍧楄皟鐢ㄦ柟娉�
+
+        #region 涓婃枡闃查敊鍗曠紦瀛樺垪琛ㄧ晫闈紝杩斿洖缂撳瓨鍒楄〃淇℃伅
+
+        /// <summary>
+        /// 涓婃枡闃查敊鍗曠紦瀛樺垪琛ㄧ晫闈紝杩斿洖缂撳瓨鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetStationInBillSub_BindBarCodeTempList_Json")]
+        [HttpGet]
+        public object GetStationInBillSub_BindBarCodeTempList_Json(string HBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Sc_GetStationInBillSub_BindBarCodeTempList '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Sc_GetStationInBillSub_BindBarCodeTempList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉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_DeleteStationInBillSub_BindBarCodeTemp_Json")]
+        [HttpGet]
+        public object set_DeleteStationInBillSub_BindBarCodeTemp_Json(long HInterID, string HBillType)
+        {
+            try
+            {
+                oCn.RunProc("Delete from Sc_StationInBillSub_BindSourceTemp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.RunProc("Delete from Sc_StationInBillSub_BindBarCodeTemp 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
+
+        #endregion
 
         #endregion
 
@@ -6311,7 +7119,194 @@
 
         #endregion
 
+        #region 浠撳簱鏀跺彂瀛樻姤琛�
+        /// <summary>
+        /// 浠撳簱鏀跺彂瀛樻姤琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_StockInOutSumQueryReport_Json")]
+        [HttpGet]
+        public object GetKf_StockInOutSumQueryReport_Json(string sWhere)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Kf_StockInOutSumQueryReport " + sWhere, "h_p_Kf_StockInOutSumQueryReport");
+                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鍒楀璞$殑鍒楀悕
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒";
+                    objJsonResult.data = null;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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_ICinventoryQueryReport_Json")]
+        [HttpGet]
+        public object GetKF_ICinventoryQueryReport_Json(string sWhere)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_KF_ICinventoryQueryReport " + sWhere, "h_p_KF_ICinventoryQueryReport");
+                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鍒楀璞$殑鍒楀悕
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒";
+                    objJsonResult.data = null;
+                    objJsonResult.list = columnNameList;
+                    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_ICInvBalList")]
+        [HttpGet]
+        public object GetKf_ICInvBalList(string sWhere)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCn.RunProcReturn("select * from h_v_Kf_ICInvBalList ", "h_v_Kf_ICInvBalList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Kf_ICInvBalList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCn.RunProcReturn(sql, "h_v_Kf_ICInvBalList");
+                }
+
+                //娣诲姞鍒楀悕
+                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 = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;                
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鏈熷垵搴撳瓨鎶ヨ〃
+        /// <summary>
+        /// 浠撳簱鏀跺彂瀛樻姤琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/UpdateKf_ICInvBal")]
+        [HttpGet]
+        public object UpdateKf_ICInvBal( )
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_KF_ICinventory ", "h_p_KF_ICinventory");
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏍″鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         #endregion
 
 

--
Gitblit v1.9.1