生日有礼发放修改

This commit is contained in:
张松
2025-10-20 09:59:57 +08:00
parent a685819158
commit e71ae0e163
6 changed files with 30 additions and 14 deletions

View File

@@ -13,6 +13,8 @@ import com.czg.account.service.UserInfoService;
import com.czg.enums.ShopUserFlowBizEnum;
import com.czg.exception.ApiNotPrintException;
import com.czg.service.account.mapper.ShopUserMapper;
import com.czg.utils.MyQueryWrapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;
@@ -20,6 +22,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.List;
/**
@@ -124,4 +128,16 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
}
return userFlow.getId();
}
@Override
public List<ShopUser> selectBirthdayUser(LocalDate current, Long mainShopId, String userType) {
QueryWrapper queryWrapper = new QueryWrapper().isNotNull(ShopUser::getBirthDay)
.eq(ShopUser::getMainShopId, mainShopId)
.eq("DATE_FORMAT(birth_day, '%m-%d')", DateUtil.format(DateUtil.date(current), "MM-dd"));
if ("vip".equals(userType)) {
queryWrapper.eq(ShopUser::getIsVip, 1);
}
return list(queryWrapper);
}
}