Browse Source

充值金额取值错误

qzyReal 2 years ago
parent
commit
685cb7b2a5

+ 265 - 248
sp-admin/sa-view/tb-account/tb-account-add.html

@@ -1,255 +1,272 @@
 <!DOCTYPE html>
 <html>
-<head>
-    <title>客户账户-添加</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <meta name="viewport"
-          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
-    <!-- 所有的 css js 资源 -->
-    <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
-    <link rel="stylesheet" href="../../static/sa.css">
-    <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
-    <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
-    <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
-    <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
-    <script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
-    <script src="../../static/sa.js"></script>
-    <script src="../../static/kj/upload-util.js"></script>
-    <script src="../../static/node_modules/crypto-js/crypto-js.js"></script>
-    <style type="text/css">
-        .c-panel .el-form .c-label {
-            width: 8em !important;
-        }
+	<head>
+		<title>客户账户-添加</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
+		<script src="../../static/node_modules/crypto-js/crypto-js.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 8em !important;
+			}
 
-        .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner {
-            width: 250px;
-        }
-        #ast .c-label:before{
-            content: '*';
-            color:red;
-        }
-    </style>
-</head>
-<body>
-<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
-    <!-- ------- 内容部分 ------- -->
-    <div class="s-body">
-        <div class="c-panel" style="text-align:center; ">
-            <div class="c-title">充值</div>
-            <el-form v-if="m">
-<!--                <sa-item type="text" name="主键" v-model="m.id" br></sa-item>-->
-<!--                <sa-item type="text" name="客户id" v-model="m.customerId" br></sa-item>-->
-                <sa-item type="text" name="客户名称" v-model="m.customerName" :disabled="true" br></sa-item>
-                <sa-item type="text" name="客户余额" v-model="m.totalMoney" :disabled="true" br></sa-item>
-                <sa-item id="ast" type="text"  name="预存金额" br>
-                    <el-input v-model="m.preTopupMoney" placeholder="请输入金额"  @change="computeChange" >
-                        <template slot="suffix">元</template>
-                    </el-input>
-                </sa-item>
-                <sa-item type="text" name="优惠金额"  br>
-                    <el-input type="text" v-model="m.discountMoney" placeholder="请输入金额"  @change="computeChange" >
-                        <template slot="suffix">元</template>
-                    </el-input>
-                </sa-item>
-                <sa-item  type="text" name="总计充值" br>
-                    <el-input ref="totalTopupInp" type="text" v-model="m.totalTopup" :disabled="true">
-                        <template slot="suffix">元</template>
-                    </el-input>
-                </sa-item>
-                <sa-item  type="enum" name="付款方式" br>
-                    <el-select v-model="m.payingType">
-                        <el-option label="请选择" v-for="(item,index) in payingTypeList" :key="item.id" :label="item.name"
-                                   :value="item.id">
-                        </el-option>
-                    </el-select>
-                </sa-item>
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
 
-                <sa-item type="textarea" name="充值说明" v-model="m.remark" :rows="2" br></sa-item>
-                <sa-item name="" class="s-ok" br>
-                    <el-button type="primary" icon="el-icon-plus" @click="ok()">确认充值</el-button>
-                </sa-item>
-            </el-form>
-        </div>
-    </div>
-    <!-- ------- 底部按钮 ------- -->
-<!--    <div class="s-foot">-->
-<!--        <el-button type="primary" @click="ok()">确定</el-button>-->
-<!--        <el-button @click="sa.closeCurrIframe()">取消</el-button>-->
-<!--    </div>-->
-</div>
-<script>
+			#ast .c-label:before {
+				content: '*';
+				color: red;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel" style="text-align:center; ">
+					<div class="c-title">充值</div>
+					<el-form v-if="m">
+						<!--                <sa-item type="text" name="主键" v-model="m.id" br></sa-item>-->
+						<!--                <sa-item type="text" name="客户id" v-model="m.customerId" br></sa-item>-->
+						<sa-item type="text" name="客户名称" v-model="m.customerName" :disabled="true" br></sa-item>
+						<sa-item type="text" name="客户余额" v-model="m.totalMoney" :disabled="true" br></sa-item>
+						<sa-item id="ast" type="text" name="充值金额" br>
+							<el-input v-model="m.preTopupMoney" placeholder="请输入金额" @change="computeChange">
+								<template slot="suffix">元</template>
+							</el-input>
+						</sa-item>
+						<sa-item type="text" name="优惠金额" br>
+							<el-input type="text" v-model="m.discountMoney" placeholder="请输入金额" @change="computeChange">
+								<template slot="suffix">元</template>
+							</el-input>
+						</sa-item>
+						<sa-item type="text" name="实收金额" br>
+							<el-input ref="totalTopupInp" type="text" v-model="m.totalTopup" :disabled="true">
+								<template slot="suffix">元</template>
+							</el-input>
+						</sa-item>
+						<sa-item type="enum" name="付款方式" br>
+							<el-select v-model="m.payingType">
+								<el-option label="请选择" v-for="(item,index) in payingTypeList" :key="item.id"
+									:label="item.name" :value="item.id">
+								</el-option>
+							</el-select>
+						</sa-item>
+						<sa-item type="textarea" name="充值说明" v-model="m.remark" :rows="2" br></sa-item>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', ''),
+					customerId: sa.p('customerId', 0), // 获取超链接中的id参数(0=添加,非0=修改)
+					m: null, // 实体对象
+					payingTypeList: [], //付款方式集合
+				},
 
