Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev' into dev

zhou vor 3 Wochen
Ursprung
Commit
3c96626257
19 geänderte Dateien mit 694 neuen und 26 gelöschten Zeilen
  1. 5 0
      pom.xml
  2. 13 13
      ruoyi-admin/src/main/resources/application-prod.yml
  3. 1 0
      ruoyi-admin/src/main/resources/application.yml
  4. 105 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/ArticleController.java
  5. 10 1
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/GameEventController.java
  6. 62 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/Article.java
  7. 57 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/bo/ArticleBo.java
  8. 74 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/vo/ArticleVo.java
  9. 6 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/vo/GameAthleteVo.java
  10. 15 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/mapper/ArticleMapper.java
  11. 68 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IArticleService.java
  12. 2 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IGameEventProjectService.java
  13. 9 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IGameEventService.java
  14. 174 0
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/ArticleServiceImpl.java
  15. 29 3
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameAthleteServiceImpl.java
  16. 24 3
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameEventGroupServiceImpl.java
  17. 12 3
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameEventProjectServiceImpl.java
  18. 21 3
      ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameEventServiceImpl.java
  19. 7 0
      ruoyi-modules/ruoyi-game-event/src/main/resources/mapper/system/ArticleMapper.xml

+ 5 - 0
pom.xml

@@ -415,6 +415,11 @@
                     <compilerArgs>
                         <arg>-parameters</arg>
                     </compilerArgs>
+                    <excludes>
+                        <exclude>ruoyi-game-event/**</exclude>
+                        <exclude>ruoyi-common-tenant/**</exclude>
+                        <exclude>ruoyi-common-mybatis/**</exclude>
+                    </excludes>
                 </configuration>
             </plugin>
             <!-- 单元测试使用 -->

+ 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

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -217,6 +217,7 @@ xss:
   # 排除链接(多个用逗号分隔)
   excludeUrls:
     - /system/notice
+    - /system/article
 
 # 全局线程池相关配置
 # 如使用JDK21请直接使用虚拟线程 不要开启此配置

+ 105 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/ArticleController.java

@@ -0,0 +1,105 @@
+package org.dromara.system.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.system.domain.vo.ArticleVo;
+import org.dromara.system.domain.bo.ArticleBo;
+import org.dromara.system.service.IArticleService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 文章(可用于活动预热)
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/system/article")
+public class ArticleController extends BaseController {
+
+    private final IArticleService articleService;
+
+    /**
+     * 查询文章(可用于活动预热)列表
+     */
+    @SaCheckPermission("system:article:list")
+    @GetMapping("/list")
+    public TableDataInfo<ArticleVo> list(ArticleBo bo, PageQuery pageQuery) {
+        return articleService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出文章(可用于活动预热)列表
+     */
+    @SaCheckPermission("system:article:export")
+    @Log(title = "文章(可用于活动预热)", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(ArticleBo bo, HttpServletResponse response) {
+        List<ArticleVo> list = articleService.queryList(bo);
+        ExcelUtil.exportExcel(list, "文章(可用于活动预热)", ArticleVo.class, response);
+    }
+
+    /**
+     * 获取文章(可用于活动预热)详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("system:article:query")
+    @GetMapping("/{id}")
+    public R<ArticleVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(articleService.queryById(id));
+    }
+
+    /**
+     * 新增文章(可用于活动预热)
+     */
+    @SaCheckPermission("system:article:add")
+    @Log(title = "文章(可用于活动预热)", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody ArticleBo bo) {
+        return toAjax(articleService.insertByBo(bo));
+    }
+
+    /**
+     * 修改文章(可用于活动预热)
+     */
+    @SaCheckPermission("system:article:edit")
+    @Log(title = "文章(可用于活动预热)", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArticleBo bo) {
+        return toAjax(articleService.updateByBo(bo));
+    }
+
+    /**
+     * 删除文章(可用于活动预热)
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("system:article:remove")
+    @Log(title = "文章(可用于活动预热)", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(articleService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 10 - 1
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/GameEventController.java

@@ -1,6 +1,7 @@
 package org.dromara.system.controller;
 
 import java.util.List;
+import java.util.Map;
 
 import lombok.RequiredArgsConstructor;
 import jakarta.servlet.http.HttpServletResponse;
@@ -64,7 +65,7 @@ public class GameEventController extends BaseController {
     @SaCheckPermission("system:gameEvent:query")
     @GetMapping("/{eventId}")
     public R<GameEventVo> getInfo(@NotNull(message = "主键不能为空")
-                                     @PathVariable Long eventId) {
+                                  @PathVariable Long eventId) {
         return R.ok(gameEventService.queryById(eventId));
     }
 
@@ -102,4 +103,12 @@ public class GameEventController extends BaseController {
                           @PathVariable Long[] eventIds) {
         return toAjax(gameEventService.deleteWithValidByIds(List.of(eventIds), true));
     }
+
+    /**
+     * 查询赛事名称和id的map
+     */
+    @GetMapping("/map")
+    public R<Map<String, Long>> getEventIdNameMap() {
+        return R.ok(gameEventService.getEventIdNameMap());
+    }
 }

+ 62 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/Article.java

@@ -0,0 +1,62 @@
+package org.dromara.system.domain;
+
+import org.dromara.common.tenant.core.TenantEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+
+/**
+ * 文章(可用于活动预热)对象 article
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("article")
+public class Article extends TenantEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    private Long eventId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 文章类型
+     */
+    private Long type;
+
+    /**
+     * 是否展示 0:展示 1:隐藏
+     */
+    private String status;
+
+    /**
+     * 是否删除 0:未删除 1:删除
+     */
+    @TableLogic
+    private String delFlag;
+
+
+}

