wenkai 3 semanas atrás
pai
commit
939ce20d86

+ 13 - 13
ruoyi-admin/src/main/resources/application-prod.yml

@@ -5,7 +5,7 @@ spring.servlet.multipart.location: /ruoyi/server/temp
 spring.boot.admin.client:
   # 增加客户端开关
   enabled: true
-  url: http://localhost:9090/admin
+  url: http://182.92.79.54:9090/admin
   instance:
     service-host-type: IP
     metadata:
@@ -22,7 +22,7 @@ snail-job:
   # SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config`表
   token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
   server:
-    host: 127.0.0.1
+    host: 182.92.79.54
     port: 17888
   # 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
   namespace: ${spring.profiles.active}
@@ -52,33 +52,33 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-          username: root
-          password: root
+          url: jdbc:mysql://182.92.79.54:3306/game_event?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          username: game_event
+          password: EMRPt6LebAij3m6j
 #        # 从库数据源
 #        slave:
 #          lazy: true
 #          type: ${spring.datasource.type}
 #          driverClassName: com.mysql.cj.jdbc.Driver
-#          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+#          url: jdbc:mysql://182.92.79.54:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
 #          username:
 #          password:
 #        oracle:
 #          type: ${spring.datasource.type}
 #          driverClassName: oracle.jdbc.OracleDriver
-#          url: jdbc:oracle:thin:@//localhost:1521/XE
+#          url: jdbc:oracle:thin:@//182.92.79.54:1521/XE
 #          username: ROOT
 #          password: root
 #        postgres:
 #          type: ${spring.datasource.type}
 #          driverClassName: org.postgresql.Driver
-#          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+#          url: jdbc:postgresql://182.92.79.54:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
 #          username: root
 #          password: root
 #        sqlserver:
 #          type: ${spring.datasource.type}
 #          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
-#          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
+#          url: jdbc:sqlserver://182.92.79.54:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
 #          username: SA
 #          password: root
       hikari:
@@ -101,13 +101,13 @@ spring:
 spring.data:
   redis:
     # 地址
-    host: localhost
+    host: 182.92.79.54
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 0
     # redis 密码必须配置
-    password: ruoyi123
+    password: game_event
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl
@@ -193,7 +193,7 @@ sms:
 --- # 三方授权
 justauth:
   # 前端外网访问地址
-  address: http://localhost:80
+  address: http://182.92.79.54:80
   type:
     maxkey:
       # maxkey 服务器地址
@@ -204,7 +204,7 @@ justauth:
       redirect-uri: ${justauth.address}/social-callback?source=maxkey
     topiam:
       # topiam 服务器地址
-      server-url: http://127.0.0.1:1989/api/v1/authorize/y0q************spq***********8ol
+      server-url: http://182.92.79.54:1989/api/v1/authorize/y0q************spq***********8ol
       client-id: 449c4*********937************759
       client-secret: ac7***********1e0************28d
       redirect-uri: ${justauth.address}/social-callback?source=topiam

+ 6 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/vo/GameAthleteVo.java

@@ -46,6 +46,12 @@ public class GameAthleteVo implements Serializable {
     @ExcelProperty(value = "赛事ID")
     private Long eventId;
 
+    /**
+     * 赛事名称
+     */
+    @ExcelProperty(value = "赛事名称")
+    private String eventName;
+
     /**
      * 队伍ID
      */

+ 29 - 3
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameAthleteServiceImpl.java

@@ -14,9 +14,13 @@ import org.dromara.system.domain.GameEventProject;
 import org.dromara.system.domain.GameScore;
 import org.dromara.system.domain.GameTeam;
 import org.dromara.system.domain.vo.AthleteScoreVo;
+import org.dromara.system.domain.vo.GameEventProjectVo;
+import org.dromara.system.domain.vo.GameEventVo;
 import org.dromara.system.mapper.GameEventProjectMapper;
 import org.dromara.system.mapper.GameScoreMapper;
 import org.dromara.system.mapper.GameTeamMapper;
+import org.dromara.system.service.IGameEventProjectService;
+import org.dromara.system.service.IGameEventService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.dromara.system.domain.bo.GameAthleteBo;
@@ -48,6 +52,10 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
     @Autowired
     private GameScoreMapper gameScoreMapper;
 
+    private final IGameEventProjectService gameEventProjectService;
+
+    private final IGameEventService gameEventService;
+
     /**
      * 根据赛事ID查询参赛者积分信息列表
      *
@@ -129,7 +137,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
      * @return 参赛队员
      */
     @Override
-    public GameAthleteVo queryById(Long athleteId){
+    public GameAthleteVo queryById(Long athleteId) {
         return baseMapper.selectVoById(athleteId);
     }
 
@@ -144,6 +152,24 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
     public TableDataInfo<GameAthleteVo> queryPageList(GameAthleteBo bo, PageQuery pageQuery) {
         LambdaQueryWrapper<GameAthlete> lqw = buildQueryWrapper(bo);
         Page<GameAthleteVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        result.getRecords().stream()
+            .filter(vo -> StringUtils.isNotBlank(vo.getProjectValue()))  // 过滤null和空字符串
+            .map(vo -> {
+                String[] projectIds = vo.getProjectValue().split(",");
+                List<GameEventProjectVo> projects =
+                    gameEventProjectService.listProjectsByEventIdAndProjectIndex(
+                        vo.getEventId(),
+                        projectIds);
+                String projectNames = projects.stream()
+                    .map(GameEventProjectVo::getProjectName)
+                    .filter(StringUtils::isNotBlank)  // 过滤项目名为空的情况
+                    .collect(Collectors.joining(","));
+                vo.setProjectValue(projectNames);
+                GameEventVo gameEventVo = gameEventService.queryById(vo.getEventId());
+                vo.setEventName(gameEventVo.getEventName());
+                return vo;
+            })
+            .collect(Collectors.toList());  // 收集结果
         return TableDataInfo.build(result);
     }
 
@@ -205,7 +231,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(GameAthlete entity){
+    private void validEntityBeforeSave(GameAthlete entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -218,7 +244,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;