| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | 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)); |
| | |
| | | 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); |