123
This commit is contained in:
@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cai.domain.AccountCash;
|
||||
import com.ruoyi.cai.dto.admin.vo.AccountCashAdminVo;
|
||||
import com.ruoyi.cai.dto.admin.vo.account.ExportBatchAuditVo;
|
||||
import com.ruoyi.cai.dto.app.query.WithdrawReq;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户提现记录Service接口
|
||||
*
|
||||
@@ -20,4 +23,7 @@ public interface AccountCashService extends IService<AccountCash> {
|
||||
Page<AccountCashAdminVo> pageAdmin(PageQuery pageQuery, AccountCashAdminVo bo);
|
||||
|
||||
void fail(Long id);
|
||||
|
||||
ExportBatchAuditVo batchAudit(List<AccountCashAdminVo> result);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ import com.ruoyi.cai.domain.AccountBankcard;
|
||||
import com.ruoyi.cai.domain.AccountCash;
|
||||
import com.ruoyi.cai.domain.WithdrawExchange;
|
||||
import com.ruoyi.cai.dto.admin.vo.AccountCashAdminVo;
|
||||
import com.ruoyi.cai.dto.admin.vo.account.ExportBatchAuditVo;
|
||||
import com.ruoyi.cai.dto.app.query.WithdrawReq;
|
||||
import com.ruoyi.cai.enums.AccountCashStatusEnum;
|
||||
import com.ruoyi.cai.enums.AuditStatusEnum;
|
||||
import com.ruoyi.cai.manager.IdManager;
|
||||
import com.ruoyi.cai.mapper.AccountCashMapper;
|
||||
import com.ruoyi.cai.service.AccountCashService;
|
||||
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, AccountCash> implements AccountCashService {
|
||||
@@ -84,5 +87,42 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExportBatchAuditVo batchAudit(List<AccountCashAdminVo> result) {
|
||||
ExportBatchAuditVo res = new ExportBatchAuditVo();
|
||||
Integer allNum = result.size();
|
||||
Integer successNum = 0;
|
||||
Integer ignoreNum = 0;
|
||||
Integer failNum = 0;
|
||||
for (AccountCashAdminVo vo : result) {
|
||||
try {
|
||||
AccountCash cash = this.getById(vo.getId());
|
||||
if(!AuditStatusEnum.AUDITING.getCode().equals(cash.getStatus())){
|
||||
ignoreNum++;
|
||||
continue;
|
||||
}
|
||||
boolean update = this.update(Wrappers.lambdaUpdate(AccountCash.class)
|
||||
.eq(AccountCash::getId, vo.getId())
|
||||
.eq(AccountCash::getStatus, AuditStatusEnum.AUDITING.getCode())
|
||||
.set(AccountCash::getVerifyTime, LocalDateTime.now())
|
||||
.set(AccountCash::getOperateIp, ServletUtils.getClientIP())
|
||||
.set(AccountCash::getStatus, AccountCashStatusEnum.SUCCESS.getCode()));
|
||||
if(update){
|
||||
successNum++;
|
||||
}else{
|
||||
ignoreNum++;
|
||||
}
|
||||
}catch (Exception e){
|
||||
failNum++;
|
||||
log.error("提现申请审核失败");
|
||||
}
|
||||
}
|
||||
res.setSuccessNum(successNum);
|
||||
res.setIgnoreNum(ignoreNum);
|
||||
res.setAllNum(allNum);
|
||||
res.setFailNum(failNum);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user