|
|
@@ -486,22 +486,25 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
AccountFreezd accountFreezd = accountFreezdService.findById(id);
|
|
|
// 可用冻结金额
|
|
|
BigDecimal canUseAmount = accountFreezd.getAmount().subtract(accountFreezd.getUnfreezeAmount());
|
|
|
- // 解冻账户金额
|
|
|
- Account account = accountService.getAccount(accountFreezd.getUserId(), 1);
|
|
|
- account.setFreezeAmount(account.getFreezeAmount().subtract(partialThawAmount));
|
|
|
- accountService.update(account);
|
|
|
// 可用金额小于等于总金额
|
|
|
if (canUseAmount.compareTo(partialThawAmount) != 1) {
|
|
|
accountFreezd.setStatus(3);
|
|
|
accountFreezd.setUnfreezeAmount(accountFreezd.getAmount());
|
|
|
accountFreezd.setUpdateTime(new Date());
|
|
|
accountFreezdService.update(accountFreezd);
|
|
|
+ // 解冻账户金额
|
|
|
+ Account account = accountService.getAccount(accountFreezd.getUserId(), 1);
|
|
|
+ account.setFreezeAmount(account.getFreezeAmount().subtract(canUseAmount));
|
|
|
+ accountService.update(account);
|
|
|
return partialThawAmount.subtract(canUseAmount);
|
|
|
} else {
|
|
|
accountFreezd.setStatus(2);
|
|
|
accountFreezd.setUnfreezeAmount(accountFreezd.getUnfreezeAmount().add(partialThawAmount));
|
|
|
accountFreezd.setUpdateTime(new Date());
|
|
|
accountFreezdService.update(accountFreezd);
|
|
|
+ Account account = accountService.getAccount(accountFreezd.getUserId(), 1);
|
|
|
+ account.setFreezeAmount(account.getFreezeAmount().subtract(partialThawAmount.subtract(canUseAmount)));
|
|
|
+ accountService.update(account);
|
|
|
return BigDecimal.ZERO;
|
|
|
}
|
|
|
}
|