wzp
2022-11-23 c052583025ff87735d2120dc63aeee7ea5e5524e
web/web/GwOrder.ashx
@@ -22,11 +22,19 @@
    private List<GwOp> _OpList;
    private List<GwOpGroup> _GroupList;
    private List<GwProduct> _ProductList;   //产品及产品分类
    //private List<GwProduct> _ProductClassList;  //产品分类
                                            //private List<GwProduct> _ProductClassList;  //产品分类
    private int _userId = -1;
    private string _userType = "";
    private string _account = "";
    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 "delete":
@@ -47,6 +55,8 @@
                return this.Cancel(context);      //取消    
            case "audit":
                return this.Audit(context);      //订单审核
            case "getOrderBySpId":
                return this.GetOrderBySpId(context);      //订单审核
            default:
                throw new Exception("Invalid Action=" + @string);
@@ -59,16 +69,18 @@
        //Console.WriteLine("List.............[" + context.GetInt("name") + "][" + context.GetInt("classes") + "]");
        string spId = context.GetString("spId");
        string clientId = context.GetString("clientId");
        string clientName = context.GetString("clientName");
        string compay = context.GetString("compay");
        int flag = context.GetInt("flag");
        DateTime startDate = context.GetDateTime("startDate");
        DateTime endDate = context.GetDateTime("endDate");
        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, compay, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
