From 3a3e585d9dd93688ed237bfc46bf06991d0772a1 Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 19 五月 2022 15:00:52 +0800
Subject: [PATCH] 账号信息增加是否自动返还 系统账号信息增加:用户类型 客户信息增加:归属客户经理、归属业务员、归属客服人员、归属财务等 客户账号查询优化 账号查询充值优化

---
 web/web/GwSp.ashx |   65 +++++++++++++++++++++++++++-----
 1 files changed, 54 insertions(+), 11 deletions(-)

diff --git a/web/web/GwSp.ashx b/web/web/GwSp.ashx
index e7cf40e..1c5f53f 100644
--- a/web/web/GwSp.ashx
+++ b/web/web/GwSp.ashx
@@ -19,6 +19,7 @@
     private List<GwDiverter> _DiverterList;
     private List<GwAp> _APList;
     private List<GwStrategy> _StrategyList;
+    private List<GwProduct> _ProductList;
 
     private List<GwOp> OpList
     {
@@ -85,6 +86,25 @@
         }
     }
 
+    private List<GwProduct> ProductList
+    {
+        get
+        {
+            if (this._ProductList == null)
+            {
+                using (GwProductDao gwProductDao = new GwProductDao())
+                {
+                    GwProduct gwProduct = new GwProduct();
+                        gwProduct.Classes = -1;
+                        gwProduct.IsDefault = -1;
+                        gwProduct.IsEnable = -1;
+                    this._ProductList = gwProductDao.getAllList(gwProduct);
+                }
+            }
+            return this._ProductList;
+        }
+    }
+
     private List<GwStrategy> StrategyList
     {
         get
@@ -123,7 +143,7 @@
                 return this.Add(context);
             case "loadGwSpPageList":
                 return this.LoadGwSpPageList(context);
-            case "loadGwSpAccountPageList":
+            case "loadGwSpAccountPageList"://鍔犺浇璐﹀彿鍒楄〃
                 return this.LoadGwSpAccountPageList(context);
             case "update":
                 return this.Update(context);
@@ -285,16 +305,17 @@
         int int3 = context.GetInt("pageSize", 20);
         int int4 = context.GetInt("pageIndex", 1);
         int int5 = context.GetInt("resendStatus", 1);
+        string productId = context.GetString("productId")==null? "": context.GetString("productId");
         if (!string.IsNullOrEmpty(string3) && int1 <= 0)
             throw new ArgumentException("璇烽�夋嫨閫氶亾缁勮矾鐢辨ā寮�");
         GwSpDao gwSpDao = new GwSpDao();
         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;
         //鍔犺浇璐﹀彿鍒楄〃淇℃伅
-        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, int1, string3, int2, int4, int3, int5.ToString(),out recordCount);
+        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(),out recordCount, productId);
         string str1 = "";
         if (list != null && list.Count > 0)
         {
@@ -302,6 +323,7 @@
             {
                 str1 = str1 + "<tr><td  rowspan=\"1\" ><input type=\"checkbox\"name=\"checkbox\" value=\"" + gwSp.SpID + "\"/></td><td rowspan=\"1\">" + gwSp.SpID + "<div class=\"text-muted\">" + this.GetAPName(gwSp.ApID) + "</div><div class=\"text-muted\">" + this.GetClientName(gwSp.ClientID) + "</div>";
                 str1 += "</td>";
+                str1 = str1 + "<td>" + (object)this.GetProductToName(gwSp.ProductId) + "</td>";
                 if (gwSp.RouterType == 1)
                 {
                     str1 += "<td rowspan=\"1\"><div class=\"btn  btn-primary btn-xs\">鐐硅矾鐢�</div>";
@@ -328,7 +350,10 @@
                 string str2 = "<div class=\"text-muted\">" + gwSp.ChargerTypeText + "</div>";
                 if (gwSp.ChargerTypeText == "鍚庝粯璐�")
                     str2 = "<div  style=\"color:red\">" + gwSp.ChargerTypeText + "</div>";
-                str1 = str1 + (object)"<td><div class=\"text-muted\">" + (object)(gwSp.Balance / (long)gwSp.Price) + "鏉�/" + (object)((double)gwSp.Balance / 1000.0) + "鍏�</div>";
+                //add: yangzh by 2022-03-14 start
+                //str1 = str1 + (object)"<td><div class=\"text-muted\">" + (object)(gwSp.Balance / (long)gwSp.Price) + "鏉�/" + (object)((double)gwSp.Balance / 1000.0) + "鍏�</div>";
+                str1 = str1 + (object)"<td><div class=\"text-muted\">" + (object)(gwSp.BasicNum + (long)gwSp.GivingNum) + "鏉� / " + (object)(gwSp.BasicNum) + "鏉� / " + (object)(gwSp.GivingNum) + "鏉�</div>";
+                //add: yangzh by 2022-03-14 end
                 str1 = str1 + (object)str2 + "<div class=\"text-muted\">" + (object)((double)gwSp.Price / 1000.0) + "鍏�/鏉�</div>";
                 if (context.HasRight("3021"))
                     str1 += string.Format(" <a class=\"btn btn-xs btn-success action-modal-charge\"  data-id=\"{0}\"><i class=\"fa fa-cny\"></i> 鍏呭��</a>", (object)gwSp.SpID);
@@ -353,8 +378,9 @@
                 if (context.HasRight("3023"))
                     str1 += string.Format(" <a class=\"btn-block btn btn-primary btn-xs action-modal-edit\" data-id=\"{0}\"><i class=\"fa fa-edit\"></i>  缂栬緫</a>", (object)gwSp.SpID);
                 str1 += string.Format(" <a class=\"btn-block btn btn-success btn-xs action-create-summary\" data-id=\"{0}\">璐﹀彿鎽樿</a>", (object)gwSp.SpID);
-                if (context.HasRight("3024"))
-                    str1 += string.Format(" <a class=\"btn-block btn btn-xs btn-default action-delete\"  data-id=\"{0}\"><i class=\"fa fa-trash\"></i> 鍒犻櫎</a>", (object)gwSp.SpID);
+
+                //if (context.HasRight("3024"))
+                //    str1 += string.Format(" <a class=\"btn-block btn btn-xs btn-default action-delete\"  data-id=\"{0}\"><i class=\"fa fa-trash\"></i> 鍒犻櫎</a>", (object)gwSp.SpID);
                 str1 += "</td>";
                 str1 += "</tr>";
             }
@@ -480,6 +506,18 @@
         return "銆�" + gwDiverter.DiverterName + "銆戝娴佺瓥鐣�";
     }
 
+    //浜у搧杞悕绉�
+    private string GetProductToName(string productId)
+    {
+        GwProduct gwProduct = this.ProductList.Find((Predicate<GwProduct>)(bean => productId.Equals(bean.Id) ));
+        if (gwProduct != null)
+        {
+            //return string.Format("{0}-{1}", (object)gwAp.ApID, (object)gwAp.ApName);//2021.2.24.wzp鍙樻洿,鍚庣画鍙互鍒犻櫎
+            return string.Format("{0}", (object)gwProduct.Name);
+        }
+        return string.Empty;
+    }
+
     private JsonPageResult LoadGwSpPageList(PageContext<SysUser> context)
     {
         string string1 = context.GetString("SelectedSpID");
@@ -533,7 +571,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");
@@ -613,8 +652,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)
@@ -654,7 +696,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