活动赠送券

This commit is contained in:
wangw 2025-03-10 14:13:28 +08:00
parent c9b37c0c91
commit 6545f98ab5
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import com.czg.sa.StpKit;
import com.czg.service.account.mapper.ShopActivateMapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import java.math.BigDecimal;
@ -38,6 +39,7 @@ import java.util.Map;
* @author ww
* @since 2025-02-17
*/
@Slf4j
@DubboService
public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, ShopActivate> implements ShopActivateService {
@ -86,8 +88,9 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
if (ObjectUtil.isNull(activate)) {
return;
}
log.info("赠送活动:{}", activate);
//赠送优惠券
if (activate.getIsGiftCoupon() == 1) {
if (activate.getIsGiftCoupon() == 1 && StrUtil.isNotBlank(activate.getCoupons())) {
Map<Long, Integer> couponUseMap = JSONObject.parseObject(activate.getCoupons(), new TypeReference<>() {
});
Map<Long, ShopCoupon> couponMap = new HashMap<>();