From 016ddc332273c36e437a6f3b5f0a25574d5b7b78 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 05 九月 2025 09:12:43 +0800 Subject: [PATCH] bug修改 --- ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TIncomeController.java | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TIncomeController.java b/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TIncomeController.java index bf91ce1..4a24e18 100644 --- a/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TIncomeController.java +++ b/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TIncomeController.java @@ -140,7 +140,6 @@ tPubTransactionDetails.setOrderType(7); break; } - pubTransactionDetailsService.insert(tPubTransactionDetails); // type=1增加 type=2减少 switch (type){ case 1: @@ -148,22 +147,27 @@ BigDecimal add = tDriver.getBalance().add(bigDecimal); tDriver.setBalance(add); + BigDecimal laveBusinessMoney = new BigDecimal(tDriver.getLaveBusinessMoney()).add(bigDecimal); + tDriver.setLaveBusinessMoney(laveBusinessMoney.doubleValue()); break; case 2: BigDecimal bigDecimal1 = new BigDecimal(mount); BigDecimal subtract = tDriver.getBalance().subtract(bigDecimal1); int comparisonResult = subtract.compareTo(BigDecimal.ZERO); // 小于0 设置为0 不要为负数 - if (comparisonResult<0){ -// tDriver.setBalance(BigDecimal.ZERO); - - return 502; - }else{ + if (comparisonResult>0){ tDriver.setBalance(subtract); + } + BigDecimal laveBusinessMoney1 = new BigDecimal(tDriver.getLaveBusinessMoney()).subtract(bigDecimal1); + int comparisonResult1 = laveBusinessMoney1.compareTo(BigDecimal.ZERO); + if (comparisonResult1>0){ + tDriver.setLaveBusinessMoney(laveBusinessMoney1.doubleValue()); } break; } driverService.updateById(tDriver); + tPubTransactionDetails.setDriverBalance(tDriver.getLaveBusinessMoney()); + pubTransactionDetailsService.insert(tPubTransactionDetails); return SUCCESS_TIP; } /** @@ -209,7 +213,7 @@ temp.put("amount",income.getMoney()); temp.put("withType","订单号"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",income.getDriverBalance()); res.add(temp); } } @@ -245,7 +249,7 @@ temp.put("amount",income.getMoney()); temp.put("withType","订单号"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",income.getDriverBalance()); res.add(temp); } } @@ -270,7 +274,7 @@ temp.put("amount",details.getMoney()); temp.put("withType","交易流水号"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",details.getDriverBalance()); res.add(temp); } } @@ -295,7 +299,7 @@ temp.put("amount",details.getMoney()); temp.put("withType","交易流水号"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",details.getDriverBalance()); res.add(temp); } } @@ -320,7 +324,7 @@ temp.put("amount",details.getMoney()); temp.put("withType","无"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",details.getDriverBalance()); res.add(temp); } } @@ -346,7 +350,7 @@ temp.put("amount",details.getMoney()); temp.put("withType","无"); // todo 新增收入明细时 需要存储当前账户余额 - temp.put("balance",0); + temp.put("balance",details.getDriverBalance()); res.add(temp); } } -- Gitblit v1.7.1