|
|
@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerAuditDao; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerAuditDao; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerDao; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerDao; |
|
|
import com.qniao.dam.query.matchmaker.MatchmakerQueryService; |
|
|
import com.qniao.dam.query.matchmaker.MatchmakerQueryService; |
|
|
|
|
|
import com.qniao.dam.query.operationcenter.OperationCenterQueryService; |
|
|
|
|
|
import com.qniao.dam.query.store.StoreQueryService; |
|
|
import com.qniao.dau.domain.aggregate.matchmaker.entity.Matchmaker; |
|
|
import com.qniao.dau.domain.aggregate.matchmaker.entity.Matchmaker; |
|
|
import com.qniao.dau.domain.aggregate.matchmakeraudit.entity.MatchmakerAudit; |
|
|
import com.qniao.dau.domain.aggregate.matchmakeraudit.entity.MatchmakerAudit; |
|
|
|
|
|
import com.qniao.dau.domian.aggregate.matchmaker.constant.MatchmakerLevelEnum; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class MatchmakerQueryServiceImpl implements MatchmakerQueryService { |
|
|
public class MatchmakerQueryServiceImpl implements MatchmakerQueryService { |
|
|
@ -17,6 +21,10 @@ public class MatchmakerQueryServiceImpl implements MatchmakerQueryService { |
|
|
private MatchmakerDao matchmakerDao; |
|
|
private MatchmakerDao matchmakerDao; |
|
|
@Resource |
|
|
@Resource |
|
|
private MatchmakerAuditDao matchmakerAuditDao; |
|
|
private MatchmakerAuditDao matchmakerAuditDao; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private StoreQueryService storeQueryService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private OperationCenterQueryService operationCenterQueryService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Matchmaker queryByUserId(Long userId) { |
|
|
public Matchmaker queryByUserId(Long userId) { |
|
|
@ -32,5 +40,27 @@ public class MatchmakerQueryServiceImpl implements MatchmakerQueryService { |
|
|
.orderByDesc(MatchmakerAudit::getCreateTime) |
|
|
.orderByDesc(MatchmakerAudit::getCreateTime) |
|
|
.last("limit 1")); |
|
|
.last("limit 1")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询用户的红娘级别 |
|
|
|
|
|
* |
|
|
|
|
|
* @param userId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public MatchmakerLevelEnum queryLevelByUserId(Long userId) { |
|
|
|
|
|
MatchmakerLevelEnum matchmakerLevel = null; |
|
|
|
|
|
Matchmaker matchmaker = queryByUserId(userId); |
|
|
|
|
|
if (Objects.nonNull(matchmaker)) { |
|
|
|
|
|
matchmakerLevel = matchmaker.queryLevel(); |
|
|
|
|
|
if (storeQueryService.hasByUserId(userId)) { |
|
|
|
|
|
matchmakerLevel = MatchmakerLevelEnum.MATCHMAKER_STORE; |
|
|
|
|
|
} |
|
|
|
|
|
if (operationCenterQueryService.hasByUserId(userId)) { |
|
|
|
|
|
matchmakerLevel = MatchmakerLevelEnum.MATCHMAKER_OPERATION_CENTER; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return matchmakerLevel; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|