生日有礼发放修改
This commit is contained in:
@@ -172,15 +172,9 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl<MkBirthdayGiftMapper,
|
||||
// 获取当月第一天
|
||||
current = DateUtil.beginOfMonth(now).toLocalDateTime().toLocalDate();
|
||||
}
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper().isNotNull(ShopUser::getBirthDay)
|
||||
.eq(ShopUser::getMainShopId, birthdayGift.getMainShopId())
|
||||
.eq("DATE_FORMAT(birth_day, '%m-%d')", DateUtil.format(DateUtil.date(current), "MM-dd"));
|
||||
if ("vip".equals(config.getUserType())) {
|
||||
queryWrapper.eq(ShopUser::getIsVip, 1);
|
||||
}
|
||||
|
||||
for (ShopUser shopUser : shopUserService.list(queryWrapper)) {
|
||||
List<ShopUser> shopUserList = shopUserService.selectBirthdayUser(current, birthdayGift.getMainShopId(), config.getUserType());
|
||||
log.info("符合用户, {}", shopUserList);
|
||||
for (ShopUser shopUser : shopUserList) {
|
||||
long count = birthdayGiftRecordService.count(new QueryWrapper().eq(MkBirthdayGiftRecord::getUserId, shopUser.getUserId())
|
||||
.eq(MkBirthdayGiftRecord::getYear, DateUtil.year(now)));
|
||||
if (count > 1) {
|
||||
@@ -193,7 +187,7 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl<MkBirthdayGiftMapper,
|
||||
TableValueConstant.BirthdayGiftRecord.PushStatus.WAIT_PUSH.getCode() : TableValueConstant.BirthdayGiftRecord.PushStatus.NO_PUSH.getCode())
|
||||
.setMainShopId(birthdayGift.getMainShopId()).setBirthday(DateUtil.parseDate(shopUser.getBirthDay()).toLocalDateTime().toLocalDate())
|
||||
.setPhone(shopUser.getPhone()).setTemplateId(shopTemplate == null ? null : shopTemplate.getId())
|
||||
.setYear(DateUtil.year(now))
|
||||
.setYear(DateUtil.year(now)).setUserType(config.getUserType())
|
||||
.setSourceId(birthdayGift.getId()).setTemplateCode(shopTemplate == null ? null : shopTemplate.getTemplateCode()).setTemplateContent(JSONObject.toJSONString(Map.of(
|
||||
"用户昵称", shopUser.getNickName(),
|
||||
"店铺名称", shopInfo.getShopName(),
|
||||
|
||||
Reference in New Issue
Block a user