|
|
|
@@ -216,10 +216,19 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { |
|
|
|
|
|
|
|
int creditChangeNumOrigin = creditIncrement(record); |
|
|
|
int creditChangeNum = creditChangeNumOrigin ; |
|
|
|
//是否参与了生日积分倍率 |
|
|
|
boolean hasBirthDateCredit = false; |
|
|
|
if (record.getCreditType().equals(EnumScoreType.CONSUMPTION.getCode()) || record.getCreditType().equals(EnumScoreType.SPEND_CREDIT.getCode())) { |
|
|
|
//等级积分配置 |
|
|
|
Integer levelScale = wxLevelConfigMapper.getScale(wxCUser.getTenantId(), wxCUser.getScore()); |
|
|
|
creditChangeNum = CreditUtil.calUserCredit(creditChangeNumOrigin, wxCUser, levelScale, wxCUserBasicInfo, wxScoreRulesService); |
|
|
|
try { |
|
|
|
creditChangeNum = CreditUtil.calUserCredit(creditChangeNumOrigin, wxCUser, levelScale, wxCUserBasicInfo, wxScoreRulesService); |
|
|
|
if (Objects.nonNull(CreditUtil.getIsBirthDayScale())) { |
|
|
|
hasBirthDateCredit = true; |
|
|
|
} |
|
|
|
} finally { |
|
|
|
CreditUtil.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (creditChangeNum != 0) { |
|
|
|
@@ -252,11 +261,10 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { |
|
|
|
wxCUserBasicInfoNew.setId(wxCUserBasicInfo.getId()); |
|
|
|
wxCUserBasicInfoNew.setCredit(record.getCreditAmount()); |
|
|
|
//如果享受了生日积分倍率,记录日期 |
|
|
|
if(Objects.nonNull(CreditUtil.getIsBirthDayScale())) { |
|
|
|
if (hasBirthDateCredit) { |
|
|
|
wxCUserBasicInfoNew.setScoreDate(new Date()); |
|
|
|
} |
|
|
|
wxCUserBasicInfoMapper.updateByPrimaryKeySelective(wxCUserBasicInfoNew); |
|
|
|
CreditUtil.clear(); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|