-    var app = new Vue({
-        components: {
-            "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
-        },
-        el: '.vue-box',
-        data: {
-            id: '',
-            customerId: sa.p('customerId', 0),		// 获取超链接中的id参数(0=添加,非0=修改)
-            m: null,		// 实体对象
-            payingTypeList:[], //付款方式集合
-        },
+				methods: {
+					// 创建一个 默认Model
+					createModel: function() {
+						return {
+							id: '', // 主键
+							customerId: sa.p('customerId', ''), // 客户id
+							customerName: '',
+							totalMoney: '', // 总金额
+							preTopupMoney: '', //预充值金额
+							discountMoney: '', //优惠金额
+							totalTopup: '', //总计充值
+							payingType: '',
+							salt: '',
+							remark: '', // 备注
+						}
+					},
+					// 提交数据
+					ok: function() {
+						let that = this;
+						let m = {
+							...this.m
+						};
+						sa.checkNull(m.preTopupMoney, '预存金额不能为空!');
+						if (!this.computeChange()) {
+							return;
+						}
+						const key = 'h!f78tr#L3D$2Z0q';
+						m.salt = key.split("").reverse().join("");
+						m.totalTopup = this.encrypt(m.totalTopup, key);
+						m.discountMoney = this.encrypt(m.discountMoney, key);
+						m.preTopupMoney = this.encrypt(m.preTopupMoney, key);
+						m.id = sa.p('id', 0);
+						sa.ajax('/TbAccount/recharge2', sa.removeNull(m), function(res) {
+							layer.open({
+								content: '充值成功!', //内容区域
+								move: false, //是否可以拖动,默认可以拖动
+								btn: ['确定'],
+								btn1: function(index) {
+									//    layer.close(index);//关闭弹框
+									that.clean();
+								},
+								cancel: function() {
+									that.clean();
+								}
+							});
 
-        methods: {
-            // 创建一个 默认Model
-            createModel: function () {
-                return {
-                    id: '',		// 主键
-                    customerId: '',		// 客户id
-                    customerName: '',
-                    // lockMoney: '',		// 冻结金额
-                    // actMoney: '',		// 可用金额
-                    totalMoney: '',		// 总金额
-                    preTopupMoney: '',		//预充值金额
-                    discountMoney:'',  //优惠金额
-                    totalTopup:'',  //总计充值
-                    payingType:'',
-                    salt:'',
-                    // status: '',		// 状态(0=禁用,1=启用)
-                    remark: '',		// 备注
-                }
-            },
-            // 提交数据
-            ok: function () {
-                let that = this;
-                let m = {...this.m};
-                sa.checkNull(m.preTopupMoney, '预存金额不能为空!');
-                if(!this.computeChange()){
-                    return;
-                }
-                const key = 'h!f78tr#L3D$2Z0q';
-                m.salt = key.split("").reverse().join("");
-                m.totalTopup = this.encrypt(m.totalTopup,key);
-                m.discountMoney = this.encrypt(m.discountMoney,key);
-                m.preTopupMoney = this.encrypt(m.preTopupMoney,key);
-                m.id = sa.p('id', 0);
-                sa.ajax('/TbAccount/recharge2', sa.removeNull(m), function (res) {
-                    layer.open({
-                        content: '充值成功!',//内容区域
-                        move: false,//是否可以拖动,默认可以拖动
-                        btn: ['确定'],
-                        btn1: function(index){
-                        //    layer.close(index);//关闭弹框
-                            that.clean();
-                        },
-                        cancel: function(){
-                            that.clean();
-                        }
-                    });
+						}.bind(this));
 
-                }.bind(this));
-
-            },
-            // 添加/修改 完成后的动作
-            clean: function () {
-                parent.app.f5();		// 刷新父页面列表
-                sa.closeCurrIframe();	// 关闭本页
-            },
-            getPayingType(){
-                sa.ajax('/TbAccount/getPayingType',  function (res) {
-                    this.payingTypeList = res.data;
-                }.bind(this))
-            },
-            computeChange(value){
-                let preMoney = this.m.preTopupMoney;
-                let disMoney = this.m.discountMoney;
-                if(!disMoney){
-                    disMoney=0;
-                }
-                if(isNaN(preMoney)){
-                    throw {type: 'sa-error', msg: "预充值金额必须是数字!"};
-                    return false;
-                }
-                if(isNaN(disMoney)){
-                    throw {type: 'sa-error', msg: "优惠金额必须是数字!"};
-                    return false;
-                }
-                if(preMoney.length>1 && preMoney.substring(0,1)==0){
-                    throw {type: 'sa-error', msg: "请输入规范的数字,前面不要带零!"};
-                    return false;
-                }
-                if(disMoney.length>1 && disMoney.substring(0,1)==0){
-                    throw {type: 'sa-error', msg: "请输入规范的数字,前面不要带零!"};
-                    return false;
-                }
-                if(!preMoney){
-                    return false;
-                }
-                preMoney = Number(preMoney);
-                disMoney = Number(disMoney);
-                if(preMoney<=0){
-                    throw {type: 'sa-error', msg: "预存金额需大于零元!"};
-                    return false;
-                }
-                if(disMoney<0){
-                    throw {type: 'sa-error', msg: "优惠金额不得低于零元!"};
-                    return false;
-                }
-                let totalM = preMoney-disMoney;
-                if(totalM<=0){
-                    throw {type: 'sa-error', msg: "总计金额是:"+totalM+",需大于零元!"};
-                    return false;
-                }
-                delete this.m.totalTopup;
-                this.$set(this.m,"totalTopup",totalM)
-                return true;
-            },
-            encrypt(word, keyStr) { // word, keyStr第一个参数是加密的字段名字  第二个是key值(16位)
-                if(!word){
-                    return;
-                }
-                if (typeof word === 'object') {
-                    // 如果传入的data是json对象,先转义为json字符串
-                    try {
-                        word = JSON.stringify(word);
-                    } catch (error) {
-                        console.log('error:', error);
-                    }
-                }
-                keyStr = keyStr || 'h!f78tr#L3D$2Z0q'; // 密文(密钥)
-                let key = CryptoJS.enc.Utf8.parse(keyStr);
-                let src = CryptoJS.enc.Utf8.parse(word);
-                let encrypted = CryptoJS.AES.encrypt(src, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
-                //  console.log(encrypted.toString())
-                return CryptoJS.enc.Base64.stringify(encrypted.ciphertext);
-            },
-            decrypt(word, keyStr) {
-                if(!word){
-                    return;
-                }
-                keyStr = keyStr || 'h!f78tr#L3D$2Z0q';
-                let base64 = CryptoJS.enc.Base64.parse(word);
-                let src = CryptoJS.enc.Base64.stringify(base64);
-                let key = CryptoJS.enc.Utf8.parse(keyStr);
-                let decrypt = CryptoJS.AES.decrypt(src, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
-                //  let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
-                return CryptoJS.enc.Utf8.stringify(decrypt).toString();
-            },
-        },
-        mounted: function () {
-            // 初始化数据
-            this.m = this.createModel();
-            this.m.customerId = this.customerId;
-            this.getPayingType();
-            sa.ajax('/TbAccount/getList', sa.removeNull(this.m), function (res) {
-                if(res.data && res.data.length==1){
-                    this.m = res.data[0];
-                    if(this.m.totalMoney){
-                        this.m.totalMoney = this.decrypt(this.m.totalMoney,this.m.salt);
-                    }else {
-                        this.m.totalMoney = 0;
-                    }
-                    this.$set(this.m,"discountMoney",0);
-                    this.$set(this.m,"payingType",1);
-                }else {
-                    sa.alert('未能查找到客户详细数据,窗口将在5秒后关闭!');
-                    setTimeout(function(){ sa.closeCurrIframe() }, 5000)
-                }
-            }.bind(this))
-        }
-    })
-
-</script>
-</body>
-</html>
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						parent.app.f5(); // 刷新父页面列表
+						sa.closeCurrIframe(); // 关闭本页
+					},
+					getPayingType() {
+						sa.ajax('/TbAccount/getPayingType', function(res) {
+							this.payingTypeList = res.data;
+						}.bind(this))
+					},
+					computeChange(value) {
+						let preMoney = this.m.preTopupMoney;
+						let disMoney = this.m.discountMoney;
+						if (!disMoney) {
+							disMoney = 0;
+						}
+						if (isNaN(preMoney)) {
+							throw {
+								type: 'sa-error',
+								msg: "预充值金额必须是数字!"
+							};
+							return false;
+						}
+						if (isNaN(disMoney)) {
+							throw {
+								type: 'sa-error',
+								msg: "优惠金额必须是数字!"
+							};
+							return false;
+						}
+						if (preMoney.length > 1 && preMoney.substring(0, 1) == 0) {
+							throw {
+								type: 'sa-error',
+								msg: "请输入规范的数字,前面不要带零!"
+							};
+							return false;
+						}
+						if (disMoney.length > 1 && disMoney.substring(0, 1) == 0) {
+							throw {
+								type: 'sa-error',
+								msg: "请输入规范的数字,前面不要带零!"
+							};
+							return false;
+						}
+						if (!preMoney) {
+							return false;
+						}
+						preMoney = Number(preMoney);
+						disMoney = Number(disMoney);
+						if (preMoney <= 0) {
+							throw {
+								type: 'sa-error',
+								msg: "预存金额需大于零元!"
+							};
+							return false;
+						}
+						if (disMoney < 0) {
+							throw {
+								type: 'sa-error',
+								msg: "优惠金额不得低于零元!"
+							};
+							return false;
+						}
+						let totalM = preMoney - disMoney;
+						delete this.m.totalTopup;
+						this.$set(this.m, "totalTopup", totalM)
+						return true;
+					},
+					encrypt(word, keyStr) { // word, keyStr第一个参数是加密的字段名字  第二个是key值(16位)
+						if (!word) {
+							return;
+						}
+						if (typeof word === 'object') {
+							// 如果传入的data是json对象,先转义为json字符串
+							try {
+								word = JSON.stringify(word);
+							} catch (error) {
+								console.log('error:', error);
+							}
+						}
+						keyStr = keyStr || 'h!f78tr#L3D$2Z0q'; // 密文(密钥)
+						let key = CryptoJS.enc.Utf8.parse(keyStr);
+						let src = CryptoJS.enc.Utf8.parse(word);
+						let encrypted = CryptoJS.AES.encrypt(src, key, {
+							mode: CryptoJS.mode.ECB,
+							padding: CryptoJS.pad.Pkcs7
+						});
+						//  console.log(encrypted.toString())
+						return CryptoJS.enc.Base64.stringify(encrypted.ciphertext);
+					},
+					decrypt(word, keyStr) {
+						if (!word) {
+							return;
+						}
+						keyStr = keyStr || 'h!f78tr#L3D$2Z0q';
+						let base64 = CryptoJS.enc.Base64.parse(word);
+						let src = CryptoJS.enc.Base64.stringify(base64);
+						let key = CryptoJS.enc.Utf8.parse(keyStr);
+						let decrypt = CryptoJS.AES.decrypt(src, key, {
+							mode: CryptoJS.mode.ECB,
+							padding: CryptoJS.pad.Pkcs7
+						});
+						//  let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
+						return CryptoJS.enc.Utf8.stringify(decrypt).toString();
+					},
+				},
+				mounted: function() {
+					// 初始化数据
+					this.m = this.createModel();
+					this.m.customerId = this.customerId;
+					this.getPayingType();
+					sa.ajax('/TbAccount/getList', sa.removeNull(this.m), function(res) {
+						if (res.data && res.data.length == 1) {
+							this.m = res.data[0];
+							if (this.m.totalMoney) {
+								this.m.totalMoney = this.decrypt(this.m.totalMoney, this.m.salt);
+							} else {
+								this.m.totalMoney = 0;
+							}
+							this.$set(this.m, "discountMoney", 0);
+							this.$set(this.m, "payingType", 1);
+						} else {
+							sa.alert('未能查找到客户详细数据,窗口将在5秒后关闭!');
+							setTimeout(function() {
+								sa.closeCurrIframe()
+							}, 5000)
+						}
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 9 - 12
sp-admin/sa-view/tb-account/tb-account-list.html

@@ -43,17 +43,14 @@
             <sa-td name="银行账户" prop="bankAccount"></sa-td>
             <sa-td name="地址" prop="address"></sa-td>
             <sa-td name="余额(元)" prop="totalMoney"></sa-td>
-            <sa-td name="操作" >
-                <template slot-scope="s">
-                    <el-button class="c-btn" type="success" icon="el-icon-view" 
-                               @click="add(s.row)">充值</el-button>
-                    <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="sa.isAuth('tb-account-list-update')"
-                               @click="update(s.row)">修改</el-button>
-                </template>
-            </sa-td>
-<!--            <el-table-column label="操作" fixed="right" width="240px">-->
-<!--                -->
-<!--            </el-table-column>-->
+           <el-table-column label="操作" fixed="right" width="240px">
+              <template slot-scope="s">
+                  <el-button class="c-btn" type="success" icon="el-icon-view" 
+                             @click="add(s.row)">充值</el-button>
+                  <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="sa.isAuth('tb-account-list-update')"
+                             @click="update(s.row)">修改</el-button>
+              </template>
+           </el-table-column>
         </el-table>
         <!-- ------------- 分页 ------------- -->
         <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
@@ -130,7 +127,7 @@
             // 新增
             add: function (data) {
                 sa.showIframe('新增数据', 'tb-account-add.html?customerId=' + data.customerId +
-                    '&id='+data.id, '1000px', '90%');
+                    '&id='+data.id, '700px', '70%');
             },
             // 删除
             // del: function (data) {

+ 1 - 4
sp-admin/sa-view/tb-charge-record/tb-charge-record-list.html

@@ -55,10 +55,7 @@
 <!--				<sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>-->
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
-					<sa-td type="selection"></sa-td>
-					<sa-td name="主键" prop="id" v-if="false"></sa-td>
-					<sa-td name="客户账户id" prop="accountId" v-if="false"></sa-td>
-					<sa-td name="客户id" prop="customerId" ></sa-td>
+					<sa-td type="index" name="序号"></sa-td>
 					<sa-td name="客户名称" prop="customerName" ></sa-td>
 					<sa-td name="充值金额(元)" prop="preTopupMoney" ></sa-td>
 					<sa-td name="优惠金额(元)" prop="discountMoney" ></sa-td>

+ 0 - 1
sp-admin/sa-view/tb-deduction-bind/tb-deduction-bind-list.html

@@ -57,7 +57,6 @@
         <el-table class="data-table" ref="data-table" :data="dataList" @select="selectRow" @row-click="handleRowClick">
             <sa-td type="selection"></sa-td>
             <sa-td name="主键" prop="id" v-if="false"></sa-td>
-            <sa-td name="客户id" prop="customerId"></sa-td>
             <sa-td name="客户名称" prop="customerName"></sa-td>
             <sa-td name="扣除金额" prop="deductMoney"></sa-td>
             <sa-td name="绑定车辆" prop="bindCar"></sa-td>

+ 6 - 6
sp-server/src/main/java/com/pj/project/tb_account/TbAccountService.java

@@ -99,21 +99,21 @@ public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> im
      */
     public void recharge(SoMap so){
         String salt = so.getString("salt");
-        String totalTopup = so.getString("totalTopup");//总计充值金额
+        String preTopupMoney = so.getString("preTopupMoney");//总计充值金额
         String key = AesUtil.reverse(salt);
-        String decTotalTopup = AesUtil.decryptECB(totalTopup,key);
+        String decTotalTopup = AesUtil.decryptECB(preTopupMoney,key);
         if(!NumberUtil.isNumber(decTotalTopup)){
             throw new AjaxError("充值金额必须是数字!");
         }
         if(Double.valueOf(decTotalTopup)<=0){
             throw new AjaxError("总计充值金额不得小于零元!");
         }
-        String beforeBalance = totalTopup;
+        String beforeBalance = preTopupMoney;
         TbAccount account = null;
         String accIdStr = so.getString("id");
         if(!NumberUtil.isNumber(accIdStr)){
             account = getTbAccountByMap(so);
-            account.setTotalMoney(totalTopup);
+            account.setTotalMoney(preTopupMoney);
             account.setAccSalt(salt);
         }else {
             long accId = Long.parseLong(accIdStr);
@@ -134,8 +134,8 @@ public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> im
         record.setId(null);
         record.setStatus(1);
         record.setAccountId(account.getId());
-        record.setTotalTopupMoney(totalTopup);
-        record.setPreTopupMoney(so.getString("preTopupMoney"));
+        record.setTotalTopupMoney(preTopupMoney);
+       record.setPreTopupMoney(preTopupMoney);
         record.setDiscountMoney(so.getString("discountMoney"));
         record.setTotalMoney(account.getTotalMoney());
         record.setBeforeBalance(beforeBalance);