From 78549fbacdf433bb0026a2c2f41351e9638cb3d4 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 09 三月 2026 01:49:24 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/WebAPIController.cs | 1547 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 1,419 insertions(+), 128 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 399f33c..08a39b6 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1150,7 +1150,52 @@
             }
         }
 
+        /// <summary>
+        /// 鑾峰彇浠撳簱鍒楄〃  --娣诲姞妯″叿浠撳簱鏉′欢  鐢ㄤ簬鍙煡璇㈡ā鍏蜂粨搴�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetWarehouseList_Json_MJ")]
+        [HttpGet]
+        public object GetWarehouseList_Json_MJ(string Warehouse, Int64 HOrgID)
+        {
+            sWhere = " Where HStopFlag=0  and HEndFlag=1 and HWarehouseType='妯″叿浠撳簱' and HUSEORGID =" + HOrgID + "";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (Warehouse != "")
+            {
+                sWhere = sWhere + " and ( HNumber like '%" + Warehouse + "%' or HName like '%" + Warehouse + "%'  or HUSEORGID like '%" + Warehouse + "%' ) ";
+            }
 
+            try
+            {
+                WebS.WebService1 oWeb = new WebS.WebService1();
+                ds = oWeb.GetWarehouseList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
 
         /// <summary>
         /// 鑾峰彇浠撲綅鍒楄〃
@@ -1424,14 +1469,110 @@
             }
         }
 
