wzp
2022-11-02 02fe59564a19996974a9d36be6ab61f29ee4c004
web/web/GwSp.ashx
@@ -57,10 +57,10 @@
        {
            if (this._ClientList == null)
            {
                using (GwClientDao gwClientDao = new GwClientDao()) {
                using (GwClientDao gwClientDao = new GwClientDao()) {
                    string permissionsSQL = gwClientDao.GetClientPermissions(_userId, _userType, null);
                    this._ClientList = gwClientDao.LoadInfoList("", "", "", "", permissionsSQL);
                 }
                }
            }
            return this._ClientList;
        }
@@ -101,9 +101,9 @@
                using (GwProductDao gwProductDao = new GwProductDao())
                {
                    GwProduct gwProduct = new GwProduct();
                        gwProduct.Classes = -1;
                        gwProduct.IsDefault = -1;
                        gwProduct.IsEnable = -1;
                    gwProduct.Classes = -1;
                    gwProduct.IsDefault = -1;
                    gwProduct.IsEnable = -1;
                    this._ProductList = gwProductDao.getAllList(gwProduct);
                }
            }
@@ -324,7 +324,7 @@
            apId = string1;
        //if (string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(string4))
        //    clientId = new GwClientDao().GetClientName(string4).ClientID;
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
        //加载账号列表信息
@@ -375,16 +375,16 @@
                if (gwSp.BalanceThreshold > 0 && !string.IsNullOrEmpty(gwSp.AlarmMobile))
                    str1 = str1 + (object)"<div class=\"text-danger\">" + (object)(gwSp.BalanceThreshold / 1000) + "元(" + gwSp.AlarmMobile + ")</div>";
                str1 += "</td>";
                    /**
                str1 = str1 + "<td>" + this.GetDiverterName(gwSp.DiverterID);
                str1 = str1 + "<div class=\"text-muted\">" + this.GetStratedyName(gwSp.StrategyID) + "</div>";
                str1 = str1 + "<div class=\"text-muted\"><font color=\"red\">" + this.GwSPAuditingName(gwSp.AuditingMode) + "</font></div>";
                str1 = str1 + "<div class=\"text-muted\">全局黑名单" + gwSp.BlackModeText + "</div>";
                str1 += "</td>";
                str1 = str1 + "<td>" + gwSp.AccessCode;
                str1 = str1 + "<div class=\"text-muted\">" + (gwSp.ExtnoExtensionMode == 1 ? "禁止客户扩展" : "允许客户扩展") + "</div>";
                str1 = str1 + "<div>" + (gwSp.AccessCodeMode == 1 ? "通道直连模式" : "虚拟接入模式") + "</div></td>";
                    **/
                /**
            str1 = str1 + "<td>" + this.GetDiverterName(gwSp.DiverterID);
            str1 = str1 + "<div class=\"text-muted\">" + this.GetStratedyName(gwSp.StrategyID) + "</div>";
            str1 = str1 + "<div class=\"text-muted\"><font color=\"red\">" + this.GwSPAuditingName(gwSp.AuditingMode) + "</font></div>";
            str1 = str1 + "<div class=\"text-muted\">全局黑名单" + gwSp.BlackModeText + "</div>";
            str1 += "</td>";
            str1 = str1 + "<td>" + gwSp.AccessCode;
            str1 = str1 + "<div class=\"text-muted\">" + (gwSp.ExtnoExtensionMode == 1 ? "禁止客户扩展" : "允许客户扩展") + "</div>";
            str1 = str1 + "<div>" + (gwSp.AccessCodeMode == 1 ? "通道直连模式" : "虚拟接入模式") + "</div></td>";
                **/
                str1 = str1 + "<td>" + this.FormatIpHtml(gwSp.ClientIp) + "</td>";
                // str1 = str1 + "<td>" + this.GetStatusText(gwSp.Status);
                str1 = str1 + "<td>" + this.GetStatusText(gwSp.Status, gwSp.SpID);
