| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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.setType(1); |
| | | accountChangeDetail.setChangeType(8); |
| | | accountChangeDetail.setOldData(driver.getBackgroundBalance()); |
| | | d = 0; |
| | | driver.setBackgroundBalance(driver.getBackgroundBalance() - d); |
| | | accountChangeDetail.setNewData(driver.getBackgroundBalance()); |
| | | 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); |
| | |
| | | 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.setType(1); |
| | | accountChangeDetail.setChangeType(8); |
| | | accountChangeDetail.setOldData(driver.getCouponBalance()); |
| | | d = 0; |
| | | driver.setCouponBalance(driver.getCouponBalance() - d); |
| | | accountChangeDetail.setNewData(driver.getCouponBalance()); |
| | | 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); |
| | |
| | | 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.setType(1); |
| | | accountChangeDetail.setChangeType(8); |
| | | accountChangeDetail.setOldData(driver.getCommission()); |
| | | d = 0; |
| | | driver.setCommission(driver.getCommission() - d); |
| | | accountChangeDetail.setNewData(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.setType(1); |
| | | accountChangeDetail.setChangeType(8); |
| | | accountChangeDetail.setOldData(driver.getBalance()); |
| | | d = 0; |
| | | driver.setBalance(driver.getBalance() - d); |
| | | accountChangeDetail.setNewData(driver.getBalance()); |
| | | accountChangeDetail.setExplain("收取保险费"); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | this.insert(accountChangeDetail); |
| | | d = 0; |
| | | } |
| | | } |
| | | |