提现-记录-使用自增id

This commit is contained in:
khalil
2024-12-19 12:44:37 +08:00
parent bf95d3ec0b
commit 8f781f36f4
2 changed files with 4 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ import com.accompany.common.model.PageReq;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.constant.BlockStatusEnum;
import com.accompany.core.enumeration.BillObjTypeEnum;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.exception.ServiceException;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -94,12 +95,12 @@ public class WithdrawUserRecordAdminServiceImpl implements WithdrawUserRecordAdm
@Override
public void grant(Long id, Integer isSecretary, Integer adminId) {
if (id == null) {
throw new ServiceException("缺少ID");
throw new AdminServiceException("缺少ID");
}
log.info("grant id : {}, adminId : {}", id, adminId);
WithdrawUserRecord record = withdrawUserRecordService.getById(id);
if (record == null) {
return;
throw new AdminServiceException("找不到"+ id +"记录");
}
LocalDateTime now = LocalDateTime.now();
withdrawUserRecordService.update(Wrappers.<WithdrawUserRecord>lambdaUpdate()

View File

@@ -267,11 +267,9 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl<WithdrawUserAcco
if ((totalGoldNum + goldNum) > weekMaxValue) {
throw new ServiceException(BusiStatus.THE_TOTAL_NUMBER_OF_GOLD_COINS_PER_WEEK_EXCEEDS_THE_LIMIT_WEEKMAXVALUE.format(weekMaxValue));
}
long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
String recordIdStr = String.valueOf(recordId);
//扣减钱包
userPurseService.subGold(uid, goldNum.doubleValue(), BillObjTypeEnum.WITHDRAW, BusiStatus.WITHDRAW_NOT_ENOUGH_GOLD,
(up)-> billRecordService.insertGeneralBillRecord(uid, recordIdStr, BillObjTypeEnum.WITHDRAW, goldNum.doubleValue(), up));
(up)-> billRecordService.insertGeneralBillRecord(uid, BillObjTypeEnum.WITHDRAW, goldNum.doubleValue(), up));
//汇率金额
WithdrawAmountHolder holder = calculate(uid, accountType, goldNum);
String accountName = holder.getAccountName();
@@ -285,7 +283,6 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl<WithdrawUserAcco
//保存记录
WithdrawUserRecord record = new WithdrawUserRecord();
BeanUtils.copyProperties(withdrawUserAccount, record);
record.setId(recordId);
record.setCreateTime(currentDate);
record.setUpdateTime(currentDate);
record.setUid(uid);