Compare commits
26 Commits
44363ca870
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| a306f53336 | |||
| 8fca992e37 | |||
| 026824d31d | |||
| 1575bf504c | |||
| 47ae81ca9f | |||
| d9e4371735 | |||
| eadaa8c4dd | |||
| fa5260d583 | |||
| 0c4bdc3031 | |||
| 47ef45054a | |||
| 9297d13045 | |||
| 701a135edd | |||
| 6781374c1e | |||
| 7c90f5e8af | |||
| 721ce5a595 | |||
| 506505bb46 | |||
| 8b83e4862f | |||
| 800b4f6f93 | |||
| 498a47977e | |||
| 6e2ba02705 | |||
| 2b4dcdb375 | |||
| 2025653cf5 | |||
| 4549fdf59e | |||
| 82f41d7153 | |||
| 7982b8f963 | |||
| 0823c42cbc |
61
.workbuddy/expert-history.json
Normal file
61
.workbuddy/expert-history.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"version": 2,
|
||||
"sessions": {
|
||||
"7759a9e57f984a0bb5af2ffd05be2f63": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "Will",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1775972794982,
|
||||
"industryId": "all"
|
||||
}
|
||||
],
|
||||
"e7c3c15a2556446884e56ce4d588e133": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "Will",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1776000797914,
|
||||
"industryId": "all"
|
||||
}
|
||||
],
|
||||
"44c34a14b6dc4139b39ff61239e259ea": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "Will",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1776000797914,
|
||||
"industryId": "all"
|
||||
}
|
||||
],
|
||||
"d11a5ebd8e064cc19ff4a85b8d931dac": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "吴八哥",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1776443595917,
|
||||
"industryId": "02-Engineering"
|
||||
}
|
||||
],
|
||||
"e339ec20b1ef45479756bdfdf93c3654": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "吴八哥",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1776696820692,
|
||||
"industryId": "02-Engineering"
|
||||
}
|
||||
]
|
||||
},
|
||||
"lastUpdated": 1776699418893
|
||||
}
|
||||
13
.workbuddy/memory/2026-04-12.md
Normal file
13
.workbuddy/memory/2026-04-12.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 2026-04-12 工作日志
|
||||
|
||||
## 修复登录日志时间显示问题
|
||||
|
||||
**问题描述**:小程序后台登录日志中的登录时间显示不正确,实际登录时间 9:20:20,显示为 17:16:31,相差约 8 小时。
|
||||
|
||||
**问题原因**:`LoginRecord` 实体类中的 `createTime` 和 `updateTime` 字段使用了 `@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")` 注解,但没有指定 `timezone` 属性。对于 `LocalDateTime` 类型,Jackson 序列化时未正确应用全局时区配置,导致时间多了 8 小时。
|
||||
|
||||
**修复方案**:为 `@JsonFormat` 注解添加 `timezone = "GMT+8"` 属性。
|
||||
|
||||
**修改文件**:`src/main/java/com/gxwebsoft/common/system/entity/LoginRecord.java`
|
||||
|
||||
**状态**:已修复
|
||||
15
.workbuddy/memory/2026-04-13.md
Normal file
15
.workbuddy/memory/2026-04-13.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 2026-04-13 工作日志
|
||||
|
||||
## 修复支付回调订单状态不更新问题
|
||||
|
||||
**问题描述**:支付成功后,订单支付状态没有更新,回调地址 `https://glt-api.websoft.top/api/shop/shop-order/notify` 接收到了通知但订单状态未改变。
|
||||
|
||||
**问题原因**:`ShopOrderController.java` 的 `wxNotify` 方法中,使用 `StrUtil.equals("支付成功", transaction.getTradeStateDesc())` 来判断支付状态。但微信返回的 `tradeStateDesc` 可能不是固定的 "支付成功" 字符串(可能是 "SUCCESS" 或其他描述),导致支付成功的回调没有被正确处理。
|
||||
|
||||
**修复方案**:将状态判断从字符串比较改为枚举值比较:
|
||||
- 原代码:`if (StrUtil.equals("支付成功", transaction.getTradeStateDesc()))`
|
||||
- 修复后:`if (Transaction.TradeStateEnum.SUCCESS.equals(transaction.getTradeState()))`
|
||||
|
||||
**修改文件**:`src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java`
|
||||
|
||||
**状态**:已修复
|
||||
75
.workbuddy/memory/2026-04-16.md
Normal file
75
.workbuddy/memory/2026-04-16.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# 2026-04-16 工作记录
|
||||
|
||||
## 支付回调状态不更新问题诊断与修复
|
||||
|
||||
**问题接口**: `POST /api/shop/shop-order/notify/{tenantId}`
|
||||
|
||||
### 发现的 Bug
|
||||
|
||||
1. **根因 Bug**:`ShopOrderServiceImpl.updateByOutTradeNo()` 第837行有 `order.setExpirationTime(null)`,强制覆盖了 Controller 中设置的 `expirationTime`(`LocalDateTime.now().plusYears(10)`),导致 XML 中 expirationTime 条件不生效。**已修复**:删除了该行。
|
||||
|
||||
2. **XML 缺少 `update_time`**:`ShopOrderMapper.xml` 的 `updateByOutTradeNo` SQL 的 `<set>` 块中没有 `update_time = NOW()` 和 `expiration_time` 字段。**已修复**:新增了这两个字段更新。
|
||||
|
||||
3. **回调地址路由问题**:Controller 路由为 `/notify/{tenantId}`,但测试访问的 `/notify`(无 tenantId)不存在,返回 fail。正确回调地址格式为 `https://glt-api.websoft.top/api/shop/shop-order/notify/{tenantId}`(需带租户ID)。**待检查**:数据库 Payment 表的 `notify_url` 字段是否正确配置了带 tenantId 的完整路径。
|
||||
|
||||
### 修复文件
|
||||
- `src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java`
|
||||
- `src/main/java/com/gxwebsoft/shop/mapper/xml/ShopOrderMapper.xml`
|
||||
|
||||
---
|
||||
|
||||
## 支付回调签名验证失败:Transaction 类错误(00:29修复)
|
||||
|
||||
**错误日志关键信息**:
|
||||
```
|
||||
signature verification failed, signType[WECHATPAY2-SHA256-RSA2048]
|
||||
serial[test] message[test\ntest\n{"test":"test"}] sign[test]
|
||||
```
|
||||
|
||||
### 根本原因(最致命)
|
||||
|
||||
`ShopOrderController.java` 导入了 **服务商模式** 的 Transaction 类:
|
||||
```java
|
||||
// 错误(服务商模式)
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||
```
|
||||
而 `ShopOrderServiceImpl.java` 下单时用的是**直连商户模式**:
|
||||
```java
|
||||
// 正确(直连商户模式)
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
```
|
||||
两个 Transaction 包路径不同,字段结构有差异(服务商 Transaction 有 spAppid/spMchid 等字段),用错误的类解析回调会导致字段映射失败,交易状态无法正确读取。**已修复**:改为正确的直连商户模式 Transaction。
|
||||
|
||||
---
|
||||
|
||||
## 配送员提成直接入账(01:15修改)
|
||||
|
||||
**文件**:`src/main/java/com/gxwebsoft/glt/service/impl/GltTicketOrderServiceImpl.java`
|
||||
|
||||
**变更**:配送员提成(ticketOrderId 关联送水订单)从进入 `freeze_money` 改为直接进入 `money`(可提现余额)。修改了 2 处 `LambdaUpdateWrapper` SQL(`freeze_money` → `money`),注释同步更新。`total_money` 不变(仍累计)。
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
## 分销佣金解冻任务分析(DealerCommissionUnfreeze10584Task)
|
||||
|
||||
**订单号**:2038841514750459904
|
||||
|
||||
### 解冻规则
|
||||
- **送水套餐**(shop_order.form_id IN 水票模板的 goods_id):该订单关联的水票第一条送水订单 deliveryStatus=40(已完成)才触发解冻
|
||||
- **非送水套餐**(form_id 不在水票模板中):shop_order.order_status=1 即触发解冻
|
||||
|
||||
### "已送达"≠"已完成"的关键区别
|
||||
- deliveryStatus=30(送达待确认):配送员拍照确认送达,此时**不触发解冻**
|
||||
- deliveryStatus=40(已完成):需用户手动确认收货 OR 超时24h自动确认后才到达此状态
|
||||
|
||||
### 常见未解冻原因(按排查优先级)
|
||||
1. 送水订单停在 deliveryStatus=30(送达待确认),未到 40(已完成)
|
||||
2. shop_order.form_id 在水票模板里,走的是"送水套餐"逻辑,但没有找到对应的 glt_user_ticket 记录
|
||||
3. glt_user_ticket 记录缺失或 order_no 字段为空
|
||||
4. 已有 flowType=50 的解冻 marker(说明已解冻)
|
||||
|
||||
### 次要原因
|
||||
|
||||
`RSAAutoCertificateConfig` 每次回调都重新 `build()`,SDK 内部会发一次 `serial=test` 的探测验签,网络问题或并发场景下可能导致首次回调失败。**已优化**:添加 `notifyConfigCache`(ConcurrentHashMap)按 mchId 缓存 config,避免重复初始化。
|
||||
13
.workbuddy/memory/2026-04-18.md
Normal file
13
.workbuddy/memory/2026-04-18.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 2026-04-18 工作日志
|
||||
|
||||
## 排查解冻任务未触发问题
|
||||
- 用户反馈:GltTicketOrder订单已完成配送,但部分订单未触发解冻(freezeMoney未转到money)
|
||||
- 完整梳理了资金流转链路:结算→冻结→解冻
|
||||
- 识别出5个可能原因:
|
||||
1. GltTicketOrder.userTicketId为NULL(解冻任务硬性过滤条件)
|
||||
2. GltUserTicket.orderNo缺失导致关联断裂
|
||||
3. isFirstTicketOrderFinished()"第一条"逻辑阻断后续订单解冻
|
||||
4. loadWaterFormIds()返回空集导致整个解冻任务跳过
|
||||
5. 配送员提成orderNo格式不匹配(非bug,配送员提成本身不经过冻结)
|
||||
- 提供了5条排查SQL和修复建议
|
||||
- 关键文件:DealerCommissionUnfreeze10584Task.java、GltTicketOrderServiceImpl.java
|
||||
18
.workbuddy/memory/2026-04-21.md
Normal file
18
.workbuddy/memory/2026-04-21.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# 2026-04-21 日志
|
||||
|
||||
## WxLoginController.getOrderQRCodeUnlimited 修复(完整)
|
||||
|
||||
### 根因
|
||||
1. `extractTenantIdFromScene` 通过 `selectByIdIgnoreTenant` 反查用户获取 tenantId,userId=35280 在多租户下有2条记录 → `TooManyResultsException`
|
||||
2. 异常被 catch 后 fallback 到默认租户 10550,Redis 中无 `mp-weixin:10550` 缓存 → 最终失败
|
||||
3. 第 452 行 `website.getRunning().equals(2)` 存在 NPE 风险
|
||||
|
||||
### 修复内容
|
||||
- **后端 WxLoginController**: scene 格式改为 `uid_userId_tenantId`,优先从 scene 直接解析 tenantId;兼容旧 `uid_userId` 格式时改用 `selectList` 避免多条记录异常
|
||||
- **后端 UserMapper/UserService**: `selectByIdIgnoreTenant` 返回类型从 `User` 改为 `List<User>`;新增 `listByIdIgnoreTenant` 方法
|
||||
- **后端 NPE 修复**: `website.getRunning().equals(2)` → `website != null && Integer.valueOf(2).equals(website.getRunning())`
|
||||
- **前端 3 个 vue**: scene 从 `uid_${userId}` 改为 `uid_${userId}_${tenantId}`(从 tenantStore.company.tenantId 获取)
|
||||
- shopDealerUser/index.vue
|
||||
- shopDealerUserShop/index.vue
|
||||
- shopDealerUserDelivery/index.vue
|
||||
|
||||
32
.workbuddy/memory/MEMORY.md
Normal file
32
.workbuddy/memory/MEMORY.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# MEMORY.md - 长期记忆
|
||||
|
||||
## 项目概况
|
||||
- 后端:/Users/gxwebsoft/JAVA/java-10584(Spring Boot + MyBatis-Plus)
|
||||
- 后台管理:/Users/gxwebsoft/VUE/mp-10584
|
||||
- 小程序端:/Users/gxwebsoft/VUE/template-10584
|
||||
- 多租户架构(tenantId 隔离),主力租户 10584
|
||||
|
||||
## 技术栈
|
||||
- 后端:Spring Boot + MyBatis-Plus + FastJSON 2.x
|
||||
- 前端:Nuxt/Vue3 + TypeScript + Ant Design Vue4 + Tailwind
|
||||
- 小程序:Uni-app/Taro
|
||||
- 开发环境:Mac + Node.js v22 + JetBrains + Docker + pnpm
|
||||
|
||||
## 业务规则备忘
|
||||
|
||||
### 分销佣金解冻规则(10584)
|
||||
- 结算:DealerOrderSettlement10584Task 每10秒,佣金先入 freezeMoney
|
||||
- 解冻:DealerCommissionUnfreeze10584Task 每20秒,freezeMoney→money
|
||||
- 送水套餐解冻条件:同一userTicketId下第一条送水订单deliveryStatus=40
|
||||
- 非送水套餐解冻条件:ShopOrder.orderStatus=1 且 payStatus=true
|
||||
- 幂等标记:ShopDealerCapital(flowType=50, comments="佣金解冻(capitalId=xxx)")
|
||||
- 配送员提成:直接入money(不经过冻结),orderNo格式="gltTicketOrder:"+id
|
||||
|
||||
### 送水订单状态流转
|
||||
- 10(待配送)→20(配送中)→30(待客户确认)→40(已完成)
|
||||
- delivered()配送员确认送达时就会同步ShopOrder.orderStatus=1
|
||||
- confirmReceive()/autoConfirmTimeout()也会同步
|
||||
|
||||
### 已知排查问题
|
||||
- 解冻任务可能因 userTicketId为空、GltUserTicket.orderNo缺失、"第一条未完成"阻断等原因未触发
|
||||
- 解冻任务依赖 loadWaterFormIds() 不为空,否则整个任务跳过
|
||||
5
.workbuddy/settings.local.json
Normal file
5
.workbuddy/settings.local.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"modern-webapp@cb_teams_marketplace": true
|
||||
}
|
||||
}
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.gxwebsoft</groupId>
|
||||
<artifactId>mp-api</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<version>1.0</version>
|
||||
|
||||
<name>mp-api</name>
|
||||
<description>WebSoftApi project for Spring Boot</description>
|
||||
|
||||
7
sql/glt_ticket_order_delivery_fields.sql
Normal file
7
sql/glt_ticket_order_delivery_fields.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- 配送方式、楼层、配送费字段
|
||||
-- 对应需求:送水订单下单时选择配送方式(电梯/步梯/一楼商铺),步梯送上楼需选楼层,配送费 = 数量 × (楼层-1)
|
||||
|
||||
ALTER TABLE glt_ticket_order
|
||||
ADD COLUMN delivery_method VARCHAR(32) DEFAULT NULL COMMENT '配送方式:elevator(电梯) / stairs(步梯) / groundFloor(一楼商铺/其他)' AFTER buyer_remarks,
|
||||
ADD COLUMN delivery_floor INT DEFAULT NULL COMMENT '楼层(步梯+送上楼时有值,从2开始)' AFTER delivery_method,
|
||||
ADD COLUMN delivery_fee DECIMAL(10,2) DEFAULT NULL COMMENT '配送费(数量 × (楼层-1))' AFTER delivery_floor;
|
||||
@@ -1,104 +0,0 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,239 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,345 +0,0 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
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") ? "男" : "女";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
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") ? "男" : "女";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,126 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,114 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
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);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
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();
|
||||
}
|
||||
@@ -1,239 +0,0 @@
|
||||
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"));
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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.
@@ -1,24 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,114 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,86 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user