diff --git a/competition/src/main/java/com/huoran/competition/controller/CompetitionController.java b/competition/src/main/java/com/huoran/competition/controller/CompetitionController.java index 783921e..ce5eae7 100644 --- a/competition/src/main/java/com/huoran/competition/controller/CompetitionController.java +++ b/competition/src/main/java/com/huoran/competition/controller/CompetitionController.java @@ -2,20 +2,16 @@ package com.huoran.competition.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.huoran.api.NakadaiClient; import com.huoran.api.UserClient; import com.huoran.common.aop.annotation.NoRepeatSubmit; -import com.huoran.common.constant.DelConstant; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.competition.entity.*; import com.huoran.competition.entity.req.AfterLoginPageCompetitionListReq; -import com.huoran.competition.entity.req.CompetitionDetailReq; import com.huoran.competition.entity.req.DisableEnableCompetitionReq; import com.huoran.competition.entity.req.PageCompetitionListReq; -import com.huoran.competition.entity.vo.CompetitionDetailsVO; import com.huoran.competition.entity.vo.CompetitionVO; import com.huoran.competition.service.*; import com.huoran.competition.service.impl.CompetitionContentServiceImpl; @@ -32,7 +28,6 @@ import java.util.Date; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; /** *

@@ -162,8 +157,6 @@ public class CompetitionController { competition.setApplicantNum(competitionRegistrationService.registrationPopulation(competitionId)); - - if (registration != null) { CompetitionTeam team = competitionTeamService.getById(registration.getTeamId()); if (team != null) { @@ -324,6 +317,10 @@ public class CompetitionController { if (!ObjectUtils.isEmpty(accountId)) { pageCompetitionListReq.setSchoolId(schoolId); pageCompetitionListReq.setAccountId(Integer.valueOf(accountId)); + Integer role = Integer.valueOf(competitionService.queryRole(accountId)); + if (!ObjectUtils.isEmpty(role)) { + pageCompetitionListReq.setRole(role); + } } Future> pageFuture = competitionService.competitionAfterLogin(pageCompetitionListReq); IPage pageList = pageFuture.get(); @@ -331,7 +328,6 @@ public class CompetitionController { } - @ApiOperation(value = "获取当前时间") @GetMapping("/getCurrentTime") public R getCurrentTime() { diff --git a/competition/src/main/java/com/huoran/competition/entity/req/AfterLoginPageCompetitionListReq.java b/competition/src/main/java/com/huoran/competition/entity/req/AfterLoginPageCompetitionListReq.java index a8c28ca..7846204 100644 --- a/competition/src/main/java/com/huoran/competition/entity/req/AfterLoginPageCompetitionListReq.java +++ b/competition/src/main/java/com/huoran/competition/entity/req/AfterLoginPageCompetitionListReq.java @@ -38,4 +38,8 @@ public class AfterLoginPageCompetitionListReq extends PageReq{ @ApiModelProperty(value = "活动分类id") private Integer classificationId; + + //当前角色 + @ApiModelProperty(value = "当前用户角色(5:幼儿园,6:供应商)") + private Integer role; } \ No newline at end of file diff --git a/competition/src/main/java/com/huoran/competition/mapper/CompetitionMapper.java b/competition/src/main/java/com/huoran/competition/mapper/CompetitionMapper.java index 7b655f0..058d410 100644 --- a/competition/src/main/java/com/huoran/competition/mapper/CompetitionMapper.java +++ b/competition/src/main/java/com/huoran/competition/mapper/CompetitionMapper.java @@ -60,6 +60,8 @@ public interface CompetitionMapper extends BaseMapper { //获取sys_platform表平台信息 String obtainPlatformInformation(@Param("platformId")String platformId ); + //查询当前账户的角色 + String obtainRole(@Param("accountId")Integer accountId); } diff --git a/competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml b/competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml index 8a14349..f464722 100644 --- a/competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml +++ b/competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml @@ -714,6 +714,8 @@ WHERE c.is_open = 0 AND c.publish_status = 1 + AND (c.competition_scope = 1 + OR competition_scope = #{req.role}) and c.classification_id=#{req.classificationId} @@ -821,4 +823,18 @@ ORDER BY create_time DESC + diff --git a/competition/src/main/java/com/huoran/competition/service/CompetitionService.java b/competition/src/main/java/com/huoran/competition/service/CompetitionService.java index 2bd3bcc..ca8eed5 100644 --- a/competition/src/main/java/com/huoran/competition/service/CompetitionService.java +++ b/competition/src/main/java/com/huoran/competition/service/CompetitionService.java @@ -43,4 +43,7 @@ public interface CompetitionService extends IService { List queryCompetitionStage(String competitionId, String accountId); R isParticipant(IsParticipantReq req); + + //查询当前账户的角色 + String queryRole(String accountId); } diff --git a/competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java b/competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java index c3ad901..290c092 100644 --- a/competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java +++ b/competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java @@ -613,4 +613,9 @@ public class CompetitionServiceImpl extends ServiceImpl