yzh
2022-05-10 a027508b5818236d0a46bc7036394c63978a68b0
充值功能优化,客户表增加余额、订单表增加充值金额
23个文件已修改
222 ■■■■ 已修改文件
web/.vs/Web/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientDao.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwOrderDao.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.csproj.FileListAbsolute.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/Model/GwOrder.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/obj/Debug/UMCLib.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrder.ashx 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrderAudit.aspx 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrderCreate.aspx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrderCreate.aspx.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/v16/.suo
Binary files differ
web/Dao/GwClientDao.cs
@@ -155,6 +155,12 @@
            return OracleHelper.ExecuteSql("UPDATE GW_SP SET ALARM_MOBILE=:ALARM_MOBILE,BALANCE_THRESHOLD=:BALANCE_THRESHOLD WHERE CLIENT_ID=:CLIENT_ID", OracleHelper.Connection, new OracleParameter(":ALARM_MOBILE", (object)client.AlarmMobile), new OracleParameter(":BALANCE_THRESHOLD", (object)client.BalanceThreshold), new OracleParameter(":CLIENT_ID", (object)client.ClientID)) > 0;
        }
        //更新充值金额AMOUNT
        public bool UpdateClientAmount(GwClient client)
        {
            return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET BALANCE=:BALANCE, TOP_UP_AMOUNT_TOTAL=:TOP_UP_AMOUNT_TOTAL WHERE CLIENT_ID=:CLIENT_ID", OracleHelper.Connection, new OracleParameter(":BALANCE", (object)client.Balance), new OracleParameter(":TOP_UP_AMOUNT_TOTAL", (object)client.Top_up_Amount_Total), new OracleParameter(":CLIENT_ID", (object)client.ClientID)) > 0;
        }
        /// <summary>
        /// 更新账号的信息
        /// </summary>
@@ -266,6 +272,7 @@
            o.Agent = oracleReaderWrapper.GetString("AGENT", "");
            o.AlarmMobile = oracleReaderWrapper.GetString("ALARM_MOBILE", "");
            o.BalanceThreshold = oracleReaderWrapper.GetInt("BALANCE_THRESHOLD", 0);
            o.Balance = oracleReaderWrapper.GetInt("BALANCE", 0);
            o.PermissionData = oracleReaderWrapper.GetString("PERMISSION_DATA", "");
            o.Id = oracleReaderWrapper.GetInt("ID", 0);
            o.Certification_Status = oracleReaderWrapper.GetInt("CERTIFICATION_STATUS", 0);
web/Dao/GwOrderDao.cs
@@ -170,11 +170,11 @@
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("INSERT INTO GW_ORDER ( ");
            stringBuilder.Append(" ORDER_ID, SP_ID, CLIENT_ID, PRODUCT_ID, COMBO_ID, BASIC_NUM, GIVING_NUM, PRICE, ORDER_NUM_TOTAL, ORDER_AMOUNT_TOTAL, BEFORE_BALANCE_NUM ");
            stringBuilder.Append(" ORDER_ID, SP_ID, CLIENT_ID, PRODUCT_ID, COMBO_ID, BASIC_NUM, GIVING_NUM, PRICE, ORDER_NUM_TOTAL, ORDER_AMOUNT_TOTAL, PAY_AMOUNT, BEFORE_BALANCE_NUM ");
            stringBuilder.Append(" , CREATOR, CREATE_TIME, STATUS, REMARK ");
            //stringBuilder.Append(" , AUDITOR, AUDIT_TIME ");
            stringBuilder.Append(" ) ");
            stringBuilder.Append(" VALUES (:ORDER_ID, :SP_ID, :CLIENT_ID, :PRODUCT_ID, :COMBO_ID, :BASIC_NUM, :GIVING_NUM, :PRICE, :ORDER_NUM_TOTAL, :ORDER_AMOUNT_TOTAL, :BEFORE_BALANCE_NUM ");
            stringBuilder.Append(" VALUES (:ORDER_ID, :SP_ID, :CLIENT_ID, :PRODUCT_ID, :COMBO_ID, :BASIC_NUM, :GIVING_NUM, :PRICE, :ORDER_NUM_TOTAL, :ORDER_AMOUNT_TOTAL, :PAY_AMOUNT, :BEFORE_BALANCE_NUM ");
            stringBuilder.Append(" , :CREATOR, :CREATE_TIME, :STATUS, :REMARK ");
            //stringBuilder.Append(" , :AUDITOR, :AUDIT_TIME ");
            stringBuilder.Append("  ) ");
