1. add lottery
This commit is contained in:
2026-02-15 00:05:34 +08:00
parent 9a086b86cd
commit 88a0a5616b
3 changed files with 25 additions and 70 deletions

View File

@@ -24,6 +24,7 @@
<if test="vo.userId!=null">
and user_id = #{vo.userId}
</if>
order by create_time desc
</select>

View File

@@ -84,6 +84,7 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
Assert.isTrue(amount.compareTo(BigDecimal.valueOf(100)) == 0 || amount.compareTo(BigDecimal.valueOf(1000)) == 0, "无效积分");
Assert.notNull(userId, "无效用户");
CommonUserPointEntity userPoint = getById(userId);
Assert.isTrue(userPoint.getAmount().compareTo(amount) >= 0, "积分不足");
BigDecimal lastAmount = userPoint.getAmount();
int i = baseMapper.deductUserPoint(userId, amount, userPoint.getVersion());
if (i > 0) {