diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/mica/MarriageInformationContactApplyApplicationService.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/mica/MarriageInformationContactApplyApplicationService.java index e2f87fb..892ba64 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/mica/MarriageInformationContactApplyApplicationService.java +++ b/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); } } }