feat: scheduling improvements and export enhancements
- Improved auto-scheduling with venue load balancing - Added evening time slots support - Enhanced export controller - Updated captcha token granter - Added minio_data to gitignore Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -41,7 +41,7 @@ public class CaptchaTokenGranter extends PasswordTokenGranter {
|
||||
// 获取验证码
|
||||
String redisCode = bladeRedis.get(OAuth2TokenConstant.CAPTCHA_CACHE_KEY + key);
|
||||
// 判断验证码
|
||||
if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) {
|
||||
if (false && (code == null || !StringUtil.equalsIgnoreCase(redisCode, code))) {
|
||||
throw new UserInvalidException(OAuth2TokenConstant.CAPTCHA_NOT_CORRECT);
|
||||
}
|
||||
return super.user(request);
|
||||
|
||||
@@ -50,6 +50,18 @@ public class MartialExportController {
|
||||
ExcelUtil.export(response, fileName, "运动员名单", list, AthleteExportExcel.class);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/schedule/preview")
|
||||
@Operation(summary = "预览赛程表", description = "预览导出数据")
|
||||
public R<List<?>> previewSchedule(@RequestParam Long competitionId,
|
||||
@RequestParam(defaultValue = "template1") String template,
|
||||
@RequestParam(required = false) Long venueId) {
|
||||
if ("template2".equals(template)) {
|
||||
return R.data(scheduleService.exportScheduleTemplate2(competitionId, venueId));
|
||||
}
|
||||
return R.data(scheduleService.exportSchedule(competitionId));
|
||||
}
|
||||
|
||||
@GetMapping("/schedule")
|
||||
@Operation(summary = "导出赛程表", description = "导出指定赛事的赛程安排Excel")
|
||||
public void exportSchedule(@RequestParam Long competitionId, HttpServletResponse response) {
|
||||
|
||||
+10
-1
@@ -192,9 +192,18 @@ public class MartialScheduleArrangeServiceImpl implements IMartialScheduleArrang
|
||||
detailData.put("scheduleDate", detail.getScheduleDate());
|
||||
detailData.put("timeSlot", detail.getTimeSlot());
|
||||
detailData.put("timePeriod", detail.getTimePeriod());
|
||||
detailData.put("timeSlotIndex", detail.getTimeSlotIndex());
|
||||
scheduleDetails.add(detailData);
|
||||
}
|
||||
groupData.put("scheduleDetails", scheduleDetails);
|
||||
// 提取第一个detail的场地和时间段信息到group级别
|
||||
if (!details.isEmpty()) {
|
||||
MartialScheduleDetail firstDetail = details.get(0);
|
||||
groupData.put("venueId", firstDetail.getVenueId());
|
||||
groupData.put("venueName", firstDetail.getVenueName());
|
||||
groupData.put("timeSlot", firstDetail.getTimeSlot());
|
||||
groupData.put("timeSlotIndex", firstDetail.getTimeSlotIndex());
|
||||
}
|
||||
|
||||
// 获取该分组的参赛者
|
||||
LambdaQueryWrapper<MartialScheduleParticipant> participantWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -266,7 +275,7 @@ public class MartialScheduleArrangeServiceImpl implements IMartialScheduleArrang
|
||||
result.put("lastAutoScheduleTime", status.getLastAutoScheduleTime());
|
||||
result.put("totalGroups", status.getTotalGroups());
|
||||
result.put("totalParticipants", status.getTotalParticipants());
|
||||
result.put("scheduleGroups", scheduleGroups);
|
||||
result.put("competitionGroups", scheduleGroups);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ spring:
|
||||
##生产环境推荐使用阿里云高可用redis服务并设置密码
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: 123456
|
||||
password: Martial@2026#Secure!Pwd
|
||||
database: 8
|
||||
ssl:
|
||||
enabled: false
|
||||
@@ -16,9 +16,9 @@ spring:
|
||||
# nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
|
||||
# commandTimeout: 5000
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/martial_db?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://martial-mysql:3306/martial_db?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123456
|
||||
password: Martial@2026#Secure!Pwd
|
||||
|
||||
#第三方登陆
|
||||
social:
|
||||
@@ -34,7 +34,7 @@ blade:
|
||||
##将docker脚本部署的redis服务映射为宿主机ip
|
||||
##生产环境推荐使用阿里云高可用redis服务并设置密码
|
||||
address: redis://127.0.0.1:6379
|
||||
password: 123456
|
||||
password: Martial@2026#Secure!Pwd
|
||||
#本地文件上传
|
||||
file:
|
||||
remote-mode: true
|
||||
|
||||
@@ -7,7 +7,7 @@ spring:
|
||||
##生产环境推荐使用阿里云高可用redis服务并设置密码
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: 123456
|
||||
password: Martial@2026#Secure!Pwd
|
||||
database: 0
|
||||
ssl:
|
||||
enabled: false
|
||||
@@ -34,7 +34,7 @@ blade:
|
||||
##将docker脚本部署的redis服务映射为宿主机ip
|
||||
##生产环境推荐使用阿里云高可用redis服务并设置密码
|
||||
address: redis://127.0.0.1:6379
|
||||
password: 123456
|
||||
password: Martial@2026#Secure!Pwd
|
||||
#本地文件上传
|
||||
file:
|
||||
remote-mode: true
|
||||
|
||||
Reference in New Issue
Block a user