yzh
2022-05-23 94f6f81692eee7567e24be26e63bc30460307cbd
客户归属权限优化
17个文件已修改
126 ■■■■ 已修改文件
web/Dao/GwClientDao.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwSpDao.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwStatisV3Dao.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/ExportDocument.aspx.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.aspx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwMoRoute.aspx.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwSp.ashx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwStatis.aspx.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwStatisProfit.aspx.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwStatisRefund.aspx.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwStatisV3.ashx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwStatisV3.aspx.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/gwspupdate.aspx.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientDao.cs
@@ -107,7 +107,7 @@
        /**
         * 查询统计功能
         */
        public List<GwClient> LoadInfoList(string clientID, string clientName, string company, string agent)
        public List<GwClient> LoadInfoList(string clientID, string clientName, string company, string agent, string permissionsSQL)
        {
            
@@ -141,6 +141,10 @@
                    ((DbParameter)oracleParameterArray[3]).Value = (object)("%" + agent + "%");
                    stringBuilder.Append(" and Agent like :Agent");
                }
                //客户权限SQL脚本
                stringBuilder.Append(permissionsSQL);
                stringBuilder.Append(" order by CREATE_TIME DESC,CLIENT_ID DESC");
                using (OracleDataReader reader = OracleHelper.ExecuteReader("select * " + stringBuilder.ToString(), OracleHelper.Connection, oracleParameterArray))
                {
web/Dao/GwSpDao.cs
@@ -208,7 +208,7 @@
      return OracleHelper.Execute(PubConstant.doOracleSql(100000, stringBuilder.ToString()).ToString(), OracleHelper.Connection, oracleParameterArray);
    }
    public List<GwSp> LoadInfoList(string spId, string apId, string clientId)
    public List<GwSp> LoadInfoList(string spId, string apId, string clientId, string permissionsSQL)
    {
      List<GwSp> list1 = new List<GwSp>();
      StringBuilder stringBuilder = new StringBuilder();
@@ -232,6 +232,10 @@
        list2.Add(new OracleParameter(":ClientID", (object) clientId));
        stringBuilder.Append(" and CLIENT_ID=:ClientID");
      }
            //客户权限SQL脚本
            stringBuilder.Append(permissionsSQL);
      stringBuilder.Append(" order by SP_ID DESC");
      using (OracleDataReader reader = OracleHelper.ExecuteReader("select * " + stringBuilder.ToString(), OracleHelper.Connection, list2.ToArray()))
      {
web/Dao/GwStatisV3Dao.cs
@@ -18,6 +18,7 @@
      return OracleHelper.Execute("SELECT * FROM\r\n(\r\nselect STATIS_TIME,\r\nNVL(SUM(AP_STATUS0),0) as AP_STATUS0,\r\nNVL(SUM(AP_STATUS1),0) as AP_STATUS1,\r\nNVL(SUM(AP_STATUS2),0) as AP_STATUS2,\r\nNVL(SUM(AP_STATUS3),0) as AP_STATUS3,\r\nNVL(SUM(AP_STATUS4),0) as AP_STATUS4,\r\nNVL(SUM(AP_STATUS5),0) as AP_STATUS5\r\n from GW_SM_STATIS_V3 where CLIENT_ID=:CLIENT_ID GROUP BY STATIS_TIME ORDER BY STATIS_TIME DESC) WHERE ROWNUM < 30 ORDER BY STATIS_TIME ASC", OracleHelper.Connection, new OracleParameter(":CLIENT_ID", (object) clientID));
    }
    //public List<GwStatisV3Item> Query(DateTime startTime, DateTime endTime, string clientID, string spID, string apID, string opID, string timeExpression, StatisOption so)
    public List<GwStatisV3Item> Query(DateTime startTime, DateTime endTime, string clientID, string spID, string apID, string opID, string timeExpression, string permissionsSQL, StatisOption so)
    {
      List<GwStatisV3Item> list = new List<GwStatisV3Item>();
web/Lib/Dao.dll
Binary files differ
web/Lib/Dao.pdb
Binary files differ
web/web/Bin/Dao.dll
Binary files differ
web/web/Bin/Dao.pdb
Binary files differ
web/web/ExportDocument.aspx.cs
@@ -11,9 +11,16 @@
public partial class ExportDocument : PageBase<SysUser>, IRequiresSessionState
{
    
    private int _userId = -1;
    private int _userType = -1;
    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":
@@ -45,6 +52,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 +65,7 @@
        using (GwClientDao dao = new GwClientDao())
        {
            clientList = dao.LoadInfoList("", "", "", "");
            clientList = dao.LoadInfoList("", "", "", "", permissionsSQL);
        }
        List<GwAp> apList;
@@ -68,8 +77,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)
web/web/GwClient.aspx
@@ -334,7 +334,7 @@
                        <div class="form-group">
                            <label class="control-label  col-sm-2">
                                公司名称(全称)
                                客户名称 <span style="color:red">*</span>
                            </label>
                            <div class="col-sm-4">
                                <input type="text" name="company" id="company" value="" class="form-control" />
@@ -352,11 +352,12 @@
                            </div>
                            <div class="col-sm-6">
                                <a class="btn btn-xs btn-primary action-generate-password ">生成密码</a>
                                <a class="btn btn-xs btn-success action-generate-password ">复制密码</a>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-2">
                                客户名称 <span style="color:red">*</span>
                                联系人 <span style="color:red">*</span>
                            </label>
                            <div class="col-sm-4">
                                <input type="text" name="clientName" id="clientName" value="" class="form-control" />
web/web/GwMoRoute.aspx.cs
@@ -13,6 +13,10 @@
{
    private List<GwOp> OpList;
 
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    public GwSp GwSp { get; protected set; }
    public string SpID
@@ -30,6 +34,11 @@
    protected void Page_Load(object sender, EventArgs e)
    {
        this.CheckRight("306", FailedOperation.ErrorMsgOnly);
        _userId = this.AppContext.SessionObject.UserID;
        _userType = this.AppContext.SessionObject.UserType;
        _account = this.AppContext.SessionObject.Account;
        using (GwSpDao gwSpDao = new GwSpDao())
        {
            if (!string.IsNullOrEmpty(this.SpID))
@@ -83,7 +92,9 @@
        StringBuilder stringBuilder = new StringBuilder();
        using (GwSpDao gwSpDao = new GwSpDao())
        {
            List<GwSp> list = gwSpDao.LoadInfoList("", "", "");
            string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
            List<GwSp> list = gwSpDao.LoadInfoList("", "", "", permissionsSQL);
            if (list.Count == 0)
            {
                stringBuilder.Append("<option value=\"\">暂无帐号</option>");
web/web/GwSp.ashx
@@ -57,8 +57,10 @@
        {
            if (this._ClientList == null)
            {
                using (GwClientDao gwClientDao = new GwClientDao())
                    this._ClientList = gwClientDao.LoadInfoList("", "", "", "");
                using (GwClientDao gwClientDao = new GwClientDao()) {
                    string permissionsSQL = gwClientDao.GetClientPermissions(_userId, _userType, null);
                    this._ClientList = gwClientDao.LoadInfoList("", "", "", "", permissionsSQL);
                 }
            }
            return this._ClientList;
        }
web/web/GwStatis.aspx.cs
@@ -17,6 +17,10 @@
    private List<GwClient> ClientList;
    private List<GwAp> ApList;
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    string permissionsSQL = null;
   
    public StatisOption SelectedOptions { get; set; }
@@ -38,10 +42,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)
@@ -147,7 +159,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>");
web/web/GwStatisProfit.aspx.cs
@@ -15,7 +15,10 @@
    private List<GwClient> ClientList;
    private List<GwAp> ApList;
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    string permissionsSQL = null;
    public StatisOption SelectedOptions { get; set; }
@@ -32,10 +35,13 @@
    protected void Page_Load(object sender, EventArgs e)
    {
        this.CheckRight("502", FailedOperation.ErrorMsgOnly);
        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)
@@ -70,7 +76,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>");
web/web/GwStatisRefund.aspx.cs
@@ -12,6 +12,11 @@
public partial class _GwStatisRefund : PageBase<SysUser>, IRequiresSessionState
{
    
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    string permissionsSQL = null;
    public string SelectedSpID { get; set; }
    public string StatisType { get; set; }
@@ -25,6 +30,7 @@
    protected void Page_Load(object sender, EventArgs e)
    {
        this.CheckRight("502", FailedOperation.ErrorMsgOnly);
        permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
        if (this.IsPostBack)
            return;
        this.SelectedOptions = StatisOption.None;
@@ -38,7 +44,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>");
web/web/GwStatisV3.ashx
@@ -82,6 +82,8 @@
        string statistype = context.GetString("statistype");
        StatisOption statisoption = (StatisOption)context.GetInt("statisoption");
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
        List<GwOp> opList;
        
        using (GwOpDao dao = new GwOpDao())
@@ -93,7 +95,7 @@
        
        using (GwClientDao dao = new GwClientDao())
        {
             clientList = dao.LoadInfoList("", "", "", "");
             clientList = dao.LoadInfoList("", "", "", "", permissionsSQL);
        }
        
        List<GwAp> apList;
@@ -105,9 +107,9 @@
             apList = dao.LoadInfoList("", "", "", out recordCount, 99999, 1);
        }
        
        //根据系统用户获取有权限客户
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
        //var list = _Dao.Query(beginTime, endTime, clientID, spID, apID, opID, statistype, (StatisOption)statisoption);
        
        //根据系统用户获取有权限客户
        var list = _Dao.Query(beginTime, endTime, clientID, spID, apID, opID, statistype, permissionsSQL, (StatisOption)statisoption);
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
web/web/GwStatisV3.aspx.cs
@@ -15,6 +15,11 @@
    private List<GwClient> ClientList;
    private List<GwAp> ApList;
 
    private int _userId = -1;
    private int _userType = -1;
    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);
    }
@@ -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>");
web/web/gwspupdate.aspx.cs
@@ -14,6 +14,9 @@
    protected List<GwOp> OpList;
    protected List<GwProduct> GwProductList;
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    public GwSp GwSp { get; protected set; }
@@ -38,6 +41,10 @@
    protected void Page_Load(object sender, EventArgs e)
    {
        _userId = this.AppContext.SessionObject.UserID;
        _userType = this.AppContext.SessionObject.UserType;
        _account = this.AppContext.SessionObject.Account;
        using (GwApDao gwApDao = new GwApDao())
            this.ApList = gwApDao.LoadInfoList();
        using (GwOpDao gwOpDao = new GwOpDao())
@@ -185,8 +192,9 @@
    {
        using (GwClientDao gwClientDao = new GwClientDao())
        {
            string permissionsSQL = gwClientDao.GetClientPermissions(_userId, _userType, null);
            string str = "";
            List<GwClient> list = gwClientDao.LoadInfoList("", "", "", "");
            List<GwClient> list = gwClientDao.LoadInfoList("", "", "", "", permissionsSQL);
            if (list.Count == 0)
            {
                str += string.Format("<option value=\"\">尚未创建客户信息</option>");
@@ -194,7 +202,7 @@
            else
            {
                foreach (GwClient gwClient in list)
                    str = !(clientId == gwClient.ClientID) ? str + string.Format("<option value=\"{0}\">{0}-{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName) : str + string.Format("<option value=\"{0}\" selected>{0}-{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName);
                    str = !(clientId == gwClient.ClientID) ? str + string.Format("<option value=\"{0}\">{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName) : str + string.Format("<option value=\"{0}\" selected>{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName);
            }
            return str;
        }