Browse Source

生日积分:记录倍率日期

release_toaliyun_real
Burce 6 years ago
parent
commit
5587023425
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      mallinkService/src/main/java/com/iformall/utils/CreditUtil.java

+ 13
- 7
mallinkService/src/main/java/com/iformall/utils/CreditUtil.java View File

@@ -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());


Loading…
Cancel
Save