称重 向下取整

会员活动
This commit is contained in:
2025-03-11 17:09:58 +08:00
parent 592518daca
commit ac9720570f
5 changed files with 38 additions and 20 deletions

View File

@@ -81,11 +81,11 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
}
@Override
public void giveActivate(ShopUser shopUser, BigDecimal memAmount, Long relationId) {
ShopActivate activate = queryChain().select().eq(ShopActivate::getShopId, shopUser.getShopId())
.le(ShopActivate::getAmount, memAmount)
.orderBy(ShopActivate::getGiftAmount, false)
.one();
public void giveActivate(ShopUser shopUser, BigDecimal memAmount, Long activateId, Long relationId) {
if (activateId == null) {
return;
}
ShopActivate activate = getById(activateId);
if (ObjectUtil.isNull(activate)) {
return;
}
@@ -164,7 +164,8 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
private List<ShopCoupon> getCoupons(String couponJson) {
Map<String, Integer> couponMap;
try {
couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {});
couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {
});
} catch (Exception e) {
return new ArrayList<>();
}