|
|
@@ -1,6 +1,7 @@
|
|
|
package org.dromara.system.service.impl.app;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
|
|
@@ -11,6 +12,7 @@ import org.dromara.system.domain.*;
|
|
|
import org.dromara.system.domain.bo.*;
|
|
|
import org.dromara.system.domain.constant.ProjectClassification;
|
|
|
import org.dromara.system.domain.vo.*;
|
|
|
+import org.dromara.system.domain.vo.app.GameAppRefereeVo;
|
|
|
import org.dromara.system.mapper.GameAthleteMapper;
|
|
|
import org.dromara.system.mapper.GameEventMapper;
|
|
|
import org.dromara.system.mapper.GameEventProjectMapper;
|
|
|
@@ -58,9 +60,19 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
vo.setMessage("裁判号码或密码错误");
|
|
|
return vo;
|
|
|
}
|
|
|
-
|
|
|
+ vo.setRefereeInfo(BeanUtil.copyProperties(referee, GameAppRefereeVo.class));
|
|
|
+
|
|
|
+ /** 登录成功后,返回裁判相关信息 */
|
|
|
+ List<Long> projectIds = JSONUtil.toList(referee.getProjectList(), Long.class);
|
|
|
+ if (CollectionUtils.isNotEmpty(projectIds)){
|
|
|
+ List<GameEventProject> list = Db.list(Wrappers.lambdaQuery(GameEventProject.class)
|
|
|
+ .select(GameEventProject::getProjectName)
|
|
|
+ .in(GameEventProject::getProjectId, projectIds)
|
|
|
+ );
|
|
|
+ List<String> names = list.stream().map(GameEventProject::getProjectName).toList();
|
|
|
+ vo.getRefereeInfo().setProjectNames(names);
|
|
|
+ }
|
|
|
vo.setSuccess(true);
|
|
|
- vo.setRefereeNumber(referee.getAccount());
|
|
|
vo.setMessage("登录成功");
|
|
|
return vo;
|
|
|
}
|
|
|
@@ -204,12 +216,17 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取该裁判负责的赛事列表
|
|
|
+ */
|
|
|
@Override
|
|
|
- public List<GameAppEvent> getEventList() {
|
|
|
+ public List<GameAppEvent> getEventList(Long refereeId) {
|
|
|
List<GameEvent> res = gameEventMapper.selectList(Wrappers.lambdaQuery(GameEvent.class)
|
|
|
.orderByDesc(GameEvent::getCreateTime)
|
|
|
+ .apply("event_id in (select event_id from game_referee where referee_id = {0})", refereeId)
|
|
|
.select(GameEvent::getEventId, GameEvent::getEventCode, GameEvent::getEventName,
|
|
|
- GameEvent::getCreateTime));
|
|
|
+ GameEvent::getCreateTime)
|
|
|
+ );
|
|
|
return res.isEmpty() ? new ArrayList<>() : res.stream().map(e -> {
|
|
|
GameAppEvent appEvent = BeanUtil.copyProperties(e, GameAppEvent.class);
|
|
|
appEvent.setId(e.getEventId());
|
|
|
@@ -219,10 +236,22 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
}).toList();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取该裁判负责的项目列表
|
|
|
+ */
|
|
|
@Override
|
|
|
- public List<GameAppProject> getProjectList(Long eventId) {
|
|
|
+ public List<GameAppProject> getProjectList(Long eventId, Long refereeId) {
|
|
|
+ String list = Db.getObj(Wrappers.lambdaQuery(GameReferee.class)
|
|
|
+ .eq(GameReferee::getRefereeId, refereeId)
|
|
|
+ .select(GameReferee::getProjectList), GameReferee::getProjectList
|
|
|
+ );
|
|
|
+ List<Long> projectIds = JSONUtil.toList(list, Long.class);
|
|
|
+ if (projectIds.isEmpty()){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
List<GameEventProject> res = projectMapper.selectList(Wrappers.lambdaQuery(GameEventProject.class)
|
|
|
.eq(GameEventProject::getEventId, eventId)
|
|
|
+ .in(GameEventProject::getProjectId, projectIds)
|
|
|
.select(GameEventProject::getProjectId, GameEventProject::getProjectType,
|
|
|
GameEventProject::getClassification, GameEventProject::getProjectName,
|
|
|
GameEventProject::getStatus)
|