feat(generator): 添加代码生成器模板和AI聊天功能
- 新增.gitignore文件配置忽略规则 - 添加Taro页面配置模板add.config.ts.btl - 添加Taro页面组件模板add.tsx.btl用于动态表单生成 - 实现AiController提供AI聊天消息处理功能 - 集成WebSocket实现AI消息流式传输 - 添加支付宝支付配置工具类AlipayConfigUtil - 创建支付宝参数实体AlipayParam - 集成阿里云短信发送工具AliYunSender - 添加阿里云机器翻译工具AliyunTranslateUtil - 完善API响应结果包装类ApiResult - 配置多环境应用参数application.yml - 添加CMS生产环境配置application-cms.yml - 添加开发环境配置application-dev.yml - 添加生产环境配置application-prod.yml
This commit is contained in:
45
.gitignore
vendored
Normal file
45
.gitignore
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**
|
||||
!**/src/test/**
|
||||
|
||||
### 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/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
/cert/
|
||||
/src/main/resources/dev/
|
||||
|
||||
### macOS ###
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
/file/
|
||||
/websoft-modules.log
|
||||
/tmp/
|
||||
51
Dockerfile
Normal file
51
Dockerfile
Normal file
@@ -0,0 +1,51 @@
|
||||
# 使用更小的 Alpine Linux + OpenJDK 17 镜像
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 创建日志目录
|
||||
RUN mkdir -p /app/logs
|
||||
|
||||
# 创建上传文件目录
|
||||
RUN mkdir -p /app/uploads
|
||||
|
||||
# 安装必要工具和中文字体支持
|
||||
# fontconfig: 字体配置库
|
||||
# ttf-dejavu: 包含DejaVu字体,支持中文显示
|
||||
# wqy-zenhei: 文泉驿正黑字体,开源中文字体
|
||||
RUN apk add --no-cache wget fontconfig ttf-dejavu && \
|
||||
# 下载并安装文泉驿微米黑字体(更好的中文支持)
|
||||
wget -O /tmp/wqy-microhei.ttc https://github.com/anthonyfok/fonts-wqy-microhei/raw/master/wqy-microhei.ttc && \
|
||||
mkdir -p /usr/share/fonts/truetype/wqy && \
|
||||
mv /tmp/wqy-microhei.ttc /usr/share/fonts/truetype/wqy/ && \
|
||||
# 刷新字体缓存
|
||||
fc-cache -fv && \
|
||||
# 创建应用用户(安全考虑)
|
||||
addgroup -g 1000 appgroup && \
|
||||
adduser -D -u 1000 -G appgroup appuser
|
||||
|
||||
# 复制jar包到容器
|
||||
COPY target/*.jar app.jar
|
||||
|
||||
# 设置目录权限
|
||||
RUN chown -R appuser:appgroup /app
|
||||
|
||||
# 切换到应用用户
|
||||
USER appuser
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 9200
|
||||
|
||||
# 设置JVM参数
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
# 设置Spring Profile
|
||||
ENV SPRING_PROFILES_ACTIVE=prod
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:9200/actuator/health || exit 1
|
||||
|
||||
# 启动应用
|
||||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
|
||||
286
README.md
Normal file
286
README.md
Normal file
@@ -0,0 +1,286 @@
|
||||
<div align="center">
|
||||
<h1>🚀 WebSoft API</h1>
|
||||
<p><strong>基于 Spring Boot + MyBatis Plus 的企业级后端API服务</strong></p>
|
||||
|
||||
<p>
|
||||
<img src="https://img.shields.io/badge/Java-1.8+-ED8B00" alt="Java">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.5.4-6DB33F" alt="Spring Boot">
|
||||
<img src="https://img.shields.io/badge/MyBatis%20Plus-3.4.3-blue" alt="MyBatis Plus">
|
||||
<img src="https://img.shields.io/badge/MySQL-8.0+-4479A1" alt="MySQL">
|
||||
<img src="https://img.shields.io/badge/Redis-6.0+-DC382D" alt="Redis">
|
||||
<img src="https://img.shields.io/badge/License-MIT-blue" alt="License">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## 📖 项目简介
|
||||
|
||||
WebSoft API 是一个基于 **Spring Boot + MyBatis Plus** 构建的现代化企业级后端API服务,采用最新的Java技术栈:
|
||||
|
||||
- **核心框架**:Spring Boot 2.5.4 + Spring Security + Spring AOP
|
||||
- **数据访问**:MyBatis Plus 3.4.3 + Druid 连接池
|
||||
- **数据库**:MySQL + Redis
|
||||
- **文档工具**:Swagger 3.0 + Knife4j
|
||||
- **工具库**:Hutool、Lombok、FastJSON
|
||||
|
||||
|
||||
|
||||
## 项目演示
|
||||
| 后台管理系统 | https://mp.websoft.top |
|
||||
|--------|-------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 测试账号 | 13800010123,123456
|
||||
| 正式账号 | [立即注册](https://mp.websoft.top/register/?inviteCode=github) |
|
||||
| 关注公众号 |  |
|
||||
|
||||
|
||||
|
||||
|
||||
## 🛠️ 技术栈
|
||||
|
||||
### 核心框架
|
||||
| 技术 | 版本 | 说明 |
|
||||
|------|------|------|
|
||||
| Java | 1.8+ | 编程语言 |
|
||||
| Spring Boot | 2.5.4 | 微服务框架 |
|
||||
| Spring Security | 5.5.x | 安全框架 |
|
||||
| MyBatis Plus | 3.4.3 | ORM框架 |
|
||||
| MySQL | 8.0+ | 关系型数据库 |
|
||||
| Redis | 6.0+ | 缓存数据库 |
|
||||
| Druid | 1.2.6 | 数据库连接池 |
|
||||
|
||||
### 功能组件
|
||||
- **Swagger 3.0 + Knife4j** - API文档生成与测试
|
||||
- **JWT** - 用户认证与授权
|
||||
- **Hutool** - Java工具类库
|
||||
- **EasyPOI** - Excel文件处理
|
||||
- **阿里云OSS** - 对象存储服务
|
||||
- **微信支付/支付宝** - 支付集成
|
||||
- **Socket.IO** - 实时通信
|
||||
- **MQTT** - 物联网消息传输
|
||||
|
||||
## 📋 环境要求
|
||||
|
||||
### 基础环境
|
||||
- ☕ **Java 1.8+**
|
||||
- 🗄️ **MySQL 8.0+**
|
||||
- 🔴 **Redis 6.0+**
|
||||
- 📦 **Maven 3.6+**
|
||||
|
||||
### 开发工具
|
||||
- **推荐**:IntelliJ IDEA / Eclipse
|
||||
- **插件**:Lombok Plugin、MyBatis Plugin
|
||||
|
||||
## 🚀 快速开始
|
||||
|
||||
### 1. 克隆项目
|
||||
```bash
|
||||
git clone https://github.com/websoft-top/mp-java.git
|
||||
cd mp-java
|
||||
```
|
||||
|
||||
### 2. 数据库配置
|
||||
```sql
|
||||
-- 创建数据库
|
||||
CREATE DATABASE websoft_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- 导入数据库脚本(如果有的话)
|
||||
-- source /path/to/database.sql
|
||||
```
|
||||
|
||||
### 3. 配置文件
|
||||
编辑 `src/main/resources/application-dev.yml` 文件,配置数据库连接:
|
||||
```yaml
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/websoft_db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
|
||||
username: your_username
|
||||
password: your_password
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: your_redis_password
|
||||
```
|
||||
|
||||
### 4. 启动项目
|
||||
```bash
|
||||
# 使用 Maven 启动
|
||||
mvn spring-boot:run
|
||||
|
||||
# 或者使用 IDE 直接运行 WebSoftApplication.java
|
||||
```
|
||||
|
||||
访问 `http://localhost:9200` 即可看到API服务。
|
||||
|
||||
### 5. API文档
|
||||
启动项目后,访问以下地址查看API文档:
|
||||
- Swagger UI: `http://localhost:9200/swagger-ui/index.html`
|
||||
- Knife4j: `http://localhost:9200/doc.html`
|
||||
|
||||
## ⚙️ 配置说明
|
||||
|
||||
### 数据库配置
|
||||
在 `application-dev.yml` 中配置数据库连接:
|
||||
```yaml
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/websoft_db
|
||||
username: root
|
||||
password: your_password
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
```
|
||||
|
||||
### Redis配置
|
||||
```yaml
|
||||
spring:
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: your_redis_password
|
||||
database: 0
|
||||
```
|
||||
|
||||
### 阿里云OSS配置
|
||||
```yaml
|
||||
config:
|
||||
endpoint: https://oss-cn-shenzhen.aliyuncs.com
|
||||
accessKeyId: your_access_key_id
|
||||
accessKeySecret: your_access_key_secret
|
||||
bucketName: your_bucket_name
|
||||
bucketDomain: https://your-domain.com
|
||||
```
|
||||
|
||||
### 其他配置
|
||||
- **JWT密钥**:`config.token-key` 用于JWT令牌加密
|
||||
- **文件上传路径**:`config.upload-path` 本地文件存储路径
|
||||
- **邮件服务**:配置SMTP服务器用于发送邮件
|
||||
|
||||
## 🎯 核心功能
|
||||
|
||||
### 🔐 用户认证与授权
|
||||
- **JWT认证**:基于JSON Web Token的用户认证
|
||||
- **Spring Security**:完整的安全框架集成
|
||||
- **角色权限**:基于RBAC的权限控制
|
||||
- **图形验证码**:防止恶意登录
|
||||
|
||||
### 📝 内容管理系统(CMS)
|
||||
- **文章管理**:支持富文本内容管理
|
||||
- **媒体文件**:图片/视频文件上传与管理
|
||||
- **分类管理**:内容分类与标签管理
|
||||
- **SEO优化**:搜索引擎优化支持
|
||||
|
||||
### 🛒 电商系统
|
||||
- **商品管理**:商品信息、规格、库存管理
|
||||
- **订单系统**:完整的订单流程管理
|
||||
- **支付集成**:支持微信支付、支付宝
|
||||
- **物流跟踪**:快递100物流查询集成
|
||||
|
||||
### 🔧 系统管理
|
||||
- **用户管理**:用户信息维护与管理
|
||||
- **系统配置**:动态配置管理
|
||||
- **日志监控**:系统操作日志记录
|
||||
- **数据备份**:数据库备份与恢复
|
||||
|
||||
### 📊 数据分析
|
||||
- **统计报表**:业务数据统计分析
|
||||
- **图表展示**:数据可视化展示
|
||||
- **导出功能**:Excel数据导出
|
||||
- **实时监控**:系统性能监控
|
||||
|
||||
## 🏗️ 项目结构
|
||||
|
||||
```
|
||||
src/main/java/com/gxwebsoft/
|
||||
├── WebSoftApplication.java # 启动类
|
||||
├── cms/ # 内容管理模块
|
||||
│ ├── controller/ # 控制器层
|
||||
│ ├── service/ # 业务逻辑层
|
||||
│ ├── mapper/ # 数据访问层
|
||||
│ └── entity/ # 实体类
|
||||
├── shop/ # 商城模块
|
||||
│ ├── controller/
|
||||
│ ├── service/
|
||||
│ ├── mapper/
|
||||
│ └── entity/
|
||||
├── common/ # 公共模块
|
||||
│ ├── core/ # 核心配置
|
||||
│ ├── utils/ # 工具类
|
||||
│ └── exception/ # 异常处理
|
||||
└── resources/
|
||||
├── application.yml # 主配置文件
|
||||
├── application-dev.yml # 开发环境配置
|
||||
└── application-prod.yml# 生产环境配置
|
||||
```
|
||||
|
||||
## 🔧 开发规范
|
||||
|
||||
### 代码结构
|
||||
- **Controller层**:处理HTTP请求,参数验证
|
||||
- **Service层**:业务逻辑处理,事务管理
|
||||
- **Mapper层**:数据访问,SQL映射
|
||||
- **Entity层**:数据实体,数据库表映射
|
||||
|
||||
### 命名规范
|
||||
- **类名**:使用大驼峰命名法(PascalCase)
|
||||
- **方法名**:使用小驼峰命名法(camelCase)
|
||||
- **常量**:使用全大写,下划线分隔
|
||||
- **包名**:使用小写字母,点分隔
|
||||
|
||||
## 📚 API文档
|
||||
|
||||
项目集成了Swagger和Knife4j,提供完整的API文档:
|
||||
|
||||
### 访问地址
|
||||
- **Swagger UI**: `http://localhost:9200/swagger-ui/index.html`
|
||||
- **Knife4j**: `http://localhost:9200/doc.html`
|
||||
|
||||
### 主要接口模块
|
||||
- **用户认证**: `/api/auth/**` - 登录、注册、权限验证
|
||||
- **用户管理**: `/api/user/**` - 用户CRUD操作
|
||||
- **内容管理**: `/api/cms/**` - 文章、媒体文件管理
|
||||
- **商城管理**: `/api/shop/**` - 商品、订单管理
|
||||
- **系统管理**: `/api/system/**` - 系统配置、日志管理
|
||||
|
||||
## 🚀 部署指南
|
||||
|
||||
### 开发环境部署
|
||||
```bash
|
||||
# 1. 启动MySQL和Redis服务
|
||||
# 2. 创建数据库并导入初始数据
|
||||
# 3. 修改配置文件
|
||||
# 4. 启动应用
|
||||
mvn spring-boot:run
|
||||
```
|
||||
|
||||
### 生产环境部署
|
||||
```bash
|
||||
# 1. 打包应用
|
||||
mvn clean package -Dmaven.test.skip=true
|
||||
|
||||
# 2. 运行jar包
|
||||
java -jar target/com-gxwebsoft-modules-1.5.0.jar --spring.profiles.active=prod
|
||||
|
||||
# 3. 使用Docker部署(可选)
|
||||
docker build -t websoft-api .
|
||||
docker run -d -p 9200:9200 websoft-api
|
||||
```
|
||||
|
||||
## 🤝 贡献指南
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
||||
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
||||
5. 打开 Pull Request
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情
|
||||
|
||||
## 📞 联系我们
|
||||
|
||||
- 官网:https://websoft.top
|
||||
- 邮箱:170083662@qq.top
|
||||
- QQ群:479713884
|
||||
|
||||
---
|
||||
|
||||
⭐ 如果这个项目对您有帮助,请给我们一个星标!
|
||||
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# 应用服务
|
||||
cms-api:
|
||||
build: .
|
||||
container_name: cms-api
|
||||
ports:
|
||||
- "9200:9200"
|
||||
environment:
|
||||
- SPRING_PROFILES_ACTIVE=prod
|
||||
- JAVA_OPTS=-Xms512m -Xmx1024m
|
||||
volumes:
|
||||
# 证书挂载卷 - 将宿主机证书目录挂载到容器
|
||||
- ./certs:/app/certs:ro
|
||||
# 日志挂载卷
|
||||
- ./logs:/app/logs
|
||||
# 上传文件挂载卷
|
||||
- ./uploads:/app/uploads
|
||||
networks:
|
||||
- cms-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9200/actuator/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
|
||||
networks:
|
||||
cms-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
188
docker-deploy-guide.md
Normal file
188
docker-deploy-guide.md
Normal file
@@ -0,0 +1,188 @@
|
||||
# Docker容器化部署指南
|
||||
|
||||
## 支付证书问题解决方案
|
||||
|
||||
本项目已经解决了Docker容器中支付证书路径失效的问题,支持多种证书加载方式。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
project-root/
|
||||
├── Dockerfile
|
||||
├── docker-compose.yml
|
||||
├── certs/ # 证书目录(需要手动创建)
|
||||
│ ├── wechat/ # 微信支付证书
|
||||
│ │ ├── apiclient_key.pem
|
||||
│ │ ├── apiclient_cert.pem
|
||||
│ │ └── wechatpay_cert.pem
|
||||
│ └── alipay/ # 支付宝证书
|
||||
│ ├── app_private_key.pem
|
||||
│ ├── appCertPublicKey.crt
|
||||
│ ├── alipayCertPublicKey.crt
|
||||
│ └── alipayRootCert.crt
|
||||
├── logs/ # 日志目录
|
||||
├── uploads/ # 上传文件目录
|
||||
└── src/
|
||||
```
|
||||
|
||||
## 部署步骤
|
||||
|
||||
### 1. 准备证书文件
|
||||
|
||||
创建证书目录并放置证书文件:
|
||||
|
||||
```bash
|
||||
# 创建证书目录
|
||||
mkdir -p certs/wechat
|
||||
mkdir -p certs/alipay
|
||||
|
||||
# 复制微信支付证书到对应目录
|
||||
cp /path/to/your/apiclient_key.pem certs/wechat/
|
||||
cp /path/to/your/apiclient_cert.pem certs/wechat/
|
||||
cp /path/to/your/wechatpay_cert.pem certs/wechat/
|
||||
|
||||
# 复制支付宝证书到对应目录
|
||||
cp /path/to/your/app_private_key.pem certs/alipay/
|
||||
cp /path/to/your/appCertPublicKey.crt certs/alipay/
|
||||
cp /path/to/your/alipayCertPublicKey.crt certs/alipay/
|
||||
cp /path/to/your/alipayRootCert.crt certs/alipay/
|
||||
|
||||
# 设置证书文件权限(只读)
|
||||
chmod -R 444 certs/
|
||||
```
|
||||
|
||||
### 2. 配置环境变量
|
||||
|
||||
创建 `.env` 文件(可选):
|
||||
|
||||
```bash
|
||||
# 应用配置
|
||||
SPRING_PROFILES_ACTIVE=prod
|
||||
JAVA_OPTS=-Xms512m -Xmx1024m
|
||||
|
||||
# 数据库配置
|
||||
MYSQL_ROOT_PASSWORD=root123456
|
||||
MYSQL_DATABASE=modules
|
||||
MYSQL_USER=modules
|
||||
MYSQL_PASSWORD=8YdLnk7KsPAyDXGA
|
||||
|
||||
# Redis配置
|
||||
REDIS_PASSWORD=redis_WSDb88
|
||||
```
|
||||
|
||||
### 3. 构建和启动
|
||||
|
||||
```bash
|
||||
# 构建应用
|
||||
mvn clean package -DskipTests
|
||||
|
||||
# 启动所有服务
|
||||
docker-compose up -d
|
||||
|
||||
# 查看服务状态
|
||||
docker-compose ps
|
||||
|
||||
# 查看应用日志
|
||||
docker-compose logs -f cms-app
|
||||
```
|
||||
|
||||
### 4. 验证部署
|
||||
|
||||
```bash
|
||||
# 检查应用健康状态
|
||||
curl http://localhost:9200/actuator/health
|
||||
|
||||
# 检查证书是否正确加载
|
||||
docker exec cms-java-app ls -la /app/certs/
|
||||
```
|
||||
|
||||
## 证书加载模式
|
||||
|
||||
### 开发环境 (CLASSPATH)
|
||||
- 证书文件放在 `src/main/resources/certs/` 目录下
|
||||
- 打包时会包含在jar包中
|
||||
- 适合开发和测试环境
|
||||
|
||||
### 生产环境 (VOLUME)
|
||||
- 证书文件通过Docker挂载卷加载
|
||||
- 证书文件在宿主机上,挂载到容器的 `/app/certs` 目录
|
||||
- 支持证书文件的动态更新(重启容器后生效)
|
||||
|
||||
### 文件系统模式 (FILESYSTEM)
|
||||
- 直接从文件系统路径加载证书
|
||||
- 适合传统部署方式
|
||||
|
||||
## 配置说明
|
||||
|
||||
### application.yml 配置
|
||||
|
||||
```yaml
|
||||
certificate:
|
||||
load-mode: VOLUME # 证书加载模式
|
||||
cert-root-path: /app/certs # 证书根目录
|
||||
|
||||
wechat-pay:
|
||||
dev:
|
||||
api-v3-key: "your-api-v3-key"
|
||||
private-key-file: "apiclient_key.pem"
|
||||
apiclient-cert-file: "apiclient_cert.pem"
|
||||
wechatpay-cert-file: "wechatpay_cert.pem"
|
||||
```
|
||||
|
||||
### 环境特定配置
|
||||
|
||||
- **开发环境**: `application-dev.yml` - 使用CLASSPATH模式
|
||||
- **生产环境**: `application-prod.yml` - 使用VOLUME模式
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 1. 证书文件找不到
|
||||
|
||||
```bash
|
||||
# 检查证书文件是否存在
|
||||
docker exec cms-java-app ls -la /app/certs/
|
||||
|
||||
# 检查文件权限
|
||||
docker exec cms-java-app ls -la /app/certs/wechat/
|
||||
```
|
||||
|
||||
### 2. 支付接口调用失败
|
||||
|
||||
```bash
|
||||
# 查看应用日志
|
||||
docker-compose logs cms-app | grep -i cert
|
||||
|
||||
# 检查证书配置
|
||||
docker exec cms-java-app cat /app/application.yml | grep -A 10 certificate
|
||||
```
|
||||
|
||||
### 3. 容器启动失败
|
||||
|
||||
```bash
|
||||
# 查看详细错误信息
|
||||
docker-compose logs cms-app
|
||||
|
||||
# 检查容器状态
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
## 安全建议
|
||||
|
||||
1. **证书文件权限**: 设置为只读权限 (444)
|
||||
2. **证书目录权限**: 限制访问权限
|
||||
3. **敏感信息**: 使用环境变量或Docker secrets管理敏感配置
|
||||
4. **网络安全**: 使用内部网络,限制端口暴露
|
||||
|
||||
## 更新证书
|
||||
|
||||
1. 停止应用容器:`docker-compose stop cms-app`
|
||||
2. 更新证书文件到 `certs/` 目录
|
||||
3. 重启应用容器:`docker-compose start cms-app`
|
||||
|
||||
## 监控和日志
|
||||
|
||||
- 应用日志:`./logs/` 目录
|
||||
- 容器日志:`docker-compose logs`
|
||||
- 健康检查:访问 `/actuator/health` 端点
|
||||
|
||||
通过以上配置,你的应用在Docker容器中就能正确加载支付证书了!
|
||||
422
pom.xml
Normal file
422
pom.xml
Normal file
@@ -0,0 +1,422 @@
|
||||
<?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>
|
||||
|
||||
<groupId>com.gxwebsoft</groupId>
|
||||
<artifactId>mp-api</artifactId>
|
||||
<version>1.5.0</version>
|
||||
|
||||
<name>mp-api</name>
|
||||
<description>WebSoftApi project for Spring Boot</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.18</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-web -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson JSR310 support for Java 8 time -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-aop -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-configuration-processor -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- mysql -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- druid -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.2.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.3.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus 连表插件-->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>1.4.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus-generator -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- hutool -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-extra</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
|
||||
<!-- easy poi -->
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-base</artifactId>
|
||||
<version>4.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- tika, 用于FileServer获取content-type -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-core</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||||
<dependency>
|
||||
<groupId>com.github.livesense</groupId>
|
||||
<artifactId>jodconverter-core</artifactId>
|
||||
<version>1.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-mail -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 模板引擎, 用于邮件、代码生成等 -->
|
||||
<dependency>
|
||||
<groupId>com.ibeetl</groupId>
|
||||
<artifactId>beetl</artifactId>
|
||||
<version>3.15.10.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringDoc OpenAPI 3 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- jjwt -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>0.11.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>0.11.5</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>0.11.5</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 图形验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--Redis-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里SDK -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.4.3</version>
|
||||
</dependency>
|
||||
<!--阿里支付 老版本 SDK-->
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.35.0.ALL</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on -->
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
<version>1.77</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.43</version>
|
||||
</dependency>
|
||||
|
||||
<!--二维码-->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.vaadin.external.google</groupId>
|
||||
<artifactId>android-json</artifactId>
|
||||
<version>0.0.20131108.vaadin1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- socketio -->
|
||||
<dependency>
|
||||
<groupId>com.corundumstudio.socketio</groupId>
|
||||
<artifactId>netty-socketio</artifactId>
|
||||
<version>2.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 微信支付 APIv3 Java SDK-->
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.17</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MQTT -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-mqtt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-miniapp</artifactId>
|
||||
<version>4.6.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-mp</artifactId>
|
||||
<version>4.6.0</version> <!-- 请替换为最新版本号 -->
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里云 OSS -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>3.17.4</version>
|
||||
</dependency>
|
||||
<!-- 快递100-->
|
||||
<dependency>
|
||||
<groupId>com.github.kuaidi100-api</groupId>
|
||||
<artifactId>sdk</artifactId>
|
||||
<version>1.0.13</version>
|
||||
</dependency>
|
||||
|
||||
<!--诺诺开票接口-->
|
||||
<dependency>
|
||||
<groupId>com.nuonuo</groupId>
|
||||
<artifactId>open-sdk</artifactId>
|
||||
<version>1.0.5.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- knife4j for SpringDoc OpenAPI -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
|
||||
<version>4.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 机器翻译 -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>alimt20181012</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>tea-openapi</artifactId>
|
||||
<version>0.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
<!-- 可选:用来做内存缓存 access_token -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>3.1.8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>bailian20231229</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.freewayso</groupId>
|
||||
<artifactId>image-combiner</artifactId>
|
||||
<version>2.6.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*Mapper.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.project-lombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliYunMaven</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
</project>
|
||||
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.gxwebsoft;
|
||||
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.config.MqttProperties;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
* Created by WebSoft on 2018-02-22 11:29:03
|
||||
*/
|
||||
@EnableAsync
|
||||
@EnableTransactionManagement
|
||||
@MapperScan("com.gxwebsoft.**.mapper")
|
||||
@EnableConfigurationProperties({ConfigProperties.class, MqttProperties.class})
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EnableWebSocket
|
||||
public class WebSoftApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WebSoftApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.gxwebsoft.auto.controller;
|
||||
|
||||
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||
import com.gxwebsoft.auto.service.QrLoginService;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 认证模块
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "认证模块")
|
||||
@RestController
|
||||
@RequestMapping("/api/qr-login")
|
||||
public class QrLoginController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private QrLoginService qrLoginService;
|
||||
|
||||
/**
|
||||
* 生成扫码登录token
|
||||
*/
|
||||
@Operation(summary = "生成扫码登录token")
|
||||
@PostMapping("/generate")
|
||||
public ApiResult<?> generateQrLoginToken() {
|
||||
try {
|
||||
QrLoginGenerateResponse response = qrLoginService.generateQrLoginToken();
|
||||
return success("生成成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查扫码登录状态
|
||||
*/
|
||||
@Operation(summary = "检查扫码登录状态")
|
||||
@GetMapping("/status/{token}")
|
||||
public ApiResult<?> checkQrLoginStatus(
|
||||
@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||
try {
|
||||
QrLoginStatusResponse response = qrLoginService.checkQrLoginStatus(token);
|
||||
return success("查询成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认扫码登录
|
||||
*/
|
||||
@Operation(summary = "确认扫码登录")
|
||||
@PostMapping("/confirm")
|
||||
public ApiResult<?> confirmQrLogin(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||
try {
|
||||
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||
return success("确认成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码操作(可选接口,用于移动端扫码后更新状态)
|
||||
*/
|
||||
@Operation(summary = "扫码操作")
|
||||
@PostMapping("/scan/{token}")
|
||||
public ApiResult<?> scanQrCode(@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||
try {
|
||||
boolean result = qrLoginService.scanQrCode(token);
|
||||
return success("操作成功", result);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序扫码登录确认(便捷接口)
|
||||
*/
|
||||
@Operation(summary = "微信小程序扫码登录确认")
|
||||
@PostMapping("/wechat-confirm")
|
||||
public ApiResult<?> wechatMiniProgramConfirm(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||
try {
|
||||
// 设置平台为微信小程序
|
||||
request.setPlatform("miniprogram");
|
||||
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||
return success("微信小程序登录确认成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 扫码登录确认请求
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "扫码登录确认请求")
|
||||
public class QrLoginConfirmRequest {
|
||||
|
||||
@Schema(description = "扫码登录token")
|
||||
@NotBlank(message = "token不能为空")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "登录平台: web-网页端, app-移动应用, miniprogram-微信小程序")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "微信小程序相关信息")
|
||||
private WechatMiniProgramInfo wechatInfo;
|
||||
|
||||
/**
|
||||
* 微信小程序信息
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "微信小程序信息")
|
||||
public static class WechatMiniProgramInfo {
|
||||
@Schema(description = "微信openid")
|
||||
private String openid;
|
||||
|
||||
@Schema(description = "微信unionid")
|
||||
private String unionid;
|
||||
|
||||
@Schema(description = "微信昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "微信头像")
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
}
|
||||
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 扫码登录数据模型
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QrLoginData {
|
||||
|
||||
/**
|
||||
* 扫码登录token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 用户ID(扫码确认后设置)
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 用户名(扫码确认后设置)
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* JWT访问令牌(确认后生成)
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 扫码登录生成响应
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "扫码登录生成响应")
|
||||
public class QrLoginGenerateResponse {
|
||||
|
||||
@Schema(description = "扫码登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "二维码内容")
|
||||
private String qrCode;
|
||||
|
||||
@Schema(description = "过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 扫码登录状态响应
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "扫码登录状态响应")
|
||||
public class QrLoginStatusResponse {
|
||||
|
||||
@Schema(description = "状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "JWT访问令牌(仅在confirmed状态时返回)")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "用户信息(仅在confirmed状态时返回)")
|
||||
private Object userInfo;
|
||||
|
||||
@Schema(description = "剩余过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.gxwebsoft.auto.service;
|
||||
|
||||
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||
|
||||
/**
|
||||
* 扫码登录服务接口
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
public interface QrLoginService {
|
||||
|
||||
/**
|
||||
* 生成扫码登录token
|
||||
*
|
||||
* @return QrLoginGenerateResponse
|
||||
*/
|
||||
QrLoginGenerateResponse generateQrLoginToken();
|
||||
|
||||
/**
|
||||
* 检查扫码登录状态
|
||||
*
|
||||
* @param token 扫码登录token
|
||||
* @return QrLoginStatusResponse
|
||||
*/
|
||||
QrLoginStatusResponse checkQrLoginStatus(String token);
|
||||
|
||||
/**
|
||||
* 确认扫码登录
|
||||
*
|
||||
* @param request 确认请求
|
||||
* @return QrLoginStatusResponse
|
||||
*/
|
||||
QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request);
|
||||
|
||||
/**
|
||||
* 扫码操作(更新状态为已扫码)
|
||||
*
|
||||
* @param token 扫码登录token
|
||||
* @return boolean
|
||||
*/
|
||||
boolean scanQrCode(String token);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
package com.gxwebsoft.auto.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.gxwebsoft.auto.dto.*;
|
||||
import com.gxwebsoft.auto.service.QrLoginService;
|
||||
import com.gxwebsoft.common.core.security.JwtSubject;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
|
||||
|
||||
/**
|
||||
* 扫码登录服务实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class QrLoginServiceImpl implements QrLoginService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Value("${config.jwt.secret:websoft-jwt-secret-key-2025}")
|
||||
private String jwtSecret;
|
||||
|
||||
@Value("${config.jwt.expire:86400}")
|
||||
private Long jwtExpire;
|
||||
|
||||
@Override
|
||||
public QrLoginGenerateResponse generateQrLoginToken() {
|
||||
// 生成唯一的扫码登录token
|
||||
String token = UUID.randomUUID().toString(true);
|
||||
|
||||
// 创建扫码登录数据
|
||||
QrLoginData qrLoginData = new QrLoginData();
|
||||
qrLoginData.setToken(token);
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_PENDING);
|
||||
qrLoginData.setCreateTime(LocalDateTime.now());
|
||||
qrLoginData.setExpireTime(LocalDateTime.now().plusSeconds(QR_LOGIN_TOKEN_TTL));
|
||||
|
||||
// 存储到Redis,设置过期时间
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
redisUtil.set(redisKey, qrLoginData, QR_LOGIN_TOKEN_TTL, TimeUnit.SECONDS);
|
||||
|
||||
log.info("生成扫码登录token: {}", token);
|
||||
|
||||
// 构造二维码内容(这里可以是前端登录页面的URL + token参数)
|
||||
String qrCodeContent = "qr-login:" + token;
|
||||
|
||||
return new QrLoginGenerateResponse(token, qrCodeContent, QR_LOGIN_TOKEN_TTL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QrLoginStatusResponse checkQrLoginStatus(String token) {
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
// 删除过期的token
|
||||
redisUtil.delete(redisKey);
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
// 计算剩余过期时间
|
||||
long expiresIn = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||
|
||||
QrLoginStatusResponse response = new QrLoginStatusResponse();
|
||||
response.setStatus(qrLoginData.getStatus());
|
||||
response.setExpiresIn(expiresIn);
|
||||
|
||||
// 如果已确认,返回token和用户信息
|
||||
if (QR_LOGIN_STATUS_CONFIRMED.equals(qrLoginData.getStatus())) {
|
||||
response.setAccessToken(qrLoginData.getAccessToken());
|
||||
|
||||
// 获取用户信息
|
||||
if (qrLoginData.getUserId() != null) {
|
||||
User user = userService.getByIdRel(qrLoginData.getUserId());
|
||||
if (user != null) {
|
||||
// 清除敏感信息
|
||||
user.setPassword(null);
|
||||
response.setUserInfo(user);
|
||||
}
|
||||
}
|
||||
|
||||
// 确认后删除token,防止重复使用
|
||||
redisUtil.delete(redisKey);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request) {
|
||||
String token = request.getToken();
|
||||
Integer userId = request.getUserId();
|
||||
String platform = request.getPlatform();
|
||||
|
||||
if (StrUtil.isBlank(token) || userId == null) {
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
throw new RuntimeException("扫码登录token不存在或已过期");
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
redisUtil.delete(redisKey);
|
||||
throw new RuntimeException("扫码登录token已过期");
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
User user = userService.getByIdRel(userId);
|
||||
if (user == null) {
|
||||
throw new RuntimeException("用户不存在");
|
||||
}
|
||||
|
||||
// 检查用户状态
|
||||
if (user.getStatus() != null && user.getStatus() != 0) {
|
||||
throw new RuntimeException("用户已被冻结");
|
||||
}
|
||||
|
||||
// 如果是微信小程序登录,处理微信相关信息
|
||||
if ("miniprogram".equals(platform) && request.getWechatInfo() != null) {
|
||||
handleWechatMiniProgramLogin(user, request.getWechatInfo());
|
||||
}
|
||||
|
||||
// 生成JWT token
|
||||
JwtSubject jwtSubject = new JwtSubject(user.getUsername(), user.getTenantId());
|
||||
String accessToken = JwtUtil.buildToken(jwtSubject, jwtExpire, jwtSecret);
|
||||
|
||||
// 更新扫码登录数据
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED);
|
||||
qrLoginData.setUserId(userId);
|
||||
qrLoginData.setUsername(user.getUsername());
|
||||
qrLoginData.setAccessToken(accessToken);
|
||||
|
||||
// 更新Redis中的数据
|
||||
redisUtil.set(redisKey, qrLoginData, 60L, TimeUnit.SECONDS); // 给前端60秒时间获取token
|
||||
|
||||
log.info("用户 {} 通过 {} 平台确认扫码登录,token: {}", user.getUsername(),
|
||||
platform != null ? platform : "unknown", token);
|
||||
|
||||
// 清除敏感信息
|
||||
user.setPassword(null);
|
||||
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_CONFIRMED, accessToken, user, 60L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理微信小程序登录相关逻辑
|
||||
*/
|
||||
private void handleWechatMiniProgramLogin(User user, QrLoginConfirmRequest.WechatMiniProgramInfo wechatInfo) {
|
||||
// 更新用户的微信信息
|
||||
if (StrUtil.isNotBlank(wechatInfo.getOpenid())) {
|
||||
user.setOpenid(wechatInfo.getOpenid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getUnionid())) {
|
||||
user.setUnionid(wechatInfo.getUnionid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getNickname()) && StrUtil.isBlank(user.getNickname())) {
|
||||
user.setNickname(wechatInfo.getNickname());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getAvatar()) && StrUtil.isBlank(user.getAvatar())) {
|
||||
user.setAvatar(wechatInfo.getAvatar());
|
||||
}
|
||||
|
||||
// 更新用户信息到数据库
|
||||
try {
|
||||
userService.updateById(user);
|
||||
log.info("更新用户 {} 的微信小程序信息成功", user.getUsername());
|
||||
} catch (Exception e) {
|
||||
log.warn("更新用户 {} 的微信小程序信息失败: {}", user.getUsername(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean scanQrCode(String token) {
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
redisUtil.delete(redisKey);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 只有pending状态才能更新为scanned
|
||||
if (QR_LOGIN_STATUS_PENDING.equals(qrLoginData.getStatus())) {
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_SCANNED);
|
||||
|
||||
// 计算剩余过期时间
|
||||
long remainingSeconds = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||
redisUtil.set(redisKey, qrLoginData, remainingSeconds, TimeUnit.SECONDS);
|
||||
|
||||
log.info("扫码登录token {} 状态更新为已扫码", token);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-报名记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-bm")
|
||||
public class BszxBmController extends BaseController {
|
||||
@Resource
|
||||
private BszxBmService bszxBmService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CmsArticleService cmsArticleService;
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "分页查询百色中学-报名记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxBm>> page(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "查询全部百色中学-报名记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxBm>> list(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "根据id查询百色中学-报名记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxBm> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@OperationLog
|
||||
@Operation(summary = "申请报名生成邀请函")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxBm bszxBm) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (bszxBm.getName() == null) {
|
||||
return fail("请填写姓名");
|
||||
}
|
||||
if (loginUser != null) {
|
||||
bszxBm.setUserId(loginUser.getUserId());
|
||||
if (bszxBmService.count(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId,loginUser.getUserId())) > 0) {
|
||||
return fail("您已经报名过了",null);
|
||||
}
|
||||
if (bszxBmService.save(bszxBm)) {
|
||||
cmsArticleService.saveInc(bszxBm.getFormId());
|
||||
return success("报名成功");
|
||||
}
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@OperationLog
|
||||
@Operation(summary = "修改报名信息")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxBm bszxBm) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser == null){
|
||||
return fail("请先登录");
|
||||
}
|
||||
if (bszxBmService.updateById(bszxBm)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除报名记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxBmService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-报名记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBm> list) {
|
||||
if (bszxBmService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-报名记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBm> batchParam) {
|
||||
if (batchParam.update(bszxBmService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-报名记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxBmService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询我的报名记录")
|
||||
@GetMapping("/myPage")
|
||||
public ApiResult<PageResult<BszxBm>> myPage(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
if (getLoginUser() != null) {
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(bszxBmService.pageRel(param));
|
||||
}
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取海报地址")
|
||||
@GetMapping("/generatePoster")
|
||||
public ApiResult<?> generatePoster() throws Exception {
|
||||
if (getLoginUser() == null) {
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, getLoginUser().getUserId()).last("limit 1"));
|
||||
return success("生成宣传海报",bszxBmService.generatePoster(bm));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-分部控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Tag(name = "百色中学-分部管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-branch")
|
||||
public class BszxBranchController extends BaseController {
|
||||
@Resource
|
||||
private BszxBranchService bszxBranchService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-分部")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxBranch>> page(BszxBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-分部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxBranch>> list(BszxBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-分部")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxBranch> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-分部")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxBranch bszxBranch) {
|
||||
if (bszxBranchService.save(bszxBranch)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-分部")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxBranch bszxBranch) {
|
||||
if (bszxBranchService.updateById(bszxBranch)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-分部")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxBranchService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-分部")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBranch> list) {
|
||||
if (bszxBranchService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-分部")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBranch> batchParam) {
|
||||
if (batchParam.update(bszxBranchService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-分部")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxBranchService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 百色中学-班级控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-班级管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-class")
|
||||
public class BszxClassController extends BaseController {
|
||||
@Resource
|
||||
private BszxClassService bszxClassService;
|
||||
@Resource
|
||||
private BszxGradeService bszxGradeService;
|
||||
@Resource
|
||||
private BszxBranchService bszxBranchService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-班级")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxClass>> page(BszxClassParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-班级")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxClass>> list(BszxClassParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-班级")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxClass> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "百色中学-年级班级数据")
|
||||
@GetMapping("/tree")
|
||||
public ApiResult<List<BszxBranch>> tree() {
|
||||
final List<BszxBranch> list = bszxBranchService.list();
|
||||
final BszxGradeParam bszxGradeParam = new BszxGradeParam();
|
||||
final List<BszxGrade> gradeList = bszxGradeService.listRel(bszxGradeParam);
|
||||
final BszxClassParam bszxClassParam = new BszxClassParam();
|
||||
final List<BszxClass> bszxClasseList = bszxClassService.listRel(bszxClassParam);
|
||||
final Map<Integer, List<BszxClass>> collectClass = bszxClasseList.stream().collect(Collectors.groupingBy(BszxClass::getGradeId));
|
||||
gradeList.forEach(d -> {
|
||||
d.setChildren(collectClass.get(d.getId()));
|
||||
});
|
||||
final Map<Integer, List<BszxGrade>> collectGrade = gradeList.stream().collect(Collectors.groupingBy(BszxGrade::getBranch));
|
||||
|
||||
list.forEach(d -> {
|
||||
d.setChildren(collectGrade.get(d.getId()));
|
||||
});
|
||||
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-班级")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxClass bszxClass) {
|
||||
if (bszxClassService.save(bszxClass)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-班级")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxClass bszxClass) {
|
||||
if (bszxClassService.updateById(bszxClass)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-班级")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxClassService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-班级")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxClass> list) {
|
||||
if (bszxClassService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-班级")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxClass> batchParam) {
|
||||
if (batchParam.update(bszxClassService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-班级")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxClassService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年代控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-年代管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-era")
|
||||
public class BszxEraController extends BaseController {
|
||||
@Resource
|
||||
private BszxEraService bszxEraService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-年代")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxEra>> page(BszxEraParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-年代")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxEra>> list(BszxEraParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-年代")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxEra> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-年代")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxEra bszxEra) {
|
||||
if (bszxEraService.save(bszxEra)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-年代")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxEra bszxEra) {
|
||||
if (bszxEraService.updateById(bszxEra)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-年代")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxEraService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-年代")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxEra> list) {
|
||||
if (bszxEraService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-年代")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxEra> batchParam) {
|
||||
if (batchParam.update(bszxEraService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-年代")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxEraService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年级控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-年级管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-grade")
|
||||
public class BszxGradeController extends BaseController {
|
||||
@Resource
|
||||
private BszxGradeService bszxGradeService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-年级")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxGrade>> page(BszxGradeParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-年级")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxGrade>> list(BszxGradeParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-年级")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxGrade> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-年级")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxGrade bszxGrade) {
|
||||
if (bszxGradeService.save(bszxGrade)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-年级")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxGrade bszxGrade) {
|
||||
if (bszxGradeService.updateById(bszxGrade)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-年级")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxGradeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-年级")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxGrade> list) {
|
||||
if (bszxGradeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-年级")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxGrade> batchParam) {
|
||||
if (batchParam.update(bszxGradeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-年级")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxGradeService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||
import com.gxwebsoft.shop.param.ShopOrderParam;
|
||||
import com.gxwebsoft.shop.service.ShopOrderService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 百色中学-订单管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-订单管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-order")
|
||||
public class BszxOrderController extends BaseController {
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
@Resource
|
||||
private BszxBmService bszxBmService;
|
||||
@Resource
|
||||
private ShopOrderService shopOrderService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-订单列表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopOrder>> page(ShopOrderParam param) {
|
||||
// 使用关联查询
|
||||
final PageResult<ShopOrder> result = shopOrderService.pageRel(param);
|
||||
if(!CollectionUtils.isEmpty(result.getList())){
|
||||
final Set<Integer> userIds = result.getList().stream().map(ShopOrder::getUserId).collect(Collectors.toSet());
|
||||
final List<BszxBm> bmList = bszxBmService.list(new LambdaQueryWrapper<BszxBm>().in(BszxBm::getUserId, userIds).isNotNull(BszxBm::getName));
|
||||
final Map<Integer, List<BszxBm>> collect = bmList.stream().collect(Collectors.groupingBy(BszxBm::getUserId));
|
||||
final Set<String> orderNos = result.getList().stream().map(ShopOrder::getOrderNo).collect(Collectors.toSet());
|
||||
final BszxPayParam bszxPayParam = new BszxPayParam();
|
||||
bszxPayParam.setOrderNos(orderNos);
|
||||
final List<BszxPay> bszxPays = bszxPayService.listRel(bszxPayParam);
|
||||
final Map<String, List<BszxPay>> collectByOrderNo = bszxPays.stream().collect(Collectors.groupingBy(BszxPay::getOrderNo));
|
||||
|
||||
result.getList().forEach(d -> {
|
||||
final List<BszxPay> pays = collectByOrderNo.get(d.getOrderNo());
|
||||
if(!CollectionUtils.isEmpty(pays)){
|
||||
d.setDeliveryStatus(20);
|
||||
}
|
||||
final List<BszxBm> bmList1 = collect.get(d.getUserId());
|
||||
if(!CollectionUtils.isEmpty(bmList1)){
|
||||
final BszxBm bm = bmList1.get(0);
|
||||
d.setBm(bm);
|
||||
d.setRealName(bm.getName());
|
||||
if(bm.getPhone() != null){
|
||||
d.setPhone(bm.getPhone());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "统计订单总金额")
|
||||
@GetMapping("/total")
|
||||
public ApiResult<BigDecimal> total() {
|
||||
try {
|
||||
BigDecimal totalAmount = bszxPayService.total();
|
||||
return success(totalAmount);
|
||||
} catch (Exception e) {
|
||||
// 异常时返回0,保持接口稳定性
|
||||
return success(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||
import com.wechat.pay.java.core.notification.*;
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.Payment;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||
import com.gxwebsoft.shop.service.ShopOrderService;
|
||||
import com.wechat.pay.java.core.notification.RequestParam;
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-捐款记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-pay")
|
||||
public class BszxPayController extends BaseController {
|
||||
public static JsapiService service;
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
@Resource
|
||||
private BszxBmService bszxBmService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private ShopOrderService shopOrderService;
|
||||
@Resource
|
||||
private ConfigProperties conf;
|
||||
@Value("${spring.profiles.active}")
|
||||
String active;
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||
@Operation(summary = "分页查询百色中学-捐款记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxPay>> page(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||
@Operation(summary = "查询全部百色中学-捐款记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxPay>> list(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||
@Operation(summary = "根据id查询百色中学-捐款记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxPay> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@OperationLog
|
||||
@Operation(summary = "活动捐款")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxPay bszxPay, HttpServletRequest request) {
|
||||
if (bszxPay.getPrice().compareTo(BigDecimal.ZERO) == 0) {
|
||||
return fail("金额不能为0");
|
||||
}
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
bszxPay.setUserId(loginUser.getUserId());
|
||||
// 微信openid(必填)
|
||||
if (StrUtil.isBlank(loginUser.getOpenid())) {
|
||||
return fail("微信openid(必填)");
|
||||
}
|
||||
final BszxBm bmInfo = bszxBmService.getByUserId(loginUser.getUserId());
|
||||
bszxPay.setName(bmInfo.getName());
|
||||
bszxPay.setSex(bmInfo.getSex());
|
||||
bszxPay.setPhone(bmInfo.getPhone());
|
||||
bszxPay.setBranchName(bmInfo.getBranchName());
|
||||
bszxPay.setGradeName(bmInfo.getGradeName());
|
||||
bszxPay.setClassName(bmInfo.getClassName());
|
||||
bszxPay.setAddress(bmInfo.getAddress());
|
||||
bszxPay.setWorkUnit(bmInfo.getWorkUnit());
|
||||
bszxPay.setPosition(bmInfo.getPosition());
|
||||
bszxPay.setAge(bmInfo.getAge());
|
||||
bszxPay.setNumber(bmInfo.getNumber());
|
||||
}
|
||||
if (bszxPayService.save(bszxPay)) {
|
||||
// 调起支付
|
||||
return success("下单成功", bszxPay);
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-捐款记录")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxPay bszxPay) {
|
||||
if (bszxPayService.updateById(bszxPay)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-捐款记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxPayService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-捐款记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPay> list) {
|
||||
if (bszxPayService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-捐款记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPay> batchParam) {
|
||||
if (batchParam.update(bszxPayService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-捐款记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxPayService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询我的报名记录")
|
||||
@GetMapping("/myPage")
|
||||
public ApiResult<PageResult<BszxPay>> myPage(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
if (getLoginUser() != null) {
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(bszxPayService.pageRel(param));
|
||||
}
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
|
||||
@Operation(summary = "统计捐款总金额与人次")
|
||||
@GetMapping("/getCount")
|
||||
public ApiResult<?> getCount() {
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
final BigDecimal bigDecimal = bszxPayService.sumMoney(wrapper);
|
||||
Long count = (long) bszxPayService.count(new LambdaQueryWrapper<BszxPay>());
|
||||
map.put("numbers", count);
|
||||
map.put("totalMoney", bigDecimal);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@Schema(description = "异步通知")
|
||||
@PostMapping("/notify/{tenantId}")
|
||||
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body,HttpServletRequest request, @PathVariable("tenantId") Integer tenantId) {
|
||||
// 获取支付配置信息用于解密 - 优先使用 Payment:1* 格式
|
||||
String key = "Payment:11"; // 微信支付类型为1,使用 Payment:11 格式
|
||||
Payment payment = redisUtil.get(key, Payment.class);
|
||||
|
||||
// 如果 Payment:1* 格式不存在,尝试原有格式
|
||||
if (payment == null) {
|
||||
String fallbackKey = "Payment:1:".concat(tenantId.toString());
|
||||
payment = redisUtil.get(fallbackKey, Payment.class);
|
||||
}
|
||||
String uploadPath = conf.getUploadPath();
|
||||
|
||||
// 开发环境
|
||||
String mid = "1242289702";
|
||||
String apiV3Key = "0b2996803383c3e3391abd9183b54key";
|
||||
String serialNumber = "3B458EB14A28160DC094431A21C0508EFA712D1C";
|
||||
String privateKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_key.pem";
|
||||
String apiclientCert = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_cert.pem";
|
||||
String pubKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/0f65a8517c284acb90aa83dd0c23e8f6.pem";
|
||||
String pubId = "PUB_KEY_ID_0112422897022025011300326200001208";
|
||||
// 生产环境
|
||||
if (ObjectUtil.isNotEmpty(payment)) {
|
||||
// 检查 payment 字段是否为空,并避免直接解析为数字
|
||||
mid = payment.getMchId();
|
||||
apiV3Key = payment.getApiKey();
|
||||
serialNumber = payment.getMerchantSerialNumber();
|
||||
// 生产环境使用容器证书路径 /www/wwwroot/file.ws
|
||||
privateKey = "/www/wwwroot/file.ws" + payment.getApiclientKey();
|
||||
apiclientCert = "/www/wwwroot/file.ws" + payment.getApiclientCert();
|
||||
pubKey = "/www/wwwroot/file.ws" + payment.getPubKey();
|
||||
pubId = payment.getPubKeyId();
|
||||
}
|
||||
RequestParam requestParam = new RequestParam.Builder()
|
||||
.serialNumber(header.get("wechatpay-serial"))
|
||||
.nonce(header.get("wechatpay-nonce"))
|
||||
.signature(header.get("wechatpay-signature"))
|
||||
.timestamp(header.get("wechatpay-timestamp"))
|
||||
.body(body)
|
||||
.build();
|
||||
|
||||
|
||||
// NotificationConfig config = new RSAPublicKeyConfig.Builder()
|
||||
// .merchantId(mid)
|
||||
// .publicKeyFromPath(pubKey)
|
||||
// .publicKeyId(pubId)
|
||||
// .privateKeyFromPath(privateKey)
|
||||
// .merchantSerialNumber(serialNumber)
|
||||
// .apiV3Key(apiV3Key)
|
||||
// .build();
|
||||
|
||||
NotificationConfig config = new RSAPublicKeyNotificationConfig.Builder()
|
||||
.publicKeyFromPath(pubKey)
|
||||
.publicKeyId(pubId)
|
||||
.apiV3Key(apiV3Key)
|
||||
.build();
|
||||
|
||||
|
||||
// 初始化 NotificationParser
|
||||
NotificationParser parser = new NotificationParser(config);
|
||||
|
||||
// 以支付通知回调为例,验签、解密并转换成 Transaction
|
||||
try {
|
||||
Transaction transaction = parser.parse(requestParam, Transaction.class);
|
||||
final String outTradeNo = transaction.getOutTradeNo();
|
||||
final String transactionId = transaction.getTransactionId();
|
||||
final Integer total = transaction.getAmount().getTotal();
|
||||
final String tradeStateDesc = transaction.getTradeStateDesc();
|
||||
final Transaction.TradeStateEnum tradeState = transaction.getTradeState();
|
||||
final Transaction.TradeTypeEnum tradeType = transaction.getTradeType();
|
||||
System.out.println("transaction = " + transaction);
|
||||
System.out.println("tradeStateDesc = " + tradeStateDesc);
|
||||
System.out.println("tradeType = " + tradeType);
|
||||
System.out.println("tradeState = " + tradeState);
|
||||
System.out.println("outTradeNo = " + outTradeNo);
|
||||
System.out.println("amount = " + total);
|
||||
|
||||
if (StrUtil.equals("支付成功", tradeStateDesc)) {
|
||||
// 1. 查询要处理的订单
|
||||
ShopOrder order = shopOrderService.getByOutTradeNo(outTradeNo);
|
||||
// 2. 已支付则跳过
|
||||
if (order.getPayStatus().equals(true)) {
|
||||
return "SUCCESS";
|
||||
}
|
||||
// 2. 未支付则处理更新订单状态
|
||||
if (order.getPayStatus().equals(false)) {
|
||||
// 5. TODO 处理订单状态
|
||||
order.setPayTime(LocalDateTime.now());
|
||||
order.setPayStatus(true);
|
||||
order.setTransactionId(transactionId);
|
||||
order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
||||
order.setExpirationTime(LocalDateTime.now().plusYears(10));
|
||||
System.out.println("实际付款金额 = " + order.getPayPrice());
|
||||
return "SUCCESS";
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
System.out.println($e.getMessage());
|
||||
System.out.println(Arrays.toString($e.getStackTrace()));
|
||||
}
|
||||
|
||||
return "fail";
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopOrder:update')")
|
||||
@Operation(summary = "修复订单")
|
||||
@PutMapping("/repair")
|
||||
public ApiResult<?> repair(@RequestBody ShopOrder shopOrder) {
|
||||
if (shopOrderService.queryOrderByOutTradeNo(shopOrder)) {
|
||||
if (bszxPayService.count(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getOrderNo, shopOrder.getOrderNo())) == 0) {
|
||||
final BszxPay bszxPay = new BszxPay();
|
||||
final BszxBm bm = shopOrder.getBm();
|
||||
if (ObjectUtil.isNotEmpty(bm)) {
|
||||
bszxPay.setName(bm.getName());
|
||||
bszxPay.setSex(bm.getSex());
|
||||
bszxPay.setClassName(bm.getClassName());
|
||||
bszxPay.setGradeName(bm.getGradeName());
|
||||
bszxPay.setAddress(bm.getAddress());
|
||||
bszxPay.setWorkUnit(bm.getWorkUnit());
|
||||
bszxPay.setPosition(bm.getPosition());
|
||||
bszxPay.setPrice(shopOrder.getPayPrice());
|
||||
bszxPay.setOrderNo(shopOrder.getOrderNo());
|
||||
bszxPay.setUserId(shopOrder.getUserId());
|
||||
bszxPay.setFormId(shopOrder.getFormId());
|
||||
bszxPay.setComments(shopOrder.getComments());
|
||||
bszxPayService.save(bszxPay);
|
||||
}
|
||||
shopOrder.setOrderStatus(1);
|
||||
shopOrderService.updateById(shopOrder);
|
||||
}
|
||||
return success("修复成功");
|
||||
}
|
||||
return fail("修复失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取捐款证书")
|
||||
@GetMapping("/generatePayCert/{id}")
|
||||
public ApiResult<?> generatePayCert(@PathVariable("id") Integer id) throws Exception {
|
||||
return success("获取捐款证书", bszxPayService.generatePayCert(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Tag(name = "百色中学-捐款排行管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-pay-ranking")
|
||||
public class BszxPayRankingController extends BaseController {
|
||||
@Resource
|
||||
private BszxPayRankingService bszxPayRankingService;
|
||||
@Resource
|
||||
private CmsArticleService cmsArticleService;
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
@Resource
|
||||
private BszxClassService bszxClassService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||
@Operation(summary = "分页查询百色中学-捐款排行")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxPayRanking>> page(BszxPayRankingParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||
@Operation(summary = "查询全部百色中学-捐款排行")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxPayRanking>> list(BszxPayRankingParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-捐款排行榜")
|
||||
@GetMapping("/ranking")
|
||||
public ApiResult<List<BszxPayRanking>> ranking(BszxPayRankingParam param) {
|
||||
final ArrayList<BszxPayRanking> rankings = new ArrayList<>();
|
||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
final List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().eq(CmsArticle::getCategoryId, 2444));
|
||||
|
||||
list.forEach(item -> {
|
||||
final BszxPayRanking ranking = new BszxPayRanking();
|
||||
wrapper.clear();
|
||||
// 按时间段查询
|
||||
if(param.getCreateTimeStart() != null && param.getCreateTimeEnd() != null){
|
||||
final String timeStart = param.getCreateTimeStart();
|
||||
final String timeEnd = param.getCreateTimeEnd();
|
||||
wrapper.ge(BszxPay::getCreateTime, timeStart);
|
||||
wrapper.le(BszxPay::getCreateTime, timeEnd);
|
||||
}
|
||||
wrapper.eq(BszxPay::getFormId, item.getArticleId());
|
||||
ranking.setFormId(item.getArticleId());
|
||||
ranking.setFormName(item.getTitle());
|
||||
ranking.setNumber((long) bszxPayService.count(wrapper));
|
||||
ranking.setTotalPrice(bszxPayService.sumMoney(wrapper));
|
||||
rankings.add(ranking);
|
||||
});
|
||||
// totalPrice按大到小排序
|
||||
rankings.sort((o1, o2) -> o2.getTotalPrice().compareTo(o1.getTotalPrice()));
|
||||
return success(rankings);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询全部百色中学-千班万元")
|
||||
@GetMapping("/ranking2")
|
||||
public ApiResult<List<BszxClass>> ranking2(BszxClassParam param) {
|
||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
final List<BszxClass> list = bszxClassService.listRel(param);
|
||||
|
||||
String key = "BSZX:UpdateRanking2";
|
||||
final String isTimeOut = redisUtil.get(key);
|
||||
if(StrUtil.isNotBlank(isTimeOut)){
|
||||
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
||||
return success(list);
|
||||
}
|
||||
list.forEach(item -> {
|
||||
wrapper.clear();
|
||||
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
||||
wrapper.eq(BszxPay::getClassName, item.getName());
|
||||
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
||||
bszxClassService.updateById(item);
|
||||
});
|
||||
// totalPrice按大到小排序
|
||||
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
||||
redisUtil.set(key, 1,1L, TimeUnit.DAYS);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||
@Operation(summary = "根据id查询百色中学-捐款排行")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxPayRanking> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-捐款排行")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||
if (bszxPayRankingService.save(bszxPayRanking)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-捐款排行")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||
if (bszxPayRankingService.updateById(bszxPayRanking)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-捐款排行")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxPayRankingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-捐款排行")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPayRanking> list) {
|
||||
if (bszxPayRankingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-捐款排行")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPayRanking> batchParam) {
|
||||
if (batchParam.update(bszxPayRankingService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-捐款排行")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxPayRankingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
151
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
151
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
@@ -0,0 +1,151 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxBm对象", description = "百色中学-报名记录")
|
||||
public class BszxBm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0校友 1单位 2爱心人士")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private String sex;
|
||||
|
||||
@Schema(description = "性别名称")
|
||||
@TableField(exist = false)
|
||||
private String sexName;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "班级ID")
|
||||
private Integer classId;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "分部ID")
|
||||
private Integer branchId;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
@TableField(exist = false)
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "是否能到场")
|
||||
private String present;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "人数")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "生成的邀请函存放路径")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private LocalDate dateTime;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "活动名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "文章对象")
|
||||
@TableField(exist = false)
|
||||
private CmsArticle article;
|
||||
|
||||
public String getSexName() {
|
||||
if (this.sex == null) {
|
||||
return "";
|
||||
}
|
||||
return this.sex.equals("1") ? "男" : "女";
|
||||
}
|
||||
|
||||
}
|
||||
43
src/main/java/com/gxwebsoft/bszx/entity/BszxBranch.java
Normal file
43
src/main/java/com/gxwebsoft/bszx/entity/BszxBranch.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-分部
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxBranch对象", description = "百色中学-分部")
|
||||
public class BszxBranch implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "分部名称 ")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@TableField(exist = false)
|
||||
private List<BszxGrade> children;
|
||||
|
||||
}
|
||||
70
src/main/java/com/gxwebsoft/bszx/entity/BszxClass.java
Normal file
70
src/main/java/com/gxwebsoft/bszx/entity/BszxClass.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-班级
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxClass对象", description = "百色中学-班级")
|
||||
public class BszxClass implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "时代ID")
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "时代名称")
|
||||
@TableField(exist = false)
|
||||
private String eraName;
|
||||
|
||||
@Schema(description = "年级ID")
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "年级名称")
|
||||
@TableField(exist = false)
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "累计捐款金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
@TableField(exist = false)
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@TableField(exist = false)
|
||||
private List<BszxClass> children;
|
||||
}
|
||||
43
src/main/java/com/gxwebsoft/bszx/entity/BszxEra.java
Normal file
43
src/main/java/com/gxwebsoft/bszx/entity/BszxEra.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年代
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxEra对象", description = "百色中学-年代")
|
||||
public class BszxEra implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@TableField(exist = false)
|
||||
private List<BszxGrade> children;
|
||||
|
||||
}
|
||||
53
src/main/java/com/gxwebsoft/bszx/entity/BszxGrade.java
Normal file
53
src/main/java/com/gxwebsoft/bszx/entity/BszxGrade.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年级
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxGrade对象", description = "百色中学-年级")
|
||||
public class BszxGrade implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@TableField(exist = false)
|
||||
private List<BszxClass> children;
|
||||
|
||||
}
|
||||
143
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
143
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
@@ -0,0 +1,143 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxPay对象", description = "百色中学-捐款记录")
|
||||
public class BszxPay implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private String sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "付费金额")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private LocalDate dateTime;
|
||||
|
||||
@Schema(description = "捐赠证书")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "来源表ID")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "活动名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "文章")
|
||||
@TableField(exist = false)
|
||||
private CmsArticle article;
|
||||
|
||||
@Schema(description = "订单")
|
||||
@TableField(exist = false)
|
||||
private ShopOrder shopOrder;
|
||||
|
||||
public String getSexName() {
|
||||
return this.sex.equals("1") ? "男" : "女";
|
||||
}
|
||||
|
||||
}
|
||||
67
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
67
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.gxwebsoft.bszx.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxPayRanking对象", description = "百色中学-捐款排行")
|
||||
public class BszxPayRanking implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "来源表ID(文章ID)")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Long number;
|
||||
|
||||
@Schema(description = "获得捐款总金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxBmMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxBmMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxBmMapper extends BaseMapper<BszxBm> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxBm>
|
||||
*/
|
||||
List<BszxBm> selectPageRel(@Param("page") IPage<BszxBm> page,
|
||||
@Param("param") BszxBmParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxBm> selectListRel(@Param("param") BszxBmParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-分部Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
public interface BszxBranchMapper extends BaseMapper<BszxBranch> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxBranch>
|
||||
*/
|
||||
List<BszxBranch> selectPageRel(@Param("page") IPage<BszxBranch> page,
|
||||
@Param("param") BszxBranchParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxBranch> selectListRel(@Param("param") BszxBranchParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxClassMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxClassMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-班级Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxClassMapper extends BaseMapper<BszxClass> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxClass>
|
||||
*/
|
||||
List<BszxClass> selectPageRel(@Param("page") IPage<BszxClass> page,
|
||||
@Param("param") BszxClassParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxClass> selectListRel(@Param("param") BszxClassParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxEraMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxEraMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年代Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxEraMapper extends BaseMapper<BszxEra> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxEra>
|
||||
*/
|
||||
List<BszxEra> selectPageRel(@Param("page") IPage<BszxEra> page,
|
||||
@Param("param") BszxEraParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxEra> selectListRel(@Param("param") BszxEraParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxGradeMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxGradeMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年级Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxGradeMapper extends BaseMapper<BszxGrade> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxGrade>
|
||||
*/
|
||||
List<BszxGrade> selectPageRel(@Param("page") IPage<BszxGrade> page,
|
||||
@Param("param") BszxGradeParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxGrade> selectListRel(@Param("param") BszxGradeParam param);
|
||||
|
||||
}
|
||||
42
src/main/java/com/gxwebsoft/bszx/mapper/BszxPayMapper.java
Normal file
42
src/main/java/com/gxwebsoft/bszx/mapper/BszxPayMapper.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxPayMapper extends BaseMapper<BszxPay> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxPay>
|
||||
*/
|
||||
List<BszxPay> selectPageRel(@Param("page") IPage<BszxPay> page,
|
||||
@Param("param") BszxPayParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxPay> selectListRel(@Param("param") BszxPayParam param);
|
||||
|
||||
BigDecimal selectSumMoney(@Param("ew") Wrapper<?> wrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
public interface BszxPayRankingMapper extends BaseMapper<BszxPayRanking> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BszxPayRanking>
|
||||
*/
|
||||
List<BszxPayRanking> selectPageRel(@Param("page") IPage<BszxPayRanking> page,
|
||||
@Param("param") BszxPayRankingParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BszxPayRanking> selectListRel(@Param("param") BszxPayRankingParam param);
|
||||
|
||||
}
|
||||
113
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxBmMapper.xml
Normal file
113
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxBmMapper.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxBmMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.title as formName, c.name as branchName, u.phone as mobile,u.avatar,u.nickname
|
||||
FROM bszx_bm a
|
||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||
LEFT JOIN bszx_branch c ON a.branch_id = c.id
|
||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.sex != null">
|
||||
AND a.sex = #{param.sex}
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.branchId != null">
|
||||
AND a.branch_id = #{param.branchId}
|
||||
</if>
|
||||
<if test="param.className != null">
|
||||
AND a.class_name LIKE CONCAT('%', #{param.className}, '%')
|
||||
</if>
|
||||
<if test="param.gradeName != null">
|
||||
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.workUnit != null">
|
||||
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
||||
</if>
|
||||
<if test="param.position != null">
|
||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||
</if>
|
||||
<if test="param.present != null">
|
||||
AND a.present = #{param.present}
|
||||
</if>
|
||||
<if test="param.age != null">
|
||||
AND a.age = #{param.age}
|
||||
</if>
|
||||
<if test="param.number != null">
|
||||
AND a.number = #{param.number}
|
||||
</if>
|
||||
<if test="param.extra != null">
|
||||
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
||||
</if>
|
||||
<if test="param.certificate != null">
|
||||
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
||||
</if>
|
||||
<if test="param.dateTime != null">
|
||||
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
||||
</if>
|
||||
<if test="param.formData != null">
|
||||
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
||||
</if>
|
||||
<if test="param.formId != null">
|
||||
AND a.form_id = #{param.formId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.phone = #{param.keywords}
|
||||
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxBranchMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM bszx_branch a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxClassMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.name as gradeName, c.name as eraName, d.name as branchName
|
||||
FROM bszx_class a
|
||||
LEFT JOIN bszx_grade b ON a.grade_id = b.id
|
||||
LEFT JOIN bszx_era c ON a.era_id = c.id
|
||||
LEFT JOIN bszx_branch d ON a.branch = d.id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.eraId != null">
|
||||
AND a.era_id = #{param.eraId}
|
||||
</if>
|
||||
<if test="param.gradeId != null">
|
||||
AND a.grade_id = #{param.gradeId}
|
||||
</if>
|
||||
<if test="param.gradeName != null">
|
||||
AND b.name = #{param.gradeName}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name = #{param.name}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.branch != null">
|
||||
AND a.branch = #{param.branch}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxEraMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM bszx_era a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxGradeMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM bszx_grade a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.eraId != null">
|
||||
AND a.era_id = #{param.eraId}
|
||||
</if>
|
||||
<if test="param.branch != null">
|
||||
AND a.branch = #{param.branch}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
126
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxPayMapper.xml
Normal file
126
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxPayMapper.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxPayMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.title as formName,u.phone as mobile,u.avatar,u.nickname
|
||||
FROM bszx_pay a
|
||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.age != null">
|
||||
AND a.age = #{param.age}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.sex != null">
|
||||
AND a.sex = #{param.sex}
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.className != null">
|
||||
AND a.class_name = #{param.className}
|
||||
</if>
|
||||
<if test="param.gradeName != null">
|
||||
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.workUnit != null">
|
||||
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
||||
</if>
|
||||
<if test="param.position != null">
|
||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||
</if>
|
||||
<if test="param.number != null">
|
||||
AND a.number = #{param.number}
|
||||
</if>
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.extra != null">
|
||||
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
||||
</if>
|
||||
<if test="param.orderNo != null">
|
||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||
</if>
|
||||
<if test="param.dateTime != null">
|
||||
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
||||
</if>
|
||||
<if test="param.certificate != null">
|
||||
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
||||
</if>
|
||||
<if test="param.formData != null">
|
||||
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
||||
</if>
|
||||
<if test="param.formId != null">
|
||||
AND a.form_id = #{param.formId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.orderNos != null">
|
||||
AND a.order_no IN
|
||||
<foreach collection="param.orderNos" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR u.phone = #{param.keywords}
|
||||
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.order_no = #{param.keywords}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 统计金额总和 -->
|
||||
<select id="selectSumMoney" resultType="java.math.BigDecimal">
|
||||
SELECT COALESCE(SUM(price), 0) as total_money
|
||||
FROM bszx_pay
|
||||
<if test="ew != null">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.gxwebsoft.bszx.mapper.BszxPayRankingMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.title as formName
|
||||
FROM bszx_pay_ranking a
|
||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.formId != null">
|
||||
AND a.form_id = #{param.formId}
|
||||
</if>
|
||||
<if test="param.number != null">
|
||||
AND a.number = #{param.number}
|
||||
</if>
|
||||
<if test="param.totalPrice != null">
|
||||
AND a.total_price = #{param.totalPrice}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
114
src/main/java/com/gxwebsoft/bszx/param/BszxBmParam.java
Normal file
114
src/main/java/com/gxwebsoft/bszx/param/BszxBmParam.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxBmParam对象", description = "百色中学-报名记录查询参数")
|
||||
public class BszxBmParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0校友 1单位")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "分部ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branchId;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "是否能到场")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean present;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "人数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "生成的邀请函存放路径")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private String dateTime;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@QueryField(type = QueryType.LIKE)
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/param/BszxBranchParam.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/param/BszxBranchParam.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-分部查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxBranchParam对象", description = "百色中学-分部查询参数")
|
||||
public class BszxBranchParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "分部名称 ")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
64
src/main/java/com/gxwebsoft/bszx/param/BszxClassParam.java
Normal file
64
src/main/java/com/gxwebsoft/bszx/param/BszxClassParam.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-班级查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxClassParam对象", description = "百色中学-班级查询参数")
|
||||
public class BszxClassParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "时代ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "年级ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "年级")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "累计捐款金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分部")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/bszx/param/BszxEraParam.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/param/BszxEraParam.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年代查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxEraParam对象", description = "百色中学-年代查询参数")
|
||||
public class BszxEraParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
52
src/main/java/com/gxwebsoft/bszx/param/BszxGradeParam.java
Normal file
52
src/main/java/com/gxwebsoft/bszx/param/BszxGradeParam.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年级查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxGradeParam对象", description = "百色中学-年级查询参数")
|
||||
public class BszxGradeParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "年代")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "分部")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
118
src/main/java/com/gxwebsoft/bszx/param/BszxPayParam.java
Normal file
118
src/main/java/com/gxwebsoft/bszx/param/BszxPayParam.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxPayParam对象", description = "百色中学-捐款记录查询参数")
|
||||
public class BszxPayParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "付费金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@QueryField(type = QueryType.IN)
|
||||
private Set<String> orderNos;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private String dateTime;
|
||||
|
||||
@Schema(description = "捐赠证书")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "来源表ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "登录用户")
|
||||
@TableField(exist = false)
|
||||
private User loginUser;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gxwebsoft.bszx.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxPayRankingParam对象", description = "百色中学-捐款排行查询参数")
|
||||
public class BszxPayRankingParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "来源表ID(项目名称)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "获得捐款总金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
50
src/main/java/com/gxwebsoft/bszx/service/BszxBmService.java
Normal file
50
src/main/java/com/gxwebsoft/bszx/service/BszxBmService.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxBmService extends IService<BszxBm> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxBm>
|
||||
*/
|
||||
PageResult<BszxBm> pageRel(BszxBmParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxBm>
|
||||
*/
|
||||
List<BszxBm> listRel(BszxBmParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 自增ID
|
||||
* @return BszxBm
|
||||
*/
|
||||
BszxBm getByIdRel(Integer id);
|
||||
|
||||
/**
|
||||
* 生成海报
|
||||
*/
|
||||
String generatePoster(BszxBm bm) throws Exception;
|
||||
|
||||
BszxBm getByUserId(Integer userId);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-分部Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
public interface BszxBranchService extends IService<BszxBranch> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxBranch>
|
||||
*/
|
||||
PageResult<BszxBranch> pageRel(BszxBranchParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxBranch>
|
||||
*/
|
||||
List<BszxBranch> listRel(BszxBranchParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxBranch
|
||||
*/
|
||||
BszxBranch getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-班级Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxClassService extends IService<BszxClass> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxClass>
|
||||
*/
|
||||
PageResult<BszxClass> pageRel(BszxClassParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxClass>
|
||||
*/
|
||||
List<BszxClass> listRel(BszxClassParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxClass
|
||||
*/
|
||||
BszxClass getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
42
src/main/java/com/gxwebsoft/bszx/service/BszxEraService.java
Normal file
42
src/main/java/com/gxwebsoft/bszx/service/BszxEraService.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年代Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxEraService extends IService<BszxEra> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxEra>
|
||||
*/
|
||||
PageResult<BszxEra> pageRel(BszxEraParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxEra>
|
||||
*/
|
||||
List<BszxEra> listRel(BszxEraParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxEra
|
||||
*/
|
||||
BszxEra getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年级Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxGradeService extends IService<BszxGrade> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxGrade>
|
||||
*/
|
||||
PageResult<BszxGrade> pageRel(BszxGradeParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxGrade>
|
||||
*/
|
||||
List<BszxGrade> listRel(BszxGradeParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxGrade
|
||||
*/
|
||||
BszxGrade getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
public interface BszxPayRankingService extends IService<BszxPayRanking> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxPayRanking>
|
||||
*/
|
||||
PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxPayRanking>
|
||||
*/
|
||||
List<BszxPayRanking> listRel(BszxPayRankingParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxPayRanking
|
||||
*/
|
||||
BszxPayRanking getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
57
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
57
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.gxwebsoft.bszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
public interface BszxPayService extends IService<BszxPay> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<BszxPay>
|
||||
*/
|
||||
PageResult<BszxPay> pageRel(BszxPayParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<BszxPay>
|
||||
*/
|
||||
List<BszxPay> listRel(BszxPayParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return BszxPay
|
||||
*/
|
||||
BszxPay getByIdRel(Integer id);
|
||||
|
||||
/**
|
||||
* 生成捐款证书
|
||||
*/
|
||||
String generatePayCert(Integer id) throws Exception;
|
||||
|
||||
BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> between);
|
||||
|
||||
/**
|
||||
* 统计捐款总金额
|
||||
*
|
||||
* @return 捐款总金额
|
||||
*/
|
||||
BigDecimal total();
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.freewayso.image.combiner.ImageCombiner;
|
||||
import com.freewayso.image.combiner.enums.OutputFormat;
|
||||
|
||||
import java.awt.Font;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.mapper.BszxBmMapper;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.utils.FileServerUtil;
|
||||
import com.gxwebsoft.common.core.utils.ImageUtil;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Service
|
||||
public class BszxBmServiceImpl extends ServiceImpl<BszxBmMapper, BszxBm> implements BszxBmService {
|
||||
@Value("${config.upload-path}")
|
||||
private String uploadPath;
|
||||
@Value("${config.file-server}")
|
||||
private String fileServer;
|
||||
@Resource
|
||||
private ConfigProperties config;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CmsArticleService cmsArticleService;
|
||||
@Resource
|
||||
private BszxClassService bszxClassService;
|
||||
|
||||
@Override
|
||||
public PageResult<BszxBm> pageRel(BszxBmParam param) {
|
||||
PageParam<BszxBm, BszxBmParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("id desc");
|
||||
List<BszxBm> list = baseMapper.selectPageRel(page, param);
|
||||
list.forEach(d -> {
|
||||
if(d.getClassId().equals(0)){
|
||||
final BszxClassParam classParam = new BszxClassParam();
|
||||
classParam.setGradeName(d.getGradeName());
|
||||
classParam.setName(d.getClassName());
|
||||
final List<BszxClass> bszxClasses = bszxClassService.listRel(classParam);
|
||||
if (!CollectionUtils.isEmpty(bszxClasses)) {
|
||||
BszxClass bszxClass = bszxClasses.get(0);
|
||||
d.setClassId(bszxClass.getId());
|
||||
d.setBranchId(bszxClass.getBranch());
|
||||
updateById(d);
|
||||
}
|
||||
}
|
||||
});
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxBm> listRel(BszxBmParam param) {
|
||||
List<BszxBm> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxBm, BszxBmParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("id desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxBm getByIdRel(Integer id) {
|
||||
BszxBmParam param = new BszxBmParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String generatePoster(BszxBm item) throws Exception {
|
||||
final CmsArticle article = cmsArticleService.getById(7859);
|
||||
if (ObjectUtil.isEmpty(article)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(item)) {
|
||||
|
||||
// 百色一小项目
|
||||
if(item.getTenantId().equals(10547)){
|
||||
return "https://oss.wsdns.cn/20250915/721b1e49e9924f3a83d7c32186bae16d.png";
|
||||
}
|
||||
|
||||
// 百色中学
|
||||
// Font font = new Font("阿里巴巴普惠体", Font.PLAIN, 40);
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
final ImageCombiner combiner = getImageCombiner(item, article);
|
||||
|
||||
if (!FileUtil.exist(uploadPath + "/poster/" + item.getTenantId() + "/bm")) {
|
||||
FileUtil.mkdir(uploadPath + "/poster/" + item.getTenantId() + "/bm");
|
||||
}
|
||||
String basePath = "/poster/" + item.getTenantId() + "/bm/big-" + item.getId() + ".jpg";
|
||||
String smallPath = "/poster/" + item.getTenantId() + "/bm/" + item.getId() + ".jpg";
|
||||
String filename = uploadPath + basePath;
|
||||
String smallFileName = uploadPath + smallPath;
|
||||
combiner.save(filename);
|
||||
|
||||
File input = new File(filename);
|
||||
File output = new File(smallFileName);
|
||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||
if(input.exists()){
|
||||
input.delete();
|
||||
}
|
||||
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static ImageCombiner getImageCombiner(BszxBm item, CmsArticle article) throws Exception {
|
||||
ImageCombiner combiner = new ImageCombiner(article.getAddress(), OutputFormat.JPG);
|
||||
|
||||
// 创建支持中文的字体
|
||||
Font chineseFont = createChineseFont(30);
|
||||
|
||||
//加文本元素:姓名
|
||||
// if (item.getType().equals(0)) {
|
||||
// combiner.addTextElement(item.getName().concat(" 校友"), 40, 220, 540);
|
||||
// } else {
|
||||
// combiner.addTextElement(item.getName(), 40, 220, 540);
|
||||
// }
|
||||
|
||||
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
||||
//加图片元素:盖章
|
||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
||||
|
||||
// 使用支持中文的字体添加文本
|
||||
if (item.getType().equals(0)) {
|
||||
combiner.addTextElement(item.getName().concat(" 校友"), chineseFont, 160, 1008);
|
||||
} else {
|
||||
combiner.addTextElement(item.getName(), chineseFont, 160, 1008);
|
||||
}
|
||||
|
||||
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
||||
//加图片元素:盖章
|
||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
||||
//执行图片合并
|
||||
combiner.combine();
|
||||
return combiner;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支持中文的字体
|
||||
* @param fontSize 字体大小
|
||||
* @return Font对象
|
||||
*/
|
||||
private static Font createChineseFont(int fontSize) {
|
||||
try {
|
||||
// 尝试使用系统中文字体
|
||||
String[] chineseFonts = {
|
||||
"Alibaba PuHuiTi 2.0",
|
||||
"PingFang SC", // 苹方 (macOS) - 优先使用
|
||||
"STHeiti", // 华文黑体 (macOS)
|
||||
"Hiragino Sans GB", // 冬青黑体 (macOS)
|
||||
"Microsoft YaHei", // 微软雅黑 (Windows)
|
||||
"SimHei", // 黑体 (Windows)
|
||||
"SimSun", // 宋体 (Windows)
|
||||
"WenQuanYi Micro Hei", // 文泉驿微米黑 (Linux)
|
||||
"Noto Sans CJK SC", // 思源黑体 (Linux)
|
||||
"Arial Unicode MS", // 支持Unicode的Arial
|
||||
"DejaVu Sans" // 备用字体
|
||||
};
|
||||
|
||||
for (String fontName : chineseFonts) {
|
||||
Font font = new Font(fontName, Font.PLAIN, fontSize);
|
||||
// 检查字体是否能正确显示中文
|
||||
if (font.canDisplay('中') && font.canDisplay('文')) {
|
||||
System.out.println("✓ 成功使用字体: " + fontName + " (字号: " + fontSize + ")");
|
||||
return font;
|
||||
} else {
|
||||
System.out.println("✗ 字体不支持中文: " + fontName);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有找到合适的字体,尝试加载系统默认中文字体
|
||||
System.out.println("⚠ 警告:未找到预定义的中文字体,尝试使用系统默认字体");
|
||||
|
||||
// 尝试使用逻辑字体名称,这些在Java中通常会映射到系统字体
|
||||
String[] logicalFonts = {"SansSerif", "Serif", "Monospaced", "Dialog", "DialogInput"};
|
||||
for (String logicalFont : logicalFonts) {
|
||||
Font font = new Font(logicalFont, Font.PLAIN, fontSize);
|
||||
if (font.canDisplay('中') && font.canDisplay('文')) {
|
||||
System.out.println("✓ 使用逻辑字体: " + logicalFont);
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
// 最后的备选方案
|
||||
System.err.println("❌ 严重警告:系统中没有找到任何支持中文的字体!请安装中文字体包。");
|
||||
return new Font("SansSerif", Font.PLAIN, fontSize);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("❌ 创建中文字体失败: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return new Font("SansSerif", Font.PLAIN, fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxBm getByUserId(Integer userId) {
|
||||
return getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, userId).last("limit 1"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.bszx.mapper.BszxBranchMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-分部Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Service
|
||||
public class BszxBranchServiceImpl extends ServiceImpl<BszxBranchMapper, BszxBranch> implements BszxBranchService {
|
||||
|
||||
@Override
|
||||
public PageResult<BszxBranch> pageRel(BszxBranchParam param) {
|
||||
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<BszxBranch> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxBranch> listRel(BszxBranchParam param) {
|
||||
List<BszxBranch> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxBranch getByIdRel(Integer id) {
|
||||
BszxBranchParam param = new BszxBranchParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.mapper.BszxClassMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-班级Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Service
|
||||
public class BszxClassServiceImpl extends ServiceImpl<BszxClassMapper, BszxClass> implements BszxClassService {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
|
||||
@Override
|
||||
public PageResult<BszxClass> pageRel(BszxClassParam param) {
|
||||
PageParam<BszxClass, BszxClassParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, id asc");
|
||||
List<BszxClass> list = baseMapper.selectPageRel(page, param);
|
||||
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (param.getLimit() == null) {
|
||||
list.forEach(item -> {
|
||||
wrapper.clear();
|
||||
// wrapper.eq(BszxPay::getBranchName,item.getBranchName());
|
||||
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
||||
wrapper.eq(BszxPay::getClassName, item.getName());
|
||||
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
||||
updateById(item);
|
||||
});
|
||||
}
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxClass> listRel(BszxClassParam param) {
|
||||
List<BszxClass> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxClass, BszxClassParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, id asc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxClass getByIdRel(Integer id) {
|
||||
BszxClassParam param = new BszxClassParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.bszx.mapper.BszxEraMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年代Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Service
|
||||
public class BszxEraServiceImpl extends ServiceImpl<BszxEraMapper, BszxEra> implements BszxEraService {
|
||||
|
||||
@Override
|
||||
public PageResult<BszxEra> pageRel(BszxEraParam param) {
|
||||
PageParam<BszxEra, BszxEraParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<BszxEra> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxEra> listRel(BszxEraParam param) {
|
||||
List<BszxEra> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxEra, BszxEraParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxEra getByIdRel(Integer id) {
|
||||
BszxEraParam param = new BszxEraParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.bszx.mapper.BszxGradeMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-年级Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Service
|
||||
public class BszxGradeServiceImpl extends ServiceImpl<BszxGradeMapper, BszxGrade> implements BszxGradeService {
|
||||
|
||||
@Override
|
||||
public PageResult<BszxGrade> pageRel(BszxGradeParam param) {
|
||||
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, id asc");
|
||||
List<BszxGrade> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxGrade> listRel(BszxGradeParam param) {
|
||||
List<BszxGrade> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, id asc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxGrade getByIdRel(Integer id) {
|
||||
BszxGradeParam param = new BszxGradeParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.bszx.mapper.BszxPayRankingMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Service
|
||||
public class BszxPayRankingServiceImpl extends ServiceImpl<BszxPayRankingMapper, BszxPayRanking> implements BszxPayRankingService {
|
||||
|
||||
@Override
|
||||
public PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param) {
|
||||
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<BszxPayRanking> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxPayRanking> listRel(BszxPayRankingParam param) {
|
||||
List<BszxPayRanking> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxPayRanking getByIdRel(Integer id) {
|
||||
BszxPayRankingParam param = new BszxPayRankingParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package com.gxwebsoft.bszx.service.impl;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.freewayso.image.combiner.ImageCombiner;
|
||||
import com.freewayso.image.combiner.enums.OutputFormat;
|
||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||
import com.gxwebsoft.bszx.mapper.BszxPayMapper;
|
||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||
import com.gxwebsoft.common.core.utils.ImageUtil;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.awt.Font;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Service
|
||||
public class BszxPayServiceImpl extends ServiceImpl<BszxPayMapper, BszxPay> implements BszxPayService {
|
||||
@Value("${config.upload-path}")
|
||||
private String uploadPath;
|
||||
@Value("${config.file-server}")
|
||||
private String fileServer;
|
||||
|
||||
@Resource
|
||||
private CmsArticleService cmsArticleService;
|
||||
@Resource
|
||||
public BszxBmService bszxBmService;
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
|
||||
@Override
|
||||
public PageResult<BszxPay> pageRel(BszxPayParam param) {
|
||||
PageParam<BszxPay, BszxPayParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("price desc, create_time desc");
|
||||
List<BszxPay> list = baseMapper.selectPageRel(page, param);
|
||||
list.forEach(item -> {
|
||||
if(item.getId().equals(2088)){
|
||||
item.setFormName("捐款用于设立阙里校友奖学金");
|
||||
}
|
||||
});
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BszxPay> listRel(BszxPayParam param) {
|
||||
List<BszxPay> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<BszxPay, BszxPayParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("id desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BszxPay getByIdRel(Integer id) {
|
||||
BszxPayParam param = new BszxPayParam();
|
||||
param.setId(id);
|
||||
final BszxPay item = param.getOne(baseMapper.selectListRel(param));
|
||||
final CmsArticle article = cmsArticleService.getById(item.getFormId());
|
||||
if (ObjectUtil.isNotEmpty(article)) {
|
||||
item.setArticle(article);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
||||
*/
|
||||
@Override
|
||||
public String generatePayCert(Integer id) throws Exception {
|
||||
final BszxPay payCert = getByIdRel(id);
|
||||
final CmsArticle item = cmsArticleService.getById(payCert.getFormId());
|
||||
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, payCert.getUserId()).last("limit 1"));
|
||||
final BigDecimal totalMoney = bszxPayService.sumMoney(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getUserId, payCert.getUserId()));
|
||||
if (StrUtil.isBlank(item.getAddress())) {
|
||||
return null;
|
||||
}
|
||||
// 百色一小项目
|
||||
if(payCert.getTenantId().equals(10547) && ObjectUtil.isNotEmpty(payCert)){
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250908/97f0891f3e4048f5b20ffb07ff370a3a.png?x-oss-process=image/resize,w_750/quality,Q_90", OutputFormat.JPG);
|
||||
//加图片元素:盖章
|
||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 550, 926);
|
||||
// 创建支持中文的字体
|
||||
Font nameFont26 = createChineseFont(26);
|
||||
Font nameFont22 = createChineseFont(22);
|
||||
Font moneyFont = createChineseFont(26);
|
||||
|
||||
//加文本元素:姓名
|
||||
String str;
|
||||
if (bm.getType().equals(0)) {
|
||||
str = bm.getName();
|
||||
combiner.addTextElement(str, nameFont26, 200, 468);
|
||||
} else {
|
||||
str = bm.getName();
|
||||
combiner.addTextElement(str, nameFont22, 200, 468);
|
||||
}
|
||||
// combiner.addTextElement(bm.getName(), 32,900, 450);
|
||||
//加文本元素:捐款证书内容
|
||||
// combiner.addTextElement(" 承您慷慨解囊,襄助百色市百色中学", 32,200, 650);
|
||||
// combiner.addTextElement("百廿校庆“" + item.getTitle() + "”项目,捐赠人民币", 32,200, 700);
|
||||
combiner.addTextElement(totalMoney + "", moneyFont, 420, 584);
|
||||
// combiner.addTextElement(" 您对学校的支持,为我们共同教育理", 32,200, 800);
|
||||
// combiner.addTextElement("想的实现增添了一份动力。", 32,200, 850);
|
||||
// combiner.addTextElement(" 承蒙惠赠,隆情铭感,特颁此证,以资谢旌!", 32, 200, 900);
|
||||
// combiner.addTextElement("百色市百色中学", 32,560, 1015);
|
||||
// final Date createTime = payCert.getCreateTime();
|
||||
// combiner.addTextElement(DateUtil.format(createTime, "yyyy年MM月"), 28,586, 1060);
|
||||
// combiner.addTextElement("2025年4月15日", 28,580, 1060);
|
||||
|
||||
//执行图片合并
|
||||
combiner.combine();
|
||||
|
||||
if (!FileUtil.exist(uploadPath + "/poster/" + payCert.getTenantId() + "/pay")) {
|
||||
FileUtil.mkdir(uploadPath + "/poster/" + payCert.getTenantId() + "/pay");
|
||||
}
|
||||
String basePath = "/poster/" + payCert.getTenantId() + "/pay/big-" + id + ".jpg";
|
||||
String smallPath = "/poster/" + payCert.getTenantId() + "/pay/" + id + ".jpg";
|
||||
String filename = uploadPath + basePath;
|
||||
String smallFileName = uploadPath + smallPath;
|
||||
System.out.println("smallFileName = " + smallFileName);
|
||||
combiner.save(filename);
|
||||
|
||||
File input = new File(filename);
|
||||
File output = new File(smallFileName);
|
||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||
if (input.exists()) {
|
||||
input.delete();
|
||||
}
|
||||
return fileServer + smallPath + "?v=" + RandomUtil.randomNumbers(4);
|
||||
}
|
||||
// 百色中学
|
||||
if (ObjectUtil.isNotEmpty(payCert)) {
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250420/811a380e8e124097aa0940a7c68a1f72.jpeg", OutputFormat.JPG);
|
||||
|
||||
// 创建支持中文的字体
|
||||
Font nameFont32 = createChineseFont(32);
|
||||
Font nameFont22 = createChineseFont(22);
|
||||
Font moneyFont32 = createChineseFont(32);
|
||||
|
||||
//加图片元素:盖章
|
||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 550, 926);
|
||||
//加文本元素:姓名
|
||||
String str;
|
||||
if (bm.getType().equals(0)) {
|
||||
str = bm.getName().concat(" 校友");
|
||||
combiner.addTextElement(str, nameFont32, 930, 450);
|
||||
} else {
|
||||
str = bm.getName();
|
||||
combiner.addTextElement(str, nameFont22, 880, 450);
|
||||
}
|
||||
// combiner.addTextElement(bm.getName(), 32,900, 450);
|
||||
//加文本元素:捐款证书内容
|
||||
// combiner.addTextElement(" 承您慷慨解囊,襄助百色市百色中学", 32,200, 650);
|
||||
// combiner.addTextElement("百廿校庆“" + item.getTitle() + "”项目,捐赠人民币", 32,200, 700);
|
||||
combiner.addTextElement(totalMoney + "", moneyFont32, 1330, 600);
|
||||
// combiner.addTextElement(" 您对学校的支持,为我们共同教育理", 32,200, 800);
|
||||
// combiner.addTextElement("想的实现增添了一份动力。", 32,200, 850);
|
||||
// combiner.addTextElement(" 承蒙惠赠,隆情铭感,特颁此证,以资谢旌!", 32, 200, 900);
|
||||
// combiner.addTextElement("百色市百色中学", 32,560, 1015);
|
||||
// final Date createTime = payCert.getCreateTime();
|
||||
// combiner.addTextElement(DateUtil.format(createTime, "yyyy年MM月"), 28,586, 1060);
|
||||
// combiner.addTextElement("2025年4月15日", 28,580, 1060);
|
||||
|
||||
//执行图片合并
|
||||
combiner.combine();
|
||||
|
||||
if (!FileUtil.exist(uploadPath + "/poster/" + payCert.getTenantId() + "/pay")) {
|
||||
FileUtil.mkdir(uploadPath + "/poster/" + payCert.getTenantId() + "/pay");
|
||||
}
|
||||
String basePath = "/poster/" + payCert.getTenantId() + "/pay/big-" + id + ".jpg";
|
||||
String smallPath = "/poster/" + payCert.getTenantId() + "/pay/" + id + ".jpg";
|
||||
String filename = uploadPath + basePath;
|
||||
String smallFileName = uploadPath + smallPath;
|
||||
combiner.save(filename);
|
||||
|
||||
File input = new File(filename);
|
||||
File output = new File(smallFileName);
|
||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||
if (input.exists()) {
|
||||
input.delete();
|
||||
}
|
||||
return fileServer + smallPath + "?v=" + RandomUtil.randomNumbers(4);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> wrapper) {
|
||||
return baseMapper.selectSumMoney(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal total() {
|
||||
try {
|
||||
// 使用数据库聚合查询统计捐款总金额,性能更高
|
||||
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
BigDecimal total = baseMapper.selectSumMoney(wrapper);
|
||||
|
||||
if (total == null) {
|
||||
total = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
return total;
|
||||
|
||||
} catch (Exception e) {
|
||||
// 异常时返回0,确保接口稳定性
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支持中文的字体
|
||||
* @param fontSize 字体大小
|
||||
* @return Font对象
|
||||
*/
|
||||
private static Font createChineseFont(int fontSize) {
|
||||
try {
|
||||
// 尝试使用系统中文字体
|
||||
String[] chineseFonts = {
|
||||
"Alibaba PuHuiTi 2.0",
|
||||
"PingFang SC", // 苹方 (macOS) - 优先使用
|
||||
"STHeiti", // 华文黑体 (macOS)
|
||||
"Hiragino Sans GB", // 冬青黑体 (macOS)
|
||||
"Microsoft YaHei", // 微软雅黑 (Windows)
|
||||
"SimHei", // 黑体 (Windows)
|
||||
"SimSun", // 宋体 (Windows)
|
||||
"WenQuanYi Micro Hei", // 文泉驿微米黑 (Linux)
|
||||
"Noto Sans CJK SC", // 思源黑体 (Linux)
|
||||
"Arial Unicode MS", // 支持Unicode的Arial
|
||||
"DejaVu Sans" // 备用字体
|
||||
};
|
||||
|
||||
for (String fontName : chineseFonts) {
|
||||
Font font = new Font(fontName, Font.PLAIN, fontSize);
|
||||
// 检查字体是否能正确显示中文
|
||||
if (font.canDisplay('中') && font.canDisplay('文')) {
|
||||
System.out.println("✓ 成功使用字体: " + fontName + " (字号: " + fontSize + ")");
|
||||
return font;
|
||||
} else {
|
||||
System.out.println("✗ 字体不支持中文: " + fontName);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有找到合适的字体,尝试加载系统默认中文字体
|
||||
System.out.println("⚠ 警告:未找到预定义的中文字体,尝试使用系统默认字体");
|
||||
|
||||
// 尝试使用逻辑字体名称,这些在Java中通常会映射到系统字体
|
||||
String[] logicalFonts = {"SansSerif", "Serif", "Monospaced", "Dialog", "DialogInput"};
|
||||
for (String logicalFont : logicalFonts) {
|
||||
Font font = new Font(logicalFont, Font.PLAIN, fontSize);
|
||||
if (font.canDisplay('中') && font.canDisplay('文')) {
|
||||
System.out.println("✓ 使用逻辑字体: " + logicalFont);
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
// 最后的备选方案
|
||||
System.err.println("❌ 严重警告:系统中没有找到任何支持中文的字体!请安装中文字体包。");
|
||||
return new Font("SansSerif", Font.PLAIN, fontSize);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("❌ 创建中文字体失败: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return new Font("SansSerif", Font.PLAIN, fontSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.clinic.service.ClinicAppointmentService;
|
||||
import com.gxwebsoft.clinic.entity.ClinicAppointment;
|
||||
import com.gxwebsoft.clinic.param.ClinicAppointmentParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 挂号控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
@Tag(name = "挂号管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-appointment")
|
||||
public class ClinicAppointmentController extends BaseController {
|
||||
@Resource
|
||||
private ClinicAppointmentService clinicAppointmentService;
|
||||
|
||||
@Operation(summary = "分页查询挂号")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicAppointment>> page(ClinicAppointmentParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicAppointmentService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:list')")
|
||||
@Operation(summary = "查询全部挂号")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicAppointment>> list(ClinicAppointmentParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicAppointmentService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:list')")
|
||||
@Operation(summary = "根据id查询挂号")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicAppointment> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicAppointmentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加挂号")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicAppointment clinicAppointment) {
|
||||
if (clinicAppointmentService.save(clinicAppointment)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改挂号")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicAppointment clinicAppointment) {
|
||||
if (clinicAppointmentService.updateById(clinicAppointment)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除挂号")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicAppointmentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加挂号")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicAppointment> list) {
|
||||
if (clinicAppointmentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改挂号")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicAppointment> batchParam) {
|
||||
if (batchParam.update(clinicAppointmentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicAppointment:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除挂号")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicAppointmentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.clinic.service.ClinicDoctorApplyService;
|
||||
import com.gxwebsoft.clinic.entity.ClinicDoctorApply;
|
||||
import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医生入驻申请控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
@Tag(name = "医生入驻申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-doctor-apply")
|
||||
public class ClinicDoctorApplyController extends BaseController {
|
||||
@Resource
|
||||
private ClinicDoctorApplyService clinicDoctorApplyService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')")
|
||||
@Operation(summary = "分页查询医生入驻申请")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicDoctorApply>> page(ClinicDoctorApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorApplyService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')")
|
||||
@Operation(summary = "查询全部医生入驻申请")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicDoctorApply>> list(ClinicDoctorApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorApplyService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')")
|
||||
@Operation(summary = "根据id查询医生入驻申请")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicDoctorApply> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorApplyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加医生入驻申请")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicDoctorApply clinicDoctorApply) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// clinicDoctorApply.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (clinicDoctorApplyService.save(clinicDoctorApply)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改医生入驻申请")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicDoctorApply clinicDoctorApply) {
|
||||
if (clinicDoctorApplyService.updateById(clinicDoctorApply)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除医生入驻申请")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicDoctorApplyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加医生入驻申请")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicDoctorApply> list) {
|
||||
if (clinicDoctorApplyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改医生入驻申请")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicDoctorApply> batchParam) {
|
||||
if (batchParam.update(clinicDoctorApplyService, "apply_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorApply:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除医生入驻申请")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicDoctorApplyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.clinic.entity.ClinicDoctorUser;
|
||||
import com.gxwebsoft.clinic.param.ClinicDoctorUserParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicDoctorUserService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-23 15:58:21
|
||||
*/
|
||||
@Tag(name = "分销商用户记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-doctor-user")
|
||||
public class ClinicDoctorUserController extends BaseController {
|
||||
@Resource
|
||||
private ClinicDoctorUserService clinicDoctorUserService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')")
|
||||
@Operation(summary = "分页查询分销商用户记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicDoctorUser>> page(ClinicDoctorUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')")
|
||||
@Operation(summary = "查询全部分销商用户记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicDoctorUser>> list(ClinicDoctorUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorUserService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')")
|
||||
@Operation(summary = "根据id查询分销商用户记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicDoctorUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicDoctorUserService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加分销商用户记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicDoctorUser clinicDoctorUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
clinicDoctorUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (clinicDoctorUserService.save(clinicDoctorUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改分销商用户记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicDoctorUser clinicDoctorUser) {
|
||||
if (clinicDoctorUserService.updateById(clinicDoctorUser)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除分销商用户记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicDoctorUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加分销商用户记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicDoctorUser> list) {
|
||||
if (clinicDoctorUserService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改分销商用户记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicDoctorUser> batchParam) {
|
||||
if (batchParam.update(clinicDoctorUserService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除分销商用户记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicDoctorUserService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicine;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicMedicineService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品库控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
@Tag(name = "药品库管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-medicine")
|
||||
public class ClinicMedicineController extends BaseController {
|
||||
@Resource
|
||||
private ClinicMedicineService clinicMedicineService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:list')")
|
||||
@Operation(summary = "分页查询药品库")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicMedicine>> page(ClinicMedicineParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:list')")
|
||||
@Operation(summary = "查询全部药品库")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicMedicine>> list(ClinicMedicineParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:list')")
|
||||
@Operation(summary = "根据id查询药品库")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicMedicine> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加药品库")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicMedicine clinicMedicine) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// clinicMedicine.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (clinicMedicineService.save(clinicMedicine)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改药品库")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicMedicine clinicMedicine) {
|
||||
if (clinicMedicineService.updateById(clinicMedicine)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除药品库")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicMedicineService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加药品库")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicMedicine> list) {
|
||||
if (clinicMedicineService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改药品库")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicMedicine> batchParam) {
|
||||
if (batchParam.update(clinicMedicineService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicine:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除药品库")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicMedicineService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicineInout;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicMedicineInoutService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出入库控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
@Tag(name = "出入库管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-medicine-inout")
|
||||
public class ClinicMedicineInoutController extends BaseController {
|
||||
@Resource
|
||||
private ClinicMedicineInoutService clinicMedicineInoutService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')")
|
||||
@Operation(summary = "分页查询出入库")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicMedicineInout>> page(ClinicMedicineInoutParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineInoutService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')")
|
||||
@Operation(summary = "查询全部出入库")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicMedicineInout>> list(ClinicMedicineInoutParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineInoutService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')")
|
||||
@Operation(summary = "根据id查询出入库")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicMedicineInout> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineInoutService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加出入库")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicMedicineInout clinicMedicineInout) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// clinicMedicineInout.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (clinicMedicineInoutService.save(clinicMedicineInout)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改出入库")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicMedicineInout clinicMedicineInout) {
|
||||
if (clinicMedicineInoutService.updateById(clinicMedicineInout)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除出入库")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicMedicineInoutService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加出入库")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicMedicineInout> list) {
|
||||
if (clinicMedicineInoutService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改出入库")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicMedicineInout> batchParam) {
|
||||
if (batchParam.update(clinicMedicineInoutService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineInout:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除出入库")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicMedicineInoutService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicineStock;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineStockParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicMedicineStockService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品库存控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
@Tag(name = "药品库存管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-medicine-stock")
|
||||
public class ClinicMedicineStockController extends BaseController {
|
||||
@Resource
|
||||
private ClinicMedicineStockService clinicMedicineStockService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')")
|
||||
@Operation(summary = "分页查询药品库存")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicMedicineStock>> page(ClinicMedicineStockParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineStockService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')")
|
||||
@Operation(summary = "查询全部药品库存")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicMedicineStock>> list(ClinicMedicineStockParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineStockService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')")
|
||||
@Operation(summary = "根据id查询药品库存")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicMedicineStock> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicMedicineStockService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加药品库存")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicMedicineStock clinicMedicineStock) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// clinicMedicineStock.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (clinicMedicineStockService.save(clinicMedicineStock)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改药品库存")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicMedicineStock clinicMedicineStock) {
|
||||
if (clinicMedicineStockService.updateById(clinicMedicineStock)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除药品库存")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicMedicineStockService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加药品库存")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicMedicineStock> list) {
|
||||
if (clinicMedicineStockService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改药品库存")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicMedicineStock> batchParam) {
|
||||
if (batchParam.update(clinicMedicineStockService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicMedicineStock:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除药品库存")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicMedicineStockService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.clinic.service.ClinicPatientUserService;
|
||||
import com.gxwebsoft.clinic.entity.ClinicPatientUser;
|
||||
import com.gxwebsoft.clinic.param.ClinicPatientUserParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 患者控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
@Tag(name = "患者管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-patient-user")
|
||||
public class ClinicPatientUserController extends BaseController {
|
||||
@Resource
|
||||
private ClinicPatientUserService clinicPatientUserService;
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')")
|
||||
@Operation(summary = "分页查询患者")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicPatientUser>> page(ClinicPatientUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPatientUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')")
|
||||
@Operation(summary = "查询全部患者")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicPatientUser>> list(ClinicPatientUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPatientUserService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')")
|
||||
@Operation(summary = "根据id查询患者")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicPatientUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicPatientUserService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加患者")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicPatientUser clinicPatientUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
clinicPatientUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (clinicPatientUserService.save(clinicPatientUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改患者")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicPatientUser clinicPatientUser) {
|
||||
if (clinicPatientUserService.updateById(clinicPatientUser)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除患者")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicPatientUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加患者")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicPatientUser> list) {
|
||||
if (clinicPatientUserService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改患者")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicPatientUser> batchParam) {
|
||||
if (batchParam.update(clinicPatientUserService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPatientUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除患者")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicPatientUserService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.gxwebsoft.clinic.dto.PrescriptionOrderRequest;
|
||||
import com.gxwebsoft.clinic.entity.ClinicPrescription;
|
||||
import com.gxwebsoft.clinic.param.ClinicPrescriptionParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicPrescriptionService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
@Tag(name = "处方主表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-prescription")
|
||||
public class ClinicPrescriptionController extends BaseController {
|
||||
@Resource
|
||||
private ClinicPrescriptionService clinicPrescriptionService;
|
||||
|
||||
@Operation(summary = "分页查询处方主表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicPrescription>> page(ClinicPrescriptionParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:list')")
|
||||
@Operation(summary = "查询全部处方主表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicPrescription>> list(ClinicPrescriptionParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询处方主表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicPrescription> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加处方主表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicPrescription clinicPrescription) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
clinicPrescription.setDoctorId(loginUser.getUserId());
|
||||
// 生成订单号
|
||||
String orderNo = Long.toString(IdUtil.getSnowflakeNextId());
|
||||
clinicPrescription.setOrderNo(orderNo);
|
||||
}
|
||||
if (clinicPrescriptionService.save(clinicPrescription)) {
|
||||
// 返回处方数据,包含处方ID
|
||||
return success("添加成功",clinicPrescriptionService.getByLastId(clinicPrescription));
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改处方主表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicPrescription clinicPrescription) {
|
||||
if (clinicPrescriptionService.updateById(clinicPrescription)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除处方主表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicPrescriptionService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加处方主表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicPrescription> list) {
|
||||
if (clinicPrescriptionService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改处方主表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicPrescription> batchParam) {
|
||||
if (batchParam.update(clinicPrescriptionService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除处方主表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicPrescriptionService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "创建处方订单")
|
||||
@PostMapping("/order")
|
||||
public ApiResult<?> createOrder(@RequestBody PrescriptionOrderRequest request) {
|
||||
try {
|
||||
// 1. 参数校验
|
||||
if (request.getPrescriptionId() == null) {
|
||||
return fail("处方ID不能为空");
|
||||
}
|
||||
if (request.getPayType() == null) {
|
||||
return fail("支付方式不能为空");
|
||||
}
|
||||
|
||||
// 2. 查询处方信息
|
||||
ClinicPrescription prescription = clinicPrescriptionService.getById(request.getPrescriptionId());
|
||||
if (prescription == null) {
|
||||
return fail("处方不存在");
|
||||
}
|
||||
|
||||
// 3. 检查处方状态
|
||||
if (prescription.getStatus() != null && prescription.getStatus() == 2) {
|
||||
return fail("该处方已支付,无需重复支付");
|
||||
}
|
||||
if (prescription.getStatus() != null && prescription.getStatus() == 3) {
|
||||
return fail("该处方已取消,无法支付");
|
||||
}
|
||||
|
||||
// 4. 更新处方订单信息
|
||||
ClinicPrescription updatePrescription = new ClinicPrescription();
|
||||
updatePrescription.setId(request.getPrescriptionId());
|
||||
|
||||
// 根据支付类型更新状态
|
||||
if (request.getPayType() == 1) {
|
||||
// 微信支付,状态保持为正常,等待支付回调
|
||||
updatePrescription.setStatus(0);
|
||||
} else if (request.getPayType() == 4 || request.getPayType() == 5) {
|
||||
// 现金支付或POS机支付,直接标记为已支付
|
||||
updatePrescription.setStatus(2);
|
||||
updatePrescription.setIsSettled(1);
|
||||
updatePrescription.setSettleTime(LocalDateTime.now());
|
||||
} else if (request.getPayType() == 6) {
|
||||
// 免费,直接标记为已完成
|
||||
updatePrescription.setStatus(1);
|
||||
updatePrescription.setIsSettled(1);
|
||||
updatePrescription.setSettleTime(LocalDateTime.now());
|
||||
}
|
||||
|
||||
if (clinicPrescriptionService.updateById(updatePrescription)) {
|
||||
return success("订单创建成功", prescription);
|
||||
}
|
||||
return fail("订单创建失败");
|
||||
|
||||
} catch (Exception e) {
|
||||
return fail("订单创建失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.gxwebsoft.clinic.controller;
|
||||
|
||||
import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem;
|
||||
import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam;
|
||||
import com.gxwebsoft.clinic.service.ClinicPrescriptionItemService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方明细表
|
||||
控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
@Tag(name = "处方明细表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/clinic/clinic-prescription-item")
|
||||
public class ClinicPrescriptionItemController extends BaseController {
|
||||
@Resource
|
||||
private ClinicPrescriptionItemService clinicPrescriptionItemService;
|
||||
|
||||
@Operation(summary = "分页查询处方明细表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ClinicPrescriptionItem>> page(ClinicPrescriptionItemParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionItemService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:list')")
|
||||
@Operation(summary = "查询全部处方明细表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ClinicPrescriptionItem>> list(ClinicPrescriptionItemParam param) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionItemService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询处方明细表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ClinicPrescriptionItem> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(clinicPrescriptionItemService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加处方明细表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ClinicPrescriptionItem clinicPrescriptionItem) {
|
||||
if (clinicPrescriptionItemService.save(clinicPrescriptionItem)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改处方明细表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ClinicPrescriptionItem clinicPrescriptionItem) {
|
||||
if (clinicPrescriptionItemService.updateById(clinicPrescriptionItem)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除处方明细表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (clinicPrescriptionItemService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加处方明细表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ClinicPrescriptionItem> list) {
|
||||
if (clinicPrescriptionItemService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改处方明细表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ClinicPrescriptionItem> batchParam) {
|
||||
if (batchParam.update(clinicPrescriptionItemService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除处方明细表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (clinicPrescriptionItemService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
package com.gxwebsoft.clinic.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 处方订单请求参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "PrescriptionOrderRequest", description = "处方订单请求参数")
|
||||
public class PrescriptionOrderRequest implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "处方ID", required = true)
|
||||
private Integer prescriptionId;
|
||||
|
||||
@Schema(description = "支付方式:0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付", required = true)
|
||||
private Integer payType;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 挂号
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicAppointment对象", description = "挂号")
|
||||
public class ClinicAppointment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "就诊原因")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "挂号时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime evaluateTime;
|
||||
|
||||
@Schema(description = "医生")
|
||||
private Integer doctorId;
|
||||
|
||||
@Schema(description = "医生名称")
|
||||
@TableField(exist = false)
|
||||
private String doctorName;
|
||||
|
||||
@Schema(description = "医生职位")
|
||||
@TableField(exist = false)
|
||||
private String doctorPosition;
|
||||
|
||||
@Schema(description = "患者")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "患者名称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "手机")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Integer isDelete;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
125
src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorApply.java
Normal file
125
src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorApply.java
Normal file
@@ -0,0 +1,125 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDate;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 医生入驻申请
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicDoctorApply对象", description = "医生入驻申请")
|
||||
public class ClinicDoctorApply implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "apply_id", type = IdType.AUTO)
|
||||
private Integer applyId;
|
||||
|
||||
@Schema(description = "类型 0医生")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String dealerName;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "生日")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Schema(description = "区分职称等级(如主治医师、副主任医师)")
|
||||
private String professionalTitle;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "执业资格核心凭证")
|
||||
private String practiceLicense;
|
||||
|
||||
@Schema(description = "限定可执业科室或疾病类型")
|
||||
private String practiceScope;
|
||||
|
||||
@Schema(description = "开始工作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startWorkDate;
|
||||
|
||||
@Schema(description = "简历")
|
||||
private String resume;
|
||||
|
||||
@Schema(description = "使用 JSON 存储多个证件文件路径(如执业证、学历证)")
|
||||
private String certificationFiles;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "签约价格")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "推荐人用户ID")
|
||||
private Integer refereeId;
|
||||
|
||||
@Schema(description = "申请方式(10需后台审核 20无需审核)")
|
||||
private Integer applyType;
|
||||
|
||||
@Schema(description = "审核状态 (10待审核 20审核通过 30驳回)")
|
||||
private Integer applyStatus;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "合同时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime contractTime;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime expirationTime;
|
||||
|
||||
@Schema(description = "驳回原因")
|
||||
private String rejectReason;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-23 15:58:20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicDoctorUser对象", description = "分销商用户记录表")
|
||||
public class ClinicDoctorUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型 0经销商 1企业 2集团")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "部门")
|
||||
private Integer departmentId;
|
||||
|
||||
@Schema(description = "专业领域")
|
||||
private String specialty;
|
||||
|
||||
@Schema(description = "职务级别")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "执业资格")
|
||||
private String qualification;
|
||||
|
||||
@Schema(description = "医生简介")
|
||||
private String introduction;
|
||||
|
||||
@Schema(description = "挂号费")
|
||||
private BigDecimal consultationFee;
|
||||
|
||||
@Schema(description = "工作年限")
|
||||
private Integer workYears;
|
||||
|
||||
@Schema(description = "问诊人数")
|
||||
private Integer consultationCount;
|
||||
|
||||
@Schema(description = "专属二维码")
|
||||
private String qrcode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Integer isDelete;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 药品库
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:31
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicMedicine对象", description = "药品库")
|
||||
public class ClinicMedicine implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "药名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "拼音")
|
||||
private String pinyin;
|
||||
|
||||
@Schema(description = "分类(如“清热解毒”、“补气养血”)")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "规格(如“饮片”、“颗粒”)")
|
||||
private String specification;
|
||||
|
||||
@Schema(description = "单位(如“克”、“袋”)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "单价")
|
||||
private BigDecimal pricePerUnit;
|
||||
|
||||
@Schema(description = "是否活跃")
|
||||
private Integer isActive;
|
||||
|
||||
@Schema(description = "买家用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 出入库
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicMedicineInout对象", description = "出入库")
|
||||
public class ClinicMedicineInout implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "买家用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "分销商用户id(一级)")
|
||||
private Integer firstUserId;
|
||||
|
||||
@Schema(description = "分销商用户id(二级)")
|
||||
private Integer secondUserId;
|
||||
|
||||
@Schema(description = "分销商用户id(三级)")
|
||||
private Integer thirdUserId;
|
||||
|
||||
@Schema(description = "分销佣金(一级)")
|
||||
private BigDecimal firstMoney;
|
||||
|
||||
@Schema(description = "分销佣金(二级)")
|
||||
private BigDecimal secondMoney;
|
||||
|
||||
@Schema(description = "分销佣金(三级)")
|
||||
private BigDecimal thirdMoney;
|
||||
|
||||
@Schema(description = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "订单总金额")
|
||||
private BigDecimal orderPrice;
|
||||
|
||||
@Schema(description = "结算金额")
|
||||
private BigDecimal settledPrice;
|
||||
|
||||
@Schema(description = "换算成度")
|
||||
private BigDecimal degreePrice;
|
||||
|
||||
@Schema(description = "实发金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@Schema(description = "税率")
|
||||
private BigDecimal rate;
|
||||
|
||||
@Schema(description = "结算月份")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "订单是否失效(0未失效 1已失效)")
|
||||
private Integer isInvalid;
|
||||
|
||||
@Schema(description = "佣金结算(0未结算 1已结算)")
|
||||
private Integer isSettled;
|
||||
|
||||
@Schema(description = "结算时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime settleTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 药品库存
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicMedicineStock对象", description = "药品库存")
|
||||
public class ClinicMedicineStock implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "药品")
|
||||
private Integer medicineId;
|
||||
|
||||
@Schema(description = "库存数量")
|
||||
private Integer stockQuantity;
|
||||
|
||||
@Schema(description = "最小库存预警")
|
||||
private Integer minStockLevel;
|
||||
|
||||
@Schema(description = "上次更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastUpdated;
|
||||
|
||||
@Schema(description = "买家用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicPatientUser对象", description = "患者")
|
||||
public class ClinicPatientUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型 0经销商 1企业 2集团")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "性别 0未知 1男 2女")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "过敏史")
|
||||
private String allergyHistory;
|
||||
|
||||
@Schema(description = "专属二维码")
|
||||
private String qrcode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Integer isDelete;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicPrescription对象", description = "处方主表")
|
||||
public class ClinicPrescription implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "患者")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "患者名称")
|
||||
@TableField(exist = false)
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@TableField(exist = false)
|
||||
private String age;
|
||||
|
||||
@Schema(description = "身高")
|
||||
@TableField(exist = false)
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
@TableField(exist = false)
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "医生")
|
||||
private Integer doctorId;
|
||||
|
||||
@Schema(description = "医生名称")
|
||||
@TableField(exist = false)
|
||||
private String doctorName;
|
||||
|
||||
@Schema(description = "医生资格")
|
||||
@TableField(exist = false)
|
||||
private String qualification;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "0未付款,1已付款")
|
||||
@TableField(exist = false)
|
||||
private Boolean payStatus;
|
||||
|
||||
@Schema(description = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
|
||||
@TableField(exist = false)
|
||||
private Integer orderStatus;
|
||||
|
||||
@Schema(description = "关联就诊表")
|
||||
private Integer visitRecordId;
|
||||
|
||||
@Schema(description = "处方类型 0中药 1西药")
|
||||
private Integer prescriptionType;
|
||||
|
||||
@Schema(description = "诊断结果")
|
||||
private String diagnosis;
|
||||
|
||||
@Schema(description = "治疗方案")
|
||||
private String treatmentPlan;
|
||||
|
||||
@Schema(description = "煎药说明")
|
||||
private String decoctionInstructions;
|
||||
|
||||
@Schema(description = "上传附件")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "订单总金额")
|
||||
private BigDecimal orderPrice;
|
||||
|
||||
@Schema(description = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "实付金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@Schema(description = "订单是否失效(0未失效 1已失效)")
|
||||
private Integer isInvalid;
|
||||
|
||||
@Schema(description = "结算(0未结算 1已结算)")
|
||||
private Integer isSettled;
|
||||
|
||||
@Schema(description = "结算时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime settleTime;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1已完成,2已支付,3已取消")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "处方明细")
|
||||
@TableField(exist = false)
|
||||
private List<ClinicPrescriptionItem> items;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.gxwebsoft.clinic.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 处方明细表
|
||||
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ClinicPrescriptionItem对象", description = "处方明细表")
|
||||
public class ClinicPrescriptionItem implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "关联处方")
|
||||
private Integer prescriptionId;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String prescriptionNo;
|
||||
|
||||
@Schema(description = "关联药品")
|
||||
private Integer medicineId;
|
||||
|
||||
@Schema(description = "药品名称")
|
||||
@TableField(exist = false)
|
||||
private String medicineName;
|
||||
|
||||
@Schema(description = "规格")
|
||||
@TableField(exist = false)
|
||||
private String specification;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@TableField(exist = false)
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "单价")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal pricePerUnit;
|
||||
|
||||
@Schema(description = "药品")
|
||||
@TableField(exist = false)
|
||||
private ClinicMedicine clinicMedicine;
|
||||
|
||||
@Schema(description = "剂量(如“10g”)")
|
||||
private String dosage;
|
||||
|
||||
@Schema(description = "用法频率(如“每日三次”)")
|
||||
private String usageFrequency;
|
||||
|
||||
@Schema(description = "服用天数")
|
||||
private Integer days;
|
||||
|
||||
@Schema(description = "购买数量")
|
||||
private Integer amount;
|
||||
|
||||
@Schema(description = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer quantity;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicAppointment;
|
||||
import com.gxwebsoft.clinic.param.ClinicAppointmentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 挂号Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:03
|
||||
*/
|
||||
public interface ClinicAppointmentMapper extends BaseMapper<ClinicAppointment> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicAppointment>
|
||||
*/
|
||||
List<ClinicAppointment> selectPageRel(@Param("page") IPage<ClinicAppointment> page,
|
||||
@Param("param") ClinicAppointmentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicAppointment> selectListRel(@Param("param") ClinicAppointmentParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicDoctorApply;
|
||||
import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医生入驻申请Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
public interface ClinicDoctorApplyMapper extends BaseMapper<ClinicDoctorApply> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicDoctorApply>
|
||||
*/
|
||||
List<ClinicDoctorApply> selectPageRel(@Param("page") IPage<ClinicDoctorApply> page,
|
||||
@Param("param") ClinicDoctorApplyParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicDoctorApply> selectListRel(@Param("param") ClinicDoctorApplyParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicDoctorUser;
|
||||
import com.gxwebsoft.clinic.param.ClinicDoctorUserParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
public interface ClinicDoctorUserMapper extends BaseMapper<ClinicDoctorUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicDoctorUser>
|
||||
*/
|
||||
List<ClinicDoctorUser> selectPageRel(@Param("page") IPage<ClinicDoctorUser> page,
|
||||
@Param("param") ClinicDoctorUserParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicDoctorUser> selectListRel(@Param("param") ClinicDoctorUserParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicineInout;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出入库Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
public interface ClinicMedicineInoutMapper extends BaseMapper<ClinicMedicineInout> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicMedicineInout>
|
||||
*/
|
||||
List<ClinicMedicineInout> selectPageRel(@Param("page") IPage<ClinicMedicineInout> page,
|
||||
@Param("param") ClinicMedicineInoutParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicMedicineInout> selectListRel(@Param("param") ClinicMedicineInoutParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicine;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品库Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:31
|
||||
*/
|
||||
public interface ClinicMedicineMapper extends BaseMapper<ClinicMedicine> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicMedicine>
|
||||
*/
|
||||
List<ClinicMedicine> selectPageRel(@Param("page") IPage<ClinicMedicine> page,
|
||||
@Param("param") ClinicMedicineParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicMedicine> selectListRel(@Param("param") ClinicMedicineParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicMedicineStock;
|
||||
import com.gxwebsoft.clinic.param.ClinicMedicineStockParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品库存Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:06:32
|
||||
*/
|
||||
public interface ClinicMedicineStockMapper extends BaseMapper<ClinicMedicineStock> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicMedicineStock>
|
||||
*/
|
||||
List<ClinicMedicineStock> selectPageRel(@Param("page") IPage<ClinicMedicineStock> page,
|
||||
@Param("param") ClinicMedicineStockParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicMedicineStock> selectListRel(@Param("param") ClinicMedicineStockParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicPatientUser;
|
||||
import com.gxwebsoft.clinic.param.ClinicPatientUserParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 患者Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-19 09:27:04
|
||||
*/
|
||||
public interface ClinicPatientUserMapper extends BaseMapper<ClinicPatientUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicPatientUser>
|
||||
*/
|
||||
List<ClinicPatientUser> selectPageRel(@Param("page") IPage<ClinicPatientUser> page,
|
||||
@Param("param") ClinicPatientUserParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicPatientUser> selectListRel(@Param("param") ClinicPatientUserParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem;
|
||||
import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方明细表
|
||||
Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
public interface ClinicPrescriptionItemMapper extends BaseMapper<ClinicPrescriptionItem> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicPrescriptionItem>
|
||||
*/
|
||||
List<ClinicPrescriptionItem> selectPageRel(@Param("page") IPage<ClinicPrescriptionItem> page,
|
||||
@Param("param") ClinicPrescriptionItemParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicPrescriptionItem> selectListRel(@Param("param") ClinicPrescriptionItemParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.gxwebsoft.clinic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.clinic.entity.ClinicPrescription;
|
||||
import com.gxwebsoft.clinic.param.ClinicPrescriptionParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-22 02:01:13
|
||||
*/
|
||||
public interface ClinicPrescriptionMapper extends BaseMapper<ClinicPrescription> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ClinicPrescription>
|
||||
*/
|
||||
List<ClinicPrescription> selectPageRel(@Param("page") IPage<ClinicPrescription> page,
|
||||
@Param("param") ClinicPrescriptionParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ClinicPrescription> selectListRel(@Param("param") ClinicPrescriptionParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicAppointmentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.nickname, b.phone, c.real_name as doctorName, c.position as doctorPosition
|
||||
FROM clinic_appointment a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||
LEFT JOIN clinic_doctor_user c ON a.doctor_id = c.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.reason != null">
|
||||
AND a.reason LIKE CONCAT('%', #{param.reason}, '%')
|
||||
</if>
|
||||
<if test="param.evaluateTime != null">
|
||||
AND a.evaluate_time LIKE CONCAT('%', #{param.evaluateTime}, '%')
|
||||
</if>
|
||||
<if test="param.doctorId != null">
|
||||
AND a.doctor_id = #{param.doctorId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.isDelete != null">
|
||||
AND a.is_delete = #{param.isDelete}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicAppointment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicAppointment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicDoctorApplyMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM clinic_doctor_apply a
|
||||
<where>
|
||||
<if test="param.applyId != null">
|
||||
AND a.apply_id = #{param.applyId}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.gender != null">
|
||||
AND a.gender = #{param.gender}
|
||||
</if>
|
||||
<if test="param.mobile != null">
|
||||
AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%')
|
||||
</if>
|
||||
<if test="param.dealerName != null">
|
||||
AND a.dealer_name LIKE CONCAT('%', #{param.dealerName}, '%')
|
||||
</if>
|
||||
<if test="param.idCard != null">
|
||||
AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%')
|
||||
</if>
|
||||
<if test="param.birthDate != null">
|
||||
AND a.birth_date LIKE CONCAT('%', #{param.birthDate}, '%')
|
||||
</if>
|
||||
<if test="param.professionalTitle != null">
|
||||
AND a.professional_title LIKE CONCAT('%', #{param.professionalTitle}, '%')
|
||||
</if>
|
||||
<if test="param.workUnit != null">
|
||||
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
||||
</if>
|
||||
<if test="param.practiceLicense != null">
|
||||
AND a.practice_license LIKE CONCAT('%', #{param.practiceLicense}, '%')
|
||||
</if>
|
||||
<if test="param.practiceScope != null">
|
||||
AND a.practice_scope LIKE CONCAT('%', #{param.practiceScope}, '%')
|
||||
</if>
|
||||
<if test="param.startWorkDate != null">
|
||||
AND a.start_work_date LIKE CONCAT('%', #{param.startWorkDate}, '%')
|
||||
</if>
|
||||
<if test="param.resume != null">
|
||||
AND a.resume LIKE CONCAT('%', #{param.resume}, '%')
|
||||
</if>
|
||||
<if test="param.certificationFiles != null">
|
||||
AND a.certification_files LIKE CONCAT('%', #{param.certificationFiles}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
</if>
|
||||
<if test="param.refereeId != null">
|
||||
AND a.referee_id = #{param.refereeId}
|
||||
</if>
|
||||
<if test="param.applyType != null">
|
||||
AND a.apply_type = #{param.applyType}
|
||||
</if>
|
||||
<if test="param.applyStatus != null">
|
||||
AND a.apply_status = #{param.applyStatus}
|
||||
</if>
|
||||
<if test="param.applyTime != null">
|
||||
AND a.apply_time LIKE CONCAT('%', #{param.applyTime}, '%')
|
||||
</if>
|
||||
<if test="param.auditTime != null">
|
||||
AND a.audit_time LIKE CONCAT('%', #{param.auditTime}, '%')
|
||||
</if>
|
||||
<if test="param.contractTime != null">
|
||||
AND a.contract_time LIKE CONCAT('%', #{param.contractTime}, '%')
|
||||
</if>
|
||||
<if test="param.expirationTime != null">
|
||||
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
|
||||
</if>
|
||||
<if test="param.rejectReason != null">
|
||||
AND a.reject_reason LIKE CONCAT('%', #{param.rejectReason}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicDoctorApply">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicDoctorApply">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicDoctorUserMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.nickname, b.phone, b.avatar
|
||||
FROM clinic_doctor_user a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.departmentId != null">
|
||||
AND a.department_id = #{param.departmentId}
|
||||
</if>
|
||||
<if test="param.specialty != null">
|
||||
AND a.specialty LIKE CONCAT('%', #{param.specialty}, '%')
|
||||
</if>
|
||||
<if test="param.position != null">
|
||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||
</if>
|
||||
<if test="param.qualification != null">
|
||||
AND a.qualification LIKE CONCAT('%', #{param.qualification}, '%')
|
||||
</if>
|
||||
<if test="param.introduction != null">
|
||||
AND a.introduction LIKE CONCAT('%', #{param.introduction}, '%')
|
||||
</if>
|
||||
<if test="param.consultationFee != null">
|
||||
AND a.consultation_fee = #{param.consultationFee}
|
||||
</if>
|
||||
<if test="param.workYears != null">
|
||||
AND a.work_years = #{param.workYears}
|
||||
</if>
|
||||
<if test="param.consultationCount != null">
|
||||
AND a.consultation_count = #{param.consultationCount}
|
||||
</if>
|
||||
<if test="param.qrcode != null">
|
||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.isDelete != null">
|
||||
AND a.is_delete = #{param.isDelete}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.real_name = #{param.keywords}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicDoctorUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicDoctorUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicMedicineInoutMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM clinic_medicine_inout a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.orderNo != null">
|
||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||
</if>
|
||||
<if test="param.firstUserId != null">
|
||||
AND a.first_user_id = #{param.firstUserId}
|
||||
</if>
|
||||
<if test="param.secondUserId != null">
|
||||
AND a.second_user_id = #{param.secondUserId}
|
||||
</if>
|
||||
<if test="param.thirdUserId != null">
|
||||
AND a.third_user_id = #{param.thirdUserId}
|
||||
</if>
|
||||
<if test="param.firstMoney != null">
|
||||
AND a.first_money = #{param.firstMoney}
|
||||
</if>
|
||||
<if test="param.secondMoney != null">
|
||||
AND a.second_money = #{param.secondMoney}
|
||||
</if>
|
||||
<if test="param.thirdMoney != null">
|
||||
AND a.third_money = #{param.thirdMoney}
|
||||
</if>
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.orderPrice != null">
|
||||
AND a.order_price = #{param.orderPrice}
|
||||
</if>
|
||||
<if test="param.settledPrice != null">
|
||||
AND a.settled_price = #{param.settledPrice}
|
||||
</if>
|
||||
<if test="param.degreePrice != null">
|
||||
AND a.degree_price = #{param.degreePrice}
|
||||
</if>
|
||||
<if test="param.payPrice != null">
|
||||
AND a.pay_price = #{param.payPrice}
|
||||
</if>
|
||||
<if test="param.rate != null">
|
||||
AND a.rate = #{param.rate}
|
||||
</if>
|
||||
<if test="param.month != null">
|
||||
AND a.month LIKE CONCAT('%', #{param.month}, '%')
|
||||
</if>
|
||||
<if test="param.isInvalid != null">
|
||||
AND a.is_invalid = #{param.isInvalid}
|
||||
</if>
|
||||
<if test="param.isSettled != null">
|
||||
AND a.is_settled = #{param.isSettled}
|
||||
</if>
|
||||
<if test="param.settleTime != null">
|
||||
AND a.settle_time LIKE CONCAT('%', #{param.settleTime}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicineInout">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicineInout">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicMedicineMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM clinic_medicine a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.pinyin != null">
|
||||
AND a.pinyin LIKE CONCAT('%', #{param.pinyin}, '%')
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||
</if>
|
||||
<if test="param.specification != null">
|
||||
AND a.specification LIKE CONCAT('%', #{param.specification}, '%')
|
||||
</if>
|
||||
<if test="param.unit != null">
|
||||
AND a.unit LIKE CONCAT('%', #{param.unit}, '%')
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.pricePerUnit != null">
|
||||
AND a.price_per_unit = #{param.pricePerUnit}
|
||||
</if>
|
||||
<if test="param.isActive != null">
|
||||
AND a.is_active = #{param.isActive}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicine">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicine">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicMedicineStockMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM clinic_medicine_stock a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.medicineId != null">
|
||||
AND a.medicine_id = #{param.medicineId}
|
||||
</if>
|
||||
<if test="param.stockQuantity != null">
|
||||
AND a.stock_quantity = #{param.stockQuantity}
|
||||
</if>
|
||||
<if test="param.minStockLevel != null">
|
||||
AND a.min_stock_level = #{param.minStockLevel}
|
||||
</if>
|
||||
<if test="param.lastUpdated != null">
|
||||
AND a.last_updated LIKE CONCAT('%', #{param.lastUpdated}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicineStock">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicMedicineStock">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?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.gxwebsoft.clinic.mapper.ClinicPatientUserMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.phone, b.avatar
|
||||
FROM clinic_patient_user a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.age != null">
|
||||
AND a.age LIKE CONCAT('%', #{param.age}, '%')
|
||||
</if>
|
||||
<if test="param.qrcode != null">
|
||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||
</if>
|
||||
<if test="param.height != null">
|
||||
AND a.height LIKE CONCAT('%', #{param.height}, '%')
|
||||
</if>
|
||||
<if test="param.weight != null">
|
||||
AND a.weight LIKE CONCAT('%', #{param.weight}, '%')
|
||||
</if>
|
||||
<if test="param.allergyHistory != null">
|
||||
AND a.allergy_history LIKE CONCAT('%', #{param.allergyHistory}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.isDelete != null">
|
||||
AND a.is_delete = #{param.isDelete}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.real_name = #{param.keywords}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user