From 737fef976ec1c6b79195fd5c55ece01053373674 Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 30 六月 2022 12:53:26 +0800
Subject: [PATCH] 订单日期查询优化

---
 web/web/GwStatisV3.aspx.cs |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/web/web/GwStatisV3.aspx.cs b/web/web/GwStatisV3.aspx.cs
index 315b738..db696dd 100644
--- a/web/web/GwStatisV3.aspx.cs
+++ b/web/web/GwStatisV3.aspx.cs
@@ -14,7 +14,12 @@
     private List<GwOp> OpList;
     private List<GwClient> ClientList;
     private List<GwAp> ApList;
- 
+
+    private int _userId = -1;
+    private string _userType = "";
+    private string _account = "";
+    string permissionsSQL = null;
+
     public StatisOption SelectedOptions { get; set; }
 
     public DateTime StartTime { get; set; }
@@ -34,10 +39,18 @@
     protected void Page_Load(object sender, EventArgs e)
     {
         this.CheckRight("502", FailedOperation.ErrorMsgOnly);
+
+        _userId = this.AppContext.SessionObject.UserID;
+        _userType = this.AppContext.SessionObject.UserType;
+        _account = this.AppContext.SessionObject.Account;
+        permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
+
         using (GwOpDao gwOpDao = new GwOpDao())
             this.OpList = gwOpDao.LoadInfoList();
         using (GwClientDao gwClientDao = new GwClientDao())
-            this.ClientList = gwClientDao.LoadInfoList("", "", "", "");
+        {
+            this.ClientList = gwClientDao.LoadInfoList("", "", "", "", permissionsSQL);
+        }
         using (GwApDao gwApDao = new GwApDao())
             this.ApList = gwApDao.LoadInfoList();
         if (this.IsPostBack)
@@ -75,7 +88,7 @@
             return string.Empty;
         GwClient gwClient = this.ClientList.Find((Predicate<GwClient>)(client => client.ClientID == clientID));
         if (gwClient != null)
-            return string.Format("{0}-{1}", (object)gwClient.ClientID, (object)gwClient.ClientName);
+            return string.Format("{0}", (object)gwClient.ClientName);
         return string.Format("{0}", (object)clientID);
     }
 
@@ -127,7 +140,7 @@
             foreach (GwClient gwClient in this.ClientList)
             {
                 if (this.AppContext.HasRight("502"))
-                    stringBuilder.AppendFormat("<option value=\"{0}\" {2}>{0}-{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName, gwClient.ClientID == this.SelectedClientID ? (object)"selected" : (object)"");
+                    stringBuilder.AppendFormat("<option value=\"{0}\" {2}>{0}-{1}</option>", (object)gwClient.ClientID, (object)gwClient.Company, gwClient.ClientID == this.SelectedClientID ? (object)"selected" : (object)"");
             }
         }
         return stringBuilder.ToString();
@@ -138,7 +151,7 @@
         StringBuilder stringBuilder = new StringBuilder();
         using (GwSpDao gwSpDao = new GwSpDao())
         {
-            List<GwSp> list = gwSpDao.LoadInfoList("", "", "");
+            List<GwSp> list = gwSpDao.LoadInfoList("", "", "", permissionsSQL);
             if (list.Count == 0)
             {
                 stringBuilder.Append("<option value=\"\">鏆傛棤瀹㈡埛淇℃伅</option>");

--
Gitblit v1.9.1