From 409529b1a6e7478d691e95f84713bdd5ad5ffed2 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期二, 05 八月 2025 19:05:14 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/WebAPIController.cs |  164 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 148 insertions(+), 16 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index be986be..ab5325f 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -343,6 +343,8 @@
         {
             try
             {
+                string sErrMsg = "";
+                oSystemParameter.ShowBill(ref sErrMsg);
                 DataSet ds = null;
                 ClsCN oCnLoc = new ClsCN();
                 DAL.ClsUser oUser = new DAL.ClsUser();
@@ -368,14 +370,18 @@
                 string sql = string.Format(@" select a.* from Gy_UserByOrgRelation a
                                               where a.HUserID = '{0}' and a.HOrgID = '{1}'", UserName, HOrgName);
                 DataSet _ds = oCnLoc.RunProcReturn(sql, "h_p_Xt_UserRelationOrg_Check");
-                //if (_ds == null || _ds.Tables[0].Rows.Count == 0)
-                //{
-                //    objjson.code = "0";
-                //    objjson.count = 0;
-                //    objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�";
-                //    objjson.data = null;
-                //    return objjson;
-                //}
+
+                if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
+                {
+                    if (_ds == null || _ds.Tables[0].Rows.Count == 0)
+                    {
+                        objjson.code = "0";
+                        objjson.count = 0;
+                        objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�";
+                        objjson.data = null;
+                        return objjson;
+                    }
+                }                
 
                 objjson.code = "0";
                 objjson.count = 1;
@@ -18600,7 +18606,7 @@
                 ClsCN oCn = new ClsCN();
                 DataSet oDs = new DataSet();
                 //==========
-                oDs = oCn.RunProcReturn("select HItemID ID,Hname Name,HStopflag Stopflag from Xt_ORGANIZATIONS", "Xt_ORGANIZATIONS");
+                oDs = oCn.RunProcReturn("select HItemID ID,Hname Name,HStopflag Stopflag from Xt_ORGANIZATIONS with(nolock)", "Xt_ORGANIZATIONS");
                 objjson.code = "1";
                 objjson.count = 1;
                 objjson.Message = "鑾峰彇鎴愬姛锛�";
@@ -19220,6 +19226,60 @@
         }
 
         /// <summary>
+        /// 鏍规嵁妯″叿浠撳簱缂栧彿鑾峰彇妯″叿鏁版嵁
+        /// </summary>
+        /// <param name="sWhere">绛涢�夋潯浠�</param>
+        /// <param name="user">鎿嶄綔鐢ㄦ埛</param>
+        /// <param name="Organization">缁勭粐</param>
+        /// <returns>妯″叿鏁版嵁娓呭崟</returns>
+        [Route("Web/Get_Sc_MouldStatusAnalysisList")]
+        [HttpGet]
+        public object Get_Sc_MouldStatusAnalysisList(string sWhere, string user, string Organization)
+        {
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("Select * from h_v_Sc_MouldStatusAnalysisList where 1=1 Order by HInterID DESC", "h_v_Sc_MouldStatusAnalysisList");
+                }
+                else
+                {
+                    string sql1 = "Select * from h_v_Sc_MouldStatusAnalysisList where 1=1  ";
+                    string sql = sql1 + sWhere + " Order by HInterID DESC";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldStatusAnalysisList");
+                }
+
+
+                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>
         /// 鑾峰彇鍣ㄥ叿鍒楄〃
         /// </summary>
         /// <returns></returns>
@@ -19330,6 +19390,51 @@
 
 
 
+        }
+
+        /// <summary>
+        /// 鑾峰彇宸℃椤圭洰鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetPatrolCheckItemList_Json")]
+        [HttpGet]
+        public object GetPatrolCheckItemList_Json(string CheckItem)
+        {
+            DataSet ds;   
+            try
+            {
+                sWhere = " Where HStopFlag=0 and HEndFlag=1";
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if(CheckItem != "" && CheckItem != null)
+                {
+                    sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) ";
+                }
+                ds = oCN.RunProcReturn("Select HItemID,HNumber,HName  from Gy_PatrolCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck");
+                if(ds == null )
+                {
+                    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>
@@ -19869,7 +19974,7 @@
                 {
                     objjson.code = "0";
                     objjson.count = 0;
-                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.Message = "鑾峰彇澶辫触,鏈缃粯璁ゆ楠屾柟妗�";
                     objjson.data = null;
                     return objjson;
                 }
@@ -20429,7 +20534,7 @@
                 {
                     objjson.code = "0";
                     objjson.count = 0;
-                    objjson.Message = "鑾峰彇澶辫触,鏌ユ棤鏁版嵁" + DBUtility.ClsPub.sErrInfo;
+                    objjson.Message = "鑾峰彇澶辫触,鏄庣粏鏌ユ棤鏁版嵁";
                     objjson.data = null;
                     return objjson;
                 }
@@ -20539,6 +20644,9 @@
                         break;
                     case "QD":
                         HView = "h_v_Sb_EquipRepairSignBillList";
+                        break;
+                    case "XJ":
+                        HView = "h_v_Sb_EquipPatrolCheckBillList";
                         break;
                     default:
                         objjson.code = "0";
@@ -21024,8 +21132,14 @@
                     ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");        //鏌ヨ鐢ㄦ埛缁戝畾鐨勮鑹� 鏄惁璁剧疆鑿滃崟淇℃伅 鍙栬鑹插悕绉版渶鐭殑涓�涓�
                     if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
                     {
-                        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");
+                        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 = 'admin' and HType = '" + HType + "' order by HPosition";
+                        ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");   //鏌ヨadmin 鏄惁璁剧疆鑿滃崟淇℃伅
+                        if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
+                        {
+                            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");
+                        }
+                            
                     }                 
                 }
 
@@ -21224,18 +21338,36 @@
         //鑾峰彇鎵�鏈夋ā鍧楅〉闈�
         [Route("Web/ModePageList")]
         [HttpGet]
-        public object ModePageList()
+        public object ModePageList(string HMakeName, string HType)
         {
             try
             {
                
                 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-                ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where isnull(Hurl,'')  like'%html%'  Order by HItemID ", "Gy_Menu");     //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏�
+
+
+                string sql = "select *  from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HType + "' and isnull(Hurl,'')  like'%html%' order by HPosition";
+                ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet");        //鏌ヨ褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鑿滃崟鏁版嵁
+                if (ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0) //鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鏈夎缃繃鑷畾涔変俊鎭紝鑻ヨ褰曟暟涓�0锛屽垯娌℃湁璁剧疆杩囷紝鍔犺浇鎵�鏈夌殑鑿滃崟淇℃伅
+                {
+                    string sql1 = "select * 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 )) and isnull(Hurl,'')  like'%html%'";
+                    ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");        //鏌ヨ鐢ㄦ埛缁戝畾鐨勮鑹� 鏄惁璁剧疆鑿滃崟淇℃伅 鍙栬鑹插悕绉版渶鐭殑涓�涓�
+                    if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
+                    {
+                        sql = "Select * from h_v_Gy_Menu_1   Order by HPosition,len(HitemID),HitemID  ";
+                        ds = oCn.RunProcReturn(sql, "Gy_Menu_1");
+                    }
+                }
+
+
+                //ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where isnull(Hurl,'')  like'%html%'  Order by HItemID ", "Gy_Menu_1");     //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏�
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鏌ヨ鎴愬姛锛�";
-                objJsonResult.data = ds;
+                objJsonResult.data = ds.Tables[0];
                 return objJsonResult;
             }
             catch (Exception e)

--
Gitblit v1.9.1