Browse Source

用户使用联系卡

master
张彭杰 1 month ago
parent
commit
ccac8cd876
1 changed files with 10 additions and 9 deletions
  1. 19
      dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/mica/MarriageInformationContactApplyApplicationService.java

19
dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/mica/MarriageInformationContactApplyApplicationService.java

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

Loading…
Cancel
Save