提现-记录-使用自增id
This commit is contained in:
@@ -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()
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user