xuhy
2023-06-14 831e3312572cf29dd91cbd882ef3dce809ac852d
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/AccountChangeDetailServiceImpl.java
@@ -134,17 +134,6 @@
            double d = num1.doubleValue();
            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());
                accountChangeDetail.setNewData(0D);
                accountChangeDetail.setExplain("收取保险费");
                accountChangeDetail.setCreateTime(new Date());
                this.insert(accountChangeDetail);
                d -= backgroundBalance;
                driver.setBackgroundBalance(0D);
            }
@@ -155,18 +144,15 @@
                accountChangeDetail.setUserId(driver.getId());
                accountChangeDetail.setType(1);
                accountChangeDetail.setChangeType(8);
                accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance());
                driver.setBackgroundBalance(driver.getBackgroundBalance() - d);
                accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance());
                accountChangeDetail.setExplain("收取保险费");
                accountChangeDetail.setCreateTime(new Date());
                this.insert(accountChangeDetail);
                d = 0;
            }
            if(d > 0){
                if(balance > 0 && balance < d){
                    continue;
                }
                if(balance > 0 && balance >= d){
                    AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
                    accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
@@ -174,9 +160,9 @@
                    accountChangeDetail.setUserId(driver.getId());
                    accountChangeDetail.setType(1);
                    accountChangeDetail.setChangeType(8);
                    accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                    accountChangeDetail.setOldData(all);
                    driver.setBalance(driver.getBalance() - d);
                    accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                    accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance());
                    accountChangeDetail.setExplain("收取保险费");
                    accountChangeDetail.setCreateTime(new Date());
                    this.insert(accountChangeDetail);