@@ -193,6 +193,7 @@
                new OracleParameter(":PRICE", (object)o.Price),
                new OracleParameter(":ORDER_NUM_TOTAL", (object)o.OrderNumTotal),
                new OracleParameter(":ORDER_AMOUNT_TOTAL", (object)o.OrderAmountTotal),
                new OracleParameter(":PAY_AMOUNT", (object)o.PayAmount),
                new OracleParameter(":BEFORE_BALANCE_NUM", (object)o.BeforeBalanceNum),
                new OracleParameter(":CREATOR", (object)o.Creator),
                new OracleParameter(":CREATE_TIME", (object)o.CreateTime),
@@ -219,16 +220,17 @@
        }
        //更新订单修改前余额
        public bool UpdateBalanceAndStatus(int basicNum, int givingNum, int orderNumTotal, int orderAmountTotal, int beforeGivingNum , int orderStatus, string orderId )
        public bool UpdateBalanceAndStatus(int basicNum, int givingNum, int orderNumTotal, int orderAmountTotal, int payAmount , int beforeGivingNum, int orderStatus, string orderId )
        {
            if (string.IsNullOrEmpty(orderId))
                return false;
            //status:4-取消
            return OracleHelper.ExecuteSql("update GW_ORDER SET BASIC_NUM=:BASIC_NUM, GIVING_NUM=:GIVING_NUM, ORDER_NUM_TOTAL=:ORDER_NUM_TOTAL, ORDER_AMOUNT_TOTAL=:ORDER_AMOUNT_TOTAL, BEFORE_BALANCE_NUM=:BEFORE_BALANCE_NUM, STATUS = :STATUS where ORDER_ID=:ORDER_ID", OracleHelper.Connection
            return OracleHelper.ExecuteSql("update GW_ORDER SET BASIC_NUM=:BASIC_NUM, GIVING_NUM=:GIVING_NUM, ORDER_NUM_TOTAL=:ORDER_NUM_TOTAL, ORDER_AMOUNT_TOTAL=:ORDER_AMOUNT_TOTAL, PAY_AMOUNT=:PAY_AMOUNT, BEFORE_BALANCE_NUM=:BEFORE_BALANCE_NUM, STATUS = :STATUS where ORDER_ID=:ORDER_ID", OracleHelper.Connection
                , new OracleParameter(":BASIC_NUM", (object)basicNum)
                , new OracleParameter(":GIVING_NUM", (object)givingNum)
                , new OracleParameter(":ORDER_NUM_TOTAL", (object)orderNumTotal)
                , new OracleParameter(":ORDER_AMOUNT_TOTAL", (object)orderAmountTotal)
                , new OracleParameter(":PAY_AMOUNT", (object)payAmount)
                , new OracleParameter(":BEFORE_BALANCE_NUM", (object)beforeGivingNum)
                , new OracleParameter(":STATUS", (object)orderStatus)
                , new OracleParameter(":ORDER_ID", (object)orderId)
@@ -249,6 +251,7 @@
                new OracleParameter(":PRICE", (object)o.Price),
                new OracleParameter(":ORDER_NUM_TOTAL", (object)o.OrderNumTotal),
                new OracleParameter(":ORDER_AMOUNT_TOTAL", (object)o.OrderAmountTotal),
                new OracleParameter(":PAY_AMOUNT", (object)o.PayAmount),
                new OracleParameter(":BEFORE_BALANCE_NUM", (object)o.BeforeBalanceNum),
                new OracleParameter(":CREATOR", (object)o.Creator),
                new OracleParameter(":CREATE_TIME", (object)o.CreateTime),
@@ -264,7 +267,7 @@
            stringBuilder.Append(" , PRODUCT_ID =:PRODUCT_ID ");
            stringBuilder.Append(" , COMBO_ID =:COMBO_ID ");
            stringBuilder.Append(" , BASIC_NUM=:BASIC_NUM, GIVING_NUM=:GIVING_NUM, PRICE=:PRICE, ORDER_NUM_TOTAL=:ORDER_NUM_TOTAL, ORDER_AMOUNT_TOTAL=:ORDER_AMOUNT_TOTAL ");
            stringBuilder.Append(" , BEFORE_BALANCE_NUM =:BEFORE_BALANCE_NUM, CREATOR=:CREATOR, CREATE_TIME=:CREATE_TIME ");
            stringBuilder.Append(" , PAY_AMOUNT =:PAY_AMOUNT, BEFORE_BALANCE_NUM =:BEFORE_BALANCE_NUM, CREATOR=:CREATOR, CREATE_TIME=:CREATE_TIME ");
            stringBuilder.Append(" , STATUS=:STATUS, REMARK=:REMARK ");
            stringBuilder.Append(" WHERE ORDER_ID=:ORDER_ID ");
@@ -311,6 +314,7 @@
            o.Price = oracleReaderWrapper.GetInt("PRICE", 0);
            o.OrderNumTotal = oracleReaderWrapper.GetInt("ORDER_NUM_TOTAL", 0);
            o.OrderAmountTotal = oracleReaderWrapper.GetInt("ORDER_AMOUNT_TOTAL", 0);
            o.PayAmount = oracleReaderWrapper.GetInt("PAY_AMOUNT", 0);
            o.BeforeBalanceNum = oracleReaderWrapper.GetInt("BEFORE_BALANCE_NUM", 0);
            o.Creator = oracleReaderWrapper.GetString("CREATOR", "");
            o.CreateTime = oracleReaderWrapper.GetDateTime("CREATE_TIME");
web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache
Binary files differ
web/Dao/obj/Debug/Dao.csproj.FileListAbsolute.txt
@@ -7,7 +7,6 @@
D:\Company\SMGW_NewWeb\web\Dao\obj\Debug\Dao.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Lib\Dao.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Lib\Dao.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Dao\obj\Debug\Dao.csproj.AssemblyReference.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Dao\obj\Debug\Dao.csproj.CoreCompileInputs.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Dao\obj\Debug\Dao.csproj.CopyComplete
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\Dao\obj\Debug\Dao.dll
web/Dao/obj/Debug/Dao.dll
Binary files differ
web/Dao/obj/Debug/Dao.pdb
Binary files differ
web/Lib/Dao.dll
Binary files differ
web/Lib/Dao.pdb
Binary files differ
web/Lib/Model.dll
Binary files differ
web/Lib/Model.pdb
Binary files differ
web/Model/Model/GwOrder.cs
@@ -29,6 +29,8 @@
        public int OrderAmountTotal { get; set; }
        public int PayAmount { get; set; }
        public int BeforeBalanceNum { get; set; }
        public string Creator { get; set; }
web/Model/obj/Debug/Model.dll
Binary files differ
web/Model/obj/Debug/Model.pdb
Binary files differ
web/UMCLib/obj/Debug/UMCLib.csproj.AssemblyReference.cache
Binary files differ
web/web/Bin/Dao.dll
Binary files differ
web/web/Bin/Dao.pdb
Binary files differ
web/web/Bin/Model.dll
Binary files differ
web/web/Bin/Model.pdb
Binary files differ
web/web/GwOrder.ashx
@@ -9,6 +9,7 @@
{
    private GwOrderDao _Dao = new GwOrderDao();
    private GwSpDao _GwSpDao = new GwSpDao();
    private GwClientDao _GwClientDao = new GwClientDao();
    private GwOpGroupDao _GwOpGroupDao = new GwOpGroupDao();
    private GwProductDao _GwProductDao = new GwProductDao();
    private SysXhDao _SysXhDao = new SysXhDao();
@@ -286,6 +287,10 @@
        string orderId = context.GetString("orderId");
        int basicNum = context.GetInt("basicNum");
        int givingNum = context.GetInt("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);
        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);
        string remark = context.GetString("remark");
@@ -307,7 +312,7 @@
        if (gwOrder.Status !=0 && gwOrder.Status !=1)
            throw new ArgumentException("该订单已处理,操作失败!");
        clientId = gwOrder.ClientId;
        //获取订单审核流程
        string flowGroup = null;    //流程组合
@@ -417,10 +422,11 @@
        }
        else if(status==1)
        {
                int beforeBasicNum = 0;
                int beforeGivingNum = 0;
                int balance = 0;
            if(string.IsNullOrEmpty(nextFlowCode))
            int beforeBasicNum = 0;
            int beforeGivingNum = 0;
            int balance = 0;
            int topUpAmountTotal = 0;
            if (string.IsNullOrEmpty(nextFlowCode))
            {
                orderStatus = 2;
@@ -429,12 +435,17 @@
                beforeBasicNum = gwSp.BasicNum;
                beforeGivingNum = gwSp.GivingNum;
                balance = Convert.ToInt32(gwSp.Balance);
                //balance = Convert.ToInt32(gwSp.Balance);
                    //为1-预付费
                if (gwSp.ChargeType.Equals("1") && gwSp.Balance < num * basicNum )
                //获取客户信息
                GwClient gwClient = _GwClientDao.Get(gwSp.ClientID);
                balance =  int.Parse(gwClient.Balance.ToString() );
                topUpAmountTotal = int.Parse(gwClient.Top_up_Amount_Total.ToString() );
                //为1-预付费
                if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
                {
                        throw new ArgumentException("账号余额不足,请联系管理员!");
                    throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!");
                }
                //gwSp.Balance = balance - num * basicNum;
@@ -446,6 +457,18 @@
                    , beforeGivingNum + givingNum
                    , spId
                    );
                //有充值金额时,更新客户累计充值金额(厘)
                if (payAmount > 0) {
                    //GwClient gwClient = new GwClient();
                    gwClient = new GwClient();
                    gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount;    //累计金额:单位(厘)
                    gwClient.Balance = ((balance + payAmount) - num * basicNum) ;   //账户余额:单位(厘)
                    gwClient.ClientID = clientId;
                    _GwClientDao.UpdateClientAmount(gwClient);
                }
            }
            else
            {
@@ -462,8 +485,8 @@
            //newGwOrder.OrderAmountTotal = basicNum * num ;
            //newGwOrder.BeforeBalanceNum = beforeGivingNum + beforeGivingNum;
            //newGwOrder.Status = orderStatus;
                //更新订单
               _Dao.UpdateBalanceAndStatus(basicNum, givingNum, basicNum + givingNum, basicNum * num, beforeGivingNum + beforeGivingNum,orderStatus, orderId );
            //更新订单
            _Dao.UpdateBalanceAndStatus(basicNum, givingNum, basicNum + givingNum, basicNum * num, payAmount,  beforeGivingNum + beforeGivingNum, orderStatus, orderId );
            //Dao.Update(newGwOrder);
@@ -496,6 +519,7 @@
        int orderNumTotal = context.GetInt("orderNumTotal", 0);
        int orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        int payAmount = 0;
        int beforeBalanceNum = context.GetInt("beforeBalanceNum", 0);
        //客服人员提交订单时的状态为1-审核中。
        int status = 1; //0-待审核(已提交);1-审核中;2-审核通过;3-审核不通过;4-取消;申请订单在未审核情况下可以取消。
@@ -503,6 +527,8 @@
        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)), 1);
        payAmount = tmpPayAmount;
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
        price = num;
@@ -523,9 +549,32 @@
            throw new ArgumentException("账号不能为空!");
        }
        if (basicNum<=0 && givingNum <= 0)
        if (basicNum<=0 && givingNum <= 0 && payAmount <=0)
        {
            throw new ArgumentException("基本条数或赠送条数必须大于零!");
            throw new ArgumentException("充值金额或基本条数或赠送条数必须大于零!");
        }
        //获取账号信息
        GwSp gwSp = _GwSpDao.Get(spId);
        int balance = 0;
        if (gwSp == null)
        {
            throw new ArgumentException("账号不存在!");
        }
        else if (gwSp.Status==0)
        {
            throw new ArgumentException("账号已禁用!");
        }
        //获取客户信息
        GwClient gwClient = _GwClientDao.Get(gwSp.ClientID);
        balance =  int.Parse(gwClient.Balance.ToString() );
        //为1-预付费
        if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
        {
            throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!");
        }
        //获取订单审核流程
