后台-赠送钻石水晶-钻石消除记录

This commit is contained in:
khalil
2023-10-25 17:52:01 +08:00
parent bf2a243c73
commit d8ba333506

View File

@@ -85,7 +85,7 @@ public class OfficialGoldRecordService extends BaseService {
* @throws Exception
*/
@Transactional(rollbackFor = Exception.class)
public BusiResult handle(String ernos, OfficalSendTypeEnum type, Long num, int optId,
public BusiResult<Void> handle(String ernos, OfficalSendTypeEnum type, Long num, int optId,
Double actualAmount, String remark, Integer busType) throws Exception {
if (type == null) {
throw new ServiceException(BusiStatus.REQUEST_PARAM_ERROR);
@@ -101,7 +101,7 @@ public class OfficialGoldRecordService extends BaseService {
case OFFICAL_REDUCE_DIAMONDS:
return reduceDiamondNum(ernos, type.getValue(), num, optId, remark, busType);
}
return new BusiResult(BusiStatus.SERVERERROR);
return new BusiResult<>(BusiStatus.SERVERERROR);
}
/**
@@ -116,8 +116,8 @@ public class OfficialGoldRecordService extends BaseService {
* @return
* @throws Exception
*/
public BusiResult reduceDiamondNum(String ernos, byte type, Long num, int optId, String remark, Integer busType) throws Exception {
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
@Transactional(rollbackFor = Exception.class)
public BusiResult<Void> reduceDiamondNum(String ernos, byte type, Long num, int optId, String remark, Integer busType) throws Exception {
Users user = usersBaseService.getUsersByErBanNo(Long.valueOf(ernos.trim()));
if (user == null) {
throw new ServiceException(BusiStatus.USERNOTEXISTS);
@@ -126,12 +126,14 @@ public class OfficialGoldRecordService extends BaseService {
if (userPurse.getDiamonds() < num) {
throw new ServiceException(BusiStatus.DIAMONDNUMNOTENOUGH);
}
billRecordService.insertGeneralBillRecord(user.getUid(), user.getUid(), null,
int recordId = addGoldRecord(user, type, Constant.WalletCurrencyType.diamonds, num, optId, remark, busType);
//增加官方操作记录
billRecordService.insertGeneralBillRecord(user.getUid(), user.getUid(), String.valueOf(recordId),
BillObjTypeEnum.OFFICIAL_DIAMOND_REDUCE, Double.valueOf(num));
//更新剩余DB数量,//更新缓存中钻石的数量
this.userPurseService.subDiamond(user.getUid(), num.doubleValue(), BillObjTypeEnum.OFFICIAL_GOLD_REDUCE.getDesc());
return busiResult;
return BusiResult.success();
}
@@ -279,14 +281,14 @@ public class OfficialGoldRecordService extends BaseService {
* @return
*/
@Transactional(rollbackFor = Exception.class)
public BusiResult giveGold(String ernos, byte type, Long num, int optId, String remark, Integer busType) {
public BusiResult<Void> giveGold(String ernos, byte type, Long num, int optId, String remark, Integer busType) {
String lockval = null;
try {
lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000);
if (StringUtils.isEmpty(lockval)) {
throw new ServiceException(BusiStatus.SERVER_BUSY);
}
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
BusiResult<Void> busiResult = new BusiResult<>(BusiStatus.SUCCESS);
// 根据配置,发送微信提示消息
List<String> erbanNos = Arrays.asList(ernos.trim().split("\n"));