+ 57 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/bo/ArticleBo.java

@@ -0,0 +1,57 @@
+package org.dromara.system.domain.bo;
+
+import org.dromara.system.domain.Article;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+
+/**
+ * 文章业务对象 article
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = Article.class, reverseConvertGenerate = false)
+public class ArticleBo extends BaseEntity {
+
+    /**
+     *
+     */
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    private Long eventId;
+
+    private String eventName;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 文章类型
+     */
+    @NotNull(message = "文章类型不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long type;
+
+    /**
+     * 是否展示 0:展示 1:隐藏
+     */
+    private String status;
+
+
+}

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

@@ -0,0 +1,74 @@
+package org.dromara.system.domain.vo;
+
+import org.dromara.system.domain.Article;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 文章(可用于活动预热)视图对象 article
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = Article.class)
+public class ArticleVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "")
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    @ExcelProperty(value = "赛事id")
+    private Long eventId;
+
+    /**
+     * 赛事标题
+     */
+    private String eventName;
+
+    /**
+     * 标题
+     */
+    @ExcelProperty(value = "标题")
+    private String title;
+
+    /**
+     * 内容
+     */
+    @ExcelProperty(value = "内容")
+    private String content;
+
+    /**
+     * 文章类型
+     */
+    @ExcelProperty(value = "文章类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "article_type")
+    private Long type;
+
+    /**
+     * 是否展示 0:展示 1:隐藏
+     */
+    @ExcelProperty(value = "是否展示 0:展示 1:隐藏")
+    private String status;
+
+
+}

+ 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
      */

+ 15 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/mapper/ArticleMapper.java

@@ -0,0 +1,15 @@
+package org.dromara.system.mapper;
+
+import org.dromara.system.domain.Article;
+import org.dromara.system.domain.vo.ArticleVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+/**
+ * 文章(可用于活动预热)Mapper接口
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+public interface ArticleMapper extends BaseMapperPlus<Article, ArticleVo> {
+
+}

+ 68 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IArticleService.java

@@ -0,0 +1,68 @@
+package org.dromara.system.service;
+
+import org.dromara.system.domain.vo.ArticleVo;
+import org.dromara.system.domain.bo.ArticleBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 文章(可用于活动预热)Service接口
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+public interface IArticleService {
+
+    /**
+     * 查询文章(可用于活动预热)
+     *
+     * @param id 主键
+     * @return 文章(可用于活动预热)
+     */
+    ArticleVo queryById(Long id);
+
+    /**
+     * 分页查询文章(可用于活动预热)列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 文章(可用于活动预热)分页列表
+     */
+    TableDataInfo<ArticleVo> queryPageList(ArticleBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的文章(可用于活动预热)列表
+     *
+     * @param bo 查询条件
+     * @return 文章(可用于活动预热)列表
+     */
+    List<ArticleVo> queryList(ArticleBo bo);
+
+    /**
+     * 新增文章(可用于活动预热)
+     *
+     * @param bo 文章(可用于活动预热)
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(ArticleBo bo);
+
+    /**
+     * 修改文章(可用于活动预热)
+     *
+     * @param bo 文章(可用于活动预热)
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(ArticleBo bo);
+
+    /**
+     * 校验并批量删除文章(可用于活动预热)信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 2 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IGameEventProjectService.java

@@ -65,4 +65,6 @@ public interface IGameEventProjectService {
      * @return 是否删除成功
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<GameEventProjectVo> listProjectsByEventIdAndProjectIndex(Long eventId, String[] projectIds);
 }

+ 9 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IGameEventService.java

@@ -1,5 +1,6 @@
 package org.dromara.system.service;
 
+import org.dromara.common.core.domain.R;
 import org.dromara.system.domain.vo.GameEventVo;
 import org.dromara.system.domain.bo.GameEventBo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -7,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 赛事基本信息Service接口
@@ -65,4 +67,11 @@ public interface IGameEventService {
      * @return 是否删除成功
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    /**
+     * 获取赛事ID与名称的映射关系
+     *
+     * @return 赛事ID与名称的映射关系
+     */
+    Map<String, Long> getEventIdNameMap();
 }