@@ -81,29 +93,31 @@
                str1 += "<tr><td>" + bean.OrderId + "</td>";
                str1 = str1 + "<td>" + bean.SpId + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "-" + bean.ClientName + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "</td>";
                str1 = str1 + "<td>" + bean.Company + "</td>";
                str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
                //str1 = str1 + "<td>" + bean.ComboId + "</td>";
                str1 = str1 + "<td>" + bean.BasicNum + "</td>";
                str1 = str1 + "<td>" + bean.GivingNum + "</td>";
                str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>";
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
                str1 = str1 + "<td>" + bean.Auditor + "</td>";
                str1 = str1 + "<td>" + bean.Creator + "</td>";
                str1 = str1 + "<td>" + bean.CreateTime + "</td>";
                str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
                //str1 = str1 + "<td>" + bean.Remark + "</td>";
                str1 += "<td  class=\"text-right\">";
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;查看</a> ", (object) bean.OrderId);
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;查看</a> ", (object) bean.OrderId);
                str1 += "</td>";
                str1 += "</tr>";
            }
        }
        else
            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
        return new JsonPageResult(true,  new
        {
@@ -117,16 +131,18 @@
    {
        string spId = context.GetString("spId");
        string clientId = context.GetString("clientId");
        string clientName = context.GetString("clientName");
        string company = context.GetString("company");
        int flag = context.GetInt("flag");
        DateTime startDate = context.GetDateTime("startDate");
        DateTime endDate = context.GetDateTime("endDate");
        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, company, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
@@ -139,24 +155,26 @@
                str1 += "<tr><td>" + bean.OrderId + "</td>";
                str1 = str1 + "<td>" + bean.SpId + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "-" + bean.ClientName + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "</td>";
                str1 = str1 + "<td>" + bean.Company + "</td>";
                str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
                //str1 = str1 + "<td>" + bean.ComboId + "</td>";
                str1 = str1 + "<td>" + bean.BasicNum + "</td>";
                str1 = str1 + "<td>" + bean.GivingNum + "</td>";
                str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>";
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
                str1 = str1 + "<td>" + bean.Auditor + "</td>";
                str1 = str1 + "<td>" + bean.Creator + "</td>";
                str1 = str1 + "<td>" + bean.CreateTime + "</td>";
                str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
                //str1 = str1 + "<td>" + bean.Remark + "</td>";
                str1 += "<td  class=\"text-right\">";
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;查看</a> ", (object) bean.OrderId);
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-audit btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;审核</a> ", (object) bean.OrderId);
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-info btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;查看</a> ", (object) bean.OrderId);
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" style=\"margin-top:10px; \" class=\"action-modal-audit btn  btn-success btn-xs\"><i class=\"fa fa-edit\"></i>&nbsp;审核</a> ", (object) bean.OrderId);
                if(bean.Status == 0) {
                    str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-cancel btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;取消</a> ", (object) bean.OrderId);
                }
@@ -165,7 +183,7 @@
            }
        }
        else
            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
        return new JsonPageResult(true,  new
        {
@@ -191,19 +209,21 @@
        string spId = context.GetString("spId");
        string clientId = context.GetString("clientId");
        string clientName = context.GetString("clientName");
        string company = context.GetString("company");
        int flag = context.GetInt("flag");
        //string startDate = context.GetString("startDate");
        //string endDate = context.GetString("endDate");
        DateTime startDate = context.GetDateTime("startDate");
        DateTime endDate = context.GetDateTime("endDate");
        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        //List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate).AddDays(1.0), pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, company, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
@@ -216,22 +236,24 @@
                str1 += "<tr><td>" + bean.OrderId + "</td>";
                str1 = str1 + "<td>" + bean.SpId + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "-" + bean.ClientName + "</td>";
                str1 = str1 + "<td>" + bean.ClientId + "</td>";
                str1 = str1 + "<td>" + bean.Company + "</td>";
                str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
                //str1 = str1 + "<td>" + bean.ComboId + "</td>";
                str1 = str1 + "<td>" + bean.BasicNum + "</td>";
                str1 = str1 + "<td>" + bean.GivingNum + "</td>";
                str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>";
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
                str1 = str1 + "<td>" + bean.Auditor + "</td>";
                str1 = str1 + "<td>" + bean.Creator + "</td>";
                str1 = str1 + "<td>" + bean.CreateTime + "</td>";
                str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
                //str1 = str1 + "<td>" + bean.Remark + "</td>";
                str1 += "<td  class=\"text-right\">";
                str1 += "<td  class=\"text-center\">";
                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;查看</a> ", (object) bean.OrderId);
                //str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-audit btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;审核</a> ", (object) bean.OrderId);
                //if(bean.Status == 0) {
@@ -242,7 +264,7 @@
            }
        }
        else
            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
        return new JsonPageResult(true,  new
        {
@@ -291,17 +313,22 @@
    {
        string spId = context.GetString("spId");
        string orderId = context.GetString("orderId");
        int basicNum = context.GetInt("basicNum");
        int givingNum = context.GetInt("givingNum");
        Int64 basicNum = context.GetInt64("basicNum");
        Int64 givingNum = context.GetInt64("givingNum");
        string clientId = "";
        int payAmount = 0;
        int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
        Int64 payAmount = 0;//金额
        Int64 tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        payAmount = tmpPayAmount;
        //double price = context.GetDecimal(price);
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        string remark = context.GetString("remark");
        int status = context.GetInt("status");  //0-审核不通过;1-审核通过
        string auditReason = context.GetString("auditReason");
        if (status == 0 && string.IsNullOrEmpty(auditReason))
        {
            throw new ArgumentException("请输入不通过原因!");
        }
        DateTime createTime = DateTime.Now;
        string creator = context.OperatorID;
@@ -398,7 +425,6 @@
                nextSort = nowSort + 1;
                //获取审核流程的第一环节流程代码
                nextFlowCode = getNextFlowCode(flowGroup, nextSort);
            }
        }
@@ -428,10 +454,10 @@
        }
        else if(status==1)
        {
            int beforeBasicNum = 0;
            int beforeGivingNum = 0;
            int balance = 0;
            int topUpAmountTotal = 0;
            Int64 beforeBasicNum = 0;
            Int64 beforeGivingNum = 0;
            Int64 balance = 0;
            Int64 topUpAmountTotal = 0;
            if (string.IsNullOrEmpty(nextFlowCode))
            {
                orderStatus = 2;
@@ -445,11 +471,12 @@
                //获取客户信息
                GwClient gwClient = _GwClientDao.Get(gwSp.ClientID);
                balance =  int.Parse(gwClient.Balance.ToString() );
                topUpAmountTotal = int.Parse(gwClient.Top_up_Amount_Total.ToString() );
                balance =  Int64.Parse(gwClient.Balance.ToString() );
                topUpAmountTotal = Int64.Parse(gwClient.Top_up_Amount_Total.ToString() );
                //为1-预付费
                if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
                //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
                if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum)
                {
                    throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!");
                }
@@ -457,23 +484,20 @@
                //gwSp.Balance = balance - num * basicNum;
                //gwSp.BasicNum = beforeBasicNum + basicNum;
                //gwSp.GivingNum = beforeGivingNum + givingNum;
                _GwSpDao.UpdateBalanceByOrder(balance - num * basicNum
                    , beforeBasicNum + basicNum
                    , beforeGivingNum + givingNum
                    , spId
                    );
                //更新账号充值数据
                _GwSpDao.UpdateBalanceByOrder( payAmount, basicNum , givingNum , spId );
                //有充值金额时,更新客户累计充值金额(厘)
                if (payAmount > 0) {
                if (payAmount > 0 || basicNum > 0 ) {
                    //GwClient gwClient = new GwClient();
                    gwClient = new GwClient();
                    gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount;    //累计金额:单位(厘)
                    gwClient.Balance = ((balance + payAmount) - num * basicNum) ;   //账户余额:单位(厘)
                    gwClient.ClientID = clientId;
                    //gwClient = new GwClient();
                    //gwClient.Balance = ((balance + payAmount) - num * basicNum) ;   //充值余额:单位(厘)
                    //gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount;    //充值金额:单位(厘)
                    //gwClient.ClientID = clientId;
                    _GwClientDao.UpdateClientAmount(gwClient);
                    //更新客户充值数据
                    _GwClientDao.UpdateClientAmount(payAmount-( num * basicNum), payAmount, clientId );
                }
            }
            else
@@ -519,21 +543,21 @@
        string clientId = context.GetString("clientId");
        string productId = context.GetString("productId");
        //string comboId = context.GetString("comboId");
        int basicNum = context.GetInt("basicNum", 0);
        int givingNum = context.GetInt("givingNum", 0);
        Int64 basicNum = context.GetInt("basicNum", 0);
        Int64 givingNum = context.GetInt("givingNum", 0);
        int price = 0;
        int orderNumTotal = context.GetInt("orderNumTotal", 0);
        int orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        int payAmount = 0;
        int beforeBalanceNum = context.GetInt("beforeBalanceNum", 0);
        Int64 orderNumTotal = context.GetInt("orderNumTotal", 0);
        Int64 orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        Int64 payAmount = 0;
        Int64 beforeBalanceNum = context.GetInt("beforeBalanceNum", 0);
        //客服人员提交订单时的状态为1-审核中。
        int status = 1; //0-待审核(已提交);1-审核中;2-审核通过;3-审核不通过;4-取消;申请订单在未审核情况下可以取消。
        string remark = context.GetString("remark");
        DateTime createTime = DateTime.Now;
        string creator = context.OperatorID;
        int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        Int64 tmpPayAmount = Math.Max((Int64) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        payAmount = tmpPayAmount;
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        price = num;
@@ -548,11 +572,11 @@
        if (string.IsNullOrEmpty(clientId))
        {
            throw new ArgumentException("客户不能为空!");
            throw new ArgumentException("客户账号不能为空!");
        }
        if (string.IsNullOrEmpty(spId))
        {
            throw new ArgumentException("账号不能为空!");
            throw new ArgumentException("短信账号不能为空!");
        }
        if (basicNum<=0 && givingNum <= 0 && payAmount <=0)
@@ -562,7 +586,7 @@
        //获取账号信息
        GwSp gwSp = _GwSpDao.Get(spId);
        int balance = 0;
        Int64 balance = 0;
        if (gwSp == null)
        {
            throw new ArgumentException("账号不存在!");
@@ -575,10 +599,11 @@
        //获取客户信息
        GwClient gwClient = _GwClientDao.Get(gwSp.ClientID);
        balance =  int.Parse(gwClient.Balance.ToString() );
        balance =  Int64.Parse(gwClient.Balance.ToString() );
        //为1-预付费
        if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
        //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
        if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum)
        {
            throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!");
        }
@@ -646,6 +671,12 @@
        productId = gwSp.ProductId;
        price = gwSp.Price;
        if (string.IsNullOrEmpty(gwSp.ProductId))
        {
            throw new ArgumentException("产品配置不允许为空!请先配置账号所关联产品!");
        }
        orderNumTotal = basicNum + givingNum;
        orderAmountTotal = basicNum * price;
@@ -701,20 +732,20 @@
        string clientId = context.GetString("clientId");
        string productId = context.GetString("productId");
        string comboId = context.GetString("clientId");
        int basicNum = context.GetInt("basicNum", 0);
        int givingNum = context.GetInt("givingNum", 0);
        Int64 basicNum = context.GetInt("basicNum", 0);
        Int64 givingNum = context.GetInt("givingNum", 0);
        int price = 0;
        int orderNumTotal = context.GetInt("orderNumTotal", 0);
        int orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        int payAmount = 0;
        int beforeBalanceNum = context.GetInt("beforeBalanceNum", 0);
        Int64 orderNumTotal = context.GetInt("orderNumTotal", 0);
        Int64 orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        Int64 payAmount = 0;
        Int64 beforeBalanceNum = context.GetInt("beforeBalanceNum", 0);
        int status = 0;
        string remark = context.GetString("remark");
        DateTime createTime = DateTime.Now;
        string creator = context.OperatorID;
        int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        Int64 tmpPayAmount = Math.Max((Int64) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
        payAmount = tmpPayAmount;
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
@@ -730,11 +761,11 @@
        if (string.IsNullOrEmpty(clientId))
        {
            throw new ArgumentException("客户不能为空!");
            throw new ArgumentException("客户账号不能为空!");
        }
        if (string.IsNullOrEmpty(spId))
        {
            throw new ArgumentException("账号不能为空!");
            throw new ArgumentException("短信账号不能为空!");
        }
        if (basicNum<=0 && givingNum <= 0)
@@ -769,7 +800,58 @@
    //根据主键获取产品或产品分类信息
    private JsonPageResult Get(PageContext<SysUser> context)
    {
        return new JsonPageResult(true, this._Dao.Get(context.GetString("orderId")));
        GwOrder gwOrder = _Dao.Get(context.GetString("orderId"));
        return new JsonPageResult(true,gwOrder);
    }
    //根据客户API账号获取充值初始信息
    private JsonPageResult GetOrderBySpId(PageContext<SysUser> context)
    {
        string spId = context.GetString("spId");
        if (!string.IsNullOrEmpty(spId))
        {
            GwSp  gwSp = new GwSpDao().Get(spId);
            if(gwSp==null)
            {
                throw new ArgumentException("账号不存在!");
            }
            else if (gwSp.Status==0)
            {
                throw new ArgumentException("账号状态已停用!");
            }
            GwOrder gwOrder = new GwOrder();
            GwClient gwClient = new GwClient();
            using (GwClientDao gwClientDao = new GwClientDao())
            {
                gwClient = gwClientDao.Get(gwSp.ClientID);
                gwOrder.Company = gwClient.Company;
                gwOrder.Balance = long.Parse(gwClient.Balance.ToString() );    //余额
            }
            gwOrder.SpId = gwSp.SpID;
            gwOrder.ClientId = gwSp.ClientID;
            gwOrder.ProductId = gwSp.ProductId;
            gwOrder.ProductName = gwSp.ProductName;
            gwOrder.Price = gwSp.Price;
            gwOrder.BasicNum = gwSp.BasicNum;  //基本条数
            gwOrder.GivingNum = gwSp.GivingNum;
            return new JsonPageResult(true, gwOrder);
        }
        else
        {
            throw new ArgumentException("请选择短信账号!");
        }
    }
    //获取通道列表
@@ -817,9 +899,9 @@
        if (classes == -1)
            return string.Empty;
        else if(classes == 0)
            return "0-产品分类";
            return "产品分类";
        else if(classes == 1)
            return "1-产品";
            return "产品";
        return string.Empty;
    }
@@ -830,9 +912,9 @@
        if (isDefault == -1)
            return string.Empty;
        else if(isDefault == 0)
            return "0-个性化";
            return "个性化";
        else if(isDefault == 1)
            return "1-系统默认";
            return "系统默认";
        return string.Empty;
    }
@@ -843,9 +925,9 @@
        if (isEnable == -1)
            return string.Empty;
        else if(isEnable == 0)
            return "0-停用";
            return "停用";
        else if(isEnable == 1)
            return "1-启用";
            return "启用";
        return string.Empty;
    }
@@ -867,15 +949,15 @@
        if (status == -1)
            return string.Empty;
        else if(status == 0)
            return "0-待审核(已提交)";
            return "待审核(已提交)";
        else if(status == 1)
            return "1-审核中";
            return "审核中";
        else if(status == 2)
            return "2-审核通过";
            return "审核通过";
        else if(status == 3)
            return "3-审核不通过";
            return "审核不通过";
        else if(status == 4)
            return "4-取消";
            return "取消";
        return string.Empty;
    }