积分变动后数据问题
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user