下单赠送积分 0的问题
This commit is contained in:
@@ -59,6 +59,9 @@ public class MkPointsConfigServiceImpl extends ServiceImpl<MkPointsConfigMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
|
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,
|
mkPointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
||||||
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, Long sourceId, String reason) {
|
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);
|
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
|
||||||
if (floatType == null) {
|
if (floatType == null) {
|
||||||
throw new CzgException("积分变动类型不能为空");
|
throw new CzgException("积分变动类型不能为空");
|
||||||
|
|||||||
Reference in New Issue
Block a user