|
|
|
@ -87,19 +87,20 @@ public class MarriageInformationContactApplyApplicationService { |
|
|
|
rewardConfig = rewardConfigQueryService.queryByRewardType(RewardTypeEnum.VIP_TRIAL_MATCH_CARD); |
|
|
|
} |
|
|
|
int freeCount = Objects.nonNull(rewardConfig) ? Integer.parseInt(rewardConfig.getValue()) : 0; |
|
|
|
if (freeCount >= usageFreeCount) { |
|
|
|
if (freeCount > usageFreeCount) { |
|
|
|
MatchCardUsageRecord record = MatchCardUsageRecord.build(existApply.getApplicantUserId(), existApply.getId(), CardUsageTypeEnum.FREE); |
|
|
|
matchCardUsageRecordDao.insert(record); |
|
|
|
vo.setSuccess(true); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!vo.getSuccess()) { |
|
|
|
//花费权益 |
|
|
|
if (rightApplicationService.consumeRight(existApply.getApplicantUserId(), existApply.getApplicantMiId(), RightTypeEnum.MATCH_CARD, null)) { |
|
|
|
MatchCardUsageRecord record = MatchCardUsageRecord.build(existApply.getApplicantUserId(), existApply.getId(), CardUsageTypeEnum.FREE); |
|
|
|
matchCardUsageRecordDao.insert(record); |
|
|
|
vo.setSuccess(true); |
|
|
|
} else { |
|
|
|
//花费权益 |
|
|
|
if (rightApplicationService.consumeRight(existApply.getApplicantUserId(), existApply.getApplicantMiId(), RightTypeEnum.MATCH_CARD, null)) { |
|
|
|
MatchCardUsageRecord record = MatchCardUsageRecord.build(existApply.getApplicantUserId(), existApply.getId(), CardUsageTypeEnum.FREE); |
|
|
|
matchCardUsageRecordDao.insert(record); |
|
|
|
vo.setSuccess(true); |
|
|
|
} else { |
|
|
|
vo.setSuccess(false); |
|
|
|
} |
|
|
|
vo.setSuccess(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|