Compare commits

...

No commits in common. "SAMS-R" and "master" have entirely different histories.

889 changed files with 15006 additions and 74476 deletions

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html

79
.gitignore vendored
View File

@ -1,47 +1,32 @@
######################################################################
# Build Tools
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
target/
!.mvn/wrapper/maven-wrapper.jar
######################################################################
# IDE
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### JRebel ###
rebel.xml
### NetBeans ###
nbproject/private/
build/*
nbbuild/
dist/
nbdist/
.nb-gradle/
######################################################################
# Others
*.log
*.xml.versionsBackup
*.swp
!*/build/*.java
!*/build/*.html
!*/build/*.xml
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

View File

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

20
LICENSE
View File

@ -1,20 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 RuoYi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

168
README.md
View File

@ -1,168 +0,0 @@
# SAMS校园社团活动管理系统
[![img](https://img.shields.io/badge/RuoYi-v3.8.9-brightgreen.svg)](https://gitee.com/y_project/RuoYi-Vue) [![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5.2-green)](https://spring.io/) [![Vue.js](https://img.shields.io/badge/Vue.js-2.5.0-brightgreen)](https://vuejs.org/)[![img](https://img.shields.io/github/license/mashape/apistatus.svg)](https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE)
>基于SpringBoot + Vue 的校园社团活动全流程管理平台
>
>毕业设计项目 | 山东建筑大学 | 2025届
## 项目简介
本项目是基于 RuoYi-Vue 前后端分离版开发的校园社团活动管理系统,旨在为高校师生提供一个高效、便捷的社团活动组织与管理平台。系统支持活动的发布、审核、参与、互动等功能,提升校园社团活动的管理效率和参与体验。
## 技术栈
### 前端
| 技术 | 说明 | 版本信息 |
| ---------- | --------- | -------- |
| Vue.js | 前端框架 | 2.6.x |
| Element UI | UI 组件库 | 2.15.x |
| Axios | 网络请求 | 0.21.x |
### 后端
| 技术 | 说明 | 版本信息 |
| --------------- | ------------ | -------- |
| Java EE | Java开发环境 | 1.8+ |
| Spring Boot | 后端开发框架 | 2.5.15 |
| Spring Security | 安全框架 | 5.7.12 |
| MyBatis | ORM 框架 | 3.x |
| JWT | 身份验证机制 | 0.9.1 |
### 数据库
| 技术 | 说明 | 版本信息 |
| ----- | ------------ | ------------ |
| MySQL | 关系型数据库 | 5.7+ 建议8.0 |
| Redis | 缓存数据库 | >=3 |
### 构建工具
| 技术 | 说明 | 版本信息 |
| ------- | ------------------ | -------- |
| Maven | 项目管理和构建工具 | 3.6.x+ |
| Node.js | 前端构建工具 | 16.14.0 |
## 功能模块
### 1. 用户管理
- **角色划分**:系统将用户分为管理员、社团成员和普通参与者三种角色,分别拥有不同的权限。
- **权限控制**:基于角色的权限控制,确保系统操作的安全性和规范性。
### 2. 社团管理
- **社团信息维护**支持社团的基本信息管理包括名称、简介、Logo、所属学院、社团类别、社团负责人等。
- **成员管理**:支持社团成员的加入和退出审核,记录成员的活跃度(如发起活动次数和参与活动次数等)。
### 3. 活动管理
- **活动申请与审核**:用户可以提交活动申请,管理员进行审核,支持通过、驳回或要求修改。
- **活动发布与展示**:活动自动分类展示,支持关键词搜索、时间筛选、社团分类浏览等功能。
- **活动执行与监控**:组织者可实时更新活动信息,管理员可监控活动进展,发现违规可强制终止并通知参与者。
### 4. 互动功能
- **报名与签到**:用户可在线报名活动,活动当日进行签到,记录参与情况。
- **评论与点赞**:用户可对活动发表评论和点赞,增强互动性。
- **通知与提醒**:系统自动推送报名成功提醒、活动开始前提醒、变更通知等。
## 系统架构
系统采用前后端分离架构,前端使用 Vue.js 构建单页应用,后端基于 Spring Boot 提供 RESTful API 接口,前后端通过 JSON 进行数据交互。
## 安装部署
### 前提条件
- **JDK**1.8 及以上
- **MySQL**5.7 及以上建议8.0+
- **Redis**3.0 及以上
- **Node.js**16.14.0(仅该版本,高低版本可能会有依赖冲突)
- **Maven**3.0 及以上
### 后端部署
1. 克隆项目代码:
```bash
git clone https://git.waynews.top/BruceSun/SAMS.git
```
1. 导入数据库:
`sql` 目录下的 SQL 文件导入 MySQL 数据库。
2. 配置数据库连接:
修改 `application-druid.yml` 文件,配置数据库连接信息。
3. 启动 Redis 服务。
4. 运行后端项目:
使用 IDE如 IntelliJ IDEA打开项目运行 `RuoYiApplication` 主类启动后端服务。
### 前端部署
1.进入前端项目目录:
```bash
cd ruoyi-ui
```
2.安装依赖:
```bash
npm install
#注意npm国内安装比较慢建议使用国内镜像安装
npm install --registry=https://registry.npmmirror.com
```
3.运行前端项目(开发环境):
```bash
npm run dev
```
4.访问系统:
在浏览器中打开 `http://localhost:80`使用默认账户登录用户名admin密码admin123
## 目录结构
### 后端目录结构
```plaintext
ruoyi
├── bs-sams // 业务模块
├── ruoyi-admin // 后台管理模块
├── ruoyi-common // 公共模块
├── ruoyi-framework // 框架核心模块
├── ruoyi-generator // 代码生成模块
├── ruoyi-quartz // 定时任务模块
├── ruoyi-system // 系统模块
└── sql // 数据库脚本
```
### 前端目录结构
```plaintext
ruoyi-ui
├── public // 公共资源
└── src
├── api // 接口请求
├── assets // 静态资源
├── components // 公共组件
├── layout // 布局组件
├── router // 路由配置
├── store // 状态管理
├── utils // 工具函数
├── views // 页面视图
├── App.vue // 根组件
└── main.js // 入口文件
```
## 参考资料
- RuoYi-Vue 官方文档https://doc.ruoyi.vip/ruoyi-vue/
- RuoYi-Vue Gitee 仓库https://gitee.com/y_project/RuoYi-Vue

View File

@ -1,12 +0,0 @@
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean
pause

View File

@ -1,12 +0,0 @@
@echo off
echo.
echo [信息] 打包Web工程生成war/jar包文件。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean package -Dmaven.test.skip=true
pause

View File

@ -1,14 +0,0 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.8.9</version>
</parent>
<artifactId>bs-sams</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,101 +0,0 @@
package com.ruoyi.sams.ams.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.sams.ams.domain.AmsActivity;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ams.domain.vo.ActivityListVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sams.ams.service.IAmsActivityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-06
*/
@RestController
@RequestMapping("/ams/activity")
public class AmsActivityController extends BaseController
{
@Autowired
private IAmsActivityService amsActivityService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(ActivityListGetVO amsActivity)
{
startPage();
List<ActivityListVO> list = amsActivityService.selectAmsActivityList(amsActivity);
return getDataTable(list);
}
/**
*
*/
@Log(title = "活动列表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ActivityListGetVO amsActivity)
{
List<ActivityListVO> list = amsActivityService.selectAmsActivityList(amsActivity);
ExcelUtil<ActivityListVO> util = new ExcelUtil<ActivityListVO>(ActivityListVO.class);
util.exportExcel(response, list, "活动列表数据");
}
/**
*
*/
@GetMapping(value = "/{actId}")
public AjaxResult getInfo(@PathVariable("actId") Long actId)
{
return success(amsActivityService.selectAmsActivityByActId(actId));
}
/**
*
*/
@Log(title = "活动列表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AmsActivity amsActivity)
{
return toAjax(amsActivityService.insertAmsActivity(amsActivity));
}
/**
*
*/
@Log(title = "活动列表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AmsActivity amsActivity)
{
return toAjax(amsActivityService.updateAmsActivity(amsActivity));
}
/**
*
*/
@Log(title = "活动列表", businessType = BusinessType.DELETE)
@DeleteMapping("/{actIds}")
public AjaxResult remove(@PathVariable Long[] actIds)
{
return toAjax(amsActivityService.deleteAmsActivityByActIds(actIds));
}
}

View File

@ -1,100 +0,0 @@
package com.ruoyi.sams.ams.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.sams.ams.domain.AmsComment;
import com.ruoyi.sams.ams.domain.vo.AmsCommentListVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sams.ams.service.IAmsCommentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-06
*/
@RestController
@RequestMapping("/ams/comment")
public class AmsCommentController extends BaseController
{
@Autowired
private IAmsCommentService amsCommentService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(AmsCommentListVO amsComment)
{
startPage();
List<AmsCommentListVO> list = amsCommentService.selectAmsCommentList(amsComment);
return getDataTable(list);
}
/**
*
*/
@Log(title = "活动评论", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AmsCommentListVO amsComment)
{
List<AmsCommentListVO> list = amsCommentService.selectAmsCommentList(amsComment);
ExcelUtil<AmsCommentListVO> util = new ExcelUtil<AmsCommentListVO>(AmsCommentListVO.class);
util.exportExcel(response, list, "活动评论数据");
}
/**
*
*/
@GetMapping(value = "/{commentId}")
public AjaxResult getInfo(@PathVariable("commentId") Long commentId)
{
return success(amsCommentService.selectAmsCommentByCommentId(commentId));
}
/**
*
*/
@Log(title = "活动评论", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AmsComment amsComment)
{
return toAjax(amsCommentService.insertAmsComment(amsComment));
}
/**
*
*/
@Log(title = "活动评论", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AmsComment amsComment)
{
return toAjax(amsCommentService.updateAmsComment(amsComment));
}
/**
*
*/
@Log(title = "活动评论", businessType = BusinessType.DELETE)
@DeleteMapping("/{commentIds}")
public AjaxResult remove(@PathVariable Long[] commentIds)
{
return toAjax(amsCommentService.deleteAmsCommentByCommentIds(commentIds));
}
}

View File

@ -1,100 +0,0 @@
package com.ruoyi.sams.ams.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.sams.ams.domain.AmsReaction;
import com.ruoyi.sams.ams.domain.vo.AmsReactionVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sams.ams.service.IAmsReactionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-06
*/
@RestController
@RequestMapping("/ams/reaction")
public class AmsReactionController extends BaseController
{
@Autowired
private IAmsReactionService amsReactionService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(AmsReactionVO amsReaction)
{
startPage();
List<AmsReactionVO> list = amsReactionService.selectAmsReactionList(amsReaction);
return getDataTable(list);
}
/**
*
*/
@Log(title = "点赞记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AmsReactionVO amsReaction)
{
List<AmsReactionVO> list = amsReactionService.selectAmsReactionList(amsReaction);
ExcelUtil<AmsReactionVO> util = new ExcelUtil<AmsReactionVO>(AmsReactionVO.class);
util.exportExcel(response, list, "点赞记录数据");
}
/**
*
*/
@GetMapping(value = "/{reactionId}")
public AjaxResult getInfo(@PathVariable("reactionId") Long reactionId)
{
return success(amsReactionService.selectAmsReactionByReactionId(reactionId));
}
/**
*
*/
@Log(title = "点赞记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AmsReaction amsReaction)
{
return toAjax(amsReactionService.insertAmsReaction(amsReaction));
}
/**
*
*/
@Log(title = "点赞记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AmsReaction amsReaction)
{
return toAjax(amsReactionService.updateAmsReaction(amsReaction));
}
/**
*
*/
@Log(title = "点赞记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{reactionIds}")
public AjaxResult remove(@PathVariable Long[] reactionIds)
{
return toAjax(amsReactionService.deleteAmsReactionByReactionIds(reactionIds));
}
}

View File

@ -1,98 +0,0 @@
package com.ruoyi.sams.ams.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sams.ams.domain.AmsRegistration;
import com.ruoyi.sams.ams.service.IAmsRegistrationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-08
*/
@RestController
@RequestMapping("/ams/registration")
public class AmsRegistrationController extends BaseController
{
@Autowired
private IAmsRegistrationService amsRegistrationService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(AmsRegistration amsRegistration)
{
startPage();
List<AmsRegistration> list = amsRegistrationService.selectAmsRegistrationList(amsRegistration);
return getDataTable(list);
}
/**
*
*/
@Log(title = "活动报名", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AmsRegistration amsRegistration)
{
List<AmsRegistration> list = amsRegistrationService.selectAmsRegistrationList(amsRegistration);
ExcelUtil<AmsRegistration> util = new ExcelUtil<AmsRegistration>(AmsRegistration.class);
util.exportExcel(response, list, "活动报名数据");
}
/**
*
*/
@GetMapping(value = "/{regId}")
public AjaxResult getInfo(@PathVariable("regId") Long regId)
{
return success(amsRegistrationService.selectAmsRegistrationByRegId(regId));
}
/**
*
*/
@Log(title = "活动报名", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AmsRegistration amsRegistration)
{
return toAjax(amsRegistrationService.insertAmsRegistration(amsRegistration));
}
/**
*
*/
@Log(title = "活动报名", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AmsRegistration amsRegistration)
{
return toAjax(amsRegistrationService.updateAmsRegistration(amsRegistration));
}
/**
*
*/
@Log(title = "活动报名", businessType = BusinessType.DELETE)
@DeleteMapping("/{regIds}")
public AjaxResult remove(@PathVariable Long[] regIds)
{
return toAjax(amsRegistrationService.deleteAmsRegistrationByRegIds(regIds));
}
}

View File

@ -1,274 +0,0 @@
package com.ruoyi.sams.ams.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ams_activity
*
* @author ruoyi
* @date 2025-05-07
*/
public class AmsActivity extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 活动ID */
private Long actId;
/** 活动标题 */
@Excel(name = "活动标题")
private String title;
/** 活动描述 */
@Excel(name = "活动描述")
private String description;
/** 封面图 */
@Excel(name = "封面图")
private String coverImage;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 活动地点 */
@Excel(name = "活动地点")
private String location;
/** 预算金额 */
@Excel(name = "预算金额")
private BigDecimal budget;
/** 最大参与人数 */
@Excel(name = "最大参与人数")
private Long maxParticipants;
/** 创建人IDsys_user */
@Excel(name = "创建人ID", readConverterExp = "s=ys_user")
private Long creatorId;
/** 所属社团IDsms_club */
@Excel(name = "所属社团ID", readConverterExp = "s=ms_club")
private Long clubId;
/** 所属院系IDsys_dept */
@Excel(name = "所属院系ID", readConverterExp = "s=ys_dept")
private Long deptId;
/** 活动类型 */
@Excel(name = "活动类型")
private String activityType;
/** 活动状态 */
@Excel(name = "活动状态")
private String status;
/** 是否公开 */
@Excel(name = "是否公开")
private String visibility;
/** 当前审批人ID */
@Excel(name = "当前审批人ID")
private Long currentApproverId;
public void setActId(Long actId)
{
this.actId = actId;
}
public Long getActId()
{
return actId;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setCoverImage(String coverImage)
{
this.coverImage = coverImage;
}
public String getCoverImage()
{
return coverImage;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setLocation(String location)
{
this.location = location;
}
public String getLocation()
{
return location;
}
public void setBudget(BigDecimal budget)
{
this.budget = budget;
}
public BigDecimal getBudget()
{
return budget;
}
public void setMaxParticipants(Long maxParticipants)
{
this.maxParticipants = maxParticipants;
}
public Long getMaxParticipants()
{
return maxParticipants;
}
public void setCreatorId(Long creatorId)
{
this.creatorId = creatorId;
}
public Long getCreatorId()
{
return creatorId;
}
public void setClubId(Long clubId)
{
this.clubId = clubId;
}
public Long getClubId()
{
return clubId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setActivityType(String activityType)
{
this.activityType = activityType;
}
public String getActivityType()
{
return activityType;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setVisibility(String visibility)
{
this.visibility = visibility;
}
public String getVisibility()
{
return visibility;
}
public void setCurrentApproverId(Long currentApproverId)
{
this.currentApproverId = currentApproverId;
}
public Long getCurrentApproverId()
{
return currentApproverId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("actId", getActId())
.append("title", getTitle())
.append("description", getDescription())
.append("coverImage", getCoverImage())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("location", getLocation())
.append("budget", getBudget())
.append("maxParticipants", getMaxParticipants())
.append("creatorId", getCreatorId())
.append("clubId", getClubId())
.append("deptId", getDeptId())
.append("activityType", getActivityType())
.append("status", getStatus())
.append("visibility", getVisibility())
.append("currentApproverId", getCurrentApproverId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,102 +0,0 @@
package com.ruoyi.sams.ams.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ams_comment
*
* @author ruoyi
* @date 2025-05-06
*/
public class AmsComment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 评论ID */
private Long commentId;
/** 活动ID */
@Excel(name = "活动ID")
private Long actId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 父评论ID嵌套结构 */
@Excel(name = "父评论ID", readConverterExp = "嵌=套结构")
private Long parentCommentId;
/** 评论内容 */
@Excel(name = "评论内容")
private String content;
public void setCommentId(Long commentId)
{
this.commentId = commentId;
}
public Long getCommentId()
{
return commentId;
}
public void setActId(Long actId)
{
this.actId = actId;
}
public Long getActId()
{
return actId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setParentCommentId(Long parentCommentId)
{
this.parentCommentId = parentCommentId;
}
public Long getParentCommentId()
{
return parentCommentId;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("commentId", getCommentId())
.append("actId", getActId())
.append("userId", getUserId())
.append("parentCommentId", getParentCommentId())
.append("content", getContent())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,87 +0,0 @@
package com.ruoyi.sams.ams.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ams_reaction
*
* @author ruoyi
* @date 2025-05-06
*/
public class AmsReaction extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 互动ID */
private Long reactionId;
/** 活动ID */
@Excel(name = "活动ID")
private Long actId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 反应类型like点赞 / dislike点踩 */
@Excel(name = "反应类型", readConverterExp = "l=ike点赞,/=,d=islike点踩")
private String reactionType;
public void setReactionId(Long reactionId)
{
this.reactionId = reactionId;
}
public Long getReactionId()
{
return reactionId;
}
public void setActId(Long actId)
{
this.actId = actId;
}
public Long getActId()
{
return actId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setReactionType(String reactionType)
{
this.reactionType = reactionType;
}
public String getReactionType()
{
return reactionType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("reactionId", getReactionId())
.append("actId", getActId())
.append("userId", getUserId())
.append("reactionType", getReactionType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,132 +0,0 @@
package com.ruoyi.sams.ams.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ams_registration
*
* @author ruoyi
* @date 2025-05-08
*/
public class AmsRegistration extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 报名ID */
private Long regId;
/** 活动ID */
@Excel(name = "活动ID")
private Long actId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 角色 */
@Excel(name = "角色")
private String role;
/** 报名状态 */
@Excel(name = "报名状态")
private String status;
/** 报名时间 */
private Date registerTime;
/** 签到时间 */
private Date attendTime;
public void setRegId(Long regId)
{
this.regId = regId;
}
public Long getRegId()
{
return regId;
}
public void setActId(Long actId)
{
this.actId = actId;
}
public Long getActId()
{
return actId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setRole(String role)
{
this.role = role;
}
public String getRole()
{
return role;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setRegisterTime(Date registerTime)
{
this.registerTime = registerTime;
}
public Date getRegisterTime()
{
return registerTime;
}
public void setAttendTime(Date attendTime)
{
this.attendTime = attendTime;
}
public Date getAttendTime()
{
return attendTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("regId", getRegId())
.append("actId", getActId())
.append("userId", getUserId())
.append("role", getRole())
.append("status", getStatus())
.append("registerTime", getRegisterTime())
.append("attendTime", getAttendTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,57 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
/**
*
*/
public class ActivityListGetVO {
private String title; // 活动标题(模糊查询)
private String status; // 状态筛选
private Long clubId; // 所属社团
private Long creatorId; // 创建人ID
/**
* 稿使
*/
private Boolean excludeOtherDraft;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
public Long getCreatorId() {
return creatorId;
}
public void setCreatorId(Long creatorId) {
this.creatorId = creatorId;
}
public Boolean getExcludeOtherDraft() {
return excludeOtherDraft;
}
public void setExcludeOtherDraft(Boolean excludeOtherDraft) {
this.excludeOtherDraft = excludeOtherDraft;
}
}

View File

@ -1,231 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
import com.ruoyi.common.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
public class ActivityListVO {
@Excel(name = "活动ID")
private Long actId;
@Excel(name = "活动标题")
private String title;
@Excel(name = "活动描述")
private String description;
/** 封面图 */
@Excel(name = "封面图")
private String coverImage;
@Excel(name = "预算")
private BigDecimal budget;
@Excel(name = "创建人ID")
private Long creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "所属社团ID")
private Long clubId;
@Excel(name = "社团名称")
private String clubName;
@Excel(name = "所属院系ID")
private Long deptId;
@Excel(name = "院系名称")
private String deptName;
@Excel(name = "活动地点")
private String location;
@Excel(name = "活动类型")
private String activityType;
@Excel(name = "活动状态")
private String status;
@Excel(name = "可见性")
private String visibility;
@Excel(name = "开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@Excel(name = "结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@Excel(name = "备注")
private String remark;
public Long getActId() {
return actId;
}
public void setActId(Long actId) {
this.actId = actId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCoverImage() {
return coverImage;
}
public void setCoverImage(String coverImage) {
this.coverImage = coverImage;
}
public BigDecimal getBudget() {
return budget;
}
public void setBudget(BigDecimal budget) {
this.budget = budget;
}
public Long getCreatorId() {
return creatorId;
}
public void setCreatorId(Long creatorId) {
this.creatorId = creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
public String getClubName() {
return clubName;
}
public void setClubName(String clubName) {
this.clubName = clubName;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getActivityType() {
return activityType;
}
public void setActivityType(String activityType) {
this.activityType = activityType;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getVisibility() {
return visibility;
}
public void setVisibility(String visibility) {
this.visibility = visibility;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "ActivityListVO{" +
"actId=" + actId +
", title='" + title + '\'' +
", description='" + description + '\'' +
", coverImage='" + coverImage + '\'' +
", budget=" + budget +
", creatorId=" + creatorId +
", creatorName='" + creatorName + '\'' +
", clubId=" + clubId +
", clubName='" + clubName + '\'' +
", deptId=" + deptId +
", deptName='" + deptName + '\'' +
", location='" + location + '\'' +
", activityType='" + activityType + '\'' +
", status='" + status + '\'' +
", visibility='" + visibility + '\'' +
", startTime=" + startTime +
", endTime=" + endTime +
", remark='" + remark + '\'' +
'}';
}
}

View File

@ -1,106 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
import com.ruoyi.common.annotation.Excel;
import java.util.Date;
public class AmsCommentListVO {
@Excel(name = "评论ID")
private Long commentId;
@Excel(name = "活动ID")
private Long actId;
@Excel(name = "活动名称")
private String activityName;
@Excel(name = "用户ID")
private Long userId;
@Excel(name = "用户名")
private String userName;
@Excel(name = "父评论ID")
private Long parentCommentId;
@Excel(name = "评论内容")
private String content;
@Excel(name = "备注")
private String remark;
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public Long getCommentId() {
return commentId;
}
public void setCommentId(Long commentId) {
this.commentId = commentId;
}
public Long getActId() {
return actId;
}
public void setActId(Long actId) {
this.actId = actId;
}
public String getActivityName() {
return activityName;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Long getParentCommentId() {
return parentCommentId;
}
public void setParentCommentId(Long parentCommentId) {
this.parentCommentId = parentCommentId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,96 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
import com.ruoyi.common.annotation.Excel;
/**
* AmsReactionVO
*/
public class AmsReactionVO {
@Excel(name = "互动ID")
private Long reactionId;
@Excel(name = "活动ID")
private Long actId;
@Excel(name = "活动名称")
private String actTitle;
@Excel(name = "用户ID")
private Long userId;
@Excel(name = "用户名")
private String userName;
@Excel(name = "反应类型", dictType = "ams_reaction_type")
private String reactionType;
@Excel(name = "备注")
private String remark;
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String createTime;
public Long getReactionId() {
return reactionId;
}
public void setReactionId(Long reactionId) {
this.reactionId = reactionId;
}
public Long getActId() {
return actId;
}
public void setActId(Long actId) {
this.actId = actId;
}
public String getActTitle() {
return actTitle;
}
public void setActTitle(String actTitle) {
this.actTitle = actTitle;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getReactionType() {
return reactionType;
}
public void setReactionType(String reactionType) {
this.reactionType = reactionType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
}

View File

@ -1,69 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
import java.util.Date;
public class AmsRegistrationGetVO {
private Long actId;
private Long userId;
private String role;
private String activityName; // 活动名称(模糊查询)
private String userName; // 用户名(模糊查询)
private Date registerTime;
private Date attendTime;
public Long getActId() {
return actId;
}
public void setActId(Long actId) {
this.actId = actId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getActivityName() {
return activityName;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Date getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
public Date getAttendTime() {
return attendTime;
}
public void setAttendTime(Date attendTime) {
this.attendTime = attendTime;
}
}

View File

@ -1,162 +0,0 @@
package com.ruoyi.sams.ams.domain.vo;
import com.ruoyi.common.annotation.Excel;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class AmsRegistrationVO {
@Excel(name = "报名ID")
private Long regId;
@Excel(name = "活动ID")
private Long actId;
@Excel(name = "活动名称")
private String activityName;
@Excel(name = "用户ID")
private Long userId;
@Excel(name = "用户姓名")
private String userName;
@Excel(name = "报名角色")
private String role;
@Excel(name = "报名状态")
private String status;
@Excel(name = "报名时间", dateFormat = "yyyy-MM-dd")
private LocalDate registerTime;
@Excel(name = "签到时间", dateFormat = "yyyy-MM-dd")
private LocalDate attendTime;
@Excel(name = "创建人")
private String createBy;
@Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@Excel(name = "更新人")
private String updateBy;
@Excel(name = "更新时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
@Excel(name = "备注")
private String remark;
public Long getRegId() {
return regId;
}
public void setRegId(Long regId) {
this.regId = regId;
}
public Long getActId() {
return actId;
}
public void setActId(Long actId) {
this.actId = actId;
}
public String getActivityName() {
return activityName;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public LocalDate getRegisterTime() {
return registerTime;
}
public void setRegisterTime(LocalDate registerTime) {
this.registerTime = registerTime;
}
public LocalDate getAttendTime() {
return attendTime;
}
public void setAttendTime(LocalDate attendTime) {
this.attendTime = attendTime;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -1,75 +0,0 @@
package com.ruoyi.sams.ams.mapper;
import java.util.List;
import com.ruoyi.sams.ams.domain.vo.ActivityListVO;
import com.ruoyi.sams.ams.domain.AmsActivity;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ui.domain.vo.ActivityQueryDTO;
import com.ruoyi.sams.ui.domain.vo.HotClubVO;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-06
*/
public interface AmsActivityMapper
{
/**
*
*
* @param actId
* @return
*/
public ActivityListVO selectAmsActivityByActId(Long actId);
/**
*
*
* @param amsActivity
* @return
*/
public List<ActivityListVO> selectAmsActivityList(ActivityListGetVO amsActivity);
/**
*
*
* @param amsActivity
* @return
*/
public int insertAmsActivity(AmsActivity amsActivity);
/**
*
*
* @param amsActivity
* @return
*/
public int updateAmsActivity(AmsActivity amsActivity);
/**
*
*
* @param actId
* @return
*/
public int deleteAmsActivityByActId(Long actId);
/**
*
*
* @param actIds
* @return
*/
public int deleteAmsActivityByActIds(Long[] actIds);
List<ActivityListVO> selectBannerActivities();
List<ActivityListVO> selectApprovedActivities();
List<HotClubVO> selectTopClubsByActivityCount(@Param("limit") int limit);
List<ActivityListVO> selectMyRegisteredActivities(@Param("userId") Long userId);
}

View File

@ -1,70 +0,0 @@
package com.ruoyi.sams.ams.mapper;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsComment;
import com.ruoyi.sams.ams.domain.vo.AmsCommentListVO;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-06
*/
public interface AmsCommentMapper
{
/**
*
*
* @param commentId
* @return
*/
public AmsComment selectAmsCommentByCommentId(Long commentId);
/**
*
*
* @param amsComment
* @return
*/
public List<AmsCommentListVO> selectAmsCommentList(AmsCommentListVO amsComment);
/**
*
*
* @param amsComment
* @return
*/
public int insertAmsComment(AmsComment amsComment);
/**
*
*
* @param amsComment
* @return
*/
public int updateAmsComment(AmsComment amsComment);
/**
*
*
* @param commentId
* @return
*/
public int deleteAmsCommentByCommentId(Long commentId);
/**
*
*
* @param commentIds
* @return
*/
public int deleteAmsCommentByCommentIds(Long[] commentIds);
/**
*
* @param actId ID
* @return
*/
List<AmsComment> selectCommentListByActId(@Param("actId") Long actId);
}

View File

@ -1,74 +0,0 @@
package com.ruoyi.sams.ams.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.sams.ams.domain.AmsReaction;
import com.ruoyi.sams.ams.domain.vo.AmsReactionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-06
*/
@Mapper
public interface AmsReactionMapper
{
/**
*
*
* @param reactionId
* @return
*/
public AmsReaction selectAmsReactionByReactionId(Long reactionId);
/**
*
*
* @param amsReaction
* @return
*/
public List<AmsReactionVO> selectAmsReactionList(AmsReactionVO amsReaction);
/**
*
*
* @param amsReaction
* @return
*/
public int insertAmsReaction(AmsReaction amsReaction);
/**
*
*
* @param amsReaction
* @return
*/
public int updateAmsReaction(AmsReaction amsReaction);
/**
*
*
* @param reactionId
* @return
*/
public int deleteAmsReactionByReactionId(Long reactionId);
/**
*
*
* @param reactionIds
* @return
*/
public int deleteAmsReactionByReactionIds(Long[] reactionIds);
/**
* /
* @param actId ID
* @return
*/
List<Map<String, Object>> countReactionByType(@Param("actId") Long actId);
}

View File

@ -1,61 +0,0 @@
package com.ruoyi.sams.ams.mapper;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsRegistration;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-08
*/
public interface AmsRegistrationMapper
{
/**
*
*
* @param regId
* @return
*/
public AmsRegistration selectAmsRegistrationByRegId(Long regId);
/**
*
*
* @param amsRegistration
* @return
*/
public List<AmsRegistration> selectAmsRegistrationList(AmsRegistration amsRegistration);
/**
*
*
* @param amsRegistration
* @return
*/
public int insertAmsRegistration(AmsRegistration amsRegistration);
/**
*
*
* @param amsRegistration
* @return
*/
public int updateAmsRegistration(AmsRegistration amsRegistration);
/**
*
*
* @param regId
* @return
*/
public int deleteAmsRegistrationByRegId(Long regId);
/**
*
*
* @param regIds
* @return
*/
public int deleteAmsRegistrationByRegIds(Long[] regIds);
}

View File

@ -1,84 +0,0 @@
package com.ruoyi.sams.ams.service;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsActivity;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ams.domain.vo.ActivityListVO;
import com.ruoyi.sams.ui.domain.vo.ActivityQueryDTO;
import com.ruoyi.sams.ui.domain.vo.HotClubVO;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
public interface IAmsActivityService
{
/**
*
*
* @param actId
* @return
*/
public ActivityListVO selectAmsActivityByActId(Long actId);
/**
*
*
* @param amsActivity
* @return
*/
public List<ActivityListVO> selectAmsActivityList(ActivityListGetVO amsActivity);
/**
*
*
* @param amsActivity
* @return
*/
public int insertAmsActivity(AmsActivity amsActivity);
/**
*
*
* @param amsActivity
* @return
*/
public int updateAmsActivity(AmsActivity amsActivity);
/**
*
*
* @param actIds
* @return
*/
public int deleteAmsActivityByActIds(Long[] actIds);
/**
*
*
* @param actId
* @return
*/
public int deleteAmsActivityByActId(Long actId);
/**
* 4
*/
List<ActivityListVO> listBannerActivities();
/**
*
*/
List<ActivityListVO> listApprovedActivities();
/**
* 4
*/
List<HotClubVO> listTop4ByActivityCount();
List<ActivityListVO> selectMyRegisteredActivities(Long userId);
}

View File

@ -1,72 +0,0 @@
package com.ruoyi.sams.ams.service;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsComment;
import com.ruoyi.sams.ams.domain.vo.AmsCommentListVO;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
public interface IAmsCommentService
{
/**
*
*
* @param commentId
* @return
*/
public AmsComment selectAmsCommentByCommentId(Long commentId);
/**
*
*
* @param amsComment
* @return
*/
public List<AmsCommentListVO> selectAmsCommentList(AmsCommentListVO amsComment);
/**
*
*
* @param amsComment
* @return
*/
public int insertAmsComment(AmsComment amsComment);
/**
*
*
* @param amsComment
* @return
*/
public int updateAmsComment(AmsComment amsComment);
/**
*
*
* @param commentIds
* @return
*/
public int deleteAmsCommentByCommentIds(Long[] commentIds);
/**
*
*
* @param commentId
* @return
*/
public int deleteAmsCommentByCommentId(Long commentId);
/**
*
* @param actId ID
* @return
*/
List<AmsComment> selectCommentListByActId(Long actId);
}

View File

@ -1,71 +0,0 @@
package com.ruoyi.sams.ams.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.sams.ams.domain.AmsReaction;
import com.ruoyi.sams.ams.domain.vo.AmsReactionVO;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
public interface IAmsReactionService
{
/**
*
*
* @param reactionId
* @return
*/
public AmsReaction selectAmsReactionByReactionId(Long reactionId);
/**
*
*
* @param amsReaction
* @return
*/
public List<AmsReactionVO> selectAmsReactionList(AmsReactionVO amsReaction);
/**
*
*
* @param amsReaction
* @return
*/
public int insertAmsReaction(AmsReaction amsReaction);
/**
*
*
* @param amsReaction
* @return
*/
public int updateAmsReaction(AmsReaction amsReaction);
/**
*
*
* @param reactionIds
* @return
*/
public int deleteAmsReactionByReactionIds(Long[] reactionIds);
/**
*
*
* @param reactionId
* @return
*/
public int deleteAmsReactionByReactionId(Long reactionId);
/**
* like/dislike
* @param actId ID
* @return Map{"like": 12, "dislike": 3}
*/
Map<String, Integer> getReactionStats(Long actId);
}

View File

@ -1,61 +0,0 @@
package com.ruoyi.sams.ams.service;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsRegistration;
/**
* Service
*
* @author ruoyi
* @date 2025-05-08
*/
public interface IAmsRegistrationService
{
/**
*
*
* @param regId
* @return
*/
public AmsRegistration selectAmsRegistrationByRegId(Long regId);
/**
*
*
* @param amsRegistration
* @return
*/
public List<AmsRegistration> selectAmsRegistrationList(AmsRegistration amsRegistration);
/**
*
*
* @param amsRegistration
* @return
*/
public int insertAmsRegistration(AmsRegistration amsRegistration);
/**
*
*
* @param amsRegistration
* @return
*/
public int updateAmsRegistration(AmsRegistration amsRegistration);
/**
*
*
* @param regIds
* @return
*/
public int deleteAmsRegistrationByRegIds(Long[] regIds);
/**
*
*
* @param regId
* @return
*/
public int deleteAmsRegistrationByRegId(Long regId);
}

View File

@ -1,126 +0,0 @@
package com.ruoyi.sams.ams.service.impl;
import java.util.List;
import java.util.Map;
import com.ruoyi.sams.ams.domain.AmsActivity;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ams.domain.vo.ActivityListVO;
import com.ruoyi.sams.ams.mapper.AmsActivityMapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sams.ui.domain.vo.ActivityQueryDTO;
import com.ruoyi.sams.ui.domain.vo.HotClubVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sams.ams.service.IAmsActivityService;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
@Service
public class AmsActivityServiceImpl implements IAmsActivityService
{
@Autowired
private AmsActivityMapper amsActivityMapper;
/**
*
*
* @param actId
* @return
*/
@Override
public ActivityListVO selectAmsActivityByActId(Long actId)
{
return amsActivityMapper.selectAmsActivityByActId(actId);
}
/**
*
*
* @param amsActivity
* @return
*/
@Override
public List<ActivityListVO> selectAmsActivityList(ActivityListGetVO amsActivity)
{
return amsActivityMapper.selectAmsActivityList(amsActivity);
}
/**
*
*
* @param amsActivity
* @return
*/
@Override
public int insertAmsActivity(AmsActivity amsActivity)
{
amsActivity.setCreateTime(DateUtils.getNowDate());
return amsActivityMapper.insertAmsActivity(amsActivity);
}
/**
*
*
* @param amsActivity
* @return
*/
@Override
public int updateAmsActivity(AmsActivity amsActivity)
{
amsActivity.setUpdateTime(DateUtils.getNowDate());
return amsActivityMapper.updateAmsActivity(amsActivity);
}
/**
*
*
* @param actIds
* @return
*/
@Override
public int deleteAmsActivityByActIds(Long[] actIds)
{
return amsActivityMapper.deleteAmsActivityByActIds(actIds);
}
/**
*
*
* @param actId
* @return
*/
@Override
public int deleteAmsActivityByActId(Long actId)
{
return amsActivityMapper.deleteAmsActivityByActId(actId);
}
@Override
public List<ActivityListVO> listBannerActivities() {
System.out.println(amsActivityMapper.selectBannerActivities());
return amsActivityMapper.selectBannerActivities();
}
@Override
public List<ActivityListVO> listApprovedActivities() {
System.out.println(amsActivityMapper.selectApprovedActivities());
return amsActivityMapper.selectApprovedActivities();
}
@Override
public List<HotClubVO> listTop4ByActivityCount() {
System.out.println(amsActivityMapper.selectTopClubsByActivityCount(4));
return amsActivityMapper.selectTopClubsByActivityCount(4);
}
@Override
public List<ActivityListVO> selectMyRegisteredActivities(Long userId ) {
return amsActivityMapper.selectMyRegisteredActivities(userId);
}
}

View File

@ -1,103 +0,0 @@
package com.ruoyi.sams.ams.service.impl;
import java.util.List;
import com.ruoyi.sams.ams.domain.AmsComment;
import com.ruoyi.sams.ams.domain.vo.AmsCommentListVO;
import com.ruoyi.sams.ams.mapper.AmsCommentMapper;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sams.ams.service.IAmsCommentService;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
@Service
public class AmsCommentServiceImpl implements IAmsCommentService
{
@Autowired
private AmsCommentMapper amsCommentMapper;
/**
*
*
* @param commentId
* @return
*/
@Override
public AmsComment selectAmsCommentByCommentId(Long commentId)
{
return amsCommentMapper.selectAmsCommentByCommentId(commentId);
}
/**
*
*
* @param amsComment
* @return
*/
@Override
public List<AmsCommentListVO> selectAmsCommentList(AmsCommentListVO amsComment)
{
return amsCommentMapper.selectAmsCommentList(amsComment);
}
/**
*
*
* @param amsComment
* @return
*/
@Override
public int insertAmsComment(AmsComment amsComment)
{
amsComment.setCreateTime(DateUtils.getNowDate());
return amsCommentMapper.insertAmsComment(amsComment);
}
/**
*
*
* @param amsComment
* @return
*/
@Override
public int updateAmsComment(AmsComment amsComment)
{
amsComment.setUpdateTime(DateUtils.getNowDate());
return amsCommentMapper.updateAmsComment(amsComment);
}
/**
*
*
* @param commentIds
* @return
*/
@Override
public int deleteAmsCommentByCommentIds(Long[] commentIds)
{
return amsCommentMapper.deleteAmsCommentByCommentIds(commentIds);
}
/**
*
*
* @param commentId
* @return
*/
@Override
public int deleteAmsCommentByCommentId(Long commentId)
{
return amsCommentMapper.deleteAmsCommentByCommentId(commentId);
}
@Override
public List<AmsComment> selectCommentListByActId(Long actId) {
return amsCommentMapper.selectCommentListByActId(actId);
}
}

View File

@ -1,116 +0,0 @@
package com.ruoyi.sams.ams.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.sams.ams.domain.AmsReaction;
import com.ruoyi.sams.ams.mapper.AmsReactionMapper;
import com.ruoyi.sams.ams.domain.vo.AmsReactionVO;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sams.ams.service.IAmsReactionService;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
@Service
public class AmsReactionServiceImpl implements IAmsReactionService
{
@Autowired
private AmsReactionMapper amsReactionMapper;
/**
*
*
* @param reactionId
* @return
*/
@Override
public AmsReaction selectAmsReactionByReactionId(Long reactionId)
{
return amsReactionMapper.selectAmsReactionByReactionId(reactionId);
}
/**
*
*
* @param amsReaction
* @return
*/
@Override
public List<AmsReactionVO> selectAmsReactionList(AmsReactionVO amsReaction)
{
return amsReactionMapper.selectAmsReactionList(amsReaction);
}
/**
*
*
* @param amsReaction
* @return
*/
@Override
public int insertAmsReaction(AmsReaction amsReaction)
{
amsReaction.setCreateTime(DateUtils.getNowDate());
return amsReactionMapper.insertAmsReaction(amsReaction);
}
/**
*
*
* @param amsReaction
* @return
*/
@Override
public int updateAmsReaction(AmsReaction amsReaction)
{
amsReaction.setUpdateTime(DateUtils.getNowDate());
return amsReactionMapper.updateAmsReaction(amsReaction);
}
/**
*
*
* @param reactionIds
* @return
*/
@Override
public int deleteAmsReactionByReactionIds(Long[] reactionIds)
{
return amsReactionMapper.deleteAmsReactionByReactionIds(reactionIds);
}
/**
*
*
* @param reactionId
* @return
*/
@Override
public int deleteAmsReactionByReactionId(Long reactionId)
{
return amsReactionMapper.deleteAmsReactionByReactionId(reactionId);
}
@Override
public Map<String, Integer> getReactionStats(Long actId) {
List<Map<String, Object>> rawStats = amsReactionMapper.countReactionByType(actId);
Map<String, Integer> result = new HashMap<>();
result.put("like", 0);
result.put("dislike", 0);
for (Map<String, Object> row : rawStats) {
String type = (String) row.get("reaction_type");
Long count = (Long) row.get("cnt");
result.put(type, count.intValue());
}
return result;
}
}

View File

@ -1,96 +0,0 @@
package com.ruoyi.sams.ams.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sams.ams.mapper.AmsRegistrationMapper;
import com.ruoyi.sams.ams.domain.AmsRegistration;
import com.ruoyi.sams.ams.service.IAmsRegistrationService;
/**
* Service
*
* @author ruoyi
* @date 2025-05-08
*/
@Service
public class AmsRegistrationServiceImpl implements IAmsRegistrationService
{
@Autowired
private AmsRegistrationMapper amsRegistrationMapper;
/**
*
*
* @param regId
* @return
*/
@Override
public AmsRegistration selectAmsRegistrationByRegId(Long regId)
{
return amsRegistrationMapper.selectAmsRegistrationByRegId(regId);
}
/**
*
*
* @param amsRegistration
* @return
*/
@Override
public List<AmsRegistration> selectAmsRegistrationList(AmsRegistration amsRegistration)
{
return amsRegistrationMapper.selectAmsRegistrationList(amsRegistration);
}
/**
*
*
* @param amsRegistration
* @return
*/
@Override
public int insertAmsRegistration(AmsRegistration amsRegistration)
{
amsRegistration.setCreateTime(DateUtils.getNowDate());
return amsRegistrationMapper.insertAmsRegistration(amsRegistration);
}
/**
*
*
* @param amsRegistration
* @return
*/
@Override
public int updateAmsRegistration(AmsRegistration amsRegistration)
{
amsRegistration.setUpdateTime(DateUtils.getNowDate());
return amsRegistrationMapper.updateAmsRegistration(amsRegistration);
}
/**
*
*
* @param regIds
* @return
*/
@Override
public int deleteAmsRegistrationByRegIds(Long[] regIds)
{
return amsRegistrationMapper.deleteAmsRegistrationByRegIds(regIds);
}
/**
*
*
* @param regId
* @return
*/
@Override
public int deleteAmsRegistrationByRegId(Long regId)
{
return amsRegistrationMapper.deleteAmsRegistrationByRegId(regId);
}
}

View File

@ -1,100 +0,0 @@
package com.ruoyi.sams.sms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.sams.sms.domain.SmsClub;
import com.ruoyi.sams.sms.domain.vo.ClubReturnVO;
import com.ruoyi.sams.sms.service.ISmsClubService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-06
*/
@RestController
@RequestMapping("/sms/club")
public class SmsClubController extends BaseController
{
@Autowired
private ISmsClubService smsClubService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(SmsClub smsClub)
{
startPage();
List<ClubReturnVO> list = smsClubService.selectSmsClubList(smsClub);
return getDataTable(list);
}
/**
*
*/
@Log(title = "社团信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SmsClub smsClub)
{
List<ClubReturnVO> list = smsClubService.selectSmsClubList(smsClub);
ExcelUtil<ClubReturnVO> util = new ExcelUtil<>(ClubReturnVO.class);
util.exportExcel(response, list, "社团信息数据");
}
/**
*
*/
@GetMapping(value = "/{clubId}")
public AjaxResult getInfo(@PathVariable("clubId") Long clubId)
{
return success(smsClubService.selectSmsClubByClubId(clubId));
}
/**
*
*/
@Log(title = "社团信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SmsClub smsClub)
{
return toAjax(smsClubService.insertSmsClub(smsClub));
}
/**
*
*/
@Log(title = "社团信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SmsClub smsClub)
{
return toAjax(smsClubService.updateSmsClub(smsClub));
}
/**
*
*/
@Log(title = "社团信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{clubIds}")
public AjaxResult remove(@PathVariable Long[] clubIds)
{
return toAjax(smsClubService.deleteSmsClubByClubIds(clubIds));
}
}

View File

@ -1,101 +0,0 @@
package com.ruoyi.sams.sms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.sams.sms.domain.SmsClubUser;
import com.ruoyi.sams.sms.domain.vo.ClubUserReturnVO;
import com.ruoyi.sams.sms.domain.vo.ClubUserSelectVO;
import com.ruoyi.sams.sms.service.ISmsClubUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-05-06
*/
@RestController
@RequestMapping("/sms/user")
public class SmsClubUserController extends BaseController
{
@Autowired
private ISmsClubUserService smsClubUserService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(ClubUserSelectVO smsClubUser)
{
startPage();
List<ClubUserReturnVO> list = smsClubUserService.selectSmsClubUserList(smsClubUser);
return getDataTable(list);
}
/**
*
*/
@Log(title = "成员管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ClubUserSelectVO smsClubUser)
{
List<ClubUserReturnVO> list = smsClubUserService.selectSmsClubUserList(smsClubUser);
ExcelUtil<ClubUserReturnVO> util = new ExcelUtil<ClubUserReturnVO>(ClubUserReturnVO.class);
util.exportExcel(response, list, "成员管理数据");
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(smsClubUserService.selectSmsClubUserById(id));
}
/**
*
*/
@Log(title = "成员管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SmsClubUser smsClubUser)
{
return toAjax(smsClubUserService.insertSmsClubUser(smsClubUser));
}
/**
*
*/
@Log(title = "成员管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SmsClubUser smsClubUser)
{
return toAjax(smsClubUserService.updateSmsClubUser(smsClubUser));
}
/**
*
*/
@Log(title = "成员管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(smsClubUserService.deleteSmsClubUserByIds(ids));
}
}

View File

@ -1,146 +0,0 @@
package com.ruoyi.sams.sms.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* sms_club
*
* @author ruoyi
* @date 2025-05-06
*/
public class SmsClub extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 社团ID */
private Long clubId;
/** 社团名称 */
@Excel(name = "社团名称")
private String clubName;
/** 社团简介 */
private String description;
/** 社团类型 */
@Excel(name = "社团类型")
private String category;
/** 所属院系IDsys_dept */
@Excel(name = "所属院系ID", readConverterExp = "s=ys_dept")
private Long deptId;
/** 负责人IDsys_user */
@Excel(name = "负责人ID", readConverterExp = "s=ys_user")
private Long leaderId;
/** logo */
@Excel(name = "logo")
private String logo;
/** 状态 */
@Excel(name = "状态")
private String status;
public void setClubId(Long clubId)
{
this.clubId = clubId;
}
public Long getClubId()
{
return clubId;
}
public void setClubName(String clubName)
{
this.clubName = clubName;
}
public String getClubName()
{
return clubName;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setCategory(String category)
{
this.category = category;
}
public String getCategory()
{
return category;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setLeaderId(Long leaderId)
{
this.leaderId = leaderId;
}
public Long getLeaderId()
{
return leaderId;
}
public void setLogo(String logo)
{
this.logo = logo;
}
public String getLogo()
{
return logo;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("clubId", getClubId())
.append("clubName", getClubName())
.append("description", getDescription())
.append("category", getCategory())
.append("deptId", getDeptId())
.append("leaderId", getLeaderId())
.append("logo", getLogo())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,105 +0,0 @@
package com.ruoyi.sams.sms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* sms_club_user
*
* @author ruoyi
* @date 2025-05-06
*/
public class SmsClubUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 社团ID */
@Excel(name = "社团ID")
private Long clubId;
/** 是否活跃 */
@Excel(name = "是否活跃")
private Integer isActive;
/** 加入社团时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "加入社团时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date joinDate;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setClubId(Long clubId)
{
this.clubId = clubId;
}
public Long getClubId()
{
return clubId;
}
public void setIsActive(Integer isActive)
{
this.isActive = isActive;
}
public Integer getIsActive()
{
return isActive;
}
public void setJoinDate(Date joinDate)
{
this.joinDate = joinDate;
}
public Date getJoinDate()
{
return joinDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("clubId", getClubId())
.append("isActive", getIsActive())
.append("joinDate", getJoinDate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,141 +0,0 @@
package com.ruoyi.sams.sms.domain.vo;
import java.io.Serializable;
public class ClubReturnVO implements Serializable {
private Long clubId;
private String clubName;
private String description;
private String category;
private Long deptId;
private String deptName; // 院系名称
private Long leaderId;
private String leaderName; // 负责人名称
private String logo;
private String status;
private String remark;
private String createBy;
private String updateBy;
private String createTime;
private String updateTime;
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
public String getClubName() {
return clubName;
}
public void setClubName(String clubName) {
this.clubName = clubName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Long getLeaderId() {
return leaderId;
}
public void setLeaderId(Long leaderId) {
this.leaderId = leaderId;
}
public String getLeaderName() {
return leaderName;
}
public void setLeaderName(String leaderName) {
this.leaderName = leaderName;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,71 +0,0 @@
package com.ruoyi.sams.sms.domain.vo;
import com.ruoyi.common.core.domain.BaseEntity;
import java.time.LocalDateTime;
public class ClubUserReturnVO extends BaseEntity {
private Long id;
private Long userId;
private String userName;
private Long clubId;
private String clubName;
private Integer isActive;
private LocalDateTime joinDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
public String getClubName() {
return clubName;
}
public void setClubName(String clubName) {
this.clubName = clubName;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public LocalDateTime getJoinDate() {
return joinDate;
}
public void setJoinDate(LocalDateTime joinDate) {
this.joinDate = joinDate;
}
}

View File

@ -1,72 +0,0 @@
package com.ruoyi.sams.sms.domain.vo;
/**
* VO
*/
public class ClubUserSelectVO {
/**
*
*/
private String userName;
/**
*
*/
private String clubName;
/**
*
*/
private Integer isActive;
/**
* ID
*/
private Long userId;
/**
* ID
*/
private Long clubId;
// ---------- Getters & Setters ----------
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getClubName() {
return clubName;
}
public void setClubName(String clubName) {
this.clubName = clubName;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
}

View File

@ -1,63 +0,0 @@
package com.ruoyi.sams.sms.mapper;
import java.util.List;
import com.ruoyi.sams.sms.domain.SmsClub;
import com.ruoyi.sams.sms.domain.vo.ClubReturnVO;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-06
*/
public interface SmsClubMapper
{
/**
*
*
* @param clubId
* @return
*/
public ClubReturnVO selectSmsClubByClubId(Long clubId);
/**
*
*
* @param smsClub
* @return
*/
public List<ClubReturnVO> selectSmsClubList(SmsClub smsClub);
/**
*
*
* @param smsClub
* @return
*/
public int insertSmsClub(SmsClub smsClub);
/**
*
*
* @param smsClub
* @return
*/
public int updateSmsClub(SmsClub smsClub);
/**
*
*
* @param clubId
* @return
*/
public int deleteSmsClubByClubId(Long clubId);
/**
*
*
* @param clubIds
* @return
*/
public int deleteSmsClubByClubIds(Long[] clubIds);
}

View File

@ -1,65 +0,0 @@
package com.ruoyi.sams.sms.mapper;
import java.util.List;
import com.ruoyi.sams.sms.domain.vo.ClubUserReturnVO;
import com.ruoyi.sams.sms.domain.SmsClubUser;
import com.ruoyi.sams.sms.domain.vo.ClubUserSelectVO;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author ruoyi
* @date 2025-05-06
*/
public interface SmsClubUserMapper
{
/**
*
*
* @param id
* @return
*/
public ClubUserReturnVO selectSmsClubUserById(Long id);
/**
*
*
* @param smsClubUser
* @return
*/
public List<ClubUserReturnVO> selectSmsClubUserList(@Param("vo") ClubUserSelectVO smsClubUser);
/**
*
*
* @param smsClubUser
* @return
*/
public int insertSmsClubUser(SmsClubUser smsClubUser);
/**
*
*
* @param smsClubUser
* @return
*/
public int updateSmsClubUser(SmsClubUser smsClubUser);
/**
*
*
* @param id
* @return
*/
public int deleteSmsClubUserById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSmsClubUserByIds(Long[] ids);
}

View File

@ -1,64 +0,0 @@
package com.ruoyi.sams.sms.service;
import java.util.List;
import com.ruoyi.sams.sms.domain.SmsClub;
import com.ruoyi.sams.sms.domain.vo.ClubReturnVO;
import com.ruoyi.sams.ui.domain.vo.HotClubVO;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
public interface ISmsClubService
{
/**
*
*
* @param clubId
* @return
*/
public ClubReturnVO selectSmsClubByClubId(Long clubId);
/**
*
*
* @param smsClub
* @return
*/
public List<ClubReturnVO> selectSmsClubList(SmsClub smsClub);
/**
*
*
* @param smsClub
* @return
*/
public int insertSmsClub(SmsClub smsClub);
/**
*
*
* @param smsClub
* @return
*/
public int updateSmsClub(SmsClub smsClub);
/**
*
*
* @param clubIds
* @return
*/
public int deleteSmsClubByClubIds(Long[] clubIds);
/**
*
*
* @param clubId
* @return
*/
public int deleteSmsClubByClubId(Long clubId);
}

View File

@ -1,64 +0,0 @@
package com.ruoyi.sams.sms.service;
import java.util.List;
import com.ruoyi.sams.sms.domain.vo.ClubUserReturnVO;
import com.ruoyi.sams.sms.domain.SmsClubUser;
import com.ruoyi.sams.sms.domain.vo.ClubUserSelectVO;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
public interface ISmsClubUserService
{
/**
*
*
* @param id
* @return
*/
public ClubUserReturnVO selectSmsClubUserById(Long id);
/**
*
*
* @param smsClubUser
* @return
*/
public List<ClubUserReturnVO> selectSmsClubUserList(ClubUserSelectVO smsClubUser);
/**
*
*
* @param smsClubUser
* @return
*/
public int insertSmsClubUser(SmsClubUser smsClubUser);
/**
*
*
* @param smsClubUser
* @return
*/
public int updateSmsClubUser(SmsClubUser smsClubUser);
/**
*
*
* @param ids
* @return
*/
public int deleteSmsClubUserByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSmsClubUserById(Long id);
}

View File

@ -1,99 +0,0 @@
package com.ruoyi.sams.sms.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sams.sms.domain.SmsClub;
import com.ruoyi.sams.sms.domain.vo.ClubReturnVO;
import com.ruoyi.sams.sms.mapper.SmsClubMapper;
import com.ruoyi.sams.sms.service.ISmsClubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
@Service
public class SmsClubServiceImpl implements ISmsClubService
{
@Autowired
private SmsClubMapper smsClubMapper;
/**
*
*
* @param clubId
* @return
*/
@Override
public ClubReturnVO selectSmsClubByClubId(Long clubId)
{
return smsClubMapper.selectSmsClubByClubId(clubId);
}
/**
*
*
* @param smsClub
* @return
*/
@Override
public List<ClubReturnVO> selectSmsClubList(SmsClub smsClub)
{
return smsClubMapper.selectSmsClubList(smsClub);
}
/**
*
*
* @param smsClub
* @return
*/
@Override
public int insertSmsClub(SmsClub smsClub)
{
smsClub.setCreateTime(DateUtils.getNowDate());
return smsClubMapper.insertSmsClub(smsClub);
}
/**
*
*
* @param smsClub
* @return
*/
@Override
public int updateSmsClub(SmsClub smsClub)
{
smsClub.setUpdateTime(DateUtils.getNowDate());
return smsClubMapper.updateSmsClub(smsClub);
}
/**
*
*
* @param clubIds
* @return
*/
@Override
public int deleteSmsClubByClubIds(Long[] clubIds)
{
return smsClubMapper.deleteSmsClubByClubIds(clubIds);
}
/**
*
*
* @param clubId
* @return
*/
@Override
public int deleteSmsClubByClubId(Long clubId)
{
return smsClubMapper.deleteSmsClubByClubId(clubId);
}
}

View File

@ -1,98 +0,0 @@
package com.ruoyi.sams.sms.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sams.sms.domain.SmsClubUser;
import com.ruoyi.sams.sms.domain.vo.ClubUserReturnVO;
import com.ruoyi.sams.sms.domain.vo.ClubUserSelectVO;
import com.ruoyi.sams.sms.mapper.SmsClubUserMapper;
import com.ruoyi.sams.sms.service.ISmsClubUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service
*
* @author ruoyi
* @date 2025-05-06
*/
@Service
public class SmsClubUserServiceImpl implements ISmsClubUserService
{
@Autowired
private SmsClubUserMapper smsClubUserMapper;
/**
*
*
* @param id
* @return
*/
@Override
public ClubUserReturnVO selectSmsClubUserById(Long id)
{
return smsClubUserMapper.selectSmsClubUserById(id);
}
/**
*
*
* @param smsClubUser
* @return
*/
@Override
public List<ClubUserReturnVO> selectSmsClubUserList(ClubUserSelectVO smsClubUser)
{
return smsClubUserMapper.selectSmsClubUserList(smsClubUser);
}
/**
*
*
* @param smsClubUser
* @return
*/
@Override
public int insertSmsClubUser(SmsClubUser smsClubUser)
{
smsClubUser.setCreateTime(DateUtils.getNowDate());
return smsClubUserMapper.insertSmsClubUser(smsClubUser);
}
/**
*
*
* @param smsClubUser
* @return
*/
@Override
public int updateSmsClubUser(SmsClubUser smsClubUser)
{
smsClubUser.setUpdateTime(DateUtils.getNowDate());
return smsClubUserMapper.updateSmsClubUser(smsClubUser);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSmsClubUserByIds(Long[] ids)
{
return smsClubUserMapper.deleteSmsClubUserByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSmsClubUserById(Long id)
{
return smsClubUserMapper.deleteSmsClubUserById(id);
}
}

View File

@ -1,51 +0,0 @@
package com.ruoyi.sams.ui.controller;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ams.service.IAmsActivityService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.sams.sms.domain.SmsClub;
import com.ruoyi.sams.sms.service.ISmsClubService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
@RestController
@RequestMapping("/sams/dashboard")
public class DashboardController {
@Autowired
private IAmsActivityService activityService;
@Autowired
private ISmsClubService clubService;
@Autowired
private ISysUserService userService;
@GetMapping("/list")
public AjaxResult getDashboardStats() {
int activityCount = activityService.selectAmsActivityList(new ActivityListGetVO()).size();
ActivityListGetVO pendingVO = new ActivityListGetVO();
pendingVO.setStatus("pending");
int pendingCount = activityService.selectAmsActivityList(pendingVO).size();
int clubCount = clubService.selectSmsClubList(new SmsClub()).size();
int userCount = userService.selectUserList(new SysUser()).size();
Map<String, Integer> data =new HashMap<>();
data.put("activityCount", activityCount);
data.put("pendingCount", pendingCount);
data.put("clubCount", clubCount);
data.put("userCount", userCount);
AjaxResult result = AjaxResult.success();
result.put("data", data);
return result;
}
}

View File

@ -1,86 +0,0 @@
package com.ruoyi.sams.ui.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.sams.ams.domain.AmsComment;
import com.ruoyi.sams.ams.domain.vo.ActivityListGetVO;
import com.ruoyi.sams.ams.domain.vo.ActivityListVO;
import com.ruoyi.sams.ams.service.IAmsActivityService;
import com.ruoyi.sams.ams.service.IAmsCommentService;
import com.ruoyi.sams.ams.service.IAmsReactionService;
import com.ruoyi.sams.ui.domain.vo.ActivityQueryDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/front/activity")
public class FrontActivityController extends BaseController {
@Autowired
private IAmsActivityService activityService;
@Autowired
private IAmsReactionService reactionService;
@Autowired
private IAmsCommentService commentService;
/**
* 4
*/
@GetMapping("/banner")
public AjaxResult listBannerActivities() {
return AjaxResult.success(activityService.listBannerActivities());
}
/**
*
*/
@GetMapping("/list")
public AjaxResult listActivities() {
return AjaxResult.success(activityService.listApprovedActivities());
}
/**
* 4
*/
@GetMapping("/hot")
public AjaxResult listHotClubs() {
return AjaxResult.success(activityService.listTop4ByActivityCount());
}
/**
* /
*/
@GetMapping("/reaction")
public AjaxResult getReactionStats(Long actId) {
return AjaxResult.success(reactionService.getReactionStats(actId));
}
/**
*
*/
@GetMapping("/comment")
public TableDataInfo listComments(Long actId) {
startPage(); // 启用分页
List<AmsComment> list = commentService.selectCommentListByActId(actId);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/my-regist")
public TableDataInfo listMyRegisteredActivities(Long userId) {
startPage();
List<ActivityListVO> list = activityService.selectMyRegisteredActivities(userId);
return getDataTable(list);
}
}

View File

@ -1,18 +0,0 @@
package com.ruoyi.sams.ui.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sams.sms.service.ISmsClubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/front/club")
public class FrontClubController {
@Autowired
private ISmsClubService clubService;
}

View File

@ -1,22 +0,0 @@
package com.ruoyi.sams.ui.domain.vo;
public class ActivityQueryDTO {
private String title;
private Long clubId;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
}

View File

@ -1,49 +0,0 @@
package com.ruoyi.sams.ui.domain.vo;
public class HotClubVO {
private Long clubId;
private String clubName;
private String logo;
private Integer activityCount;
public Long getClubId() {
return clubId;
}
public void setClubId(Long clubId) {
this.clubId = clubId;
}
public String getClubName() {
return clubName;
}
public void setClubName(String clubName) {
this.clubName = clubName;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public Integer getActivityCount() {
return activityCount;
}
public void setActivityCount(Integer activityCount) {
this.activityCount = activityCount;
}
@Override
public String toString() {
return "HotClubVO{" +
"clubId=" + clubId +
", clubName='" + clubName + '\'' +
", activityCount=" + activityCount +
'}';
}
}

View File

@ -1,205 +0,0 @@
<?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="com.ruoyi.sams.ams.mapper.AmsActivityMapper">
<resultMap id="ActivityListResult" type="com.ruoyi.sams.ams.domain.vo.ActivityListVO">
<id column="act_id" property="actId"/>
<result column="title" property="title"/>
<result column="description" property="description"/>
<result column="budget" property="budget"/>
<result column="cover_image" property="coverImage"/>
<result column="creator_id" property="creatorId"/>
<result column="creator_name" property="creatorName"/>
<result column="club_id" property="clubId"/>
<result column="club_name" property="clubName"/>
<result column="dept_id" property="deptId"/>
<result column="dept_name" property="deptName"/>
<result column="location" property="location"/>
<result column="activity_type" property="activityType"/>
<result column="status" property="status"/>
<result column="visibility" property="visibility"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
<result column="remark" property="remark"/>
</resultMap>
<sql id="selectAmsActivityVo">
SELECT
a.act_id, a.title, a.description ,a.cover_image,
a.budget, a.creator_id, u.nick_name AS creator_name,
a.club_id, c.club_name, a.dept_id, d.dept_name,
a.location, a.activity_type, a.status, a.visibility,
a.start_time, a.end_time, a.remark
FROM ams_activity a
LEFT JOIN sys_user u ON a.creator_id = u.user_id
LEFT JOIN sms_club c ON a.club_id = c.club_id
LEFT JOIN sys_dept d ON a.dept_id = d.dept_id
</sql>
<select id="selectAmsActivityList" resultMap="ActivityListResult">
<if test="excludeOtherDraft != null and excludeOtherDraft">
AND (a.status != 'draft' OR a.creator_id = #{creatorId})
</if>
<include refid="selectAmsActivityVo"/>
WHERE 1 = 1
<if test="title != null and title != ''">
AND a.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="status != null and status != ''">
AND a.status = #{status}
</if>
<if test="clubId != null">
AND a.club_id = #{clubId}
</if>
ORDER BY a.create_time DESC
</select>
<select id="selectAmsActivityByActId" parameterType="Long" resultMap="ActivityListResult">
<include refid="selectAmsActivityVo"/>
where act_id = #{actId}
</select>
<insert id="insertAmsActivity" parameterType="AmsActivity" useGeneratedKeys="true" keyProperty="actId">
insert into ams_activity
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if>
<if test="description != null">description,</if>
<if test="coverImage != null">cover_image,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="location != null">location,</if>
<if test="budget != null">budget,</if>
<if test="maxParticipants != null">max_participants,</if>
<if test="creatorId != null">creator_id,</if>
<if test="clubId != null">club_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="activityType != null">activity_type,</if>
<if test="status != null">status,</if>
<if test="visibility != null">visibility,</if>
<if test="currentApproverId != null">current_approver_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if>
<if test="description != null">#{description},</if>
<if test="coverImage != null">#{coverImage},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="location != null">#{location},</if>
<if test="budget != null">#{budget},</if>
<if test="maxParticipants != null">#{maxParticipants},</if>
<if test="creatorId != null">#{creatorId},</if>
<if test="clubId != null">#{clubId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="activityType != null">#{activityType},</if>
<if test="status != null">#{status},</if>
<if test="visibility != null">#{visibility},</if>
<if test="currentApproverId != null">#{currentApproverId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAmsActivity" parameterType="AmsActivity">
update ams_activity
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="description != null">description = #{description},</if>
<if test="coverImage != null">cover_image = #{coverImage},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="location != null">location = #{location},</if>
<if test="budget != null">budget = #{budget},</if>
<if test="maxParticipants != null">max_participants = #{maxParticipants},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="clubId != null">club_id = #{clubId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="activityType != null">activity_type = #{activityType},</if>
<if test="status != null">status = #{status},</if>
<if test="visibility != null">visibility = #{visibility},</if>
<if test="currentApproverId != null">current_approver_id = #{currentApproverId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where act_id = #{actId}
</update>
<delete id="deleteAmsActivityByActId" parameterType="Long">
delete from ams_activity where act_id = #{actId}
</delete>
<delete id="deleteAmsActivityByActIds" parameterType="String">
delete from ams_activity where act_id in
<foreach item="actId" collection="array" open="(" separator="," close=")">
#{actId}
</foreach>
</delete>
<!-- 获取轮播图活动最多4条 -->
<select id="selectBannerActivities" resultMap="ActivityListResult">
SELECT * FROM ams_activity
WHERE status = 'approved'
ORDER BY start_time DESC
LIMIT 4
</select>
<!-- 分页+条件筛选:活动列表(已审批通过) -->
<select id="selectApprovedActivities" resultMap="ActivityListResult">
SELECT * FROM ams_activity
WHERE status = 'approved'
ORDER BY net_likes ASC
LIMIT 8
</select>
<resultMap id="HotClubVOMap" type="com.ruoyi.sams.ui.domain.vo.HotClubVO">
<result column="club_id" property="clubId"/>
<result column="club_name" property="clubName"/>
<result column="logo" property="logo"/>
<result column="activityCount" property="activityCount"/>
</resultMap>
<!-- 活动最多的前4个社团 -->
<select id="selectTopClubsByActivityCount" resultMap="HotClubVOMap">
SELECT c.club_id, c.club_name, c.logo , COUNT(a.act_id) AS activityCount
FROM sms_club c
JOIN ams_activity a ON c.club_id = a.club_id
WHERE a.status = 'approved'
GROUP BY c.club_id, c.club_name
ORDER BY activityCount DESC
LIMIT #{limit}
</select>
<select id="selectMyRegisteredActivities"
resultMap="ActivityListResult"
parameterType="java.lang.Long">
SELECT
a.act_id, a.title, a.description ,a.cover_image,
a.budget, a.creator_id, u.nick_name AS creator_name,
a.club_id, c.club_name, a.dept_id, d.dept_name,
a.location, a.activity_type, a.status, a.visibility,
a.start_time, a.end_time, a.remark
FROM ams_activity a
INNER JOIN ams_registration r ON a.act_id = r.act_id
LEFT JOIN sys_user u ON a.creator_id = u.user_id
LEFT JOIN sms_club c ON a.club_id = c.club_id
LEFT JOIN sys_dept d ON a.dept_id = d.dept_id
WHERE r.user_id = #{userId}
AND a.status = 'approved'
ORDER BY a.start_time ASC
</select>
</mapper>

View File

@ -1,124 +0,0 @@
<?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="com.ruoyi.sams.ams.mapper.AmsCommentMapper">
<resultMap id="AmsCommentListVOResult" type="com.ruoyi.sams.ams.domain.vo.AmsCommentListVO">
<result property="commentId" column="comment_id"/>
<result property="actId" column="act_id"/>
<result property="activityName" column="title"/>
<result property="userId" column="user_id"/>
<result property="userName" column="user_name"/>
<result property="parentCommentId" column="parent_comment_id"/>
<result property="content" column="content"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectAmsCommentVo">
SELECT c.comment_id,
c.act_id,
a.title,
c.user_id,
u.user_name,
c.parent_comment_id,
c.content,
c.remark,
c.create_time
FROM ams_comment c
LEFT JOIN ams_activity a ON c.act_id = a.act_id
LEFT JOIN sys_user u ON c.user_id = u.user_id
</sql>
<select id="selectAmsCommentList" parameterType="com.ruoyi.sams.ams.domain.AmsComment"
resultMap="AmsCommentListVOResult">
<include refid="selectAmsCommentVo"/>
WHERE 1=1
<if test="activityName != null and activityName != ''">
AND a.title LIKE CONCAT('%', #{activityName}, '%')
</if>
<if test="userName != null and userName != ''">
AND u.user_name LIKE CONCAT('%', #{userName}, '%')
</if>
ORDER BY c.create_time DESC
</select>
<select id="selectAmsCommentByCommentId" parameterType="Long" resultMap="AmsCommentListVOResult">
<include refid="selectAmsCommentVo"/>
where comment_id = #{commentId}
</select>
<insert id="insertAmsComment" parameterType="AmsComment" useGeneratedKeys="true" keyProperty="commentId">
insert into ams_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="actId != null">act_id,</if>
<if test="userId != null">user_id,</if>
<if test="parentCommentId != null">parent_comment_id,</if>
<if test="content != null and content != ''">content,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="actId != null">#{actId},</if>
<if test="userId != null">#{userId},</if>
<if test="parentCommentId != null">#{parentCommentId},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAmsComment" parameterType="AmsComment">
update ams_comment
<trim prefix="SET" suffixOverrides=",">
<if test="actId != null">act_id = #{actId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="parentCommentId != null">parent_comment_id = #{parentCommentId},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where comment_id = #{commentId}
</update>
<delete id="deleteAmsCommentByCommentId" parameterType="Long">
delete
from ams_comment
where comment_id = #{commentId}
</delete>
<delete id="deleteAmsCommentByCommentIds" parameterType="String">
delete from ams_comment where comment_id in
<foreach item="commentId" collection="array" open="(" separator="," close=")">
#{commentId}
</foreach>
</delete>
<select id="selectCommentListByActId" resultType="com.ruoyi.sams.ams.domain.AmsComment">
SELECT c.comment_id AS commentId,
c.act_id AS actId,
c.user_id AS userId,
c.content AS content,
c.parent_comment_id AS parentCommentId,
c.create_by AS createBy,
c.create_time AS createTime,
c.update_by AS updateBy,
c.update_time AS updateTime,
c.remark AS remark
FROM ams_comment c
WHERE c.act_id = #{actId}
ORDER BY c.create_time ASC
</select>
</mapper>

View File

@ -1,105 +0,0 @@
<?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="com.ruoyi.sams.ams.mapper.AmsReactionMapper">
<resultMap id="AmsReactionVOResult" type="com.ruoyi.sams.ams.domain.vo.AmsReactionVO">
<id property="reactionId" column="reaction_id" />
<result property="actId" column="act_id"/>
<result property="actTitle" column="title"/>
<result property="userId" column="user_id"/>
<result property="userName" column="user_name"/>
<result property="reactionType" column="reaction_type"/>
<result property="remark" column="remark"/>
<result property="createTime" column="created_at"/>
</resultMap>
<sql id="selectAmsReactionJoinVo">
SELECT
r.reaction_id,
r.act_id,
a.title,
r.user_id,
u.user_name,
r.reaction_type,
r.remark,
r.create_time
FROM ams_reaction r
LEFT JOIN ams_activity a ON r.act_id = a.act_id
LEFT JOIN sys_user u ON r.user_id = u.user_id
</sql>
<select id="selectAmsReactionList" resultMap="AmsReactionVOResult" parameterType="AmsReaction">
<include refid="selectAmsReactionJoinVo"/>
<where>
<if test="actId != null">AND r.act_id = #{actId}</if>
<if test="userId != null">AND r.user_id = #{userId}</if>
<if test="reactionType != null and reactionType != ''">AND r.reaction_type = #{reactionType}</if>
</where>
ORDER BY r.create_time DESC
</select>
<select id="selectAmsReactionByReactionId" resultMap="AmsReactionVOResult" parameterType="Long">
<include refid="selectAmsReactionJoinVo"/>
WHERE r.reaction_id = #{reactionId}
</select>
<insert id="insertAmsReaction" parameterType="AmsReaction" useGeneratedKeys="true" keyProperty="reactionId">
insert into ams_reaction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="actId != null">act_id,</if>
<if test="userId != null">user_id,</if>
<if test="reactionType != null and reactionType != ''">reaction_type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="actId != null">#{actId},</if>
<if test="userId != null">#{userId},</if>
<if test="reactionType != null and reactionType != ''">#{reactionType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAmsReaction" parameterType="AmsReaction">
update ams_reaction
<trim prefix="SET" suffixOverrides=",">
<if test="actId != null">act_id = #{actId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="reactionType != null and reactionType != ''">reaction_type = #{reactionType},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where reaction_id = #{reactionId}
</update>
<delete id="deleteAmsReactionByReactionId" parameterType="Long">
delete from ams_reaction where reaction_id = #{reactionId}
</delete>
<delete id="deleteAmsReactionByReactionIds" parameterType="String">
delete from ams_reaction where reaction_id in
<foreach item="reactionId" collection="array" open="(" separator="," close=")">
#{reactionId}
</foreach>
</delete>
<select id="countReactionByType" parameterType="long" resultType="map">
SELECT reaction_type, COUNT(*) AS cnt
FROM ams_reaction
WHERE act_id = #{actId}
GROUP BY reaction_type
</select>
</mapper>

View File

@ -1,98 +0,0 @@
<?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="com.ruoyi.sams.ams.mapper.AmsRegistrationMapper">
<resultMap type="AmsRegistration" id="AmsRegistrationResult">
<result property="regId" column="reg_id" />
<result property="actId" column="act_id" />
<result property="userId" column="user_id" />
<result property="role" column="role" />
<result property="status" column="status" />
<result property="registerTime" column="register_time" />
<result property="attendTime" column="attend_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAmsRegistrationVo">
select reg_id, act_id, user_id, role, status, register_time, attend_time, create_by, create_time, update_by, update_time, remark from ams_registration
</sql>
<select id="selectAmsRegistrationList" parameterType="AmsRegistration" resultMap="AmsRegistrationResult">
<include refid="selectAmsRegistrationVo"/>
<where>
<if test="actId != null "> and act_id = #{actId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="role != null and role != ''"> and role = #{role}</if>
</where>
</select>
<select id="selectAmsRegistrationByRegId" parameterType="Long" resultMap="AmsRegistrationResult">
<include refid="selectAmsRegistrationVo"/>
where reg_id = #{regId}
</select>
<insert id="insertAmsRegistration" parameterType="AmsRegistration" useGeneratedKeys="true" keyProperty="regId">
insert into ams_registration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="actId != null">act_id,</if>
<if test="userId != null">user_id,</if>
<if test="role != null">role,</if>
<if test="status != null">status,</if>
<if test="registerTime != null">register_time,</if>
<if test="attendTime != null">attend_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="actId != null">#{actId},</if>
<if test="userId != null">#{userId},</if>
<if test="role != null">#{role},</if>
<if test="status != null">#{status},</if>
<if test="registerTime != null">#{registerTime},</if>
<if test="attendTime != null">#{attendTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAmsRegistration" parameterType="AmsRegistration">
update ams_registration
<trim prefix="SET" suffixOverrides=",">
<if test="actId != null">act_id = #{actId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="role != null">role = #{role},</if>
<if test="status != null">status = #{status},</if>
<if test="registerTime != null">register_time = #{registerTime},</if>
<if test="attendTime != null">attend_time = #{attendTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where reg_id = #{regId}
</update>
<delete id="deleteAmsRegistrationByRegId" parameterType="Long">
delete from ams_registration where reg_id = #{regId}
</delete>
<delete id="deleteAmsRegistrationByRegIds" parameterType="String">
delete from ams_registration where reg_id in
<foreach item="regId" collection="array" open="(" separator="," close=")">
#{regId}
</foreach>
</delete>
</mapper>

View File

@ -1,117 +0,0 @@
<?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="com.ruoyi.sams.sms.mapper.SmsClubMapper">
<resultMap id="ClubReturnVOResult" type="com.ruoyi.sams.sms.domain.vo.ClubReturnVO">
<result column="club_id" property="clubId" />
<result column="club_name" property="clubName" />
<result column="description" property="description" />
<result column="category" property="category" />
<result column="dept_id" property="deptId" />
<result column="dept_name" property="deptName" />
<result column="leader_id" property="leaderId" />
<result column="leader_name" property="leaderName" />
<result column="logo" property="logo" />
<result column="status" property="status" />
<result column="remark" property="remark" />
<result column="create_by" property="createBy" />
<result column="update_by" property="updateBy" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<sql id="selectSmsClubVO">
SELECT
c.club_id,c.club_name,c.description,c.category,c.dept_id,
d.dept_name,c.leader_id,u.nick_name AS leader_name,
c.logo,c.status,c.remark,c.create_by,c.update_by,
c.create_time,c.update_time
FROM sms_club c
LEFT JOIN sys_dept d ON c.dept_id = d.dept_id
LEFT JOIN sys_user u ON c.leader_id = u.user_id
</sql>
<select id="selectSmsClubList" parameterType="com.ruoyi.sams.sms.domain.SmsClub" resultMap="ClubReturnVOResult">
<include refid="selectSmsClubVO"/>
<where>
<if test="clubName != null and clubName != ''">
AND c.club_name LIKE CONCAT('%', #{clubName}, '%')
</if>
<if test="category != null and category != ''">
AND c.category = #{category}
</if>
<if test="deptId != null">
AND c.dept_id = #{deptId}
</if>
</where>
</select>
<select id="selectSmsClubByClubId" parameterType="Long" resultMap="ClubReturnVOResult">
<include refid="selectSmsClubVO"/>
where club_id = #{clubId}
</select>
<insert id="insertSmsClub" parameterType="SmsClub" useGeneratedKeys="true" keyProperty="clubId">
insert into sms_club
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clubName != null and clubName != ''">club_name,</if>
<if test="description != null">description,</if>
<if test="category != null and category != ''">category,</if>
<if test="deptId != null">dept_id,</if>
<if test="leaderId != null">leader_id,</if>
<if test="logo != null">logo,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clubName != null and clubName != ''">#{clubName},</if>
<if test="description != null">#{description},</if>
<if test="category != null and category != ''">#{category},</if>
<if test="deptId != null">#{deptId},</if>
<if test="leaderId != null">#{leaderId},</if>
<if test="logo != null">#{logo},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSmsClub" parameterType="SmsClub">
update sms_club
<trim prefix="SET" suffixOverrides=",">
<if test="clubName != null and clubName != ''">club_name = #{clubName},</if>
<if test="description != null">description = #{description},</if>
<if test="category != null and category != ''">category = #{category},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="leaderId != null">leader_id = #{leaderId},</if>
<if test="logo != null">logo = #{logo},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where club_id = #{clubId}
</update>
<delete id="deleteSmsClubByClubId" parameterType="Long">
delete from sms_club where club_id = #{clubId}
</delete>
<delete id="deleteSmsClubByClubIds" parameterType="String">
delete from sms_club where club_id in
<foreach item="clubId" collection="array" open="(" separator="," close=")">
#{clubId}
</foreach>
</delete>
</mapper>

View File

@ -1,110 +0,0 @@
<?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="com.ruoyi.sams.sms.mapper.SmsClubUserMapper">
<resultMap type="com.ruoyi.sams.sms.domain.vo.ClubUserReturnVO" id="SmsClubUserResult">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="clubId" column="club_id"/>
<result property="userName" column="user_name"/>
<result property="clubName" column="club_name"/>
<result property="isActive" column="is_active"/>
<result property="joinDate" column="join_date"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectSmsClubUserVo">
SELECT
scu.id,scu.user_id,scu.club_id,u.nick_name AS user_name,
c.club_name,scu.is_active,scu.join_date,
scu.create_by,scu.create_time,scu.update_by,scu.update_time,scu.remark
FROM sms_club_user scu
LEFT JOIN sys_user u ON scu.user_id = u.user_id
LEFT JOIN sms_club c ON scu.club_id = c.club_id
</sql>
<select id="selectSmsClubUserList" parameterType="com.ruoyi.sams.sms.domain.vo.ClubUserSelectVO" resultMap="SmsClubUserResult">
<include refid="selectSmsClubUserVo"/>
<where>
<if test="vo.userName != null and vo.userName != ''">
AND u.nick_name LIKE CONCAT('%', #{vo.userName}, '%')
</if>
<if test="vo.clubName != null and vo.clubName != ''">
AND c.club_name LIKE CONCAT('%', #{vo.clubName}, '%')
</if>
<if test="vo.isActive != null">
AND scu.is_active = #{vo.isActive}
</if>
<if test="vo.userId != null">
AND scu.user_id = #{vo.userId}
</if>
<if test="vo.clubId != null">
AND scu.club_id = #{vo.clubId}
</if>
</where>
</select>
<select id="selectSmsClubUserById" parameterType="Long" resultMap="SmsClubUserResult">
<include refid="selectSmsClubUserVo"/>
where id = #{id}
</select>
<insert id="insertSmsClubUser" parameterType="SmsClubUser" useGeneratedKeys="true" keyProperty="id">
insert into sms_club_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="clubId != null">club_id,</if>
<if test="isActive != null">is_active,</if>
<if test="joinDate != null">join_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="clubId != null">#{clubId},</if>
<if test="isActive != null">#{isActive},</if>
<if test="joinDate != null">#{joinDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSmsClubUser" parameterType="SmsClubUser">
update sms_club_user
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="clubId != null">club_id = #{clubId},</if>
<if test="isActive != null">is_active = #{isActive},</if>
<if test="joinDate != null">join_date = #{joinDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSmsClubUserById" parameterType="Long">
delete from sms_club_user where id = #{id}
</delete>
<delete id="deleteSmsClubUserByIds" parameterType="String">
delete from sms_club_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

20
doc/README.md 100644
View File

@ -0,0 +1,20 @@
# SAMS系统文档
本目录包含SAMS系统的相关文档。
## 文档结构
- `api.md`: API接口文档包含所有后端接口的详细说明
- 认证接口
- 系统管理接口
- 活动管理接口
- 社团管理接口
- 通用说明
## 文档更新
本文档会随着系统开发持续更新。如果您发现文档中的任何问题或有改进建议,请及时反馈。
## 文档格式
所有文档均使用Markdown格式编写可以使用任何支持Markdown的编辑器或查看器阅读。

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

View File

@ -1,83 +0,0 @@
@startuml
entity "社团 (sms_club)" as Club {
* club_id : bigint <<PK>>
--
club_name : varchar
description : text
category : varchar
dept_id : bigint
leader_id : bigint
logo : varchar
status : enum
}
entity "社团成员关系 (sms_club_user)" as ClubUser {
* id : bigint <<PK>>
--
user_id : bigint
club_id : bigint
join_date : datetime
is_active : boolean
}
entity "活动 (ams_activity)" as Activity {
* act_id : bigint <<PK>>
--
title : varchar
description : text
cover_image : varchar
start_time : datetime
end_time : datetime
location : varchar
budget : decimal
max_participants : int
creator_id : bigint
club_id : bigint
dept_id : bigint
activity_type : enum
status : enum
visibility : enum
current_approver_id : bigint
net_likes : int
}
entity "活动报名 (ams_registration)" as Registration {
* reg_id : bigint <<PK>>
--
act_id : bigint
user_id : bigint
register_time : datetime
status : enum
attend_time : datetime
role : enum
}
entity "活动评论 (ams_comment)" as Comment {
* comment_id : bigint <<PK>>
--
act_id : bigint
user_id : bigint
parent_comment_id : bigint
content : text
}
entity "活动点赞/点踩 (ams_reaction)" as Reaction {
* reaction_id : bigint <<PK>>
--
act_id : bigint
user_id : bigint
reaction_type : enum
}
' 关系线
Club ||--o{ ClubUser : 包含
Activity ||--o{ Registration : 对应
Activity ||--o{ Comment : 被评论
Activity ||--o{ Reaction : 被点赞
@enduml

View File

@ -1,35 +0,0 @@
@startuml
title 图 2.4 校园社团活动管理系统总体结构图
' 顶层模块
object "校园社团活动管理系统" as System {
}
object "登录注册" as Login {
}
object "管理员界面" as Admin {
}
object "学生界面" as Student {
}
System --> Login
Login --> Admin
Login --> Student
Admin --> "用户管理"
Admin --> "社团管理"
Admin --> "成员管理"
Admin --> "活动管理"
Admin --> "审批管理"
Admin --> "统计总览"
Admin --> "修改密码"
Student --> "浏览社团"
Student --> "加入社团"
Student --> "活动报名"
Student --> "活动签到"
Student --> "评论互动"
Student --> "通知查看"
Student --> "个人资料修改"
Student --> "修改密码"
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@ -1,24 +0,0 @@
@startuml
start
:审批通过的活动对用户可见;
:用户查看活动详情;
:提交报名;
:等待发起人/管理员审批;
:活动开始,签到开放;
:用户签到;
if (活动结束时间已到?) then (是)
:签到关闭;
else (否)
:继续签到;
endif
:系统统计报名与签到情况;
stop
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,33 +0,0 @@
@startuml
start
:发起活动申请;
:选择活动类型(社团/院级/校级);
:提交活动信息;
if (是否为社团内部活动?) then (是)
:社团管理员审批;
if (审批通过?) then (是)
:活动发布;
else (否)
:退回修改;
:提交活动信息;
endif
else (否)
:社团管理员初审;
if (初审通过?) then (是)
:提交至对应上级审批;
:院级/校级管理员终审;
if (终审通过?) then (是)
:活动发布;
else (否)
:退回修改;
:提交活动信息;
endif
else (否)
:退回修改;
endif
endif
stop
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1,19 +0,0 @@
@startuml
start
:管理员进入活动报名管理页面;
:系统加载所有待审核报名记录;
:点击“审核”按钮;
if (是否通过报名?) then (是)
:更新报名状态为“已报名”;
else (否)
:更新报名状态为“未通过”;
:可填写驳回原因;
endif
:刷新报名列表;
stop
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,36 +0,0 @@
@startuml
start
:进入社团总览页面;
split
:点击“新增社团”按钮;
:弹出社团表单;
:填写名称、类型、负责人、Logo 等;
if (信息是否完整?) then (是)
:提交表单;
:新增社团成功;
:刷新社团列表;
else (否)
:提示信息不完整;
endif
split again
:点击“编辑社团”按钮;
:弹出社团信息表单;
:修改社团简介、负责人、状态等;
if (信息是否合法?) then (是)
:提交修改;
:修改成功;
:刷新社团列表;
else (否)
:提示修改失败;
endif
split again
:设置查询条件;
:输入关键词或选择筛选项;
:点击“查询”按钮;
:刷新社团分页列表;
endsplit
stop
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1,28 +0,0 @@
@startuml
start
:管理员进入社团成员管理页面;
split
:管理员处理入团申请;
:点击“审核”按钮;
if (是否通过?) then (通过)
:设置成员状态为“活跃”;
:写入审核备注;
else (拒绝)
:设置状态为“已拒绝”;
endif
split again
:管理员点击“筛选/查询”按钮;
:输入社团名、成员名或学号等条件;
:系统刷新并展示匹配成员数据;
split again
:管理员点击“移除成员”或“设为非活跃”按钮;
:弹出确认提示;
if (确认操作?) then (是)
:更新成员状态为“已退出”或“非活跃”;
else
:取消操作;
endif
endsplit
stop
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,26 +0,0 @@
@startuml
left to right direction
actor 学生用户
usecase "浏览社团信息" as UC1
usecase "申请加入社团" as UC2
usecase "退出社团申请" as UC3
usecase "报名参加活动" as UC4
usecase "活动签到" as UC5
usecase "发布评论/点赞" as UC6
usecase "修改个人信息" as UC7
usecase "修改密码" as UC8
usecase "查看系统通知" as UC9
学生用户 --> UC1
学生用户 --> UC2
学生用户 --> UC3
学生用户 --> UC4
学生用户 --> UC5
学生用户 --> UC6
学生用户 --> UC7
学生用户 --> UC8
学生用户 --> UC9
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,22 +0,0 @@
@startuml
left to right direction
actor 系统管理员
usecase "用户管理" as UC1
usecase "社团管理" as UC2
usecase "成员管理" as UC3
usecase "活动管理" as UC4
usecase "审批管理" as UC5
usecase "统计总览" as UC6
usecase "账户管理" as UC7
系统管理员 --> UC1
系统管理员 --> UC2
系统管理员 --> UC3
系统管理员 --> UC4
系统管理员 --> UC5
系统管理员 --> UC6
系统管理员 --> UC7
@enduml

406
pom.xml
View File

@ -1,287 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.8.9</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.8.9</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<spring-boot.version>2.5.15</spring-boot.version>
<druid.version>1.2.23</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>2.0.53</fastjson.version>
<oshi.version>6.6.5</oshi.version>
<commons.io.version>2.13.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<!-- override dependency version -->
<tomcat.version>9.0.102</tomcat.version>
<logback.version>1.2.13</logback.version>
<spring-security.version>5.7.12</spring-security.version>
<spring-framework.version>5.3.39</spring-framework.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- 覆盖SpringFramework的依赖配置-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring-framework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 覆盖SpringSecurity的依赖配置-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${spring-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 覆盖logback的依赖配置-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- 覆盖tomcat的依赖配置-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>bs-sms</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>bs-sams</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>bs-sams</module>
</modules>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.bruce</groupId>
<artifactId>SAMS</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SAMS</name>
<description>SAMS</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<!--web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--security-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!--MySQL-->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<!--MyBatis Plus3-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.10.1</version>
</dependency>
<!--Lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>1.18.36</version>
</dependency>
<!--JWT token依赖 -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.12.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

155
readme.md 100644
View File

@ -0,0 +1,155 @@
# 校园社团活动管理系统
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.4.2-green)](https://spring.io/)
[![Vue.js](https://img.shields.io/badge/Vue.js-3.2.0-brightgreen)](https://vuejs.org/)
[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
> 基于SpringBoot + Vue的校园社团活动全流程管理平台
> 毕业设计项目 | 山东建筑大学 | 2025届
---
## 项目简介
本系统旨在解决传统校园社团活动管理的痛点,提供数字化全流程解决方案:
- **角色分层管理**:支持管理员、组织者、参与者三级权限体系
- **活动全生命周期管理**:覆盖活动申请、审核、执行到归档全流程
- **数据可视化**:实时统计活动参与度与社团活跃度
- **安全可靠**采用JWT鉴权+BCrypt加密+操作日志审计
[//]: # ([👉 **在线演示**]&#40;https://demo.club-manager.com&#41; | [📚 需求文档]&#40;/docs/需求分析说明书1.4.docx&#41;)
---
## 功能特性
### 🎯 核心功能
| 模块 | 功能描述 |
|----------|--------------------------------|
| **社团管理** | 社团信息维护/成员审核/权限分级/数据统计 |
| **活动管理** | 在线申请-审核-发布全流程/扫码签到/评论互动/实时通知推送 |
| **用户中心** | 多角色视图切换/我的活动追踪/消息通知中心 |
### 🚀 特色功能
- **智能推荐**:基于用户兴趣的活动推送
- **扫码签到**:动态二维码防作弊机制
- **数据看板**:社团活跃度排行榜
---
## 技术栈
### 前端技术
| 技术 | 说明 | 版本 |
|--------------|-----------------|-------|
| Vue.js | 渐进式JavaScript框架 | 3.2.0 |
| Element-Plus | UI组件库 | 2.2.0 |
| Axios | HTTP客户端 | 1.1.3 |
| ECharts | 数据可视化 | 5.4.0 |
### 后端技术
| 技术 | 说明 | 版本 |
|--------------|----------|--------|
| Spring Boot | Java开发框架 | 2.7.0 |
| MyBatis-Plus | ORM框架 | 3.5.2 |
| JWT | 身份认证 | 0.11.2 |
| Redis | 缓存管理 | 6.2.6 |
| Swagger | API文档生成 | 3.0.0 |
### 基础设施
| 组件 | 用途 |
|-----------|-----------|
| MySQL 8.0 | 主数据库 |
| Nginx | 反向代理/负载均衡 |
| Docker | 容器化部署 |
---
## 快速开始
### 环境要求
- JDK 17+
- Node.js 16.x
- MySQL 8.0+
- Redis 6.x
### 本地部署
[//]: # ( todo 完善本地部署方法)
**初始化数据库**
执行 [/sql/init.sql](/sql/init.sql) 脚本
---
## 项目结构
```text
campus-club-system/
├── server/ # 后端服务
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/bruce/sams/
│ │ │ │ ├── controller # API接口层
│ │ │ │ ├── service # 业务逻辑层
│ │ │ │ ├── mapper # 数据访问层
│ │ │ │ └── config # 安全/缓存配置
│ │ │ └── resources/ # 配置文件
│ └── pom.xml
├── client/ # 前端应用
│ ├── src/
│ │ ├── api/ # 接口封装
│ │ ├── router/ # 路由配置
│ │ ├── views/ # 页面组件
│ │ └── store/ # 状态管理
│ └── package.json
├── docs/ # 文档资料
│ ├── 需求分析说明书.docx
│ └── 数据库设计.md
└── sql/ # 数据库脚本
├── init.sql # 初始化脚本
└── sample_data.sql # 测试数据
```
---
## 数据库设计
[//]: # (![ER Diagram]&#40;/docs/er-diagram.png&#41;)
关键数据表说明:
- **用户表(user)**:存储用户基础信息与角色权限
- **活动表(activity)**:记录活动全生命周期状态
- **报名表(signup_record)**:管理用户报名与签到信息
- **操作日志(admin_log)**:审计所有管理操作
[//]: # ([🔍 查看完整数据库设计]&#40;/docs/数据库设计.md&#41;)
---
## 贡献指南
欢迎通过Issue或PR参与改进
1. Fork本仓库
2. 创建特性分支 (`git checkout -b feature/your-feature`)
3. 提交修改 (`git commit -m 'Add some feature'`)
4. 推送到分支 (`git push origin feature/your-feature`)
5. 创建Pull Request
---
## 许可证
[MIT License](LICENSE) © 2025 孙之烨 | 山东建筑大学

View File

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>bs-sams</artifactId>
<version>3.8.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

View File

@ -1,30 +0,0 @@
package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
*
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -1,18 +0,0 @@
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web
*
* @author ruoyi
*/
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(RuoYiApplication.class);
}
}

View File

@ -1,94 +0,0 @@
package com.ruoyi.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@RestController
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

View File

@ -1,163 +0,0 @@
package com.ruoyi.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/**
*
*
* @param fileName
* @param delete
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
/**
*
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

View File

@ -1,121 +0,0 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysCache;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(new TreeSet<>(cacheKeys));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

View File

@ -1,27 +0,0 @@
package com.ruoyi.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Server server = new Server();
server.copyTo();
return AjaxResult.success(server);
}
}

View File

@ -1,82 +0,0 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPasswordService;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
/**
* 访
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController
{
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)
{
startPage();
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysLogininfor logininfor)
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
util.exportExcel(response, list, "登录日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public AjaxResult remove(@PathVariable Long[] infoIds)
{
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean()
{
logininforService.cleanLogininfor();
return success();
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public AjaxResult unlock(@PathVariable("userName") String userName)
{
passwordService.clearLoginRecordCache(userName);
return success();
}
}

View File

@ -1,69 +0,0 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController
{
@Autowired
private ISysOperLogService operLogService;
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping("/list")
public TableDataInfo list(SysOperLog operLog)
{
startPage();
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list);
}
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysOperLog operLog)
{
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)
{
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/clean")
public AjaxResult clean()
{
operLogService.cleanOperLog();
return success();
}
}

View File

@ -1,83 +0,0 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysUserOnline;
import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 线
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController
{
@Autowired
private ISysUserOnlineService userOnlineService;
@Autowired
private RedisCache redisCache;
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
@GetMapping("/list")
public TableDataInfo list(String ipaddr, String userName)
{
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys)
{
LoginUser user = redisCache.getCacheObject(key);
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
{
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
else if (StringUtils.isNotEmpty(ipaddr))
{
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
{
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
else
{
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
}
}
Collections.reverse(userOnlineList);
userOnlineList.removeAll(Collections.singleton(null));
return getDataTable(userOnlineList);
}
/**
* 退
*/
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}
}

View File

@ -1,133 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController
{
@Autowired
private ISysConfigService configService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:list')")
@GetMapping("/list")
public TableDataInfo list(SysConfig config)
{
startPage();
List<SysConfig> list = configService.selectConfigList(config);
return getDataTable(list);
}
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:config:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysConfig config)
{
List<SysConfig> list = configService.selectConfigList(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId)
{
return success(configService.selectConfigById(configId));
}
/**
*
*/
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey)
{
return success(configService.selectConfigByKey(configKey));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:edit')")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
configService.deleteConfigByIds(configIds);
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.resetConfigCache();
return success();
}
}

View File

@ -1,132 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController
{
@Autowired
private ISysDeptService deptService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list")
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list/exclude/{deptId}")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
return success(depts);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:query')")
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
{
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:add')")
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkDeptNameUnique(dept))
{
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
Long deptId = dept.getDeptId();
deptService.checkDeptDataScope(deptId);
if (!deptService.checkDeptNameUnique(dept))
{
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(deptId))
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
{
return error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable Long deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
return warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return warn("部门存在用户,不允许删除");
}
deptService.checkDeptDataScope(deptId);
return toAjax(deptService.deleteDeptById(deptId));
}
}

View File

@ -1,121 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
@Autowired
private ISysDictDataService dictDataService;
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictData dictData)
{
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictData dictData)
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return success(dictDataService.selectDictDataById(dictCode));
}
/**
*
*/
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

View File

@ -1,131 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictTypeService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/type")
public class SysDictTypeController extends BaseController
{
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictType dictType)
{
startPage();
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictType dictType)
{
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
}
/**
*
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

View File

@ -1,29 +0,0 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.StringUtils;
/**
*
*
* @author ruoyi
*/
@RestController
public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/**
* 访
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
}
}

View File

@ -1,97 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysMenuService;
/**
*
*
* @author ruoyi
*/
@RestController
public class SysLoginController
{
@Autowired
private SysLoginService loginService;
@Autowired
private ISysMenuService menuService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private TokenService tokenService;
/**
*
*
* @param loginBody
* @return
*/
@PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
*
*
* @return
*/
@GetMapping("getInfo")
public AjaxResult getInfo()
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
if (!loginUser.getPermissions().equals(permissions))
{
loginUser.setPermissions(permissions);
tokenService.refreshToken(loginUser);
}
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
*
*
* @return
*/
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
}

View File

@ -1,142 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysMenuService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController
{
@Autowired
private ISysMenuService menuService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:list')")
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menus);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:query')")
@GetMapping(value = "/{menuId}")
public AjaxResult getInfo(@PathVariable Long menuId)
{
return success(menuService.selectMenuById(menuId));
}
/**
*
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menuService.buildMenuTreeSelect(menus));
}
/**
*
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
return ajax;
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:add')")
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
else if (menu.getMenuId().equals(menu.getParentId()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{menuId}")
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
if (menuService.hasChildByMenuId(menuId))
{
return warn("存在子菜单,不允许删除");
}
if (menuService.checkMenuExistRole(menuId))
{
return warn("菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}
}

View File

@ -1,91 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/notice")
public class SysNoticeController extends BaseController
{
@Autowired
private ISysNoticeService noticeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:list')")
@GetMapping("/list")
public TableDataInfo list(SysNotice notice)
{
startPage();
List<SysNotice> list = noticeService.selectNoticeList(notice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return success(noticeService.selectNoticeById(noticeId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
}

View File

@ -1,129 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/post")
public class SysPostController extends BaseController
{
@Autowired
private ISysPostService postService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:list')")
@GetMapping("/list")
public TableDataInfo list(SysPost post)
{
startPage();
List<SysPost> list = postService.selectPostList(post);
return getDataTable(list);
}
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:post:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysPost post)
{
List<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
util.exportExcel(response, list, "岗位数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:query')")
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable Long postId)
{
return success(postService.selectPostById(postId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:add')")
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:edit')")
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:remove')")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public AjaxResult remove(@PathVariable Long[] postIds)
{
return toAjax(postService.deletePostByIds(postIds));
}
/**
*
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysPost> posts = postService.selectPostAll();
return success(posts);
}
}

View File

@ -1,140 +0,0 @@
package com.ruoyi.web.controller.system;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private TokenService tokenService;
/**
*
*/
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
/**
*
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
LoginUser loginUser = getLoginUser();
SysUser currentUser = loginUser.getUser();
currentUser.setNickName(user.getNickName());
currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
}
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
}
if (userService.updateUserProfile(currentUser) > 0)
{
// 更新缓存用户信息
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改个人信息异常,请联系管理员");
}
/**
*
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(@RequestBody Map<String, String> params)
{
String oldPassword = params.get("oldPassword");
String newPassword = params.get("newPassword");
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return error("修改密码失败,旧密码错误");
}
if (SecurityUtils.matchesPassword(newPassword, password))
{
return error("新密码不能与旧密码相同");
}
newPassword = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userName, newPassword) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(newPassword);
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改密码异常,请联系管理员");
}
/**
*
*/
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
{
if (!file.isEmpty())
{
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
{
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);
// 更新缓存用户头像
loginUser.getUser().setAvatar(avatar);
tokenService.setLoginUser(loginUser);
return ajax;
}
}
return error("上传图片异常,请联系管理员");
}
}

Some files were not shown because too many files have changed in this diff Show More