wzp
2022-11-11 2f74eb23c0d2d4a246bc612c5c34bdfa8dea5603
web/web/GwSp.ashx
@@ -343,12 +343,12 @@
                if (gwSp.RouterType == 1)
                {
                    str1 += "<td rowspan=\"1\"><span class='label label-primary'>通道</span>";
                    str1 += string.Format("<div>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetOpName(gwSp.CMOPID), (object)this.GetOpName(gwSp.CTOPID), (object)this.GetOpName(gwSp.UNOPID));
                    str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetOpName(gwSp.CMOPID), (object)this.GetOpName(gwSp.CTOPID), (object)this.GetOpName(gwSp.UNOPID));
                }
                else if (gwSp.RouterType == 3)
                {
                    str1 += "<td rowspan=\"1\"><span class='label label-success'>通道组</span>";
                    str1 += string.Format("<div>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetGroupName(gwSp.CMGroupID), (object)this.GetGroupName(gwSp.CTGroupID), (object)this.GetGroupName(gwSp.CUGroupID));
                    str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetGroupName(gwSp.CMGroupID), (object)this.GetGroupName(gwSp.CTGroupID), (object)this.GetGroupName(gwSp.CUGroupID));
                }
                /**
                if (gwSp.RESEND_STATUS == 1)
@@ -373,7 +373,7 @@
                str1 = str1 + (object)"<td>" + (object)(gwSp.BasicNum + (long)gwSp.GivingNum) + "条 / " + (object)(gwSp.BasicNum) + "条 / " + (object)(gwSp.GivingNum) + "条";
                //add: yangzh by 2022-03-14 end
                if (gwSp.BalanceThreshold > 0 && !string.IsNullOrEmpty(gwSp.AlarmMobile))
                    str1 = str1 + (object)"<div class=\"text-danger\">" + (object)(gwSp.BalanceThreshold / 1000) + "元(" + gwSp.AlarmMobile + ")</div>";
                    str1 = str1 + "<div class=\"text-danger\">" + gwSp.BalanceThreshold + "条(" + gwSp.AlarmMobile + ")</div>";
                str1 += "</td>";
                /**
            str1 = str1 + "<td>" + this.GetDiverterName(gwSp.DiverterID);
@@ -385,20 +385,20 @@
            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.FormatIpHtml(gwSp.ClientIp) + "</td>";//去掉IP
                // str1 = str1 + "<td>" + this.GetStatusText(gwSp.Status);
                str1 = str1 + "<td>" + this.GetStatusText(gwSp.Status, gwSp.SpID);
                str1 += "</td>";
                str1 += "<td>" + gwSp.CreateTime + "</td>";
                str1 += "<td rowspan=\"1\" class=\"text-center\">";
                str1 += "<td rowspan=\"1\" class=\"text-center\" >";
                if (context.HasRight("3023"))
                    str1 += string.Format(" <a class=\"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 style='margin-top:5px;' class=\"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);
                str1 = gwSp.Status != 0 ? str1 + string.Format(" <a href=\"javascript:;\" data-spid=\"{0}\" data-status=\"0\" class=\"action-updateStatus btn btn-primary btn-xs\"><i class=\"fa fa-toggle-off\"></i>&nbsp;停用</a><br> ", (object) gwSp.SpID ) : str1 + string.Format("<a href=\"javascript:;\" data-spid=\"{0}\" data-status=\"1\" class=\"action-updateStatus btn  btn-default btn-xs\"><i class=\"fa fa-toggle-on\"/></i>&nbsp;启用</a><br> ", (object) gwSp.SpID );
                str1 = gwSp.Status != 0 ? str1 + string.Format(" <a style='margin-top:5px;' href=\"javascript:;\" data-spid=\"{0}\" data-status=\"0\" class=\"action-updateStatus btn btn-primary btn-xs\"><i class=\"fa fa-toggle-off\"></i>&nbsp;停用</a><br> ", (object) gwSp.SpID ) : str1 + string.Format("<a href=\"javascript:;\" data-spid=\"{0}\" data-status=\"1\" class=\"action-updateStatus btn  btn-default btn-xs\"><i class=\"fa fa-toggle-on\"/></i>&nbsp;启用</a><br> ", (object) gwSp.SpID );
                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);
                    str1 += string.Format(" <a style='margin-top:5px;' 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);
                    str1 += string.Format(" <a style='margin-top:5px;' 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);
@@ -620,7 +620,7 @@
        o.CumulativeAuditTime = context.GetInt("CumulativeAuditTime");
        o.IsSyncChildSendAudit = context.GetInt("IsSyncChildSendAudit");
        o.ProductId = context.GetString("ProductId","");
        o.ProductId = context.GetString("ProductId","");//产品ID
        if (context.GetInt("RouterType", 1) == 1)
        {
@@ -663,8 +663,8 @@
            o.CUGroupID = 0;
            o.CTGroupID = 0;
        }
        o.BalanceThreshold = context.GetInt("BalanceThreshold") * 1000;
        o.AlarmMobile = context.GetString("AlarmMobile");
        o.BalanceThreshold = context.GetInt("BalanceThreshold");//告警条数
        o.AlarmMobile = context.GetString("AlarmMobile");//告警号码
        o.ForceSignFlag = context.GetInt("ForceSignFlag");
        o.ForceSign = context.GetString("ForceSign");
        o.SignatureMode = context.GetInt("signatureMode");
@@ -715,6 +715,27 @@
            throw new Exception("账号密码不能为空");
        this._Dao.Update(o);
        this._Dao.UpdatePattern(cTPattern, context.OperatorID); //更新账号里面的报备内容
        //同时修改客户-产品表记录,若存在,则更新,否则新建
        bool flag = GwClientProductDao.Instance.FindBySp(o.SpID);
        GwClientProduct clientProduct = new GwClientProduct()
        {
            ClientId = o.ClientID,
            ProductId = o.ProductId,
            SpId = o.SpID,
            ActivateStatus = 1,
            Id=Guid.NewGuid().ToString()
        };
        if (flag)//存在,更新
        {
            GwClientProductDao.Instance.Update(clientProduct);
        }
        else
        {
            GwClientProductDao.Instance.Add(clientProduct);
        }
        return new JsonPageResult(true, (object)("账户" + o.SpID + "修改成功!"));
    }
@@ -817,6 +838,33 @@
            throw new Exception("SPID已经存在,请重新填写!");
        this._Dao.Add(o);
        this._Dao.UpdatePattern(string1, @int, string2, context.OperatorID);//添加账号的时候配置报备
        //如果选择了产品,表示创建的时候就激活。后台创建无赠送
        if (!string.IsNullOrEmpty(o.ProductId))
        {
            //同时修改客户-产品表记录,若存在,则更新,否则新建
            bool flag = GwClientProductDao.Instance.FindBySp(o.SpID);
            GwClientProduct clientProduct = new GwClientProduct()
            {
                ClientId = o.ClientID,
                ProductId = o.ProductId,
                SpId = o.SpID,
                ActivateStatus = 1,
                Id = Guid.NewGuid().ToString()
            };
            if (flag)//存在,更新
            {
                GwClientProductDao.Instance.Update(clientProduct);
            }
            else
            {
                GwClientProductDao.Instance.Add(clientProduct);
            }
        }
        return new JsonPageResult(true, (object)("账户" + o.SpID + "添加成功!"));
    }