下单赠送积分 0的问题

This commit is contained in:
2025-12-11 17:15:50 +08:00
parent 1bd44d38c6
commit 9cbe81df41
2 changed files with 6 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ public class MkPointsConfigServiceImpl extends ServiceImpl<MkPointsConfigMapper,
}
}
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
if (awardPoints.compareTo(BigDecimal.ZERO) <= 0) {
return;
}
mkPointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
}

View File

@@ -116,6 +116,9 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
@Override
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, Long sourceId, String reason) {
if (points <= 0) {
return null;
}
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
if (floatType == null) {
throw new CzgException("积分变动类型不能为空");