| @@ -75,15 +75,21 @@ public class CreditUtil { | |||||
| private static int getBirthdayScale(WxCUserBasicInfo wxCUserBasicInfo, WxScoreRulesService wxScoreRulesService) { | private static int getBirthdayScale(WxCUserBasicInfo wxCUserBasicInfo, WxScoreRulesService wxScoreRulesService) { | ||||
| int birthdayScale = WxScoreRules.DEFAULT_SCALE; | int birthdayScale = WxScoreRules.DEFAULT_SCALE; | ||||
| //判断是否生日当天,一年一天有效 | //判断是否生日当天,一年一天有效 | ||||
| //发过生日券的用户 | |||||
| if (Objects.nonNull(wxCUserBasicInfo.getScoreDate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getScoreDate()) == 0) { | |||||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantId(), wxScoreRulesService); | |||||
| //没有发过生日券的用户 | |||||
| } else if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getBirthdate()) == 0) { | |||||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantId(), wxScoreRulesService); | |||||
| //没有发过生日券的用户或者没有享受过生日积分倍率的用户 | |||||
| if(Objects.isNull(wxCUserBasicInfo.getScoreDate())) { | |||||
| //设置过生日的用户 | |||||
| if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getBirthdate()) == 0) { | |||||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantId(), wxScoreRulesService); | |||||
| } else { | |||||
| log.info("积分倍率计算:未设置生日或生日条件未匹配={}", wxCUserBasicInfo.getScoreDate()); | |||||
| } | |||||
| } else { | } else { | ||||
| log.info("积分倍率计算:未设置生日或生日条件未匹配={}", wxCUserBasicInfo.getScoreDate()); | |||||
| //发过生日券的用户或者享受过生日积分倍率的用户 | |||||
| if (Objects.nonNull(wxCUserBasicInfo.getScoreDate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getScoreDate()) == 0) { | |||||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantId(), wxScoreRulesService); | |||||
| } | |||||
| } | } | ||||
| //配置了生日积分倍率,保存到上下文 | //配置了生日积分倍率,保存到上下文 | ||||
| if (!Objects.equals(birthdayScale, WxScoreRules.DEFAULT_SCALE)) { | if (!Objects.equals(birthdayScale, WxScoreRules.DEFAULT_SCALE)) { | ||||
| isBirthDayScale.set(wxCUserBasicInfo.getId()); | isBirthDayScale.set(wxCUserBasicInfo.getId()); | ||||