From f63d8ead25bdb3c32dacca817a059bd30390e9bc Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期三, 15 六月 2022 22:20:07 +0800
Subject: [PATCH] 1.系统账户数据库优化:   修改“账户类型”的数据类型为VARCHAR2(1024),多个角色时以半角“,”分隔。   加密盐。 密码加密优化;账户登录优化;角色权限管理(作废用户权限); 2.字典类型管理(定义:用户角色) 3.字典数据管理(初始化用户角色数据) 3.角色权限管理 4.系统账户管理,账户类型对应用户角色(可多选)。

---
 web/web/ExportDocument.aspx.cs |   82 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/web/web/ExportDocument.aspx.cs b/web/web/ExportDocument.aspx.cs
index 0d28a08..213dc99 100644
--- a/web/web/ExportDocument.aspx.cs
+++ b/web/web/ExportDocument.aspx.cs
@@ -10,20 +10,30 @@
 
 public partial class ExportDocument : PageBase<SysUser>, IRequiresSessionState
 {
-    
+
+    private int _userId = -1;
+    private string _userType = "";
+    private string _account = "";
 
     protected void Page_Load(object sender, EventArgs e)
     {
+        _userId = this.AppContext.SessionObject.UserID;
+        _userType = this.AppContext.SessionObject.UserType;
+        _account = this.AppContext.SessionObject.Account;
+
         switch (this.AppContext.GetString("action"))
         {
             case "exPortGwSp":
-                this.ExPortGwSp();
+                this.ExPortGwSp(); 
                 break;
             case "exPortGwSm":
                 this.ExportGwSmData();
                 break;
             case "exportGwStatisV3"://瀵煎嚭缁熻鎶ヨ〃
                 this.ExprortGwStatisV3();
+                break;
+            case "exportGwClient":  //瀵煎嚭瀹㈡埛淇℃伅
+                this.ExportGwClientData();
                 break;
         }
     }
@@ -45,6 +55,8 @@
         string statistype = this.AppContext.GetString("Statistype");
         StatisOption statisoption = (StatisOption)this.AppContext.GetInt("Statisoption");
 
+        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
+
         List<GwOp> opList;
 
         using (GwOpDao dao = new GwOpDao())
@@ -56,7 +68,7 @@
 
         using (GwClientDao dao = new GwClientDao())
         {
-            clientList = dao.LoadInfoList("", "", "", "");
+            clientList = dao.LoadInfoList("", "", "", "", permissionsSQL);
         }
 
         List<GwAp> apList;
@@ -68,8 +80,9 @@
             apList = dao.LoadInfoList("", "", "", out recordCount, 99999, 1);
         }
 
+
         GwStatisV3Dao _Dao = new GwStatisV3Dao();
-        var list = _Dao.Query(Convert.ToDateTime(beginTime), Convert.ToDateTime(endTime), clientId, spid, apMid, opid, statistype, (StatisOption)statisoption);
+        var list = _Dao.Query(Convert.ToDateTime(beginTime), Convert.ToDateTime(endTime), clientId, spid, apMid, opid, statistype, permissionsSQL, (StatisOption)statisoption);
 
         List<Model.GwStatisV3> statisList = new List<Model.GwStatisV3>();
         foreach (GwStatisV3Item item in list)
@@ -183,7 +196,7 @@
 
         Model.GwClient x = clientlist.Find(delegate(Model.GwClient client) { return client.ClientID == clientID; });
 
-        return x == null ? string.Format("{0}", clientID) : string.Format("{0}-{1}", x.ClientID, x.ClientName);
+        return x == null ? string.Format("{0}", clientID) : string.Format("{0}-{1}", x.ClientID, x.Company);
     }
 
 
@@ -307,7 +320,7 @@
             WebTool webTool = new WebTool();
             Dictionary<string, string> dictionary = new Dictionary<string, string>();
             dictionary["AP娑堟伅ID"] = "AP_MID";
-            dictionary["浠g悊鍟�"] = "CLIENT_ID";
+            dictionary["瀹㈡埛ID"] = "CLIENT_ID";
             dictionary["璐﹀彿"] = "SP_ID";
             dictionary["鎺ュ叆鐐笽D"] = "AP_ID";
             dictionary["閫氶亾鍚�"] = "OP_NAME";
@@ -333,4 +346,61 @@
             webTool.Export(dataTable, dictionary, "鏃ュ織_" + sDate, this.Context.Response);
         }
     }
+
+    //瀵煎嚭瀹㈡埛淇℃伅
+    private void ExportGwClientData()
+    {
+
+        string ClientID = this.AppContext.GetString("ClientID");
+        string Company = this.AppContext.GetString("Company");
+        string ClientName = this.AppContext.GetString("ClientName");
+        string Telephone = this.AppContext.GetString("Telephone");
+        string Salesman = this.AppContext.GetString("Salesman");
+        string SupportStaff = this.AppContext.GetString("SupportStaff");
+        string ProductId = this.AppContext.GetString("ProductId");
+        string Agent = this.AppContext.GetString("Agent");
+        int IsEnable = this.AppContext.GetInt("IsEnable", -1);
+
+        int pageIndex = this.AppContext.GetInt("pageIndex", 1);
+        int recordCount = 0;
+        int pageSize = this.AppContext.GetInt("pageSize", 999999999);
+
+        string str = "";
+        using (GwClientDao dao = new GwClientDao())
+        {
+            string permissionsSQL = dao.GetClientPermissions(_userId, _userType, "gwc");
+            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable, permissionsSQL);
+            if (recordCount> 1000000)
+            {
+                this.Response.Write("<script type='text/javascript'>alert('瀵煎嚭鏁版嵁涓嶈兘澶т簬100涓囨潯锛�');location.href='GwClient.aspx?IsEnable=" + IsEnable + "';</script>");
+                this.Response.End();
+
+            }
+
+            DataTable dataTable = dao.LoadClientDataTable(ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable, permissionsSQL);
+
+            WebTool webTool = new WebTool();
+            Dictionary<string, string> dictionary = new Dictionary<string, string>();
+            dictionary["瀹㈡埛璐﹀彿"] = "CLIENT_ID";
+            dictionary["鍏徃鍚嶇О"] = "COMPANY";
+            dictionary["鑱旂郴浜�"] = "CLIENT_NAME";
+            dictionary["鑱旂郴鐢佃瘽"] = "TELEPHONE";
+            dictionary["璐︽埛浣欓(鍏�)"] = "BALANCE";  //宸查櫎浠�1000
+            dictionary["绱鍏呭��(鍏�)"] = "TOP_UP_AMOUNT_TOTAL";  //宸查櫎浠�1000
+            dictionary["涓氬姟鍛�"] = "SALESMAN_NAME";
+            dictionary["宸插垎閰嶄釜鎬т骇鍝�(澶氫釜鎸夆��,鈥濆垎闅�) "] = "PRODUCT_IDS";
+            dictionary["鐘舵�� "] = "Is_Enable";
+
+            string isEnableStr = "";
+            if (IsEnable == 1)
+            {
+                isEnableStr = "姝e父";
+            }
+            else
+            {
+                isEnableStr = "鍋滅敤";
+            }
+            webTool.Export(dataTable, dictionary, isEnableStr + "瀹㈡埛淇℃伅_" + DateTime.Now, this.Context.Response);
+        }
+    }
 }

--
Gitblit v1.9.1