+ 174 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/ArticleServiceImpl.java

@@ -0,0 +1,174 @@
+package org.dromara.system.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.dromara.system.domain.GameEvent;
+import org.dromara.system.domain.bo.GameEventBo;
+import org.dromara.system.domain.vo.GameEventVo;
+import org.dromara.system.service.IGameEventService;
+import org.springframework.stereotype.Service;
+import org.dromara.system.domain.bo.ArticleBo;
+import org.dromara.system.domain.vo.ArticleVo;
+import org.dromara.system.domain.Article;
+import org.dromara.system.mapper.ArticleMapper;
+import org.dromara.system.service.IArticleService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+/**
+ * 文章(可用于活动预热)Service业务层处理
+ *
+ * @author Lion Li
+ * @date 2025-08-08
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class ArticleServiceImpl implements IArticleService {
+
+    private final ArticleMapper baseMapper;
+
+    private final IGameEventService gameEventService;
+
+    /**
+     * 查询文章(可用于活动预热)
+     *
+     * @param id 主键
+     * @return 文章(可用于活动预热)
+     */
+    @Override
+    public ArticleVo queryById(Long id) {
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询文章(可用于活动预热)列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 文章(可用于活动预热)分页列表
+     */
+    @Override
+    public TableDataInfo<ArticleVo> queryPageList(ArticleBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<Article> lqw = buildQueryWrapper(bo);
+        Page<ArticleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        // 查询赛事相关信息
+        result.getRecords().stream()
+            .filter(articleVo -> ObjectUtil.isNotNull(articleVo.getEventId()))
+            .map(vo -> {
+                GameEventVo gameEventVo = gameEventService.queryById(vo.getEventId());
+                if (ObjectUtil.isNotNull(gameEventVo)) {
+                    vo.setEventName(gameEventVo.getEventName());
+                }
+                return vo;
+            }).collect(Collectors.toList());
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的文章(可用于活动预热)列表
+     *
+     * @param bo 查询条件
+     * @return 文章(可用于活动预热)列表
+     */
+    @Override
+    public List<ArticleVo> queryList(ArticleBo bo) {
+        LambdaQueryWrapper<Article> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<Article> buildQueryWrapper(ArticleBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<Article> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(Article::getId);
+        lqw.eq(bo.getEventId() != null, Article::getEventId, bo.getEventId());
+
+        // 通过名称模糊查询
+        if (StringUtils.isNotBlank(bo.getEventName())) {
+            GameEventBo gameEventBo = new GameEventBo();
+            gameEventBo.setEventName(bo.getEventName());
+            List<GameEventVo> vos = gameEventService.queryList(gameEventBo);
+            List<Long> ids = vos.stream()
+                .map(GameEventVo::getEventId)
+                .collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(ids)) {
+                lqw.in(Article::getEventId, ids);
+            } else {
+                lqw.apply("1=0");
+            }
+        }
+
+        lqw.eq(StringUtils.isNotBlank(bo.getTitle()), Article::getTitle, bo.getTitle());
+        lqw.eq(StringUtils.isNotBlank(bo.getContent()), Article::getContent, bo.getContent());
+        lqw.eq(bo.getType() != null, Article::getType, bo.getType());
+        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Article::getStatus, bo.getStatus());
+        return lqw;
+    }
+
+    /**
+     * 新增文章(可用于活动预热)
+     *
+     * @param bo 文章(可用于活动预热)
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(ArticleBo bo) {
+        Article add = MapstructUtils.convert(bo, Article.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改文章(可用于活动预热)
+     *
+     * @param bo 文章(可用于活动预热)
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(ArticleBo bo) {
+        Article update = MapstructUtils.convert(bo, Article.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(Article entity) {
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除文章(可用于活动预热)信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if (isValid) {
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+
+}

+ 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;

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

@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.system.domain.vo.GameEventProjectVo;
+import org.dromara.system.service.IGameEventProjectService;
 import org.springframework.stereotype.Service;
 import org.dromara.system.domain.bo.GameEventGroupBo;
 import org.dromara.system.domain.vo.GameEventGroupVo;
@@ -19,6 +21,7 @@ import org.dromara.system.service.IGameEventGroupService;
 import java.util.List;
 import java.util.Map;
 import java.util.Collection;
+import java.util.stream.Collectors;
 
 /**
  * 赛事分组Service业务层处理
@@ -33,6 +36,8 @@ public class GameEventGroupServiceImpl implements IGameEventGroupService {
 
     private final GameEventGroupMapper baseMapper;
 
+    private final IGameEventProjectService gameEventProjectService;
+
     /**
      * 查询赛事分组
      *
@@ -40,7 +45,7 @@ public class GameEventGroupServiceImpl implements IGameEventGroupService {
      * @return 赛事分组
      */
     @Override
-    public GameEventGroupVo queryById(Long groupId){
+    public GameEventGroupVo queryById(Long groupId) {
         return baseMapper.selectVoById(groupId);
     }
 
@@ -55,6 +60,22 @@ public class GameEventGroupServiceImpl implements IGameEventGroupService {
     public TableDataInfo<GameEventGroupVo> queryPageList(GameEventGroupBo bo, PageQuery pageQuery) {
         LambdaQueryWrapper<GameEventGroup> lqw = buildQueryWrapper(bo);
         Page<GameEventGroupVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        result.getRecords().stream()
+            .filter(vo -> StringUtils.isNotBlank(vo.getProjectList()))  // 过滤null和空字符串
+            .map(vo -> {
+                String[] projectIds = vo.getProjectList().split(",");
+                List<GameEventProjectVo> projects =
+                    gameEventProjectService.listProjectsByEventIdAndProjectIndex(
+                        vo.getEventId(),
+                        projectIds);
+                String projectNames = projects.stream()
+                    .map(GameEventProjectVo::getProjectName)
+                    .filter(StringUtils::isNotBlank)  // 过滤项目名为空的情况
+                    .collect(Collectors.joining(","));
+                vo.setProjectList(projectNames);
+                return vo;
+            })
+            .collect(Collectors.toList());  // 收集结果
         return TableDataInfo.build(result);
     }
 
@@ -117,7 +138,7 @@ public class GameEventGroupServiceImpl implements IGameEventGroupService {
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(GameEventGroup entity){
+    private void validEntityBeforeSave(GameEventGroup entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -130,7 +151,7 @@ public class GameEventGroupServiceImpl implements IGameEventGroupService {
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;

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

@@ -40,7 +40,7 @@ public class GameEventProjectServiceImpl implements IGameEventProjectService {
      * @return 赛事项目
      */
     @Override
-    public GameEventProjectVo queryById(Long projectId){
+    public GameEventProjectVo queryById(Long projectId) {
         return baseMapper.selectVoById(projectId);
     }
 
@@ -117,7 +117,7 @@ public class GameEventProjectServiceImpl implements IGameEventProjectService {
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(GameEventProject entity){
+    private void validEntityBeforeSave(GameEventProject entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -130,9 +130,18 @@ public class GameEventProjectServiceImpl implements IGameEventProjectService {
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;
     }
+
+    @Override
+    public List<GameEventProjectVo> listProjectsByEventIdAndProjectIndex(Long eventId, String[] projectIds) {
+        return this.baseMapper.selectVoList(
+            new LambdaQueryWrapper<GameEventProject>()
+                .eq(GameEventProject::getEventId, eventId)
+                .in(GameEventProject::getProjectId, projectIds)
+        );
+    }
 }

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

@@ -1,5 +1,6 @@
 package org.dromara.system.service.impl;
 
+import org.dromara.common.core.domain.R;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -19,6 +20,7 @@ import org.dromara.system.service.IGameEventService;
 import java.util.List;
 import java.util.Map;
 import java.util.Collection;
+import java.util.stream.Collectors;
 
 /**
  * 赛事基本信息Service业务层处理
@@ -40,7 +42,7 @@ public class GameEventServiceImpl implements IGameEventService {
      * @return 赛事基本信息
      */
     @Override
-    public GameEventVo queryById(Long eventId){
+    public GameEventVo queryById(Long eventId) {
         return baseMapper.selectVoById(eventId);
     }
 
@@ -117,7 +119,7 @@ public class GameEventServiceImpl implements IGameEventService {
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(GameEvent entity){
+    private void validEntityBeforeSave(GameEvent entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -130,9 +132,25 @@ public class GameEventServiceImpl implements IGameEventService {
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;
     }
+
+    /**
+     * 获取赛事ID与名称的映射关系
+     *
+     * @return 赛事ID与名称的映射关系
+     */
+    @Override
+    public Map<String, Long> getEventIdNameMap() {
+        List<GameEvent> idNameList = this.baseMapper.selectList(
+            new LambdaQueryWrapper<GameEvent>()
+                .select(GameEvent::getEventId, GameEvent::getEventName)
+        );
+        Map<String, Long> idNameMap = idNameList.stream()
+            .collect(Collectors.toMap(GameEvent::getEventName, GameEvent::getEventId));
+        return idNameMap;
+    }
 }

+ 7 - 0
ruoyi-modules/ruoyi-game-event/src/main/resources/mapper/system/ArticleMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.dromara.system.mapper.ArticleMapper">
+
+</mapper>