积分变动后数据问题

This commit is contained in:
2025-12-11 15:54:37 +08:00
parent d02b3ddd62
commit 0ee9770837

View File

@@ -119,6 +119,8 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
if (floatType == null) { if (floatType == null) {
throw new CzgException("积分变动类型不能为空"); throw new CzgException("积分变动类型不能为空");
} }
//points 取绝对值
points = Math.abs(points);
switch (floatType) { switch (floatType) {
case ADD: case ADD:
pointsUser.setPointBalance(pointsUser.getPointBalance() + points); pointsUser.setPointBalance(pointsUser.getPointBalance() + points);
@@ -140,7 +142,7 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
.shopUserId(pointsUser.getShopUserId()) .shopUserId(pointsUser.getShopUserId())
.floatType(floatType.getValue()) .floatType(floatType.getValue())
.floatPoints(Long.valueOf(points)) .floatPoints(Long.valueOf(points))
.balancePoints(pointsUser.getPointBalance() - points) .balancePoints(pointsUser.getPointBalance() + points)
.sourceId(sourceId.toString()) .sourceId(sourceId.toString())
.content(reason) .content(reason)
.build(); .build();