@@ -588,18 +637,6 @@
            throw new ArgumentException("用户没有充值权限,请联系管理员!");
        }
        //获取订单信息
        GwSp gwSp = _GwSpDao.Get(spId);
        if (gwSp == null)
        {
            throw new ArgumentException("账号不存在!");
        }
        else if (gwSp.Status==0)
        {
            throw new ArgumentException("账号已禁用!");
        }
        productId = gwSp.ProductId;
        price = gwSp.Price;
@@ -620,6 +657,7 @@
            Price = price,    //单价换算
            OrderNumTotal = orderNumTotal,
            OrderAmountTotal = orderAmountTotal,
            PayAmount = payAmount,
            BeforeBalanceNum = beforeBalanceNum,
            Status = status,
            Remark = remark,
@@ -628,19 +666,22 @@
        });
        string auditId = _SysXhDao.getXh("GW_ORDER_AUDIT");  //获取生成订单审核ID
        this._GwOrderAuditDao.Add(new GwOrderAudit()
        //流程组合为空时
        if (!string.IsNullOrEmpty(flowGroup))
        {
            AuditId = auditId,
            OrderId = orderId,
            AuditSort = sort,
            AuditStatus = status,
            Auditor = creator,
            //AuditReason = null,
            AuditTime = createTime
            string auditId = _SysXhDao.getXh("GW_ORDER_AUDIT");  //获取生成订单审核ID
            this._GwOrderAuditDao.Add(new GwOrderAudit()
            {
                AuditId = auditId,
                OrderId = orderId,
                AuditSort = sort,
                AuditStatus = status,
                Auditor = creator,
                //AuditReason = null,
                AuditTime = createTime
        });
            });
        }
        return new JsonPageResult(true, "生成订单信息成功!");
