|
@@ -9,6 +9,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.system.domain.*;
|
|
import org.dromara.system.domain.*;
|
|
|
import org.dromara.system.domain.bo.*;
|
|
import org.dromara.system.domain.bo.*;
|
|
|
import org.dromara.system.domain.constant.ProjectClassification;
|
|
import org.dromara.system.domain.constant.ProjectClassification;
|
|
|
|
|
+import org.dromara.system.domain.vo.ClientLoginVo;
|
|
|
import org.dromara.system.domain.vo.ScorePreviewVo;
|
|
import org.dromara.system.domain.vo.ScorePreviewVo;
|
|
|
import org.dromara.system.domain.vo.ScoreSheetDetailVo;
|
|
import org.dromara.system.domain.vo.ScoreSheetDetailVo;
|
|
|
import org.dromara.system.domain.vo.ScoreSheetItemVo;
|
|
import org.dromara.system.domain.vo.ScoreSheetItemVo;
|
|
@@ -43,6 +44,28 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
private final GameScoreMapper gameScoreMapper;
|
|
private final GameScoreMapper gameScoreMapper;
|
|
|
private final GameAthleteMapper gameAthleteMapper;
|
|
private final GameAthleteMapper gameAthleteMapper;
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public ClientLoginVo login(ClientLoginBo bo) {
|
|
|
|
|
+ ClientLoginVo vo = new ClientLoginVo();
|
|
|
|
|
+ GameReferee referee = Db.getOne(Wrappers.lambdaQuery(GameReferee.class)
|
|
|
|
|
+ .eq(GameReferee::getEventId, bo.getEventId())
|
|
|
|
|
+ .eq(GameReferee::getAccount, bo.getRefereeNumber())
|
|
|
|
|
+ .eq(GameReferee::getPassword, bo.getPassword())
|
|
|
|
|
+ .eq(GameReferee::getDelFlag, "0")
|
|
|
|
|
+ .last("LIMIT 1"));
|
|
|
|
|
+
|
|
|
|
|
+ if (referee == null) {
|
|
|
|
|
+ vo.setSuccess(false);
|
|
|
|
|
+ vo.setMessage("裁判号码或密码错误");
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ vo.setSuccess(true);
|
|
|
|
|
+ vo.setRefereeNumber(referee.getAccount());
|
|
|
|
|
+ vo.setMessage("登录成功");
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 客户端同步赛事及项目信息 (接口4)
|
|
* 客户端同步赛事及项目信息 (接口4)
|
|
|
*
|
|
*
|
|
@@ -192,7 +215,7 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
return projectMapper.selectList(Wrappers.lambdaQuery(GameEventProject.class)
|
|
return projectMapper.selectList(Wrappers.lambdaQuery(GameEventProject.class)
|
|
|
.eq(GameEventProject::getEventId, eventId)
|
|
.eq(GameEventProject::getEventId, eventId)
|
|
|
.select(GameEventProject::getProjectId, GameEventProject::getProjectType,
|
|
.select(GameEventProject::getProjectId, GameEventProject::getProjectType,
|
|
|
- GameEventProject::getClassification, GameEventProject::getProjectName));
|
|
|
|
|
|
|
+ GameEventProject::getClassification, GameEventProject::getProjectName, GameEventProject::getStatus));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -282,7 +305,7 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
* 将小数格式的成绩转换成时间格式显示
|
|
* 将小数格式的成绩转换成时间格式显示
|
|
|
*
|
|
*
|
|
|
* @param decimalScore 以秒为单位的小数值
|
|
* @param decimalScore 以秒为单位的小数值
|
|
|
- * @param format 格式 (HH:mm:ss.SSS 或 mm:ss.SSS)
|
|
|
|
|
|
|
+ * @param format 格式 (HH:mm:ss.SSS 或 mm:ss.SSS)
|
|
|
* @return 时间格式字符串
|
|
* @return 时间格式字符串
|
|
|
*/
|
|
*/
|
|
|
private String convertDecimalToTimeScore(BigDecimal decimalScore, String format) {
|
|
private String convertDecimalToTimeScore(BigDecimal decimalScore, String format) {
|
|
@@ -364,7 +387,8 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
|
|
|
|
|
if (!missingAthleteItems.isEmpty()) {
|
|
if (!missingAthleteItems.isEmpty()) {
|
|
|
// 预查是否存在,防止重复
|
|
// 预查是否存在,防止重复
|
|
|
- Set<String> codes = missingAthleteItems.stream().map(ScoreSubmitItemBo::getAthleteCode).collect(Collectors.toSet());
|
|
|
|
|
|
|
+ Set<String> codes = missingAthleteItems.stream().map(ScoreSubmitItemBo::getAthleteCode)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
List<GameAthlete> existAthletes = gameAthleteMapper.selectList(Wrappers.lambdaQuery(GameAthlete.class)
|
|
List<GameAthlete> existAthletes = gameAthleteMapper.selectList(Wrappers.lambdaQuery(GameAthlete.class)
|
|
|
.eq(GameAthlete::getEventId, eventId)
|
|
.eq(GameAthlete::getEventId, eventId)
|
|
|
.in(GameAthlete::getAthleteCode, codes)
|
|
.in(GameAthlete::getAthleteCode, codes)
|
|
@@ -394,8 +418,10 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
// 3. 直接批量更新所有上传项的运动员信息 (不再预查对比,直接全量同步)
|
|
// 3. 直接批量更新所有上传项的运动员信息 (不再预查对比,直接全量同步)
|
|
|
List<GameAthlete> updateBatch = items.stream()
|
|
List<GameAthlete> updateBatch = items.stream()
|
|
|
.map(item -> {
|
|
.map(item -> {
|
|
|
- Long aid = item.getAthleteId() != null ? item.getAthleteId() : athleteIdMap.get(item.getAthleteCode());
|
|
|
|
|
- if (aid == null) return null;
|
|
|
|
|
|
|
+ Long aid = item.getAthleteId() != null ? item.getAthleteId()
|
|
|
|
|
+ : athleteIdMap.get(item.getAthleteCode());
|
|
|
|
|
+ if (aid == null)
|
|
|
|
|
+ return null;
|
|
|
GameAthlete a = new GameAthlete();
|
|
GameAthlete a = new GameAthlete();
|
|
|
a.setAthleteId(aid);
|
|
a.setAthleteId(aid);
|
|
|
a.setTrackIndex(item.getTrackIndex());
|
|
a.setTrackIndex(item.getTrackIndex());
|
|
@@ -409,8 +435,10 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
|
|
|
|
|
// 4. 循环处理成绩录入 (统一使用 details 明细列表)
|
|
// 4. 循环处理成绩录入 (统一使用 details 明细列表)
|
|
|
for (ScoreSubmitItemBo item : items) {
|
|
for (ScoreSubmitItemBo item : items) {
|
|
|
- Long athleteId = item.getAthleteId() != null ? item.getAthleteId() : athleteIdMap.get(item.getAthleteCode());
|
|
|
|
|
- if (athleteId == null) continue;
|
|
|
|
|
|
|
+ Long athleteId = item.getAthleteId() != null ? item.getAthleteId()
|
|
|
|
|
+ : athleteIdMap.get(item.getAthleteCode());
|
|
|
|
|
+ if (athleteId == null)
|
|
|
|
|
+ continue;
|
|
|
|
|
|
|
|
Long teamId = item.getTeamId() != null ? item.getTeamId() : teamIdMap.get(item.getTeamName());
|
|
Long teamId = item.getTeamId() != null ? item.getTeamId() : teamIdMap.get(item.getTeamName());
|
|
|
|
|
|
|
@@ -447,6 +475,17 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public void endProject(Long projectId) {
|
|
|
|
|
+ GameEventProject project = projectMapper.selectById(projectId);
|
|
|
|
|
+ if (project == null) {
|
|
|
|
|
+ throw new RuntimeException("项目不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ project.setStatus("1");
|
|
|
|
|
+ projectMapper.updateById(project);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<ScorePreviewVo> getScorePreviewList(Long projectId) {
|
|
public List<ScorePreviewVo> getScorePreviewList(Long projectId) {
|
|
|
List<ScorePreviewVo> list = baseMapper.selectScorePreviewList(projectId);
|
|
List<ScorePreviewVo> list = baseMapper.selectScorePreviewList(projectId);
|
|
@@ -499,7 +538,8 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
if (StringUtils.isNotBlank(project.getTimingFormat())) {
|
|
if (StringUtils.isNotBlank(project.getTimingFormat())) {
|
|
|
list.forEach(item -> {
|
|
list.forEach(item -> {
|
|
|
if (StringUtils.isNotBlank(item.getScore())) {
|
|
if (StringUtils.isNotBlank(item.getScore())) {
|
|
|
- item.setScore(convertDecimalToTimeScore(new BigDecimal(item.getScore()), project.getTimingFormat()));
|
|
|
|
|
|
|
+ item.setScore(
|
|
|
|
|
+ convertDecimalToTimeScore(new BigDecimal(item.getScore()), project.getTimingFormat()));
|
|
|
}
|
|
}
|
|
|
if (item.getDetails() != null) {
|
|
if (item.getDetails() != null) {
|
|
|
item.getDetails().forEach(detail -> {
|
|
item.getDetails().forEach(detail -> {
|
|
@@ -624,7 +664,8 @@ public class ToClientServiceImpl implements IToClientService {
|
|
|
* 支持普通数字和时间格式 (HH:mm:ss.SSS 或 mm:ss.SSS)
|
|
* 支持普通数字和时间格式 (HH:mm:ss.SSS 或 mm:ss.SSS)
|
|
|
*/
|
|
*/
|
|
|
private BigDecimal parsePerformanceValue(String scoreStr) {
|
|
private BigDecimal parsePerformanceValue(String scoreStr) {
|
|
|
- if (StringUtils.isBlank(scoreStr)) return null;
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(scoreStr))
|
|
|
|
|
+ return null;
|
|
|
scoreStr = scoreStr.trim();
|
|
scoreStr = scoreStr.trim();
|
|
|
// 兼容时间格式
|
|
// 兼容时间格式
|
|
|
if (scoreStr.contains(":")) {
|
|
if (scoreStr.contains(":")) {
|