|
@@ -197,18 +197,22 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public HttpResponseResult<Boolean> batchAuth(AuthOperaReq authOperaReq, SysUser sysUser) {
|
|
|
Long[] ids = StringUtil.toLongArray(StringPool.COMMA, authOperaReq.getId());
|
|
|
- //todo 先判断三方余额是否充足,不足直接抛异常
|
|
|
+ //先判断三方余额是否充足
|
|
|
List<UserWithdrawal> userWithdrawals = baseMapper.selectList(Wrappers.<UserWithdrawal>lambdaQuery()
|
|
|
.in(UserWithdrawal::getId, ids)
|
|
|
.ne(UserWithdrawal::getAuthStatus, AuthStatusEnum.DOING));
|
|
|
//总提现金额
|
|
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
for (UserWithdrawal withdrawal : userWithdrawals) {
|
|
|
- if(null != withdrawal.getActualAmount()
|
|
|
- && BigDecimal.ZERO.compareTo(withdrawal.getActualAmount())<=0){
|
|
|
+ if (null != withdrawal.getActualAmount()
|
|
|
+ && BigDecimal.ZERO.compareTo(withdrawal.getActualAmount()) <= 0) {
|
|
|
totalAmount = totalAmount.add(withdrawal.getActualAmount());
|
|
|
}
|
|
|
}
|
|
|
+ BigDecimal useDecimal = withdrawSdk.balanceQuery();
|
|
|
+ if (useDecimal.compareTo(totalAmount) < 0) {
|
|
|
+ return HttpResponseResult.failed("账户余额不足");
|
|
|
+ }
|
|
|
|
|
|
for (Long id : ids) {
|
|
|
AuthOperaReq param = new AuthOperaReq();
|