@@ -660,11 +701,15 @@
        int orderNumTotal = context.GetInt("orderNumTotal", 0);
        int orderAmountTotal = context.GetInt("orderAmountTotal", 0);
        int payAmount = 0;
        int 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)), 1);
        payAmount = tmpPayAmount;
        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
        price = num;
@@ -703,6 +748,7 @@
            Price = price,    //单价换算
            OrderNumTotal = orderNumTotal,
            OrderAmountTotal = orderAmountTotal,
            PayAmount = payAmount,
            BeforeBalanceNum = beforeBalanceNum,
            Status = status,
            Remark = remark,
web/web/GwOrderAudit.aspx
@@ -51,6 +51,7 @@
                $("#orderDialog #price").val(r.Message.Price / 1000, 0.00).attr("readonly", "readonly");
                $("#orderDialog #orderNumTotal").val(r.Message.OrderNumTotal, 0).attr("readonly", "readonly");
                $("#orderDialog #orderAmountTotal").val(r.Message.OrderAmountTotal / 1000, 0).attr("readonly", "readonly");
                $("#orderDialog #payAmount").val(r.Message.PayAmount / 1000, 0).attr("readonly", "readonly");
                $("#orderDialog #beforeBalanceNum").val(r.Message.BeforeBalanceNum, 0).attr("readonly", "readonly");
                $("#orderDialog #creator").val(r.Message.Creator).attr("readonly", "readonly");
                $("#orderDialog #createTime").val(r.Message.CreateTime).attr("readonly", "readonly");
