|
@@ -33,6 +33,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
|
import org.dromara.system.domain.GameEvent;
|
|
|
+import org.dromara.system.domain.GameEventGroup;
|
|
|
import org.dromara.system.domain.bo.GameAthleteBo;
|
|
|
import org.dromara.system.domain.bo.GameEventBo;
|
|
|
import org.dromara.system.domain.bo.GameTeamBo;
|
|
@@ -40,10 +41,7 @@ import org.dromara.system.domain.bo.GenerateBibBo;
|
|
|
import org.dromara.system.domain.constant.GameEventConstant;
|
|
|
import org.dromara.system.domain.vo.*;
|
|
|
import org.dromara.system.mapper.GameEventMapper;
|
|
|
-import org.dromara.system.service.IGameAthleteService;
|
|
|
-import org.dromara.system.service.IGameEventProjectService;
|
|
|
-import org.dromara.system.service.IGameEventService;
|
|
|
-import org.dromara.system.service.IGameTeamService;
|
|
|
+import org.dromara.system.service.*;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -76,6 +74,8 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
|
private IGameAthleteService gameAthleteService;
|
|
|
@Resource
|
|
|
private IGameEventProjectService gameEventProjectService;
|
|
|
+ @Resource
|
|
|
+ private IGameEventGroupService gameEventGroupService;
|
|
|
|
|
|
/**
|
|
|
* 查询赛事基本信息
|
|
@@ -586,9 +586,11 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
|
//3.查询赛事所有项目缓存
|
|
|
Map<Long, String> projectMap = gameEventProjectService.queryListByEventId(defaultEventId)
|
|
|
.stream().collect(Collectors.toMap(GameEventProjectVo::getProjectId, GameEventProjectVo::getProjectName));
|
|
|
- //4.根据参数生成号码布
|
|
|
+ //4.查询赛事组别
|
|
|
+ GameEventGroup gameEventGroup = gameEventGroupService.queryByEventId(defaultEventId);
|
|
|
+ //5.根据参数生成号码布
|
|
|
GameEventVo eventVo = baseMapper.selectVoById(defaultEventId);
|
|
|
- generateBib(response, bgImage, logo, eventVo.getEventName(), athleteVoList, teamNameMap, projectMap, bibParam);
|
|
|
+ generateBib(response, bgImage, logo, eventVo.getEventName(), gameEventGroup.getGroupName(), athleteVoList, teamNameMap, projectMap, bibParam);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -598,6 +600,7 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
|
* @param backgroundImage 背景图 (MultipartFile)
|
|
|
* @param logo Logo 图片(可选)
|
|
|
* @param eventName 赛事名称
|
|
|
+ * @param groupName 组别名称
|
|
|
* @param athleteList 运动员列表
|
|
|
* @param teamNameMap 队伍id名称映射
|
|
|
* @param projectMap 项目id名称映射
|
|
@@ -608,6 +611,7 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
|
MultipartFile backgroundImage,
|
|
|
MultipartFile logo,
|
|
|
String eventName,
|
|
|
+ String groupName,
|
|
|
List<GameAthleteVo> athleteList,
|
|
|
Map<Long, String> teamNameMap,
|
|
|
Map<Long, String> projectMap,
|
|
@@ -718,22 +722,24 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // 生成二维码 - 更精确的位置调整
|
|
|
+ // 生成二维码
|
|
|
String qrData = String.format(
|
|
|
"""
|
|
|
- 赛事名称:%s,
|
|
|
- 运动员序号:%d,
|
|
|
- 运动员编号:%s,
|
|
|
- 参与项目:%s,
|
|
|
- 队伍id:%d,
|
|
|
- 队伍名称:%s,
|
|
|
- 运动员姓名:%s,
|
|
|
- 性别:%s,
|
|
|
- 年龄:%d
|
|
|
- """,
|
|
|
+ {
|
|
|
+ 赛事名称:%s,
|
|
|
+ 运动员序号:%d,
|
|
|
+ 运动员编号:%s,
|
|
|
+ 参与项目:%s,
|
|
|
+ 队伍名称:%s,
|
|
|
+ 运动员姓名:%s,
|
|
|
+ 性别:%s,
|
|
|
+ 年龄:%d
|
|
|
+ 组别:%s
|
|
|
+ }
|
|
|
+ """,
|
|
|
eventName, athlete.getAthleteId(), athlete.getAthleteCode(),
|
|
|
- joinProject.toString(),
|
|
|
- athlete.getTeamId(), teamNameMap.get(athlete.getTeamId()), athlete.getName(), athlete.getGender(), athlete.getAge()
|
|
|
+ joinProject, teamNameMap.get(athlete.getTeamId()), athlete.getName(),
|
|
|
+ athlete.getGender(), athlete.getAge(), groupName
|
|
|
);
|
|
|
|
|
|
byte[] qrBytes = generateQRCode(qrData, 150, 150);
|