处理星级厨房临界投注问题
This commit is contained in:
@@ -302,7 +302,7 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService
|
||||
}
|
||||
String roundId = null;
|
||||
try {
|
||||
checkDrawParam(params, uid);
|
||||
Long costGoldTotal = checkDrawParam(params, uid);
|
||||
LuckySeaActInfo actInfo = luckySeaActInfoService.getByCurrTime();
|
||||
if (actInfo == null) {
|
||||
log.error("选择失败,当前时段不存在活动。actInfo:" + JSON.toJSONString(actInfo));
|
||||
@@ -314,11 +314,17 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService
|
||||
log.error("选择失败,当前不处于选择阶段。actInfo:" + JSON.toJSONString(actInfo));
|
||||
throw new ServiceException("Selection failed. It is not in the selection at present");
|
||||
}
|
||||
|
||||
// 扣减用户钻石
|
||||
log.info("【春日游园活动】 uid {} 消耗钻石总数 {}", uid, costGoldTotal);
|
||||
Boolean ret = userPurseService.subDiamond(uid, (double) costGoldTotal, Constant.BusinessType.LUCKY_SEA_DRAW);
|
||||
if (!ret) {
|
||||
throw new ServiceException(BusiStatus.DIAMONDNUMNOTENOUGH);
|
||||
}
|
||||
|
||||
// TODO: 2021/1/14 待优化,这里可以优化为批量写入
|
||||
Long costGoldTotal = 0L;
|
||||
for (LuckySeaActDrawParams param : params) {
|
||||
luckySeaUserDrawRecordService.updateUserDrawRecord(uid, actInfo.getRoundId(), param.getItemId(), param.getNum());
|
||||
costGoldTotal += param.getNum();
|
||||
}
|
||||
billRecordService.insertGeneralBillRecord(uid, null, null, BillObjTypeEnum.ACTIVITY_LUCKY_SEA_DRAW,
|
||||
-Double.valueOf(costGoldTotal));
|
||||
@@ -791,8 +797,8 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService
|
||||
costPieceTotal += param.getNum();
|
||||
}
|
||||
// 扣减用户钻石
|
||||
log.info("【春日游园活动】 uid {} 消耗钻石总数 {}", uid, costPieceTotal);
|
||||
userPurseService.subDiamond(uid, (double)costPieceTotal, Constant.BusinessType.LUCKY_SEA_DRAW);
|
||||
// log.info("【春日游园活动】 uid {} 消耗钻石总数 {}", uid, costPieceTotal);
|
||||
// userPurseService.subDiamond(uid, (double)costPieceTotal, Constant.BusinessType.LUCKY_SEA_DRAW);
|
||||
return costPieceTotal;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user