@@ -83,11 +84,12 @@
                $("#orderDialog #clientId").val(r.Message.ClientId).attr("disabled", "disabled");
                $("#orderDialog #productId").val(r.Message.ProductId).attr("disabled", "disabled");
                //$("#orderDialog #comboId").val(r.Message.ComboId);
                $("#orderDialog #basicNum").val(r.Message.BasicNum, 0).attr("readonly", "readonly");
                $("#orderDialog #givingNum").val(r.Message.GivingNum, 0).attr("readonly", "readonly");
                $("#orderDialog #basicNum").val(r.Message.BasicNum, 0).attr("readonly", false);
                $("#orderDialog #givingNum").val(r.Message.GivingNum, 0).attr("readonly", false);
                $("#orderDialog #price").val(r.Message.Price / 1000, 0.00).attr("readonly", "readonly");
                $("#orderDialog #orderNumTotal").val(r.Message.OrderNumTotal, 0).attr("readonly", "readonly");
                $("#orderDialog #orderAmountTotal").val(r.Message.OrderAmountTotal / 1000, 0).attr("readonly", "readonly");
                $("#orderDialog #payAmount").val(r.Message.PayAmount / 1000, 0).attr("readonly", false);
                $("#orderDialog #beforeBalanceNum").val(r.Message.BeforeBalanceNum, 0).attr("readonly", "readonly");
                $("#orderDialog #creator").val(r.Message.Creator).attr("readonly", "readonly");
                $("#orderDialog #createTime").val(r.Message.CreateTime).attr("readonly", "readonly");