@@ -399,7 +399,7 @@
                    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);
                if (context.HasRight("3022"))
                    str1 += string.Format(" <a class=\" btn btn-success btn-xs action-modal-Acctunchargelog\"  data-id=\"{0}\"><i class=\"fa fa-list-alt\"></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>";
@@ -506,8 +506,8 @@
    private string GetStatusText(int status, string spid)
    {
        if (status == 0)
                return string.Format("<span class='label label-default'>已停用</span>");
            //return string.Format("<span class=\"action-updateStatus btn btn-xs btn-default\" data-status=\"1\" data-spid=\"{0}\">已停用</span>", (object)spid);
            return string.Format("<span class='label label-default'>已停用</span>");
        //return string.Format("<span class=\"action-updateStatus btn btn-xs btn-default\" data-status=\"1\" data-spid=\"{0}\">已停用</span>", (object)spid);
        //return string.Format("<span class=\"action-updateStatus btn btn-xs  btn-success \" data-status=\"0\" data-spid=\"{0}\">已启用</span>", (object)spid);
        return string.Format("<span class='label label-success'>已启用</span>");
    }
@@ -593,7 +593,7 @@
        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);
@@ -607,7 +607,7 @@
        o.Signatures = context.GetString("Signatures");
        o.AuditingMode = context.GetInt("AuditingMode");
        o.DeductPercent = context.GetInt("DeductPercent");
        o.SubPackageNum = context.GetInt("SubPackageNum");
        o.SingleSubmitMinRestrict = context.GetInt("SingleSubmitMinRestrict");
        o.IsDispalyPrice = context.GetInt("IsDispalyPrice");
@@ -619,6 +619,8 @@
        o.CumulativeAuditNum = context.GetInt("CumulativeAuditNum");
        o.CumulativeAuditTime = context.GetInt("CumulativeAuditTime");
        o.IsSyncChildSendAudit = context.GetInt("IsSyncChildSendAudit");
        o.ProductId = context.GetString("ProductId","");
        if (context.GetInt("RouterType", 1) == 1)
        {
@@ -687,7 +689,7 @@
        cTPattern.SpID = context.GetString("SpID");
        cTPattern.Enabled = context.GetInt("enabled");
        cTPattern.Pattern = context.GetString("patternContent");
            string pattern = @"^[A-Za-z0-9]+$"; //判断是字符或数字
        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}$"))
@@ -731,7 +733,7 @@
        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);
@@ -770,7 +772,7 @@
        o.Signatures = context.GetString("signatures");
        string string1 = context.GetString("SpID");
        int @int = context.GetInt("enabled");
        o.SubPackageNum = context.GetInt("SubPackageNum");
        o.SingleSubmitMinRestrict = context.GetInt("SingleSubmitMinRestrict");
        o.IsDispalyPrice = context.GetInt("IsDispalyPrice");
@@ -884,14 +886,20 @@
    private JsonPageResult BatchUpdateOp(PageContext<SysUser> context)
    {
        int int1 = context.GetInt("cmopID");
        int int2 = context.GetInt("unopID");
        int int3 = context.GetInt("ctopID");
        int int4 = context.GetInt("cmGroupID");
        int int5 = context.GetInt("cuGroupID");
        int int6 = context.GetInt("ctGroupID");
        int cmOpId = context.GetInt("cmopID");
        int cuOpId = context.GetInt("unopID");
        int ctOpId = context.GetInt("ctopID");
        int cmGroupId = context.GetInt("cmGroupID");
        int cuGroupId = context.GetInt("cuGroupID");
        int ctGroupId = context.GetInt("ctGroupID");
        if (cmOpId == 0 && cuOpId == 0 && ctOpId == 0 && cmGroupId ==0 && cuGroupId==0 &&ctGroupId==0)
        {
            throw new ArgumentException("选项不允许全部为空,请至少选择一项!");
        }
        foreach (string spid in JsonConvert.DeserializeObject<string[]>(context.GetString("idArray")))
            this._Dao.UpdateSingleOP(spid, int1, int3, int2, int4, int5, int6);
            this._Dao.UpdateSingleOP(spid, cmOpId, ctOpId, cuOpId, cmGroupId, cuGroupId, ctGroupId);
        return new JsonPageResult(true, (object)"批量修改通道成功!");
    }