wzp
2022-11-11 2f74eb23c0d2d4a246bc612c5c34bdfa8dea5603
修改账号产品关联的bug
修改产品不显示的bug
8个文件已修改
93 ■■■■■ 已修改文件
web/.vs/Web/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientProductDao.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | 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/GwProduct.ashx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwSp.ashx 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/v16/.suo
Binary files differ
web/Dao/GwClientProductDao.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using Common;
@@ -32,9 +33,41 @@
        /// <returns></returns>
        public bool Add(GwClientProduct gcp)
        {
            return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id) values(:id,:client_id,:product_id)", OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId), new OracleParameter(":product_id", (object)gcp.ProductId)) > 0;
            return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id,sp_id,ACTIVATE_STATUS) values(:id,:client_id,:product_id,:sp_id,:ACTIVATE_STATUS)",
                OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId),
                new OracleParameter(":product_id", gcp.ProductId),new OracleParameter(":sp_id",gcp.SpId),
                new OracleParameter(":ACTIVATE_STATUS", gcp.ActivateStatus)) > 0;
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="gcp"></param>
        /// <returns></returns>
        public bool Update(GwClientProduct gcp)
        {
            return OracleHelper.ExecuteSql("update GW_Client_Product set product_id=:product_id,client_id=:client_id where sp_id=:sp_id ",
                OracleHelper.Connection, new OracleParameter(":product_id", gcp.ProductId), new OracleParameter(":sp_id", gcp.SpId),
                new OracleParameter(":client_id",gcp.ClientId)
                ) > 0;
        }
        /// <summary>
        /// 查找账号是否存在
        /// </summary>
        /// <param name="spid"></param>
        /// <returns></returns>
        public bool FindBySp(string spid)
        {
            using (OracleDataReader oracleDataReader = OracleHelper.ExecuteReader(string.Format("select * from GW_Client_Product where SP_ID=:SP_ID"), OracleHelper.Connection, new OracleParameter(":SP_ID", spid)))
            {
                if (oracleDataReader.Read())
                    return true;
            }
            return false;
        }
    }
}
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/GwProduct.ashx
@@ -88,12 +88,12 @@
                if (bean.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(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId));
                    str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetOpName(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId));
                }
                else if (bean.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(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid));
                    str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetGroupName(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid));
                }
                else
                {
web/web/GwSp.ashx
@@ -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");
        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 + "添加成功!"));
    }