@@ -141,11 +143,12 @@
            var orderId = $("#orderId").val();
            var basicNum = $("#basicNum").val();
            var givingNum = $("#givingNum").val();
            var payAmount = $("#payAmount").val();
            var price = $("#price").val();
            var auditReason = $("#auditReason").val();
            mytek.confirm("是否确定审核通过该信息?", "数据更新后将无法恢复,请谨慎操作!", function (b) {
                if (b) {
                    $.post("gwOrder.ashx", { "action": "audit", status: 1, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, price: price, auditReason: auditReason }, function (result) {
                    $.post("gwOrder.ashx", { "action": "audit", status: 1, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, payAmount: payAmount, price: price, auditReason: auditReason }, function (result) {
                        mytek.alert(result.Message, result.OK, function () {
                            loadPageList();
                        });
@@ -161,11 +164,12 @@
            var orderId = $("#orderId").val();
            var basicNum = $("#basicNum").val();
            var givingNum = $("#givingNum").val();
            var payAmount = $("#payAmount").val();
            var price = $("#price").val();
            var auditReason = $("#auditReason").val();
            mytek.confirm("是否确定审核不通过该信息?", "数据更新后将无法恢复,请谨慎操作!", function (b) {
                if (b) {
                    $.post("gwOrder.ashx", { "action": "audit", status: 0, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, price: price, auditReason: auditReason }, function (result) {
                    $.post("gwOrder.ashx", { "action": "audit", status: 0, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, payAmount: payAmount, price: price, auditReason: auditReason }, function (result) {
                        mytek.alert(result.Message, result.OK, function () {
                            loadPageList();
                        });
@@ -336,7 +340,7 @@
                                订单基本条数</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="basicNum" id="basicNum" value="" maxlength="5"
                                <input type="text" class="form-control" name="basicNum" id="basicNum" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                                </div>
@@ -347,7 +351,7 @@
                                订单赠送条数</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="givingNum" id="givingNum" value="" maxlength="5"
                                <input type="text" class="form-control" name="givingNum" id="givingNum" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                                </div>
@@ -358,7 +362,7 @@
                                单价</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" class="form-control" name="price" id="price" value="" maxlength="5"
                                    <input type="text" class="form-control" name="price" id="price" value="" maxlength="10"
                                        onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                        oncontextmenu="return false" /><span class="input-group-addon">元/条 </span>
                                </div>
@@ -369,7 +373,7 @@
                                订单总条数</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="orderNumTotal" id="orderNumTotal" value="" maxlength="5"
                                <input type="text" class="form-control" name="orderNumTotal" id="orderNumTotal" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                                </div>
@@ -380,7 +384,18 @@
                                订单总金额</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="orderAmountTotal" id="orderAmountTotal" value="" maxlength="5"
                                <input type="text" class="form-control" name="orderAmountTotal" id="orderAmountTotal" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">元 </span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                充值金额</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="payAmount" id="payAmount" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">元 </span>
                                </div>
@@ -391,7 +406,7 @@
                                充值前账号余额</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <input type="text" class="form-control" name="beforeBalanceNum" id="beforeBalanceNum" value="" maxlength="5"
                                <input type="text" class="form-control" name="beforeBalanceNum" id="beforeBalanceNum" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                                </div>
web/web/GwOrderCreate.aspx
@@ -76,7 +76,7 @@
                    </div>
                    <div class="form-group classes-span classes-span-1">
                        <label class="col-sm-2 control-label">
                            用户余额</label>
                            客户余额</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <input type="text" class="form-control" value="<%=(double)Balance/1000 %>" 
@@ -85,12 +85,23 @@
                            </div>
                        </div>
                    </div>
                    <div class="form-group classes-span classes-span-1">
                        <label class="col-sm-2 control-label">
                            充值金额</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <input type="text" class="form-control" name="payAmount" id="payAmount" value="" maxlength="10"
                                    onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                    oncontextmenu="return false" /><span class="input-group-addon">元 </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            订单基本条数</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                            <input type="text" class="form-control" name="basicNum" id="basicNum" value="" maxlength="5"
                            <input type="text" class="form-control" name="basicNum" id="basicNum" value="" maxlength="10"
                                onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                            </div>
@@ -101,7 +112,7 @@
                            订单赠送条数</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                            <input type="text" class="form-control" name="givingNum" id="givingNum" value="" maxlength="5"
                            <input type="text" class="form-control" name="givingNum" id="givingNum" value="" maxlength="10"
                                onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                oncontextmenu="return false" /><span class="input-group-addon">条 </span>
                            </div>
@@ -131,7 +142,9 @@
            var spId = $("#spId").val();
            var clientId = $("#clientId").val();
            var productId = $("#productId").val();
            var productId = $("#productId").val();
            var price = $("#price").val();
            var payAmount = $("#payAmount").val();
            var basicNum = $("#basicNum").val();
            var givingNum = $("#givingNum").val();
            var remark = $("#remark").val();
@@ -140,9 +153,14 @@
                if (b) {
                    $.post("gwOrder.ashx", { action: "add", spId: spId, clientId: clientId, productId: productId, basicNum: basicNum, givingNum: givingNum, remark: remark }, function (r) {
                    $.post("gwOrder.ashx", { action: "add", spId: spId, clientId: clientId, productId: productId, price: price, payAmount:payAmount, basicNum: basicNum, givingNum: givingNum, remark: remark }, function (r) {
                        mytek.alert(r.Message, r.OK, function () {
                            //loadPageList();
                            if (r.OK) {
                                window.location = "GwSp.aspx";
                            } else {
                                mytek.alert(r.Message, false);
                            }
                        });
                    });
web/web/GwOrderCreate.aspx.cs
@@ -50,9 +50,16 @@
                    throw new ArgumentException("账号状态已停用!");
                }
                else
                GwClient gwClient = new GwClient();
                using (GwClientDao gwClientDao = new GwClientDao())
                {
                    this.GwOrder = new GwOrder();
                    gwClient = gwClientDao.Get(gwSp.ClientID);
                }
                this.GwOrder = new GwOrder();
                    this.GwOrder.SpId = gwSp.SpID;
                    this.GwOrder.ClientId = gwSp.ClientID;
                    this.GwOrder.ProductId = gwSp.ProductId;
@@ -60,8 +67,8 @@
                    this.GwOrder.BasicNum = gwSp.BasicNum;  //基本条数
                    this.GwOrder.GivingNum = gwSp.GivingNum;
                    this.Balance = gwSp.Balance;    //余额
                }
                //this.Balance = gwSp.Balance;    //余额
                this.Balance = long.Parse(gwClient.Balance.ToString() );    //余额
            }
            else
            {