+        /// <summary>
+        /// 鑾峰彇鐢熶骇璧勬簮鍒楄〃涓嬫媺妗�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetSouceList_Select")]
+        [HttpGet]
+        public object GetSouceList_Select(string HMaterID,Int64 HOrgID)
+        {
+            sWhere = " and HStopFlag=0 and HUSEORGID =" + HOrgID + "";            
+            try
+            {
+                string sql = "EXEC h_p_Gy_SouceList_PC " + HMaterID + ",'" + sWhere + "'";
+                ds = oCN.RunProcReturn(sql, "h_p_Gy_SouceList_PC");
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        #region 鑾峰彇鑱屽憳鍒楄〃 (娣诲姞杞﹂棿绛涢��)
+        [Route("Web/GetEmployeeList_Json")]
+        [HttpGet]
+        public object GetEmployeeList_Json3(string Employee, Int64 HGroupID, Int64 HDeptID = -1)
+        {
+            // 缁欓儴闂�(杞﹂棿)ID璁剧疆榛樿鍊硷紝褰撴病鏈変紶鍏ュ�兼垨鑰呭�间负0鐨勬椂鍊欙紝璧版棫鏈夌殑鍑芥暟锛屽惁鍒欒蛋鏂扮殑閫昏緫
+            if(HDeptID == -1 || HDeptID == 0)
+            {
+                return GetEmployeeList_Json2(Employee, HGroupID);
+            }else
+            {
+                sWhere = $" Where HStopFlag=0  and HEndFlag=1  and HDeptID=${HDeptID}";
+                
+                if(Employee != "")
+                {
+                    sWhere += " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' )";
+                }
+                if(HGroupID != 0)
+                {
+                    sWhere += " and HGroupID=" + HGroupID.ToString();
+                }
+
+                try
+                {
+                    string sql = $"Select * from h_v_IF_Emp {sWhere} Order by HNumber";
+                    ds = oCN.RunProcReturn(sql, "h_v_IF_Emp");
+                    if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                    {
+                        // 濡傛灉 閫掑叆 閮ㄩ棬娌℃湁缁存姢浜哄憳鍒楄〃 鍒欓檷绾т娇鐢ㄨ�佹柟妗�
+                        return GetEmployeeList_Json2(Employee, HGroupID);
+                    }
+                    else
+                    {
+                        objjson.code = "0";
+                        objjson.count = 1;
+                        objjson.Message = "鑾峰彇鎴愬姛!";
+                        objjson.data = ds.Tables[0];
+                        return objjson;
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                    objjson.data = null;
+                    return objjson;
+                }
+
+            }
+        }
+        #endregion
+
 
         /// <summary>
         /// 鑾峰彇鑱屽憳鍒楄〃
         /// </summary>
         /// <returns></returns>
-        [Route("Web/GetEmployeeList_Json")]
-        [HttpGet]
-        public object GetEmployeeList_Json(string Employee, Int64 HGroupID)
+        // [Route("Web/GetEmployeeList_Json")]
+        // [HttpGet]
+        public object GetEmployeeList_Json2(string Employee, Int64 HGroupID)
         {
             sWhere = " Where HStopFlag=0  and HEndFlag=1";
             //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
@@ -1450,11 +1591,11 @@
             {
                 if (Employee != "")
                 {
-                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
+                    sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
                 }
                 else
                 {
-                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString();
+                    sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString();
                 }
             }
             try
@@ -1489,6 +1630,7 @@
             }
         }
 
+       
 
         /// <summary>
         /// 鑾峰彇鐝鍒楄〃
@@ -18335,6 +18477,229 @@
         }
         #endregion
 
+        #region 鐧芥爣鍩虹淇℃伅琛� 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+        /// <summary>
+        /// 淇濆瓨鐧芥爣鍩虹淇℃伅琛�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveSc_PackUnionBillBarCode_tempList")]
+        [HttpPost]
+        public object SaveSc_PackUnionBillBarCode_tempList([FromBody] JObject msg)
+        {
+            DataSet ds;
+            var _value = msg["msg"].ToString();
+            string msg3 = _value.ToString();
+            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg1 = sArray[0].ToString();
+            string msg2 = sArray[1].ToString();
+
+            //鏌ョ湅鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log("Sc_PackUnionBillBarCode_temp_Edit", 1, false, msg2))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+            Int64 HItemID = 0;
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+            ListModels oListModels = new ListModels();
+            try
+            {
+                WebAPI.DLL.ClsSc_PackUnionBillBarCode_temp_Ctl oBill = new WebAPI.DLL.ClsSc_PackUnionBillBarCode_temp_Ctl();
+                List<Model.ClsSc_PackUnionBillBarCode_temp_Model> lsmain = new List<Model.ClsSc_PackUnionBillBarCode_temp_Model>();
+                msg1 = msg1.Replace("\\", "");
+                msg1 = msg1.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Sc_PackUnionBillBarCode_temp(msg1);
+                foreach (Model.ClsSc_PackUnionBillBarCode_temp_Model oItem in lsmain)
+                {
+                    if (oItem.HMaterNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (oItem.HMaterName.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (!DBUtility.ClsPub.AllowNumber(oItem.HMaterNumber.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+
+                    ds = oCN.RunProcReturn("select * from  Sc_PackUnionBillBarCode_temp where   HMaterNumber='" + oItem.HMaterNumber.Trim() + "' and HUSEORGID= '" + oItem.HUSEORGID + "'  ", "Sc_PackUnionBillBarCode_temp");
+                    if (oItem.HMaterNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+                    //宸插鏍哥殑涓嶅厑璁镐繚瀛�
+                    if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜淇濆瓨锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    oItem.HMakeEmp = msg2; //鍒涘缓浜�
+
+                    oBill.oModel = oItem;
+                }
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.oModel.HInterID == 0)
+                {
+                    bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyByID(oBill.oModel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 鐧芥爣鍩虹淇℃伅琛ㄨ幏鍙栦俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetSc_PackUnionBillBarCode_tempDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetSc_PackUnionBillBarCode_tempDetail(string HID)
+        {
+            var model = LuBaoSevice.GetSc_PackUnionBillBarCode_tempBillDetail(HID);
+            return model;
+        }
+
+        /// <summary>
+        /// 鐧芥爣鍩虹淇℃伅琛� 鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetSc_PackUnionBillBarCode_temp")]
+        [HttpGet]
+        public object DeltetSc_PackUnionBillBarCode_temp(string HItemID, string user)
+        {
+            DataSet ds;
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_PackUnionBillBarCode_temp_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (string.IsNullOrWhiteSpace(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Sc_PackUnionBillBarCode_temp where HInterID=" + HItemID, "Sc_PackUnionBillBarCode_temp");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+
+                if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                oCN.RunProc("delete from Sc_PackUnionBillBarCode_temp where HInterID=" + HItemID);
+
+
+                oCN.Commit();//鎻愪氦浜嬪姟
+                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
+
 
         /// <summary>
         /// 鐢ㄥ叧鑱斿伐搴忚幏鍙栦俊鎭�
@@ -18653,7 +19018,8 @@
                     objjson.data = ds.Tables[0];
                     return objjson;
                 }
-            } catch (Exception e)
+            }
+            catch (Exception e)
             {
                 objjson.code = "0";
                 objjson.count = 0;
@@ -19804,7 +20170,7 @@
                 List<object> columnNameList = new List<object>();
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere + "Order by hmainid ";
+                string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 and HUSEORGID = "+OrganizationID + sWhere + "Order by hmainid ";
                 ds = oCN.RunProcReturn(sql, "h_v_Gy_GetSampleSchemeListView");
 
                 //娣诲姞鍒楀悕
@@ -19955,6 +20321,7 @@
             }
         }
 
+       
         /// <summary>
         /// 鏍规嵁鐗╂枡+宸ュ簭鑾峰彇妫�楠屾柟妗�
         /// </summary>
@@ -20005,21 +20372,69 @@
         /// <returns></returns>
         [Route("Web/GetCheckItemByCheckProjectID")]
         [HttpGet]
-        public object GetCheckItemByCheckProjectID(int CheckProjectID, int HBatchQty)
+        public object GetCheckItemByCheckProjectID(int CheckProjectID, int HBatchQty, int HMaterID, string HBillType)
         {
-            if (CheckProjectID <= 0)
-            {
-                objjson.code = "0";
-                objjson.count = 0;
-                objjson.Message = "妫�楠屾柟妗堟湭閫夋嫨";
-                objjson.data = null;
-                return objjson;
-            }
+            //if (CheckProjectID <= 0)
+            //{
+            //    objjson.code = "0";
+            //    objjson.count = 0;
+            //    objjson.Message = "妫�楠屾柟妗堟湭閫夋嫨";
+            //    objjson.data = null;
+            //    return objjson;
+            //}
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql = "exec h_p_Gy_GetQCCheckItemByProject " + CheckProjectID + "," + HBatchQty;
+                string sql = "exec h_p_Gy_GetQCCheckItemByProject " + CheckProjectID + "," + HBatchQty + "," + HMaterID + ",'" + HBillType + "'";
                 ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁妫�楠屾柟妗堜富鍐呯爜鑾峰彇妫�楠岄」鐩�,鍓嶉潰鐨勪細鎶婂厛鑾峰彇鐗╂枡鐨勯粯璁よ川妫�鏂规锛孉PP鍙牴鎹楠屾柟妗圛D鑾峰彇瀵瑰簲妫�楠岄」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetCheckItemByCheckProjectID_Sec")]
+        [HttpGet]
+        public object GetCheckItemByCheckProjectID_Sec(int CheckProjectID, int HBatchQty, int HMaterID, string HBillType)
+        {
+            //if (CheckProjectID <= 0)
+            //{
+            //    objjson.code = "0";
+            //    objjson.count = 0;
+            //    objjson.Message = "妫�楠屾柟妗堟湭閫夋嫨";
+            //    objjson.data = null;
+            //    return objjson;
+            //}
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = "exec h_p_Gy_GetQCCheckItemByProject_Sec " + CheckProjectID + "," + HBatchQty + "," + HMaterID + ",'" + HBillType + "'";
+                ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject_Sec");
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objjson.code = "0";
@@ -20279,6 +20694,7 @@
                 }
                 else
                 {
+                    sWhere = sWhere.Replace("\"", "''");
                     ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList");
                 }
 
@@ -20614,6 +21030,80 @@
             }
         }
 
+        #region
+        [Route("Web/GetMouldBillsList")]
+        [HttpGet]
+        public object GetMouldBillsList(string sWhere, string Type, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                string HView = "";
+                switch (Type)
+                {
+                    case "RC": // 妯″叿缁翠慨妫�楠屽崟
+                        HView = "h_v_Sc_MouldRepairCheckBillList";
+                        break;
+                    case "PG": // 妯″叿缁翠慨娲惧伐鍗�
+                        HView = "h_v_Sc_MouldRepairSendWorkBill";
+                        break;
+                    default:
+                        objjson.code = "0";
+                        objjson.count = 0;
+                        objjson.Message = "璁惧妯″潡绫诲瀷閿欒锛�";
+                        objjson.data = null;
+                        return objjson;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
+                if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //鏄惁绠$悊鍛�
+                {
+                    //涓嶆槸绠$悊鍛�
+                    sWhere += " and 鍒跺崟浜� = '" + user + "'";
+                }
+
+
+                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc, hmainid desc");
+                ds = oCN.RunProcReturn(sql, HView);
+                //娣诲姞鍒楀悕
+                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)
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇澶辫触,鏌ユ棤鏁版嵁";
+                    objjson.data = null;
+                    objjson.list = columnNameList;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    objjson.list = columnNameList;
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
+
         /// <summary>
         /// 鏌ヨ鍚勭被璁惧鍗曟嵁鍒楄〃锛堣澶囩偣妫�锛岃澶囩淮淇紝璁惧淇濆吇......锛�
         /// </summary>
@@ -20649,6 +21139,9 @@
                     case "XJ":
                         HView = "h_v_Sb_EquipPatrolCheckBillList";
                         break;
+                    case "PG": // 璁惧缁翠慨娲惧伐鍗�
+                        HView = "h_v_Sb_EquipRepairSendWorkBillList";
+                        break;
                     default:
                         objjson.code = "0";
                         objjson.count = 0;
@@ -20667,7 +21160,7 @@
                 }
 
 
-                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
+                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc, hmainid desc");
                 ds = oCN.RunProcReturn(sql, HView);
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -21067,6 +21560,50 @@
 
 
         /// <summary>
+        /// 鑾峰彇閫夊崟鍙风殑婧愬崟绫诲瀷 閫氳繃閫夊崟鍙峰崟鎹被鍨�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetHSourceBillTypeByBillType")]
+        [HttpGet]
+        public object GetHSourceBillTypeByBillType(string HBillType, int Num)
+        {
+            try
+            {
+                ClsCN oCn = new ClsCN();
+                DataSet oDs = new DataSet();
+                //鏈夌殑鍗曞瓙婧愬崟鍒嗕负绾㈣摑鍗�  0浠h〃钃濆崟  1浠h〃绾㈠崟
+                if (Num == 0)
+                {           //婧愬崟涓鸿摑鍗�
+                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HNumber='" + HBillType + "'and  HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet");
+                }
+                else if (Num == 1)
+                {          //婧愬崟涓虹孩鍗�
+                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HNumber='" + HBillType + "' and  HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet");
+                }
+                else if (Num == 2)
+                {       //涓嶅垎绾㈣摑鍗�
+                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HNumber='" + HBillType + "'", "Xt_BillSourceSet");
+                }
+
+                objjson.code = "1";
+                objjson.count = 1;
+                objjson.Message = "鑾峰彇鎴愬姛锛�";
+                objjson.data = oDs.Tables[0];
+                return objjson; ;
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触锛佸紓甯�" + e.ToString();
+                objjson.data = null;
+                return objjson; ;
+            }
+        }
+
+
+        /// <summary>
         /// 鑾峰彇閫夊崟鍙风殑婧愬崟绫诲瀷
         /// </summary>
         /// <returns></returns>
@@ -21098,114 +21635,116 @@
         }
         #region [浠庢暟鎹簱鍔犺浇鑿滃崟 APP]
 
-        //public class AppMenuLoad
-        //{
-        //    public string HitemID { get; set; } // 涓婚敭
-        //    public string HPartentID { get; set; } = "0"; // 鐖惰妭鐐笽D
-        //    public string HEntryID { get; set; } // 鑿滃崟鑺傜偣id
-        //    public string HIndex { get; set; }
-        //    public string HName { get; set; }
-        //    public string HMenuName { get; set; }
-        //    public string HPicNum { get; set; }
-        //    public string HShowMode { get; set; }
-        //    public string HTranslationText_English { get; set; }
-        //    public string HTranslationText_Spain { get; set; }
-        //    public string HMaker { get; set; }
-        //    public List<MenuLoad> childMenus { get; set; }
-        //}
-        //[Route("Web/MenuList_APP")]
-        //[HttpGet]
-        //public object MenuList_APP(string HMaker, string HType)
-        //{
-        //    try {
-        //        DataSet ds = oCN.RunProcReturn("exec h_p_Gy_MenuDefineSet_APP_Get" +
-        //            "@HMaker = '" + HMaker + "'" +
-        //            "@HType = '" + HType + "'"
-        //            , "h_p_Gy_MenuDefineSet_APP_Get");
+        public class AppMenuLoad
+        {
+            public string HitemID { get; set; } // 涓婚敭
+            public string HPartentID { get; set; } = "0"; // 鐖惰妭鐐笽D
+            public string HEntryID { get; set; } // 鑿滃崟鑺傜偣id
+            public string HIndex { get; set; }
+            public string HName { get; set; }
+            public string HMenuName { get; set; }
+            public string HPicNum { get; set; }
+            public string HShowMode { get; set; }
+            public string HTranslationText_English { get; set; }
+            public string HTranslationText_Spain { get; set; }
+            public string HMaker { get; set; }
+            public List<MenuLoad> childMenus { get; set; }
+        }
+        [Route("Web/MenuList_APP")]
+        [HttpGet]
+        public object MenuList_APP(string HMaker, string HType, string HMenuListName)
+        {
+            try
+            {
+                DataSet ds = oCN.RunProcReturn("exec [h_p_Gy_MenuDefineSet_APP_Get] " +
+                    "@HMaker = N'" + HMaker + "'," +
+                    "@HType = N'" + HType + "'," +
+                    "@HMenuListName = N'" + HMenuListName + "'"
+                    , "h_p_Gy_MenuDefineSet_APP_Get");
 
-        //        if((bool)ds.Tables[0].Rows[0]["returntype"] == true)
-        //        {
-        //            objJsonResult.code = "1";
-        //            objJsonResult.count = 1;
-        //            objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
-        //            objJsonResult.data = ds.Tables[1];
-        //            return objJsonResult;
-        //        }
-        //        else
-        //        {
-        //            objJsonResult.code = "0";
-        //            objJsonResult.count = 0;
-        //            objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
-        //            return objJsonResult;
-        //        }
+                if ((bool)ds.Tables[0].Rows[0]["returnType"] == true)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
+                    objJsonResult.data = ds.Tables[1];
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
+                    return objJsonResult;
+                }
 
-        //    }
-        //    catch(Exception e)
-        //    {
-        //        objJsonResult.code = "0";
-        //        objJsonResult.count = 0;
-        //        objJsonResult.Message = e.ToString();
-        //        objJsonResult.data = null;
-        //        return objJsonResult;
-        //    }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
 
-        //}
+        }
 
-        //[Route("Web/SetMenuList_APP")]
-        //[HttpPost]
-        //public object SetMenuList_APP([FromBody] JObject oMain)
-        //{
-        //    var _value = oMain["oMain"].ToString();
-        //    string msg1 = _value.ToString();
-        //    string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
-        //    try
-        //    {
-        //        string msg2 = sArray[0];
-        //        string user = sArray[1].ToString();
-        //        string MenuName = sArray[2].ToString();
-        //        string type = sArray[3].ToString();
+        [Route("Web/SetMenuList_APP")]
+        [HttpPost]
+        public object SetMenuList_APP([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            try
+            {
+                string msg2 = sArray[0];
+                string user = sArray[1].ToString();
+                string MenuName = sArray[2].ToString();
+                string type = sArray[3].ToString();
 
-        //        if (String.Equals(type, "APP", StringComparison.InvariantCultureIgnoreCase))
-        //        {
-        //            oCN.BeginTran();
-        //            List<AppMenuLoad> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AppMenuLoad>>(msg2);
-        //            string sql1 = "delete from Gy_MenuDefineSet_APP where HMenuName = '" + MenuName + "' and HMaker = '" + user + "'";
-        //            oCN.RunProcReturn(sql1, "Gy_MenuDefineSet_APP");
-        //            list.ForEach(one =>
-        //            {
-        //                string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" +
-        //               "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + one.HName +
-        //               "','" + MenuName + "','" + one.HPicNum + "','" + one.HShowMode + "','" + user + "')";
-        //                oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP");
-        //            });
+                if (String.Equals(type, "APP", StringComparison.InvariantCultureIgnoreCase))
+                {
+                    oCN.BeginTran();
+                    List<AppMenuLoad> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AppMenuLoad>>(msg2);
+                    string sql1 = "delete from Gy_MenuDefineSet_APP where HMenuName = '" + MenuName + "' and HMaker = '" + user + "'";
+                    oCN.RunProcReturn(sql1, "Gy_MenuDefineSet_APP");
+                    list.ForEach(one =>
+                    {
+                        string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" +
+                       "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + MenuName + "','"
+                       + one.HPicNum + "','" + one.HShowMode + "','" + user + "')";
+                        oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP");
+                    });
 
-        //            oCN.Commit();
+                    oCN.Commit();
 
-        //            objJsonResult.code = "1";
-        //            objJsonResult.count = 1;
-        //            objJsonResult.Message = "璁剧疆鎴愬姛锛�";
-        //            objJsonResult.data = null;
-        //            return objJsonResult;
-        //        }
-        //        else
-        //        {
-        //            objJsonResult.code = "0";
-        //            objJsonResult.count = 0;
-        //            objJsonResult.Message = "鏆備笉鏀寔璇ュ钩鍙拌缃嚜瀹氫箟鑿滃崟锛�";
-        //            objJsonResult.data = null;
-        //            return objJsonResult;
-        //        }
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "璁剧疆鎴愬姛锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    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;
-        //    }
-        //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
         #endregion
 
 
@@ -21241,7 +21780,7 @@
                 {
                     string sql1 = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Gy_MenuDefineSet where HMakeName=" +
                         "(select   top 1 c.GroupName  from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId  " +
-                        "left join System_UserGroup c on b.GroupId = c.GroupID  where a.Czymc ='"+HMakeName+"' order by len(c.GroupName ))";
+                        "left join System_UserGroup c on b.GroupId = c.GroupID  where a.Czymc ='" + HMakeName + "' order by len(c.GroupName ))";
                     ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");        //鏌ヨ鐢ㄦ埛缁戝畾鐨勮鑹� 鏄惁璁剧疆鑿滃崟淇℃伅 鍙栬鑹插悕绉版渶鐭殑涓�涓�
                     if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
                     {
@@ -21252,8 +21791,8 @@
                             sql = "Select HitemID,HNumber,HName,HPartentID,HLevel,Hurl,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain,HPicNum from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID  ";
                             ds = oCn.RunProcReturn(sql, "Gy_Menu_1");
                         }
-                            
-                    }                 
+
+                    }
                 }
 
                 for (int i = 0; i < ds.Tables[0].Rows.Count; i++)       //灏嗚彍鍗曠殑鏍硅妭鐐逛繚瀛樺埌鍒楄〃menu涓�
@@ -21455,7 +21994,7 @@
         {
             try
             {
-               
+
                 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
 
 
@@ -21547,7 +22086,7 @@
                         if (HPartentID == "0" || HPartentID == ds.Tables[0].Rows[0]["HItemID"].ToString())
                         {
                             string HPosition = ds.Tables[0].Rows[0]["HPosition"].ToString();
-                            sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "','"+ HTranslationText_English + "','" + HTranslationText_Spain + "')";
+                            sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "','" + HTranslationText_English + "','" + HTranslationText_Spain + "')";
                             oCN.RunProc(sql);
                         }
                         else
@@ -21591,7 +22130,7 @@
         //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
         [Route("Web/Xt_UserFastMenu_Display")]
         [HttpGet]
-        public object Xt_UserFastMenu_Display(string HMakeName, string HType,string HModelAtributos)
+        public object Xt_UserFastMenu_Display(string HMakeName, string HType, string HModelAtributos)
         {
             try
             {
@@ -21713,7 +22252,7 @@
                             string HCaption = ds.Tables[0].Rows[0]["HName"].ToString();
                             string HType = ds.Tables[0].Rows[0]["HType"].ToString();
 
-                            sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','"+ HModelAtributos + "')";
+                            sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','" + HModelAtributos + "')";
                             oCN.RunProc(sql);
                         }
                     }
@@ -21743,7 +22282,7 @@
         //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
         [Route("Web/Xt_UserFastMenu_Init")]
         [HttpGet]
-        public object Xt_UserFastMenu_Init(string HMakeName, string HType,string HModelAtributos)
+        public object Xt_UserFastMenu_Init(string HMakeName, string HType, string HModelAtributos)
         {
             try
             {
@@ -22143,7 +22682,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-                ds = oCN.RunProcReturn("Select * from Xt_BillType where HNumber = '" + HModuleType + "'", "Xt_BillType");
+                ds = oCN.RunProcReturn("Select * from Xt_BillType  with(nolock) where HNumber = '" + HModuleType + "'", "Xt_BillType");
 
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
@@ -22171,6 +22710,116 @@
                 return objjson;
             }
         }
+
+        #region 閫氳繃鍗曟嵁绫诲瀷銆佸崟鎹彿鏌ヨ鍗曟嵁淇℃伅
+        /// <summary>
+        /// 閫氳繃鍗曟嵁绫诲瀷鑾峰彇瀵瑰簲瑙嗗浘骞堕�氳繃鍗曟嵁鍙锋煡璇㈠崟鎹俊鎭�
+        /// </summary>
+        /// <param name="HBillNo"></param>
+        /// <param name="HBillType"></param>
+        /// <param name="HStoreOrgID"></param>
+        /// <returns></returns>
+        [Route("Web/GetBillInfo")]
+        [HttpGet]
+        public object GetBillInfo(string HBillNo, string HBillType, int HStockOrgID)
+        {
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("exec h_p_Gy_GetBillInfoByHBillTypeAndHBillNo N'" + HBillType + "',N'" + HBillNo +
+                    "'," + HStockOrgID, "h_p_Gy_GetBillInfoByHBillTypeAndHBillNo");
+
+                if (ds == null)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else if ((bool)ds.Tables[1].Rows[0]["returnType"] == false)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + ds.Tables[1].Rows[1]["payload"];
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
+
+        #region 閫氳繃鍗曟嵁绫诲瀷銆佸崟鎹唴鐮併�佸瓙鍐呯爜鏌ヨ鍗曟嵁淇℃伅
+        /// <summary>
+        /// 閫氳繃鍗曟嵁绫诲瀷鑾峰彇瀵瑰簲瑙嗗浘骞堕�氳繃鍗曟嵁鍙锋煡璇㈠崟鎹俊鎭�
+        /// </summary>
+        /// <param name="HBillNo"></param>
+        /// <param name="HBillType"></param>
+        /// <param name="HStoreOrgID"></param>
+        /// <returns></returns>
+        [Route("Web/GetBillInfo_GenerateBillCode")]
+        [HttpGet]
+        public object GetBillInfo_GenerateBillCode(string HBillType, string HInterID, int HEntryID)
+        {
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("exec h_p_Gy_GetBillInfo_GenerateCode N'" + HBillType + "'," + HInterID +
+                    "," + HEntryID, "h_p_Gy_GetBillInfo_GenerateCode");
+
+                if (ds == null)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else if ((bool)ds.Tables[1].Rows[0]["returnType"] == false)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + ds.Tables[1].Rows[1]["payload"];
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
 
 
         /// <summary>
@@ -22233,6 +22882,648 @@
             }
         }
 
-    }
+        #region 灏忓崼鐢靛櫒鑾峰彇鐗╂枡鏉$爜瀵瑰簲鍗曟嵁
+        /// <summary>
+        /// 灏忓崼鐢靛櫒鑾峰彇鐗╂枡鏉$爜瀵瑰簲鍗曟嵁
+        /// </summary>
+        /// <param name="sWhere">鑷畾涔夎繃婊ゆ潯浠�</param>
+        /// <param name="HBillType">鍗曟嵁鍙�</param>
+        /// <param name="HSourceBillType">婧愬崟鍙�</param>
+        /// <returns></returns>
+        [Route("web/XiaoWeiBarCodeQuery")]
+        [HttpGet]
+        public object XiaoWeiBarCodeQuery(string sWhere, int HBillType, int HSourceBillType)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("exec h_p_XiaoWeiBarCodeQuery '" + sWhere + "'," + HBillType + "," + HSourceBillType, "h_p_XiaoWeiBarCodeQuery");
 
+                if(ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "璇ョ墿鏂欐潯鐮佹棤瀵瑰簲鐨勫崟鎹�";
+                    objjson.data = null;
+                    return objjson;
+                }else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        #endregion
+
+
+        #region  璐圭敤椤圭洰  璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+        /// <summary>
+        ///  椤圭洰璐圭敤 淇濆瓨
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveGy_ItemMoney")]
+        [HttpPost]
+        public object SaveGy_ItemMoney([FromBody] JObject msg)
+        {
+            DataSet ds;
+            var _value = msg["msg"].ToString();
+            string msg3 = _value.ToString();
+            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg1 = sArray[0].ToString();
+            string msg2 = sArray[1].ToString();
+
+            //鏌ョ湅鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log("Gy_ItemMoney_Edit", 1, false, msg2))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+            Int64 HItemID = 0;
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            //鑾峰彇鏈�澶D鍊艰祴鍊�
+            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_ItemMoney_1 ", "Gy_ItemMoney_1");
+            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+            {
+                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+                maxid += 1;
+                HItemID = maxid;
+            }
+            ListModels oListModels = new ListModels();
+            try
+            {
+
+                WebAPI.DLL.ClsGy_ItemMoney_Ctl oBill = new WebAPI.DLL.ClsGy_ItemMoney_Ctl();
+                List<Model.ClsGy_ItemMoney_Model> lsmain = new List<Model.ClsGy_ItemMoney_Model>();
+                msg1 = msg1.Replace("\\", "");
+                msg1 = msg1.Replace("\n", "");
+                lsmain = oListModels.getObjectByJson_Gy_ItemMoney(msg1);
+                foreach (Model.ClsGy_ItemMoney_Model oItem in lsmain)
+                {
+                    if (oItem.HNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (oItem.HName.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+
+                    ds = oCN.RunProcReturn("select * from  Gy_ItemMoney_1 where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_ItemMoney_1");
+                    if (oItem.HNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    //鏂板鏃跺垽鏂�
+                    if (oItem.HItemID == 0)
+                    {
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
+                        {
+
+                        }
+                        else
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+                        string sParent;
+                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+                        if (sParent.Trim() == "")
+                        {
+                            oBill.oModel.HParentID = 0;
+                        }
+                        else
+                        {
+                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
+                            {
+                                oBill.oModel.HParentID = oBill.oModel.HItemID;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+                                objJsonResult.data = 1;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    else//缂栬緫鏃跺垽鏂�
+                    {
+                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+                        string sParent;
+                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+                        if (sParent.Trim() == "")
+                        {
+                            oBill.oModel.HParentID = 0;
+                        }
+                        else
+                        {
+                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+                            {
+                                oBill.oModel.HParentID = oBill.oModel.HItemID;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+                                objJsonResult.data = 1;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    //寰楀埌鐭唬鐮�
+                    string sShortNumber;
+                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+                    if (sShortNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+                    oItem.HEndFlag = true;//鏈骇鏍囧織
+                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+                    oItem.HMakeEmp = msg2; //鍒涘缓浜�
+
+                    oBill.oModel = oItem;
+                }
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.oModel.HItemID == 0)
+                {
+                    bResult = oBill.AddNew();
+                }
+                else
+                {
+                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 椤圭洰璐圭敤 鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetGy_ItemMoneyDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetGy_ItemMoneyDetail(string HID)
+        {
+            var model = LuBaoSevice.GetGy_ItemMoneyDetail(HID);
+            return model;
+        }
+
+        /// <summary>
+        /// 椤圭洰璐圭敤 鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetGy_ItemMoney")]
+        [HttpGet]
+        public object DeltetGy_ItemMoney(string HItemID, string user)
+        {
+            DataSet ds;
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_ItemMoney_Delete", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (string.IsNullOrWhiteSpace(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+
+                ds = oCN.RunProcReturn("select * from Gy_ItemMoney_1 where HItemID=" + HItemID, "Gy_ItemMoney_1");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                //鍒犻櫎鍓嶆帶鍒�=========================================      
+                string sql1 = "exec h_p_Gy_ItemMoney_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+                ds = oCN.RunProcReturn(sql1, "h_p_Gy_ItemMoney_BeforeDelCtrl");
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+                //================================================================================== 
+
+
+                oCN.RunProc("delete Gy_ItemMoney_1 where HItemID=" + HItemID);
+
+
+                //鍒犻櫎鍚庢帶鍒�=========================================      
+                string sql2 = "exec h_p_Gy_ItemMoney_AfterDelCtrl " + HItemID + ",'" + user + "'";
+                ds = oCN.RunProcReturn(sql2, "h_p_Gy_ItemMoney_AfterDelCtrl");
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+                //================================================================================== 
+
+                oCN.Commit();//鎻愪氦浜嬪姟
+                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 鐢ㄤ簬杩炴帴鐨勫仴搴峰害妫�楠岋紝鍙鑳借闂�氳繖涓帴鍙o紝鍒欒〃鏄庤繛鎺ュ彲鐢�
+        [Route("Health")]
+        [HttpGet]
+        public IHttpActionResult CheckHealth()
+        {
+            // 杩斿洖 200 鐘舵�佺爜 纭鍋ュ悍鐘舵��
+            return Ok();
+        }
+        #endregion
+
+        #region 鐧诲綍鐢ㄦ埛涓庤澶嘋lientID 鐨勫叧绯� 鍐欏叆鏁版嵁搴�
+        [Route("Web/SetGy_UserClientIdConnection")]
+        [HttpPost]
+        public object SetGy_UserClientIdConnection([FromBody] JObject msg)
+        {
+            DataSet ds;
+            oCN.BeginTran();
+            try
+            {
+                ds = oCN.RunProcReturn($@"exec h_p_SetGy_UserClientIdRelation 
+                @HUserbm=N'{msg["HUserbm"].ToString()}',
+	            @HUserName=N'{msg["HUserName"].ToString()}',
+	            @HClientID=N'{msg["HClientID"].ToString()}',
+                @HOnline={msg["HOnline"].ToString()}
+                ", "h_p_SetGy_UserClientIdRelation");
+                
+                if(ds.Tables[0].Rows[0]["HStatus"].ToString() == "1")
+                {
+                    oCN.Commit();
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨璁惧淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨璁惧淇℃伅澶辫触锛�" + ds.Tables[0].Rows[0]["msg"];
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }catch(Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨璁惧淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region APP 鏍规嵁妯″潡鑾峰彇璇ユā鍧椾笅闇�瑕佹樉绀烘秷鎭爣璇嗙殑瀛愭ā鍧�
+        [Route("Web/getMessageIdentified")]
+        [HttpGet]
+        public object getMessageIdentified(string user, string moduleName)
+        {
+            DataSet oDs = oCN.RunProcReturn($"exec h_p_getMessageIdentifier_APP '{user}', '{moduleName}'", "h_p_getMessageIdentifier_APP");
+            if(oDs == null || oDs.Tables[0].Rows.Count == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇娑堟伅鏍囪瘑澶辫触锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇娑堟伅鏍囪瘑鎴愬姛锛�";
+                objJsonResult.data = oDs.Tables[0];
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 妯″叿寰呬笂妯℃煡璇� 鑾峰彇
+        [Route("Web/getSc_MouldUpperAwaitQuery")]
+        [HttpGet]
+        public object getSc_MouldUpperAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+        {
+            if(HBeginDate == "") // 榛樿7澶╅棿璺�
+            {
+                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+            }
+
+            if(HEndDate == "")
+            {
+                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+            }
+            List<object> columnNameList = new List<object>();
+            try
+            {
+                DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldUpperAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldUpperAwaitQuery");
+                if(oDs == null || oDs.Tables[0].Rows.Count == 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+                    objjson.data = null;
+                    return objjson;
+                }else
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in oDs.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = oDs.Tables[0];
+                    objjson.list = columnNameList;
+                    return objjson;
+                }
+
+            }catch(Exception ex)
+            {
+                LogService.Write(ex.ToString());
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
+
+        #region 寰呭紑宸ュ垪琛� 鑾峰彇
+        [Route("Web/getCj_StationInBillAwaitQuery")]
+        [HttpGet]
+        public object getCj_StationInBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+        {
+            if (HBeginDate == "") // 榛樿7澶╅棿璺�
+            {
+                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+            }
+
+            if (HEndDate == "")
+            {
+                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+            }
+            List<object> columnNameList = new List<object>();
+            try
+            {
+                DataSet oDs = oCN.RunProcReturn($" exec h_p_Cj_StationInBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Cj_StationInBillAwaitQuery");
+                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in oDs.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = oDs.Tables[0];
+                    objjson.list = columnNameList;
+                    return objjson;
+                }
+
+            }
+            catch (Exception ex)
+            {
+                LogService.Write(ex.ToString());
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
+
+        #region 妯″叿寰呬笅妯℃煡璇� 鑾峰彇
+        [Route("Web/getSc_MouldLowerBillAwaitQuery")]
+        [HttpGet]
+        public object getSc_MouldLowerBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+        {
+            if (HBeginDate == "") // 榛樿7澶╅棿璺�
+            {
+                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+            }
+
+            if (HEndDate == "")
+            {
+                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+            }
+            List<object> columnNameList = new List<object>();
+            try
+            {
+                DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldLowerBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldLowerBillAwaitQuery");
+                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in oDs.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = oDs.Tables[0];
+                    objjson.list = columnNameList;
+                    return objjson;
+                }
+
+            }
+            catch (Exception ex)
+            {
+                LogService.Write(ex.ToString());
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        #endregion
+    }
 }

--
Gitblit v1.9.1