From 203edd6bbdf883e897a0075037a4ef68cd519ac9 Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 23 六月 2022 00:07:56 +0800
Subject: [PATCH] 系统账户管理列表用户角色显示优化
---
web/web/ExportDocument.aspx.cs | 88 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 80 insertions(+), 8 deletions(-)
diff --git a/web/web/ExportDocument.aspx.cs b/web/web/ExportDocument.aspx.cs
index 0effa22..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);
}
@@ -303,13 +316,14 @@
this.Response.End();
}
DataTable dataTable = gwSmDao.LoadSpDataTable(apMid, opName, clientId, spid, mobile, sDate, beginTime, endTime, content, @int, opstat);
+
WebTool webTool = new WebTool();
Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary["AP娑堟伅ID"] = "AP_MID";
- dictionary["CLTID"] = "CLIENT_ID";
+ dictionary["瀹㈡埛ID"] = "CLIENT_ID";
dictionary["璐﹀彿"] = "SP_ID";
- dictionary["APID"] = "AP_ID";
- dictionary["OPID"] = "OP_ID";
+ dictionary["鎺ュ叆鐐笽D"] = "AP_ID";
+ dictionary["閫氶亾鍚�"] = "OP_NAME";
dictionary["鐮佸彿"] = "ACCESS_CODE";
dictionary["鎺ユ敹鍙风爜"] = "MOBILE";
dictionary["PKN "] = "PK_NUMBER";
@@ -328,7 +342,65 @@
dictionary["鐘舵�佹姤鍛婂洖鎵ф椂闂�"] = "OP_DELIVER_TIME";
dictionary["鍐呭"] = "MSG_CONTENT";
dictionary["鐘舵��"] = "STAT";
+ dictionary["鑰楁椂"] = "OUT_TIME";
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