From 8e9440ea0a09fc6d9cea1c205904c51ccbf62a2a Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期一, 24 七月 2023 15:07:53 +0800
Subject: [PATCH] 超省2.0
---
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java | 44 ++++++++++++++++++++++++--------------------
1 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java
index 0b1b322..c33aa86 100644
--- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java
+++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java
@@ -129,7 +129,7 @@
}
double d = num1.doubleValue();
- if(backgroundBalance < d){
+ if(backgroundBalance > 0 && backgroundBalance < d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
@@ -143,24 +143,25 @@
this.insert(accountChangeDetail);
d -= backgroundBalance;
driver.setBackgroundBalance(0D);
- }else{
+ }
+ if(backgroundBalance > 0 && backgroundBalance >= d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
accountChangeDetail.setUserId(driver.getId());
accountChangeDetail.setType(1);
accountChangeDetail.setChangeType(8);
- accountChangeDetail.setOldData(driver.getBackgroundBalance());
- d = 0;
+ accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
driver.setBackgroundBalance(driver.getBackgroundBalance() - d);
- accountChangeDetail.setNewData(driver.getBackgroundBalance());
+ accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
accountChangeDetail.setExplain("收取保险费");
accountChangeDetail.setCreateTime(new Date());
this.insert(accountChangeDetail);
+ d = 0;
}
if(d > 0){
- if(couponBalance < d){
+ if(couponBalance > 0 && couponBalance < d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
@@ -174,24 +175,25 @@
this.insert(accountChangeDetail);
d -= couponBalance;
driver.setCouponBalance(0D);
- }else{
+ }
+ if(couponBalance > 0 && couponBalance >= d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
accountChangeDetail.setUserId(driver.getId());
accountChangeDetail.setType(1);
accountChangeDetail.setChangeType(8);
- accountChangeDetail.setOldData(driver.getCouponBalance());
- d = 0;
+ accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
driver.setCouponBalance(driver.getCouponBalance() - d);
- accountChangeDetail.setNewData(driver.getCouponBalance());
+ accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
accountChangeDetail.setExplain("收取保险费");
accountChangeDetail.setCreateTime(new Date());
this.insert(accountChangeDetail);
+ d = 0;
}
}
if(d > 0){
- if(commission < d){
+ if(commission > 0 && commission < d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
@@ -205,39 +207,41 @@
this.insert(accountChangeDetail);
d -= commission;
driver.setCommission(0D);
- }else{
+ }
+ if(commission > 0 && commission >= d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
accountChangeDetail.setUserId(driver.getId());
accountChangeDetail.setType(1);
accountChangeDetail.setChangeType(8);
- accountChangeDetail.setOldData(driver.getCommission());
- d = 0;
+ accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
driver.setCommission(driver.getCommission() - d);
- accountChangeDetail.setNewData(driver.getCommission());
+ accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
accountChangeDetail.setExplain("收取保险费");
accountChangeDetail.setCreateTime(new Date());
this.insert(accountChangeDetail);
+ d = 0;
}
}
if(d > 0){
- if(balance < d){
+ if(balance > 0 && balance < d){
continue;
- }else{
+ }
+ if(balance > 0 && balance >= d){
AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
accountChangeDetail.setUserType(2);
accountChangeDetail.setUserId(driver.getId());
accountChangeDetail.setType(1);
accountChangeDetail.setChangeType(8);
- accountChangeDetail.setOldData(driver.getBalance());
- d = 0;
+ accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
driver.setBalance(driver.getBalance() - d);
- accountChangeDetail.setNewData(driver.getBalance());
+ accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
accountChangeDetail.setExplain("收取保险费");
accountChangeDetail.setCreateTime(new Date());
this.insert(accountChangeDetail);
+ d = 0;
}
}
--
Gitblit v1.7.1