From 3b18a48485f7207438d9d0eb3038d979e069431d Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 26 五月 2022 17:58:18 +0800
Subject: [PATCH] 优化产品及产品分类,订单,对称加密,IP转地区名称

---
 web/web/GwSp.ashx |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/web/web/GwSp.ashx b/web/web/GwSp.ashx
index 0a168f7..25423cb 100644
--- a/web/web/GwSp.ashx
+++ b/web/web/GwSp.ashx
@@ -21,6 +21,10 @@
     private List<GwStrategy> _StrategyList;
     private List<GwProduct> _ProductList;
 
+    private int _userId = -1;
+    private int _userType = -1;
+    private string _account = "";
+
     private List<GwOp> OpList
     {
         get
@@ -53,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;
         }
@@ -121,6 +127,10 @@
     public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context)
     {
         string @string = context.GetString("action");
+        _userId = context.SessionObject.UserID;
+        _userType = context.SessionObject.UserType;
+        _account = context.SessionObject.Account;
+
         switch (@string)
         {
             case "updateSpStatus":
@@ -312,10 +322,13 @@
         string apId = "0";
         if (this.IsInt(string1))
             apId = string1;
-        if (string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(string4))
-            clientId = new GwClientDao().GetClientName(string4).ClientID;
+        //if (string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(string4))
+        //    clientId = new GwClientDao().GetClientName(string4).ClientID;
+        
+        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
+
         //鍔犺浇璐﹀彿鍒楄〃淇℃伅
-        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, int1, string3, int2, int4, int3, int5.ToString(),out recordCount, productId);
+        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(), productId, permissionsSQL, out recordCount);
         string str1 = "";
         if (list != null && list.Count > 0)
         {
@@ -571,7 +584,8 @@
         o.AccessCode = context.GetString("AccessCode");
         o.Priority = context.GetInt("Priority", 0);
         o.Price = Math.Max((int)(context.GetDecimal("Price", new Decimal(4, 0, 0, false, (byte)2)) * new Decimal(1000)), 1);
-        o.ChargeType = context.GetInt("ChargeType", 0);
+        //o.ChargeType = context.GetInt("ChargeType", 0);
+        o.IsAutoReturn = context.GetInt("IsAutoReturn", 0);
         o.Threshold = Math.Max(context.GetInt("Threshold", 10), 10);
         o.MaxConnCount = context.GetInt("MaxConnCount", 1);
         o.Remark = context.GetString("Remark");
@@ -651,8 +665,11 @@
         cTPattern.SpID = context.GetString("SpID");
         cTPattern.Enabled = context.GetInt("enabled");
         cTPattern.Pattern = context.GetString("patternContent");
-        if (!Regex.IsMatch(o.SpID, "^\\d{6}$"))
-            throw new Exception("璐﹀彿蹇呴』涓�6浣嶆暟瀛楋紒");
+            string pattern = @"^[A-Za-z0-9]+$"; //鍒ゆ柇鏄瓧绗︽垨鏁板瓧
+        //if (!Regex.IsMatch(o.SpID, "^\\d{6}$"))
+        //    throw new Exception("璐﹀彿蹇呴』涓�6浣嶆暟瀛楋紒");
+        if (!Regex.IsMatch(o.SpID, "^[A-Za-z0-9]{6}$"))
+            throw new Exception("璐﹀彿蹇呴』涓�6浣嶅瓧绗︽垨鏁板瓧锛�");
         if (o.AccessCodeMode == 1)
         {
             if (o.DiverterID != 0)
@@ -692,7 +709,8 @@
         o.AccessCode = context.GetString("AccessCode");
         o.Priority = context.GetInt("Priority", 0);
         o.Price = Math.Max((int)(context.GetDecimal("Price", new Decimal(4, 0, 0, false, (byte)2)) * new Decimal(1000)), 1);
-        o.ChargeType = context.GetInt("ChargeType", 0);
+        //o.ChargeType = context.GetInt("ChargeType", 0);
+        o.IsAutoReturn = context.GetInt("IsAutoReturn", 0);
         o.Threshold = Math.Max(context.GetInt("Threshold", 10), 10);
         o.MaxConnCount = context.GetInt("MaxConnCount", 1);
         o.Remark = context.GetString("Remark");

--
Gitblit v1.9.1