Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
570ed10c33 | ||
|
|
d47737de5e | ||
|
|
991dbabe8a | ||
|
|
2f5712a678 | ||
|
|
41bce5c0b2 | ||
|
|
5c8b56430d | ||
|
|
674891eba3 | ||
|
|
a8e8b53203 | ||
|
|
a835b874ad | ||
|
|
b6058c5f80 | ||
|
|
245cffecb0 | ||
|
|
b7525d6c7c | ||
|
|
1ad322c16a | ||
|
|
d08d20f1ee | ||
|
|
c260b1d79b | ||
|
|
1028a4e4e1 | ||
|
|
4a15ebe0d2 | ||
|
|
0ae963c4cf | ||
|
|
07d6f21fed | ||
|
|
26ae76a398 | ||
|
|
468314df64 | ||
|
|
3b7f260103 | ||
|
|
693749fece | ||
|
|
e9360d1ad9 | ||
|
|
ab0470c04c | ||
|
|
05c37fd532 | ||
|
|
670d82c868 | ||
|
|
c3afd0adfa | ||
|
|
44e8ac7da5 | ||
|
|
1167ac792e | ||
|
|
df41e0c8ce | ||
|
|
f6f70ebf32 | ||
|
|
661079dd3a | ||
|
|
9111cb40c6 | ||
|
|
3aa16600d8 | ||
|
|
32d8ad3652 | ||
|
|
b5c5251913 | ||
|
|
38a0aa07dd | ||
|
|
be701122ca | ||
|
|
1a5a2dcb3f | ||
|
|
fecfb2a355 | ||
|
|
f604d18b32 | ||
|
|
145cf89a89 | ||
|
|
d4f1d1a7bd | ||
|
|
2d5198ec3f | ||
|
|
e844fec480 | ||
|
|
194c3b2134 | ||
|
|
a1e5625ca7 | ||
|
|
e16c0c2536 | ||
|
|
66b77cc231 | ||
|
|
9b35cfe9c2 | ||
|
|
4898a63b4b | ||
|
|
37132eeeb6 | ||
|
|
8efc5bbd56 | ||
|
|
3c65f7eb24 | ||
|
|
bb95f1d78f | ||
|
|
1484f621bd | ||
|
|
f10221e92c | ||
|
|
945c0b46d7 | ||
|
|
74ecbe6bda | ||
|
|
fd7fd32c8d | ||
|
|
4cb3411eca | ||
|
|
9a022aa9cc | ||
|
|
ebc3a026d1 | ||
|
|
29c2be8856 | ||
|
|
9713b242e8 | ||
|
|
bbb0d5b0f8 | ||
|
|
3c5bfc8ad1 | ||
|
|
5612fe0752 | ||
|
|
3d8b930d1a | ||
|
|
8761a965aa | ||
|
|
3f63abe1e3 | ||
|
|
2cc0668391 | ||
|
|
c8c3598edd | ||
|
|
532041ff8d | ||
|
|
c6d12c9c68 | ||
|
|
6384021c4d | ||
|
|
74ebe26a6c | ||
|
|
7acee51892 | ||
|
|
0b6b5856d1 | ||
|
|
7775f6eef4 | ||
|
|
99f150be25 | ||
|
|
eb33cc2408 | ||
|
|
d11d605418 | ||
|
|
2d3f3670e0 | ||
|
|
b4111900f1 | ||
|
|
74310b095c | ||
|
|
61f26973ae | ||
|
|
270c9a52f9 | ||
|
|
86fa43c284 | ||
|
|
42c7d223c9 | ||
|
|
15dfd6a9c7 | ||
|
|
10d7a2f908 | ||
|
|
98a06d0c66 | ||
|
|
a7a037daf9 | ||
|
|
cb5bbb1021 | ||
|
|
a7cafe9d7f | ||
|
|
f273609f95 | ||
|
|
f1abb06ae8 | ||
|
|
c6338a8d45 | ||
|
|
66795541c0 | ||
|
|
0fed763499 | ||
|
|
786b053703 | ||
|
|
fda24ef418 | ||
|
|
5a870bb767 | ||
|
|
3005d8d80a | ||
|
|
fc347944a0 | ||
|
|
7aa25f5f3a | ||
|
|
4a139d9240 | ||
|
|
409b5bdfa0 | ||
|
|
de4b503376 | ||
|
|
a3bf6a2063 | ||
|
|
0389fc8390 | ||
|
|
344cd1ff5e | ||
|
|
412e66b3dd | ||
|
|
0b4f4a4d74 | ||
|
|
53d48fdd06 | ||
|
|
e2bac530e2 | ||
|
|
307cc42437 | ||
|
|
f7f27c34c9 | ||
|
|
a975e9d223 | ||
|
|
96e82801e0 | ||
|
|
86190b949f | ||
|
|
2214aee8b4 | ||
|
|
b0016073e3 | ||
|
|
d3f14ed824 | ||
|
|
b7906db202 | ||
|
|
04b00de86e | ||
|
|
25643710e3 | ||
|
|
bac673f2e8 | ||
|
|
01982703f4 | ||
|
|
d1e2f707ae | ||
|
|
156ccde751 | ||
|
|
f5d1090479 | ||
|
|
21f801019a | ||
|
|
961dc7c104 | ||
|
|
7d3ee66a4b | ||
|
|
2c9d1d8781 | ||
|
|
bc941755b3 | ||
|
|
7f27749cdf | ||
|
|
618020de3a | ||
|
|
f4598505c2 | ||
|
|
858e23a311 | ||
|
|
b5c87ed3ff | ||
|
|
ff63db7081 | ||
|
|
04c2a2218a | ||
|
|
c488d5c7ab | ||
|
|
e3f9545462 | ||
|
|
065dc6e7db | ||
|
|
073efdd34f | ||
|
|
bc40b561dc | ||
|
|
886c9d1dbc | ||
|
|
b9ea233a45 | ||
|
|
670f36a57b | ||
|
|
3733d442cc | ||
|
|
061749cfb3 | ||
|
|
0b403a559e | ||
|
|
8fd4cd9253 | ||
|
|
10d5e6ca4a | ||
|
|
d98884ea4c | ||
|
|
bab238daae | ||
|
|
5233e6cb4b | ||
|
|
224dae23ee | ||
|
|
5f790c0c7e | ||
|
|
890cdfe40d | ||
|
|
909ccacaeb | ||
|
|
9b3021e847 | ||
|
|
264ca97055 | ||
|
|
9251e202f3 | ||
|
|
5885cd2ea0 | ||
|
|
d2a2f8291c | ||
|
|
a38f8adfc8 | ||
|
|
4c98dd2d30 | ||
|
|
b751f40bb4 | ||
|
|
61045e4389 | ||
|
|
a3cb8a45ad | ||
|
|
fb5f142127 | ||
|
|
2c0d684079 | ||
|
|
98dc17552d | ||
|
|
e9784f7957 | ||
|
|
175238e291 | ||
|
|
3c822d581c | ||
|
|
77d72d1d78 | ||
|
|
9dbdd911d9 | ||
|
|
0022497f64 | ||
|
|
9714e97a71 | ||
|
|
65f5755422 | ||
|
|
677b4d5080 | ||
|
|
49f316dd82 | ||
|
|
b6aecf4e64 | ||
|
|
cd7f5661de | ||
|
|
6e005f2f4e | ||
|
|
03f8be4c98 | ||
|
|
b2b96290bf | ||
|
|
80d1cebc0f | ||
|
|
e064e312da | ||
|
|
173eaa1b60 | ||
|
|
ff4de69409 | ||
|
|
6b13ab307a | ||
|
|
b57482b0be | ||
|
|
41ab299602 | ||
|
|
e1eeafa13b | ||
|
|
e535308048 | ||
|
|
b03c4db189 | ||
|
|
a6aebf34b4 | ||
|
|
46c0c15bf2 | ||
|
|
e47a02f4cd | ||
|
|
6f404e466c | ||
|
|
40506c561c | ||
|
|
c73c1089ee | ||
|
|
fe014a56c8 | ||
|
|
24b1967ba9 | ||
|
|
c9020ee8d3 | ||
|
|
1a9c557899 | ||
|
|
8eca7a0232 | ||
|
|
b580502f48 | ||
|
|
654a842ed9 | ||
|
|
a58a007809 | ||
|
|
fdd6fce15c | ||
|
|
3a8252e81d | ||
|
|
4f8ca1b97b | ||
|
|
4ba67b70c5 | ||
|
|
58acc58338 | ||
|
|
410bd6efa6 | ||
|
|
a00d361f6b | ||
|
|
464abc6521 | ||
|
|
7362ca6b8a | ||
|
|
309bdc467e | ||
|
|
33470b1a04 | ||
|
|
66b90d1c14 | ||
|
|
de888296d9 | ||
|
|
fb699c5227 | ||
|
|
60edd2726d | ||
|
|
10c2b4737f | ||
|
|
a6935d9f42 | ||
|
|
ab7fe2a199 | ||
|
|
1495841ad2 | ||
|
|
9f583d8850 | ||
|
|
6381d7ab9c | ||
|
|
34c3c59c0c | ||
|
|
7b473e5e36 | ||
|
|
f5247cc21f | ||
|
|
1c7ba176f6 | ||
|
|
e45f571cd2 | ||
|
|
492e44bb80 | ||
|
|
66bb39bc18 | ||
|
|
5d66a58af9 | ||
|
|
9686399c80 | ||
|
|
19f6973a1f | ||
|
|
bffd4fa7df | ||
|
|
86862ea0a7 | ||
|
|
da9169f774 | ||
|
|
a972e556d9 | ||
|
|
b093d95463 | ||
|
|
a7bad9d444 | ||
|
|
9533c976f2 | ||
|
|
79c8bd0da1 | ||
|
|
7c337a40a7 | ||
|
|
3b25a26540 | ||
|
|
428992ca6d | ||
|
|
a59914b95c | ||
|
|
5c9cfbb7c3 | ||
|
|
9d157d17d5 | ||
|
|
f88bb0af52 | ||
|
|
117d9185f4 | ||
|
|
4d9051d5f9 | ||
|
|
6c3047abf2 | ||
|
|
9b15cb694d | ||
|
|
08b487accf | ||
|
|
3bc6566f2d | ||
|
|
fbf8b11d4f | ||
|
|
f2d63353b0 | ||
|
|
707e41025c | ||
|
|
8f1d3fdf2a | ||
|
|
24cd7cfdca | ||
|
|
2ca6c5f1cd | ||
|
|
5e4f95c10d | ||
|
|
de69956a71 | ||
|
|
7d316cdf47 | ||
|
|
9d6c2f2a14 | ||
|
|
569e23322f | ||
|
|
fe5ca6619c | ||
|
|
f73a09e91c | ||
|
|
9916e792db | ||
|
|
36bbbbf180 | ||
|
|
b8108c4908 | ||
|
|
06236177a3 | ||
|
|
930b806a25 | ||
|
|
0f6fc575d5 | ||
|
|
4446515656 | ||
|
|
3c7bda80bb | ||
|
|
f37963f141 | ||
|
|
5d0dc81279 | ||
|
|
22626eb9d5 | ||
|
|
0b5ec13aab | ||
|
|
595d702e9e | ||
|
|
a4a0265a82 | ||
|
|
430817655a | ||
|
|
536ca94d8b | ||
|
|
cb0d45c81b | ||
|
|
a20771f420 | ||
|
|
23b560ca01 | ||
|
|
cd6d48c22e | ||
|
|
5d6ab34fd2 | ||
|
|
ae4c5e7ee6 | ||
|
|
e7669dc8bc | ||
|
|
560fe0dc19 | ||
|
|
9086453544 | ||
|
|
8adaff4445 | ||
|
|
9942105af9 | ||
|
|
714bba6733 | ||
|
|
f09b695903 | ||
|
|
019c7d600a | ||
|
|
56697c1a78 | ||
|
|
fe0e075220 | ||
|
|
ee7ff671b5 | ||
|
|
d7d69755a7 | ||
|
|
5f612993c6 | ||
|
|
105bf98d25 | ||
|
|
354d3c82a2 | ||
|
|
3d5f72a26b | ||
|
|
551eaf50fb | ||
|
|
5aacb190ef | ||
|
|
e975d62c17 | ||
|
|
ec67a5e064 | ||
|
|
a1a9360d97 | ||
|
|
fba5870c50 | ||
|
|
7e310ba037 | ||
|
|
9e2ee4b81a | ||
|
|
0101561d12 | ||
|
|
54edb2032d | ||
|
|
34007bc02e | ||
|
|
348815ab68 | ||
|
|
e9be1437ce | ||
|
|
729fcef675 | ||
|
|
8780de32f2 | ||
|
|
75986f785b | ||
|
|
40ab4b65dd | ||
|
|
f2c6914fa9 | ||
|
|
92033a17cb | ||
|
|
6d747c49fb | ||
|
|
c3d68906ab | ||
|
|
5baa1b5479 | ||
|
|
3016f15244 | ||
|
|
c6bc9296e0 | ||
|
|
8ee7c1f9d1 | ||
|
|
36c67c6c2a | ||
|
|
15cbd2f085 | ||
|
|
a18166d6a8 | ||
|
|
0810aa1370 | ||
|
|
137b4efa38 | ||
|
|
051905a6f2 | ||
|
|
4356433ee0 | ||
|
|
e9774bc270 | ||
|
|
9f7882497b | ||
|
|
2a67051beb | ||
|
|
c808470275 | ||
|
|
2b6e5d2736 | ||
|
|
19e46db6a1 | ||
|
|
b678b33734 | ||
|
|
6d498f3b74 | ||
|
|
f2503fdd52 | ||
|
|
eba9ee928f | ||
|
|
9d68bcd2ff | ||
|
|
ff6e83f1c8 | ||
|
|
273d1377b9 | ||
|
|
106863d986 | ||
|
|
688abc5703 | ||
|
|
e9fada7bbd | ||
|
|
853eefb48c | ||
|
|
34c4e9accc | ||
|
|
8f73f46fcf | ||
|
|
cd6b8e49e5 | ||
|
|
3e4f5ebe3e | ||
|
|
2a7dde25ea | ||
|
|
59ade8db2b | ||
|
|
a035d3f47e | ||
|
|
4e4cce85e8 | ||
|
|
3a45a45f99 | ||
|
|
747c881b74 | ||
|
|
23c53a782c | ||
|
|
b327524823 | ||
|
|
63ce497551 | ||
|
|
49dd2287ad | ||
|
|
eeeaf9166b | ||
|
|
64b6c78b92 | ||
|
|
a68409917e | ||
|
|
17a693f768 | ||
|
|
2b2b070979 | ||
|
|
afa6942d77 | ||
|
|
e4d815ae54 | ||
|
|
476b3a00d5 | ||
|
|
7ea6dd3411 | ||
|
|
dce89d699a | ||
|
|
84e9334a20 | ||
|
|
73aeba99b3 | ||
|
|
6372acdf2d | ||
|
|
180734119a | ||
|
|
6139c70e97 | ||
|
|
b182e6e59e | ||
|
|
76cba3c817 | ||
|
|
36603cbda9 | ||
|
|
e334685b1d | ||
|
|
f16b65982c | ||
|
|
3684588a52 | ||
|
|
3169464045 | ||
|
|
df2b136b3e | ||
|
|
d5cfc9e76f | ||
|
|
d842bb1dbb | ||
|
|
f28b1e755b | ||
|
|
e64091efde | ||
|
|
34adc1a5e2 | ||
|
|
ac42d99bd2 | ||
|
|
e19f3f57b9 | ||
|
|
7c69912296 | ||
|
|
75d0775ca9 | ||
|
|
ec897c0567 | ||
|
|
19addb4469 | ||
|
|
65b15b8dbd | ||
|
|
2b25e0bf99 | ||
|
|
3a43716e9b | ||
|
|
e93fb4de8d | ||
|
|
5a1d6d828b | ||
|
|
c342a77af1 | ||
|
|
3bd73a6eb8 | ||
|
|
58f859bcac | ||
|
|
7e83999711 | ||
|
|
7fb0ac6aa6 | ||
|
|
909c083e51 | ||
|
|
e15aae5a26 | ||
|
|
2804df2af3 | ||
|
|
c91978f42a | ||
|
|
68fd95a017 |
@@ -0,0 +1,224 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📌 重要提示
|
||||||
|
|
||||||
|
**在开始工作前,请务必先阅读 `skills.md` 文件,了解当前任务的具体约束和技术指南。**
|
||||||
|
|
||||||
|
- **CLAUDE.md** (本文件): 项目通用知识库,包含架构、技术栈、开发规范等基础信息
|
||||||
|
- **skills.md**: 当前任务技能包,定义特定任务的范围约束、禁止事项和专项技术指南
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 项目概述
|
||||||
|
|
||||||
|
新疆油田健康管理平台 - 基于 JeecgBoot 3.6.3.1-plus 框架的微服务架构后端系统。
|
||||||
|
|
||||||
|
## 技术栈
|
||||||
|
|
||||||
|
- **框架版本**: Spring Boot 2.7.18, Spring Cloud 2021.0.9, Spring Cloud Alibaba 2021.0.6.0
|
||||||
|
- **JDK**: Java 1.8
|
||||||
|
- **构建工具**: Maven 3.x
|
||||||
|
- **服务治理**: Nacos 2.3.2 (配置中心 + 服务发现)
|
||||||
|
- **持久层**: MyBatis-Plus 3.5.6, MyBatis-Plus Join 1.5.3
|
||||||
|
- **数据源**: 动态多数据源 (Dynamic Datasource 4.3.0), Druid 1.2.18
|
||||||
|
- **数据库支持**: 达梦DM8 (主要), MySQL, Oracle, PostgreSQL
|
||||||
|
- **认证授权**: Shiro 1.13.0, JWT
|
||||||
|
- **文档**: Knife4j 4.5.0
|
||||||
|
- **报表**: 积木报表 1.6.1
|
||||||
|
- **对象存储**: MinIO, 阿里云OSS, 七牛云
|
||||||
|
|
||||||
|
## 微服务模块
|
||||||
|
|
||||||
|
项目采用多模块微服务架构,各服务独立部署:
|
||||||
|
|
||||||
|
| 服务名称 | 模块路径 | 默认端口 | 说明 |
|
||||||
|
|---------|---------|---------|------|
|
||||||
|
| health-system | jeecg-system/jeecg-system-start | 7001 | 系统核心服务(用户、角色、权限、租户管理) |
|
||||||
|
| health-consultation | health-consultation/health-consultation-start | 7010 | 健康咨询服务 |
|
||||||
|
| health-emergency | health-emergency/health-emergency-start | - | 急救服务 |
|
||||||
|
| health-watch | health-watch/health-watch-start | - | 手表数据服务 |
|
||||||
|
| health-im | health-im/health-im-start | - | 即时通讯服务 |
|
||||||
|
| health-bank | health-bank/health-bank-start | - | 健康银行服务 |
|
||||||
|
|
||||||
|
## 核心架构特性
|
||||||
|
|
||||||
|
### 1. 多租户(SaaS)架构
|
||||||
|
|
||||||
|
- **实现方式**: MyBatis-Plus TenantLineInnerInterceptor 租户拦截器
|
||||||
|
- **配置位置**: `jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java`
|
||||||
|
- **租户字段**: 数据表通过 `tenant_id` 字段实现租户隔离
|
||||||
|
- **隔离范围**: 用户、角色、部门、字典、多数据源等系统模块
|
||||||
|
- **非隔离表**: 菜单表、租户表不做租户隔离
|
||||||
|
|
||||||
|
### 2. 动态多数据源
|
||||||
|
|
||||||
|
- **配置**: 支持运行时动态切换数据源
|
||||||
|
- **主要数据库**: 达梦数据库 DM8 (国产数据库)
|
||||||
|
- **注解切换**: 使用 `@DS("数据源名称")` 注解切换数据源
|
||||||
|
- **拦截器**: `DmKeywordInterceptor` 处理达梦数据库关键字转义
|
||||||
|
|
||||||
|
### 3. 安眼系统集成
|
||||||
|
|
||||||
|
- **模块位置**: `functional-modules/xj-anyan-api`
|
||||||
|
- **执行器**: `AnYanClientExecutor` 实现与安眼系统的API对接
|
||||||
|
- **功能**: 统一身份认证、用户数据同步、登录集成
|
||||||
|
|
||||||
|
### 4. 环境配置
|
||||||
|
|
||||||
|
每个微服务启动模块都包含独立的 `.env` 文件用于环境变量配置:
|
||||||
|
|
||||||
|
```
|
||||||
|
PROFILE_NAME=dev # 环境名称
|
||||||
|
SERVER_PORT=7001 # 服务端口
|
||||||
|
NACOS_SERVER_ADDR=192.168.1.80:8848 # Nacos地址
|
||||||
|
NACOS_USERNAME=xjuser # Nacos用户名
|
||||||
|
NACOS_PASSWORD=Aa135790!123 # Nacos密码
|
||||||
|
NACOS_NAMESPACE=xjxc-space-common # 配置命名空间
|
||||||
|
NACOS_NAMESPACE_DISCOVERY=workspace_lian # 服务发现命名空间
|
||||||
|
NACOS_GROUP=dev # 配置分组
|
||||||
|
```
|
||||||
|
|
||||||
|
**注意**: `.env` 文件包含敏感信息,不应提交到版本控制系统。
|
||||||
|
|
||||||
|
## 常用开发命令
|
||||||
|
|
||||||
|
### Maven 构建命令
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 全量编译打包(跳过测试)
|
||||||
|
mvn clean package -DskipTests
|
||||||
|
|
||||||
|
# 编译指定模块
|
||||||
|
mvn clean package -pl jeecg-system/jeecg-system-start -am -DskipTests
|
||||||
|
|
||||||
|
# 安装到本地仓库
|
||||||
|
mvn clean install -DskipTests
|
||||||
|
|
||||||
|
# 分包打包(依赖和应用分离,用于Docker部署)
|
||||||
|
mvn clean package -P divide-package -DskipTests
|
||||||
|
|
||||||
|
# 依赖漏洞分析
|
||||||
|
mvn clean package -P bom-analysis
|
||||||
|
```
|
||||||
|
|
||||||
|
### 启动服务
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 方式1: IDE直接运行启动类
|
||||||
|
# 例如: org.jeecg.JeecgSystemCloudApplication
|
||||||
|
|
||||||
|
# 方式2: 使用 spring-boot-maven-plugin 启动
|
||||||
|
cd jeecg-system/jeecg-system-start
|
||||||
|
mvn spring-boot:run
|
||||||
|
|
||||||
|
# 方式3: 打包后启动
|
||||||
|
java -jar jeecg-system/jeecg-system-start/target/jeecg-system-start.jar
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker 部署
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 构建 Docker 镜像(在各服务的 start 模块目录执行)
|
||||||
|
cd jeecg-system/jeecg-system-start
|
||||||
|
docker build -t health-system:latest .
|
||||||
|
|
||||||
|
# 运行容器
|
||||||
|
docker run -d \
|
||||||
|
-p 7001:7001 \
|
||||||
|
-e PROFILE_NAME=dev \
|
||||||
|
-e NACOS_SERVER_ADDR=nacos:8848 \
|
||||||
|
--name health-system \
|
||||||
|
health-system:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## 代码规范
|
||||||
|
|
||||||
|
### 包结构约定
|
||||||
|
|
||||||
|
```
|
||||||
|
com.renkang / org.jeecg
|
||||||
|
├── modules
|
||||||
|
│ └── [模块名]
|
||||||
|
│ ├── controller # 控制器层
|
||||||
|
│ ├── service # 服务层
|
||||||
|
│ │ └── impl # 服务实现
|
||||||
|
│ ├── mapper # 数据访问层
|
||||||
|
│ │ └── xml # MyBatis XML映射文件
|
||||||
|
│ ├── entity # 实体类
|
||||||
|
│ ├── vo # 视图对象
|
||||||
|
│ └── dto # 数据传输对象
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mapper扫描路径
|
||||||
|
|
||||||
|
在 `MybatisPlusSaasConfig.java` 中配置了全局 Mapper 扫描:
|
||||||
|
|
||||||
|
```java
|
||||||
|
@MapperScan(value = {"org.jeecg.modules.**.mapper*", "com.renkang.**.mapper*", "com.jeecg.**.mapper*"})
|
||||||
|
```
|
||||||
|
|
||||||
|
### MyBatis XML 映射文件位置
|
||||||
|
|
||||||
|
- **方式1**: 放在 `src/main/resources/mapper` 或 `src/main/resources/mapper/xml`
|
||||||
|
- **方式2**: 与 Mapper 接口同目录,在 `src/main/java` 下 (已配置资源过滤)
|
||||||
|
|
||||||
|
### 多租户开发注意事项
|
||||||
|
|
||||||
|
1. 新增业务表时,需要添加 `tenant_id` 字段用于租户隔离
|
||||||
|
2. 如果某些表不需要租户隔离,需要在 `MybatisPlusSaasConfig` 的 `TenantLineHandler` 中排除
|
||||||
|
3. 租户ID由拦截器自动注入,业务代码无需手动设置
|
||||||
|
|
||||||
|
### 动态数据源使用
|
||||||
|
|
||||||
|
```java
|
||||||
|
@Service
|
||||||
|
public class UserService {
|
||||||
|
|
||||||
|
@DS("slave") // 切换到从库
|
||||||
|
public List<User> queryUsers() {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("master") // 切换到主库
|
||||||
|
public void saveUser(User user) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 项目特定依赖
|
||||||
|
|
||||||
|
- **Aspose Words**: 文档处理库,用于生成Word报告
|
||||||
|
- **EasyExcel**: Excel导入导出
|
||||||
|
- **POI-TL**: Word模板引擎
|
||||||
|
- **极光推送**: 消息推送服务
|
||||||
|
- **微信小程序**: 小程序API集成
|
||||||
|
- **北郊工具**: 膳食摄入算法工具 (`yixiong-tools`)
|
||||||
|
- **重庆风险评估**: 健康风险评估工具 (`cqRisk`)
|
||||||
|
|
||||||
|
## 重要配置文件
|
||||||
|
|
||||||
|
- **根 pom.xml**: 定义所有依赖版本和Maven仓库配置
|
||||||
|
- **application.yml**: 各服务启动配置,从Nacos加载配置
|
||||||
|
- **.env**: 环境变量配置,控制Nacos连接和服务端口
|
||||||
|
- **Dockerfile**: 各服务的容器化配置
|
||||||
|
|
||||||
|
## 开发工具推荐
|
||||||
|
|
||||||
|
- **IDE**: IntelliJ IDEA
|
||||||
|
- **数据库工具**: DM数据库客户端 (达梦官方), Navicat (支持达梦插件)
|
||||||
|
- **API测试**: Knife4j Web UI (启动服务后访问 `/doc.html`)
|
||||||
|
- **服务监控**: Nacos 控制台
|
||||||
|
|
||||||
|
## 调试建议
|
||||||
|
|
||||||
|
1. 确保 Nacos 服务已启动并可访问
|
||||||
|
2. 检查 `.env` 文件中的 Nacos 配置是否正确
|
||||||
|
3. 在 Nacos 配置中心确认对应的配置文件存在 (`jeecg.yaml`, `health-system-dev.yaml` 等)
|
||||||
|
4. 查看日志目录 `logs/` 下的服务日志文件
|
||||||
|
5. 多租户问题排查: 检查请求Header中的 `tenant-id` 或 `X-Access-Token` (从Token解析租户ID)
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE "QH_HLT_USER_EMPLOYEE_EX" ADD "NON_CARE_FLAG" INT DEFAULT null;
|
||||||
|
COMMENT ON COLUMN "QH_HLT_USER_EMPLOYEE_EX"."NON_CARE_FLAG" IS '非关爱人员标记:0-否,1-是';
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
-- 手表用户绑定数据视图
|
||||||
|
-- 关联 QH_WAT_DEVICE 与 QH_SYS_USER,查询已绑定用户的手表设备信息
|
||||||
|
CREATE OR REPLACE VIEW V_WATCH_USER_BIND AS
|
||||||
|
SELECT
|
||||||
|
u.WORK_NO AS employee_num,
|
||||||
|
d.WATCH_NO AS watch_no,
|
||||||
|
u.REALNAME AS real_name,
|
||||||
|
d.BIND_DATE AS bind_date
|
||||||
|
FROM QH_WAT_DEVICE d
|
||||||
|
INNER JOIN QH_SYS_USER u ON d.BIND_USER_ID = u.ID
|
||||||
|
WHERE d.BIND_USER_ID IS NOT NULL
|
||||||
|
AND d.BIND_USER_ID <> '';
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
-- =====================================================
|
||||||
|
-- 急救宣教资源管理 — 线上部署 SQL(达梦 DM8)
|
||||||
|
-- 包含:分类/标签、资源、用户行为、版本历史、审核记录、推送记录
|
||||||
|
-- 日期: 2026-06-25
|
||||||
|
-- =====================================================
|
||||||
|
|
||||||
|
-- 1. 资源分类/标签统一表
|
||||||
|
-- TYPE: 1=分类(树形), 2=标签(扁平)
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_RES_CATE" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"NAME" VARCHAR2(100) NOT NULL,
|
||||||
|
"TYPE" NUMBER(1) DEFAULT 1 NOT NULL,
|
||||||
|
"PARENT_ID" VARCHAR2(32),
|
||||||
|
"DESCRIPTION" VARCHAR2(500),
|
||||||
|
"SORT_NO" NUMBER(10) DEFAULT 0,
|
||||||
|
"STATUS" NUMBER(1) DEFAULT 1,
|
||||||
|
"CREATE_BY" VARCHAR2(50),
|
||||||
|
"CREATE_TIME" TIMESTAMP,
|
||||||
|
"UPDATE_BY" VARCHAR2(50),
|
||||||
|
"UPDATE_TIME" TIMESTAMP,
|
||||||
|
"DEL_FLAG" NUMBER(1) DEFAULT 0,
|
||||||
|
"MEMO" VARCHAR2(500),
|
||||||
|
PRIMARY KEY ("ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_RES_CATE" IS '急救宣教资源分类/标签';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."NAME" IS '名称';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."TYPE" IS '类型:1=分类,2=标签';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."PARENT_ID" IS '父分类ID(根分类为NULL,标签指向所属分类ID)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."DESCRIPTION" IS '描述';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."SORT_NO" IS '排序号';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."STATUS" IS '状态(1=正常,2=冻结)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."DEL_FLAG" IS '删除标记(0=正常,1=已删除)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_CATE"."MEMO" IS '备注';
|
||||||
|
CREATE INDEX "IDX_FA_CATEGORY_TYPE" ON "QH_EME_FIR_AID_RES_CATE"("TYPE");
|
||||||
|
CREATE INDEX "IDX_FA_CATEGORY_PARENT_ID" ON "QH_EME_FIR_AID_RES_CATE"("PARENT_ID");
|
||||||
|
|
||||||
|
-- 2. 资源表
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_RES" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"TITLE" VARCHAR2(200) NOT NULL,
|
||||||
|
"SUMMARY" VARCHAR2(500),
|
||||||
|
"CONTENT_TYPE" VARCHAR2(32),
|
||||||
|
"CATEGORY_ID" VARCHAR2(32),
|
||||||
|
"APPLICABLE_SCENARIO" VARCHAR2(500),
|
||||||
|
"TAGS" VARCHAR2(2000),
|
||||||
|
"CONTENT" CLOB,
|
||||||
|
"COVER_IMAGE" VARCHAR2(500),
|
||||||
|
"FILE_URL" CLOB,
|
||||||
|
"EFFECTIVE_TIME" TIMESTAMP,
|
||||||
|
"EXPIRY_TIME" TIMESTAMP,
|
||||||
|
"AUDIT_STATUS" NUMBER(2),
|
||||||
|
"AUDIT_REJECT_REASON" VARCHAR2(500),
|
||||||
|
"AUDIT_BY" VARCHAR2(50),
|
||||||
|
"AUDIT_BY_ID" VARCHAR2(32),
|
||||||
|
"AUDIT_TIME" TIMESTAMP,
|
||||||
|
"VIEW_COUNT" NUMBER(10) DEFAULT 0,
|
||||||
|
"FAVORITE_COUNT" NUMBER(10) DEFAULT 0,
|
||||||
|
"STATUS" NUMBER(1) DEFAULT 0,
|
||||||
|
"CREATE_BY" VARCHAR2(50),
|
||||||
|
"CREATE_TIME" TIMESTAMP,
|
||||||
|
"UPDATE_BY" VARCHAR2(50),
|
||||||
|
"UPDATE_TIME" TIMESTAMP,
|
||||||
|
"DEL_FLAG" NUMBER(1) DEFAULT 0,
|
||||||
|
"MEMO" VARCHAR2(500),
|
||||||
|
PRIMARY KEY ("ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_RES" IS '急救宣教资源';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."TITLE" IS '标题';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."SUMMARY" IS '摘要/简介';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."CONTENT_TYPE" IS '内容类型:IMAGE_TEXT=图文/VIDEO=视频/AUDIO=音频/PDF';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."CATEGORY_ID" IS '所属分类ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."APPLICABLE_SCENARIO" IS '适用场景';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."TAGS" IS '标签ID列表(逗号分隔)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."CONTENT" IS '正文内容(富文本HTML)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."COVER_IMAGE" IS '封面图URL';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."FILE_URL" IS '附件URL列表(JSON数组)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."EFFECTIVE_TIME" IS '生效时间';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."EXPIRY_TIME" IS '失效时间';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."AUDIT_STATUS" IS '审核状态(NULL=无审核/10=待审核/11=已通过/12=已驳回)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."AUDIT_REJECT_REASON" IS '驳回原因';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."AUDIT_BY" IS '审核人';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."AUDIT_BY_ID" IS '审核人ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."AUDIT_TIME" IS '审核时间';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."VIEW_COUNT" IS '浏览次数';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."FAVORITE_COUNT" IS '收藏次数';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."STATUS" IS '发布状态(0=草稿,1=已发布,2=已下架)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."DEL_FLAG" IS '删除标记(0=正常,1=已删除)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES"."MEMO" IS '备注';
|
||||||
|
CREATE INDEX "IDX_FA_RESOURCE_CATEGORY_ID" ON "QH_EME_FIR_AID_RES"("CATEGORY_ID");
|
||||||
|
CREATE INDEX "IDX_FA_RESOURCE_AUDIT_STATUS" ON "QH_EME_FIR_AID_RES"("AUDIT_STATUS");
|
||||||
|
CREATE INDEX "IDX_FA_RESOURCE_EFFECTIVE_TIME" ON "QH_EME_FIR_AID_RES"("EFFECTIVE_TIME");
|
||||||
|
|
||||||
|
-- 3. 用户行为记录表(阅读+收藏)
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_RES_UACT" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"RESOURCE_ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"USER_ID" VARCHAR2(50) NOT NULL,
|
||||||
|
"TYPE" NUMBER(1) NOT NULL,
|
||||||
|
"CREATE_TIME" TIMESTAMP,
|
||||||
|
PRIMARY KEY ("ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_RES_UACT" IS '用户行为记录(阅读/收藏)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_UACT"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_UACT"."RESOURCE_ID" IS '资源ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_UACT"."USER_ID" IS '用户ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_UACT"."TYPE" IS '行为类型:1=阅读,2=收藏';
|
||||||
|
CREATE UNIQUE INDEX "UK_FA_USER_ACTION" ON "QH_EME_FIR_AID_RES_UACT"("RESOURCE_ID", "USER_ID", "TYPE");
|
||||||
|
CREATE INDEX "IDX_FA_USER_ACTION_USER_TYPE" ON "QH_EME_FIR_AID_RES_UACT"("USER_ID", "TYPE");
|
||||||
|
|
||||||
|
-- 4. 版本历史表
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_RES_VER" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"RESOURCE_ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"VERSION_NO" NUMBER(10) NOT NULL,
|
||||||
|
"TITLE" VARCHAR2(200),
|
||||||
|
"CONTENT" CLOB,
|
||||||
|
"CHANGE_DESCRIPTION" VARCHAR2(500),
|
||||||
|
"IS_CURRENT" NUMBER(1) DEFAULT 0,
|
||||||
|
"CREATE_BY" VARCHAR2(50),
|
||||||
|
"CREATE_TIME" TIMESTAMP,
|
||||||
|
PRIMARY KEY ("ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_RES_VER" IS '资源版本历史';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."RESOURCE_ID" IS '资源ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."VERSION_NO" IS '版本号';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."TITLE" IS '版本时的标题';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."CONTENT" IS '版本时的正文内容';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."CHANGE_DESCRIPTION" IS '变更描述';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_VER"."IS_CURRENT" IS '是否当前版本(1=是,0=否)';
|
||||||
|
CREATE INDEX "IDX_FA_VERSION_RESOURCE_ID" ON "QH_EME_FIR_AID_RES_VER"("RESOURCE_ID");
|
||||||
|
|
||||||
|
-- 5. 审核记录表
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_RES_AUD" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"RESOURCE_ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"AUDIT_STATUS" NUMBER(2),
|
||||||
|
"AUDIT_REJECT_REASON" VARCHAR2(500),
|
||||||
|
"AUDIT_BY" VARCHAR2(50),
|
||||||
|
"AUDIT_BY_ID" VARCHAR2(32),
|
||||||
|
"AUDIT_TIME" TIMESTAMP,
|
||||||
|
"CREATE_TIME" TIMESTAMP DEFAULT SYSDATE,
|
||||||
|
PRIMARY KEY ("ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_RES_AUD" IS '急救宣教资源审核记录';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."RESOURCE_ID" IS '关联资源ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."AUDIT_STATUS" IS '审核状态:10=待审核,11=已通过,12=已驳回';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."AUDIT_REJECT_REASON" IS '驳回原因';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."AUDIT_BY" IS '审核人';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."AUDIT_BY_ID" IS '审核人ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."AUDIT_TIME" IS '审核时间';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_RES_AUD"."CREATE_TIME" IS '创建时间';
|
||||||
|
CREATE INDEX "IDX_FA_AUDIT_RESOURCE_ID" ON "QH_EME_FIR_AID_RES_AUD"("RESOURCE_ID");
|
||||||
|
|
||||||
|
-- 6. 推送记录表
|
||||||
|
CREATE TABLE "QH_EME_FIR_AID_PUSH_RD" (
|
||||||
|
"ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"RESOURCE_ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"RESOURCE_TITLE" VARCHAR2(200) DEFAULT NULL,
|
||||||
|
"ORDER_ID" VARCHAR2(32) NOT NULL,
|
||||||
|
"TARGET_USER_ID" VARCHAR2(32) DEFAULT NULL,
|
||||||
|
"PUSH_BY" VARCHAR2(50) DEFAULT NULL,
|
||||||
|
"PUSH_BY_ID" VARCHAR2(32) DEFAULT NULL,
|
||||||
|
"PUSH_TIME" TIMESTAMP DEFAULT NULL,
|
||||||
|
"TENANT_ID" VARCHAR2(32) DEFAULT NULL,
|
||||||
|
PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT "UK_ORDER_RESOURCE" UNIQUE ("ORDER_ID", "RESOURCE_ID")
|
||||||
|
);
|
||||||
|
COMMENT ON TABLE "QH_EME_FIR_AID_PUSH_RD" IS '急救宣教推送记录表';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."ID" IS '主键';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."RESOURCE_ID" IS '资源ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."RESOURCE_TITLE" IS '资源标题(冗余)';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."ORDER_ID" IS '关联应急工单ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."TARGET_USER_ID" IS '推送目标用户ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."PUSH_BY" IS '推送人';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."PUSH_BY_ID" IS '推送人ID';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."PUSH_TIME" IS '推送时间';
|
||||||
|
COMMENT ON COLUMN "QH_EME_FIR_AID_PUSH_RD"."TENANT_ID" IS '租户ID';
|
||||||
|
CREATE INDEX "IDX_FA_PUSH_RECORD_ORDER_ID" ON "QH_EME_FIR_AID_PUSH_RD"("ORDER_ID");
|
||||||
|
|
||||||
|
-- 7. 字典数据
|
||||||
|
-- 7.1 内容类型
|
||||||
|
INSERT INTO "QH_SYS_DICT" ("ID", "TYPE", "DICT_NAME", "DICT_CODE", "DESCRIPTION", "DEL_FLAG", "TENANT_ID", "LOW_APP_ID", "CREATE_BY", "CREATE_TIME", "UPDATE_BY", "UPDATE_TIME")
|
||||||
|
VALUES ('1589123456789100001', 0, '内容类型', 'first_aid_content_type', '急救宣教资源内容类型', 0, 0, NULL, 'admin', SYSDATE, 'admin', SYSDATE);
|
||||||
|
|
||||||
|
INSERT INTO "QH_SYS_DICT_ITEM" ("ID", "DICT_ID", "ITEM_TEXT", "ITEM_VALUE", "DESCRIPTION", "SORT_ORDER", "STATUS", "CREATE_BY", "CREATE_TIME", "UPDATE_BY", "UPDATE_TIME") VALUES
|
||||||
|
('1589123456789100011', '1589123456789100001', '图文', 'IMAGE_TEXT', '图文内容', 1, 1, 'admin', SYSDATE, 'admin', SYSDATE);
|
||||||
|
|
||||||
|
INSERT INTO "QH_SYS_DICT_ITEM" ("ID", "DICT_ID", "ITEM_TEXT", "ITEM_VALUE", "DESCRIPTION", "SORT_ORDER", "STATUS", "CREATE_BY", "CREATE_TIME", "UPDATE_BY", "UPDATE_TIME") VALUES
|
||||||
|
('1589123456789100012', '1589123456789100001', '视频', 'VIDEO', '视频内容', 2, 1, 'admin', SYSDATE, 'admin', SYSDATE);
|
||||||
|
|
||||||
|
INSERT INTO "QH_SYS_DICT_ITEM" ("ID", "DICT_ID", "ITEM_TEXT", "ITEM_VALUE", "DESCRIPTION", "SORT_ORDER", "STATUS", "CREATE_BY", "CREATE_TIME", "UPDATE_BY", "UPDATE_TIME") VALUES
|
||||||
|
('1589123456789100013', '1589123456789100001', '音频', 'AUDIO', '音频内容', 3, 1, 'admin', SYSDATE, 'admin', SYSDATE);
|
||||||
|
|
||||||
|
INSERT INTO "QH_SYS_DICT_ITEM" ("ID", "DICT_ID", "ITEM_TEXT", "ITEM_VALUE", "DESCRIPTION", "SORT_ORDER", "STATUS", "CREATE_BY", "CREATE_TIME", "UPDATE_BY", "UPDATE_TIME") VALUES
|
||||||
|
('1589123456789100014', '1589123456789100001', 'PDF', 'PDF', 'PDF文档', 4, 1, 'admin', SYSDATE, 'admin', SYSDATE);
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
-- =====================================================
|
||||||
|
-- 缩短急救宣教相关表名(达梦数据库)
|
||||||
|
-- 原因:原表名超过数据库限制
|
||||||
|
-- 日期:2026-08-10
|
||||||
|
-- =====================================================
|
||||||
|
|
||||||
|
-- 1. 急救资源分类表
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_RESOURCE_CATEGORY RENAME TO QH_EME_FIR_AID_RES_CATE;
|
||||||
|
|
||||||
|
-- 2. 用户操作记录表
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_RESOURCE_USER_ACTION RENAME TO QH_EME_FIR_AID_RES_UACT;
|
||||||
|
|
||||||
|
-- 3. 资源版本表
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_RESOURCE_VERSION RENAME TO QH_EME_FIR_AID_RES_VER;
|
||||||
|
|
||||||
|
-- 4. 资源审核表
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_RESOURCE_AUDIT RENAME TO QH_EME_FIR_AID_RES_AUD;
|
||||||
|
|
||||||
|
-- 5. 推送记录表
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_PUSH_RECORD RENAME TO QH_EME_FIR_AID_PUSH_RD;
|
||||||
|
|
||||||
|
-- 6. 急救资源主表(最后执行,避免外键依赖)
|
||||||
|
ALTER TABLE QH_EME_FIRST_AID_RESOURCE RENAME TO QH_EME_FIR_AID_RES;
|
||||||
|
|
||||||
|
-- =====================================================
|
||||||
|
-- 验证:确认新表名已生效
|
||||||
|
-- SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'QH_EME_FIR_AID_%';
|
||||||
|
-- =====================================================
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
-- QH_WAT_MONITOR_DATA 新增 EVENT_ID(事件ID)和 LOCATE_TIME(定位时间)字段
|
||||||
|
-- 数据库:118-DM 达梦数据库,SQL 全大写规范
|
||||||
|
ALTER TABLE "QH_WAT_MONITOR_DATA" ADD "EVENT_ID" VARCHAR(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE "QH_WAT_MONITOR_DATA" ADD "LOCATE_TIME" DATETIME DEFAULT NULL;
|
||||||
|
|
||||||
|
COMMENT ON COLUMN "QH_WAT_MONITOR_DATA"."EVENT_ID" IS '事件ID';
|
||||||
|
COMMENT ON COLUMN "QH_WAT_MONITOR_DATA"."LOCATE_TIME" IS '定位时间';
|
||||||
|
|
||||||
|
CREATE INDEX "IDX_EVENT_ID" ON "QH_WAT_MONITOR_DATA"("EVENT_ID");
|
||||||
|
CREATE INDEX "IDX_WATCH_NO_EVENT_ID" ON "QH_WAT_MONITOR_DATA"("WATCH_NO", "EVENT_ID");
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
spring:
|
|
||||||
datasource:
|
|
||||||
druid:
|
|
||||||
stat-view-servlet:
|
|
||||||
enabled: true
|
|
||||||
loginUsername: admin
|
|
||||||
loginPassword: 123456
|
|
||||||
allow:
|
|
||||||
web-stat-filter:
|
|
||||||
enabled: true
|
|
||||||
dynamic:
|
|
||||||
druid:
|
|
||||||
initial-size: 5
|
|
||||||
min-idle: 5
|
|
||||||
maxActive: 20
|
|
||||||
maxWait: 60000
|
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
|
||||||
minEvictableIdleTimeMillis: 300000
|
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
|
||||||
testWhileIdle: true
|
|
||||||
testOnBorrow: false
|
|
||||||
testOnReturn: false
|
|
||||||
poolPreparedStatements: true
|
|
||||||
maxPoolPreparedStatementPerConnectionSize: 20
|
|
||||||
filters: stat,wall,slf4j
|
|
||||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
|
||||||
datasource:
|
|
||||||
master:
|
|
||||||
url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
redis:
|
|
||||||
database: 0
|
|
||||||
host: jeecg-boot-redis
|
|
||||||
password:
|
|
||||||
port: 6379
|
|
||||||
rabbitmq:
|
|
||||||
host: jeecg-boot-rabbitmq
|
|
||||||
username: guest
|
|
||||||
password: guest
|
|
||||||
port: 5672
|
|
||||||
publisher-confirms: true
|
|
||||||
publisher-returns: true
|
|
||||||
virtual-host: /
|
|
||||||
listener:
|
|
||||||
simple:
|
|
||||||
acknowledge-mode: manual
|
|
||||||
concurrency: 1
|
|
||||||
max-concurrency: 1
|
|
||||||
retry:
|
|
||||||
enabled: true
|
|
||||||
minidao:
|
|
||||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
|
||||||
jeecg:
|
|
||||||
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
|
|
||||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
|
||||||
uploadType: local
|
|
||||||
domainUrl:
|
|
||||||
pc: http://localhost:3100
|
|
||||||
app: http://localhost:8051
|
|
||||||
path:
|
|
||||||
upload: /opt/upFiles
|
|
||||||
webapp: /opt/webapp
|
|
||||||
shiro:
|
|
||||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
|
|
||||||
oss:
|
|
||||||
endpoint: oss-cn-beijing.aliyuncs.com
|
|
||||||
accessKey: ??
|
|
||||||
secretKey: ??
|
|
||||||
bucketName: jeecgdev
|
|
||||||
staticDomain: ??
|
|
||||||
elasticsearch:
|
|
||||||
cluster-name: jeecg-ES
|
|
||||||
cluster-nodes: jeecg-boot-es:9200
|
|
||||||
check-enabled: false
|
|
||||||
file-view-domain: 127.0.0.1:8012
|
|
||||||
minio:
|
|
||||||
minio_url: http://minio.jeecg.com
|
|
||||||
minio_name: ??
|
|
||||||
minio_pass: ??
|
|
||||||
bucketName: otatest
|
|
||||||
jmreport:
|
|
||||||
mode: dev
|
|
||||||
is_verify_token: false
|
|
||||||
verify_methods: remove,delete,save,add,update
|
|
||||||
wps:
|
|
||||||
domain: https://wwo.wps.cn/office/
|
|
||||||
appid: ??
|
|
||||||
appsecret: ??
|
|
||||||
xxljob:
|
|
||||||
enabled: false
|
|
||||||
adminAddresses: http://jeecg-boot-xxljob:9080/xxl-job-admin
|
|
||||||
appname: ${spring.application.name}
|
|
||||||
accessToken: ''
|
|
||||||
logPath: logs/jeecg/job/jobhandler/
|
|
||||||
logRetentionDays: 30
|
|
||||||
redisson:
|
|
||||||
address: jeecg-boot-redis:6379
|
|
||||||
password:
|
|
||||||
type: STANDALONE
|
|
||||||
enabled: true
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
org.jeecg.modules.system.mapper: info
|
|
||||||
cas:
|
|
||||||
prefixUrl: http://localhost:8888/cas
|
|
||||||
knife4j:
|
|
||||||
production: false
|
|
||||||
basic:
|
|
||||||
enable: false
|
|
||||||
username: jeecg
|
|
||||||
password: jeecg1314
|
|
||||||
justauth:
|
|
||||||
enabled: true
|
|
||||||
type:
|
|
||||||
GITHUB:
|
|
||||||
client-id: ??
|
|
||||||
client-secret: ??
|
|
||||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/github/callback
|
|
||||||
WECHAT_ENTERPRISE:
|
|
||||||
client-id: ??
|
|
||||||
client-secret: ??
|
|
||||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/wechat_enterprise/callback
|
|
||||||
agent-id: ??
|
|
||||||
DINGTALK:
|
|
||||||
client-id: ??
|
|
||||||
client-secret: ??
|
|
||||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/dingtalk/callback
|
|
||||||
cache:
|
|
||||||
type: default
|
|
||||||
prefix: 'demo::'
|
|
||||||
timeout: 1h
|
|
||||||
third-app:
|
|
||||||
enabled: false
|
|
||||||
type:
|
|
||||||
WECHAT_ENTERPRISE:
|
|
||||||
enabled: false
|
|
||||||
client-id: ??
|
|
||||||
client-secret: ??
|
|
||||||
agent-id: ??
|
|
||||||
DINGTALK:
|
|
||||||
enabled: false
|
|
||||||
client-id: ??
|
|
||||||
client-secret: ??
|
|
||||||
agent-id: ??
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
jeecg:
|
|
||||||
route:
|
|
||||||
config:
|
|
||||||
#type:database nacos yml
|
|
||||||
data-type: database
|
|
||||||
group: DEFAULT_GROUP
|
|
||||||
data-id: jeecg-gateway-router
|
|
||||||
spring:
|
|
||||||
redis:
|
|
||||||
database: 0
|
|
||||||
host: jeecg-boot-redis
|
|
||||||
port: 6379
|
|
||||||
password:
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "jeecg-system",
|
|
||||||
"order": 0,
|
|
||||||
"predicates": [
|
|
||||||
{
|
|
||||||
"name": "Path",
|
|
||||||
"args": {
|
|
||||||
"_genkey_0": "/sys/**",
|
|
||||||
"_genkey_1": "/jmreport/**",
|
|
||||||
"_genkey_3": "/online/**",
|
|
||||||
"_genkey_4": "/generic/**"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"filters": [],
|
|
||||||
"uri": "lb://jeecg-system"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "jeecg-demo",
|
|
||||||
"order": 1,
|
|
||||||
"predicates": [
|
|
||||||
{
|
|
||||||
"name": "Path",
|
|
||||||
"args": {
|
|
||||||
"_genkey_0": "/mock/**",
|
|
||||||
"_genkey_1": "/test/**",
|
|
||||||
"_genkey_2": "/bigscreen/template1/**",
|
|
||||||
"_genkey_3": "/bigscreen/template2/**"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"filters": [],
|
|
||||||
"uri": "lb://jeecg-demo"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "jeecg-system-websocket",
|
|
||||||
"order": 2,
|
|
||||||
"predicates": [
|
|
||||||
{
|
|
||||||
"name": "Path",
|
|
||||||
"args": {
|
|
||||||
"_genkey_0": "/websocket/**",
|
|
||||||
"_genkey_1": "/newsWebsocket/**"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"filters": [],
|
|
||||||
"uri": "lb:ws://jeecg-system"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "jeecg-demo-websocket",
|
|
||||||
"order": 3,
|
|
||||||
"predicates": [
|
|
||||||
{
|
|
||||||
"name": "Path",
|
|
||||||
"args": {
|
|
||||||
"_genkey_0": "/vxeSocket/**"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"filters": [],
|
|
||||||
"uri": "lb:ws://jeecg-demo"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
server:
|
|
||||||
tomcat:
|
|
||||||
max-swallow-size: -1
|
|
||||||
error:
|
|
||||||
include-exception: true
|
|
||||||
include-stacktrace: ALWAYS
|
|
||||||
include-message: ALWAYS
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
min-response-size: 1024
|
|
||||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
|
||||||
management:
|
|
||||||
health:
|
|
||||||
mail:
|
|
||||||
enabled: false
|
|
||||||
endpoints:
|
|
||||||
web:
|
|
||||||
exposure:
|
|
||||||
include: "*"
|
|
||||||
health:
|
|
||||||
sensitive: true
|
|
||||||
endpoint:
|
|
||||||
health:
|
|
||||||
show-details: ALWAYS
|
|
||||||
spring:
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 10MB
|
|
||||||
max-request-size: 10MB
|
|
||||||
mail:
|
|
||||||
host: smtp.163.com
|
|
||||||
username: jeecgos@163.com
|
|
||||||
password: ??
|
|
||||||
properties:
|
|
||||||
mail:
|
|
||||||
smtp:
|
|
||||||
auth: true
|
|
||||||
starttls:
|
|
||||||
enable: true
|
|
||||||
required: true
|
|
||||||
quartz:
|
|
||||||
job-store-type: jdbc
|
|
||||||
initialize-schema: embedded
|
|
||||||
auto-startup: false
|
|
||||||
startup-delay: 1s
|
|
||||||
overwrite-existing-jobs: true
|
|
||||||
properties:
|
|
||||||
org:
|
|
||||||
quartz:
|
|
||||||
scheduler:
|
|
||||||
instanceName: MyScheduler
|
|
||||||
instanceId: AUTO
|
|
||||||
jobStore:
|
|
||||||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
|
||||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
|
||||||
tablePrefix: QRTZ_
|
|
||||||
isClustered: true
|
|
||||||
misfireThreshold: 12000
|
|
||||||
clusterCheckinInterval: 15000
|
|
||||||
threadPool:
|
|
||||||
class: org.quartz.simpl.SimpleThreadPool
|
|
||||||
threadCount: 10
|
|
||||||
threadPriority: 5
|
|
||||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
|
||||||
jackson:
|
|
||||||
date-format: yyyy-MM-dd HH:mm:ss
|
|
||||||
time-zone: GMT+8
|
|
||||||
aop:
|
|
||||||
proxy-target-class: true
|
|
||||||
activiti:
|
|
||||||
check-process-definitions: false
|
|
||||||
async-executor-activate: false
|
|
||||||
job-executor-activate: false
|
|
||||||
jpa:
|
|
||||||
open-in-view: false
|
|
||||||
freemarker:
|
|
||||||
suffix: .ftl
|
|
||||||
content-type: text/html
|
|
||||||
charset: UTF-8
|
|
||||||
cache: false
|
|
||||||
prefer-file-system-access: false
|
|
||||||
template-loader-path:
|
|
||||||
- classpath:/templates
|
|
||||||
mvc:
|
|
||||||
static-path-pattern: /**
|
|
||||||
pathmatch:
|
|
||||||
matching-strategy: ant_path_matcher
|
|
||||||
resource:
|
|
||||||
static-locations: classpath:/static/,classpath:/public/
|
|
||||||
autoconfigure:
|
|
||||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
|
||||||
mybatis-plus:
|
|
||||||
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
|
|
||||||
global-config:
|
|
||||||
banner: false
|
|
||||||
db-config:
|
|
||||||
id-type: ASSIGN_ID
|
|
||||||
table-underline: true
|
|
||||||
configuration:
|
|
||||||
call-setters-on-nulls: true
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
spring:
|
|
||||||
shardingsphere:
|
|
||||||
datasource:
|
|
||||||
names: ds0,ds1
|
|
||||||
ds0:
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
ds1:
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot2?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
props:
|
|
||||||
sql-show: true
|
|
||||||
rules:
|
|
||||||
replica-query:
|
|
||||||
load-balancers:
|
|
||||||
round-robin:
|
|
||||||
type: ROUND_ROBIN
|
|
||||||
props:
|
|
||||||
default: 0
|
|
||||||
data-sources:
|
|
||||||
prds:
|
|
||||||
primary-data-source-name: ds0
|
|
||||||
replica-data-source-names: ds1
|
|
||||||
load-balancer-name: round_robin
|
|
||||||
sharding:
|
|
||||||
binding-tables:
|
|
||||||
- sys_log
|
|
||||||
key-generators:
|
|
||||||
snowflake:
|
|
||||||
type: SNOWFLAKE
|
|
||||||
props:
|
|
||||||
worker-id: 123
|
|
||||||
sharding-algorithms:
|
|
||||||
table-classbased:
|
|
||||||
props:
|
|
||||||
strategy: standard
|
|
||||||
algorithmClassName: org.jeecg.modules.test.sharding.algorithm.StandardModTableShardAlgorithm
|
|
||||||
type: CLASS_BASED
|
|
||||||
database-inline:
|
|
||||||
type: INLINE
|
|
||||||
props:
|
|
||||||
algorithm-expression: ds$->{operate_type % 2}
|
|
||||||
tables:
|
|
||||||
sys_log:
|
|
||||||
actual-data-nodes: ds$->{0..1}.sys_log$->{0..1}
|
|
||||||
database-strategy:
|
|
||||||
standard:
|
|
||||||
sharding-column: operate_type
|
|
||||||
sharding-algorithm-name: database-inline
|
|
||||||
table-strategy:
|
|
||||||
standard:
|
|
||||||
sharding-algorithm-name: table-classbased
|
|
||||||
sharding-column: log_type
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
spring:
|
|
||||||
shardingsphere:
|
|
||||||
datasource:
|
|
||||||
names: ds0
|
|
||||||
ds0:
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
|
||||||
props:
|
|
||||||
sql-show: true
|
|
||||||
rules:
|
|
||||||
sharding:
|
|
||||||
binding-tables: sys_log
|
|
||||||
key-generators:
|
|
||||||
snowflake:
|
|
||||||
type: SNOWFLAKE
|
|
||||||
props:
|
|
||||||
worker-id: 123
|
|
||||||
sharding-algorithms:
|
|
||||||
table-classbased:
|
|
||||||
props:
|
|
||||||
strategy: standard
|
|
||||||
algorithmClassName: org.jeecg.modules.test.sharding.algorithm.StandardModTableShardAlgorithm
|
|
||||||
type: CLASS_BASED
|
|
||||||
tables:
|
|
||||||
sys_log:
|
|
||||||
actual-data-nodes: ds0.sys_log$->{0..1}
|
|
||||||
table-strategy:
|
|
||||||
standard:
|
|
||||||
sharding-algorithm-name: table-classbased
|
|
||||||
sharding-column: log_type
|
|
||||||
@@ -30,10 +30,6 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<module>font-resources</module>
|
<module>font-resources</module>
|
||||||
<module>monitoring-sync</module>
|
<module>monitoring-sync</module>
|
||||||
<module>renkang-test</module>
|
<module>renkang-test</module>
|
||||||
|
<module>xj-anyan-api</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
+16
-2
@@ -25,6 +25,7 @@ import org.springframework.core.task.TaskExecutor;
|
|||||||
import org.springframework.jdbc.support.JdbcTransactionManager;
|
import org.springframework.jdbc.support.JdbcTransactionManager;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.transaction.PlatformTransactionManager;
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -125,8 +126,21 @@ public class BatchAutoConfiguration {
|
|||||||
@BatchDataSource ObjectProvider<DataSource> batchDataSource,
|
@BatchDataSource ObjectProvider<DataSource> batchDataSource,
|
||||||
BatchProperties properties
|
BatchProperties properties
|
||||||
) {
|
) {
|
||||||
return new BatchDataSourceScriptDatabaseInitializer(batchDataSource.getIfAvailable(() -> dataSource),
|
DataSource dataSourceToUse = batchDataSource.getIfAvailable(() -> dataSource);
|
||||||
properties.getJdbc());
|
BatchProperties.Jdbc jdbc = properties.getJdbc();
|
||||||
|
// 达梦数据库兼容处理:设置platform绕过构造器中的自动类型检测
|
||||||
|
if (!StringUtils.hasText(jdbc.getPlatform())) {
|
||||||
|
jdbc.setPlatform("dm");
|
||||||
|
}
|
||||||
|
// 重写afterPropertiesSet()跳过SQL脚本初始化:
|
||||||
|
// 父类会先断言SQL文件存在再检查initializeSchema mode,导致找不到schema-dm.sql时报错
|
||||||
|
// Batch元数据表已通过数据迁移创建,无需自动建表
|
||||||
|
return new BatchDataSourceScriptDatabaseInitializer(dataSourceToUse, jdbc) {
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() {
|
||||||
|
// 跳过Batch元数据表的自动建表,防止找不到schema-dm.sql文件报错
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -34,6 +34,12 @@ public class CustomBatchConfigurer extends BasicBatchConfigurer {
|
|||||||
this.taskExecutor = taskExecutor;
|
this.taskExecutor = taskExecutor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
// 调用父类的 initialize() 方法来初始化 JobRepository 等
|
||||||
|
super.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JobLauncher createJobLauncher() throws Exception {
|
protected JobLauncher createJobLauncher() throws Exception {
|
||||||
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
|
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>functional-modules</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>xj-anyan-api</artifactId>
|
||||||
|
<description>xj安眼系统API</description>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.retry</groupId>
|
||||||
|
<artifactId>spring-retry</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
+213
@@ -0,0 +1,213 @@
|
|||||||
|
package com.renkang.anyan.client;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.anyan.model.dto.*;
|
||||||
|
import com.renkang.anyan.model.vo.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanClient xj安眼系统接口调用客户端
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AnYanClient {
|
||||||
|
/**
|
||||||
|
* 获取服务访问令牌
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getAuthToken();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取服务访问令牌(密码模式)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AuthResult getAuthTokenByPassword(String username, String password);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新口令
|
||||||
|
*/
|
||||||
|
void refreshToken();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 体检医院人数统计查询
|
||||||
|
*
|
||||||
|
* @param medicalYear 体检年份
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MedicalPeopleNumStatisticsVO> examinationStatistics(Integer medicalYear);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康打卡数据统计查询(血压,减重,血糖)
|
||||||
|
*
|
||||||
|
* @param beginDate
|
||||||
|
* @param endDate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
HealthSignStatVO healthCheckStatistics(Date beginDate, Date endDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康打卡异常数据详细查询(血压)
|
||||||
|
*
|
||||||
|
* @param healthSignListParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<BloodPressureList> bloodPressureList(HealthSignListParam healthSignListParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康打卡异常数据详细查询(减重)
|
||||||
|
*
|
||||||
|
* @param healthSignListParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<WeightPressureList> weightPressureList(HealthSignListParam healthSignListParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康打卡异常数据详细查询(血糖)
|
||||||
|
*
|
||||||
|
* @param healthSignListParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<BloodSugarClockSList> bloodSugarClockSList(HealthSignListParam healthSignListParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 油田医院数据查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HospitalListVO> hospitalList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康小屋基础数据查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HealthRoomBaseVO> healthPlaceHomList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康小屋详细数据查询
|
||||||
|
*
|
||||||
|
* @param healthRoomDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<HealthPlaceHomeDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当年体检异常人数统计
|
||||||
|
*
|
||||||
|
* @param medicalYear 年份
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
MedicalAbnormalStatisticsVO medicalAbnormalStatistics(Integer medicalYear);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当年体检异常人员列表
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<MedicalAbnormalVO> medicalAbnormalList(MedicalAbnormalDTO param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公网环境获取服务访问token (目前仅用于访问安眼大屏)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String publicNetworkToken();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公网环境获取服务访问token (目前仅用于访问安眼大屏, 不走缓存, 每次用现取)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AuthResult publicNetworkTokenNoCache();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AnYanUserInfoResult getAnYanUserInfo(String token, String username);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量拉取安眼平台AED信息 , 用于定时任务更新本地数据的AED数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AnYanAedInfo> queryAnYanAedInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最新检查员工信息查询接口 (大屏首页重点关爱趋势预警滚动列表,固定查100前项)
|
||||||
|
*
|
||||||
|
* @return 最新的100条数据
|
||||||
|
*/
|
||||||
|
List<CarePersonList> homeCarePersonList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一人一案信息详情接口 (用大屏首页重点关爱趋势预警滚动列表点击数据详情)
|
||||||
|
*
|
||||||
|
* @param employeeNum 工号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CareUserListVo careUserDetails(String anYanUserId, String employeeNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一人一案分页列表查询接口(用大屏首页重点关爱趋势预警弹窗列表)
|
||||||
|
*
|
||||||
|
* @param param 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询关爱联络员信息及急救人员查询接口
|
||||||
|
*
|
||||||
|
* @param param 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新员工关键信息接口
|
||||||
|
*
|
||||||
|
* @param employeeNumList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AnYanUpdateUserBatchInfo> updateUserBatch(List<String> employeeNumList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单个员工扩展信息
|
||||||
|
* 是否是借调人员 这个判断是依据 数据中是否存在currentOfficeId来决定的,存在说明是借调人员,不存在说明不是借调人员
|
||||||
|
*
|
||||||
|
* @param employeeNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AnYanUserEmployee updateEmployeeNum(String employeeNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 体检数据
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<AnYanHealthCheckNew> queryAnYanHealthCheckNew(AnYanHealthCheckNewParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询体检数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AnYanEmpHealthCheckNew queryEmpHealthCheckNew(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据检查id、科室编号、科室名称查询体检记录
|
||||||
|
*/
|
||||||
|
List<HealthCheckProject> queryHealthCheckProject(AnYanHealthCheckProjectParam param);
|
||||||
|
}
|
||||||
+441
@@ -0,0 +1,441 @@
|
|||||||
|
package com.renkang.anyan.client;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.anyan.config.AnYanProperties;
|
||||||
|
import com.renkang.anyan.config.RestTemplateUtil;
|
||||||
|
import com.renkang.anyan.constants.AnYanConstants;
|
||||||
|
import com.renkang.anyan.enums.AnYanApiEnum;
|
||||||
|
import com.renkang.anyan.model.dto.*;
|
||||||
|
import com.renkang.anyan.model.vo.*;
|
||||||
|
import com.renkang.anyan.utils.PageResultToBeanUtil;
|
||||||
|
import com.renkang.anyan.utils.SM4Utils;
|
||||||
|
import com.renkang.anyan.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.jeecg.common.exception.ExceptionAssertsUtil;
|
||||||
|
import org.jeecg.util.RedisClientUtil;
|
||||||
|
import org.jeecg.util.RedisKeyPrefix;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.retry.annotation.EnableRetry;
|
||||||
|
import org.springframework.retry.annotation.Retryable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanClientExecutor xj安眼系统接口调用执行器
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@EnableRetry
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AnYanClientExecutor implements AnYanClient {
|
||||||
|
//安眼获取token访问公钥
|
||||||
|
private String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJL0JkqsUoK6kt3JyogsgqNp9VDGDp+t3ZAGMbVoMPdHNT2nfiIVh9ZMNHF7g2XiAa8O8AQWyh2PjMR0NiUSVQMCAwEAAQ==";
|
||||||
|
private final RedisClientUtil redisClientUtil;
|
||||||
|
private final AnYanProperties anYanProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getAuthToken() {
|
||||||
|
String token = redisClientUtil.get(new RedisKeyPrefix(AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "token", String.class);
|
||||||
|
if (StrUtil.isEmpty(token)) {
|
||||||
|
AuthResult authResult = getAuthTokenExecutor();
|
||||||
|
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
||||||
|
token = authResult.getAccess_token();
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "token", token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
private AuthResult getAuthTokenExecutor() {
|
||||||
|
AuthParam authParam = new AuthParam();
|
||||||
|
authParam.setClient_id(anYanProperties.getClientId());
|
||||||
|
authParam.setClient_secret(anYanProperties.getClientSecret());
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
ResponseEntity<AuthResult> responseEntity = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_AUTH_TOKEN, headers, authParam, AuthResult.class);
|
||||||
|
if (HttpStatus.OK.equals(responseEntity.getStatusCode()) && ObjectUtils.isNotEmpty(responseEntity.getBody())) {
|
||||||
|
return responseEntity.getBody();
|
||||||
|
} else {
|
||||||
|
ExceptionAssertsUtil.fail("------安眼系统获取token失败------" + responseEntity.getBody());
|
||||||
|
}
|
||||||
|
return new AuthResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 通过密码获取令牌
|
||||||
|
* @author PengJ
|
||||||
|
* @date 2025/10/24 11:15
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AuthResult getAuthTokenByPassword(String username, String password) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
String encryptPassword = StringUtils.encryptByPublicKey(publicKey, password);
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
|
||||||
|
formData.add("grant_type", "password");
|
||||||
|
formData.add("username", username);
|
||||||
|
formData.add("password", encryptPassword);
|
||||||
|
formData.add("client_id", anYanProperties.getClientId());
|
||||||
|
formData.add("client_secret", anYanProperties.getClientSecret());
|
||||||
|
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
||||||
|
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
||||||
|
&& ObjectUtils.isNotEmpty(authResult.getBody())) {
|
||||||
|
String token = authResult.getBody().getAccess_token();
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getBody().getExpires_in()) ? authResult.getBody().getExpires_in() : 3600;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_USER_TOKEN_PREFIX), username, token);
|
||||||
|
return authResult.getBody();
|
||||||
|
} else {
|
||||||
|
log.error("------安眼系统获取token失败(密码模式){}------", authResult.getBody());
|
||||||
|
ExceptionAssertsUtil.fail("------安眼系统获取token失败------" + authResult.getBody());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (HttpClientErrorException e) {
|
||||||
|
log.error("------安眼系统获取token失败(密码模式){}------", e.getMessage());
|
||||||
|
String replace = Objects.requireNonNull(e.getMessage()).replace("401 Unauthorized: ", "");
|
||||||
|
replace = replace.replace("\"", "");
|
||||||
|
AuthResult bean = JSONUtil.toBean(replace, AuthResult.class);
|
||||||
|
ExceptionAssertsUtil.fail(bean.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionAssertsUtil.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*调用安眼提供的支持公网访问的获取token接口也能通过接口的鉴权, 并且部分接口还需要传入鉴权用户的身份证号, 所以业务接口直接使用公网环境的鉴权接口
|
||||||
|
@Override
|
||||||
|
public void refreshToken() {
|
||||||
|
AuthResult authResult = getAuthTokenExecutor();
|
||||||
|
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "token", authResult.getAccess_token());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpHeaders buildTokenHeader() {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.add(AnYanConstants.AUTHORIZATION, AnYanConstants.TOKEN_TYPE + getAuthToken());
|
||||||
|
return headers;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void refreshToken() {
|
||||||
|
AuthResult authResult = publicNetworkTokenNoCache();
|
||||||
|
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "publicToken", authResult.getAccess_token());
|
||||||
|
log.info("---------刷新安眼token成功-------新的token:{},剩余过期时间:{}", authResult.getAccess_token(), authResult.getExpires_in());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpHeaders buildTokenHeader() {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.add(AnYanConstants.AUTHORIZATION, AnYanConstants.TOKEN_TYPE + publicNetworkToken());
|
||||||
|
headers.add(AnYanConstants.HEADER_PARAM_X_AUTH_ID, AnYanConstants.X_AUTH_ID_PREFIX + anYanProperties.getPublicUserCardNo());
|
||||||
|
headers.add(AnYanConstants.HEADER_PARAM_ROLES, AnYanConstants.HEADER_PARAM_ROLES_VALUES);
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<MedicalPeopleNumStatisticsVO> examinationStatistics(Integer medicalYear) {
|
||||||
|
if (null == medicalYear) {
|
||||||
|
medicalYear = DateUtil.year(new Date());
|
||||||
|
}
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("medicalYear", String.valueOf(medicalYear));
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_EXAMINATION_STATISTICS, buildTokenHeader(), param);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, MedicalPeopleNumStatisticsVO.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public HealthSignStatVO healthCheckStatistics(Date beginDate, Date endDate) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("inputDateBegin", ObjectUtil.isEmpty(beginDate) ? DateUtil.today() : DateUtil.formatDate(beginDate));
|
||||||
|
param.put("inputDateEnd", ObjectUtil.isEmpty(endDate) ? DateUtil.today() : DateUtil.formatDate(endDate));
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_CHECK_STATISTICS, buildTokenHeader(), param);
|
||||||
|
return BeanUtil.toBean(result.getData(), HealthSignStatVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<BloodPressureList> bloodPressureList(HealthSignListParam healthSignListParam) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.BLOOD_PRESSURE_LIST, buildTokenHeader(), healthSignListParam);
|
||||||
|
return new PageResultToBeanUtil<BloodPressureList>().transform(result, BloodPressureList.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<WeightPressureList> weightPressureList(HealthSignListParam healthSignListParam) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.WEIGHT_PRESSURE_LIST, buildTokenHeader(), healthSignListParam);
|
||||||
|
return new PageResultToBeanUtil<WeightPressureList>().transform(result, WeightPressureList.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<BloodSugarClockSList> bloodSugarClockSList(HealthSignListParam healthSignListParam) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.BLOOD_SUGAR_CLOCKS_LIST, buildTokenHeader(), healthSignListParam);
|
||||||
|
return new PageResultToBeanUtil<BloodSugarClockSList>().transform(result, BloodSugarClockSList.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<HospitalListVO> hospitalList() {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HOSPITAL_LIST, buildTokenHeader(), null);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HospitalListVO.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<HealthRoomBaseVO> healthPlaceHomList() {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_PLACE_ROOM_LIST, buildTokenHeader(), null);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HealthRoomBaseVO.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<HealthPlaceHomeDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_PLACE_ROOM_INFO_LIST, buildTokenHeader(), healthRoomDTO);
|
||||||
|
return new PageResultToBeanUtil<HealthPlaceHomeDetailsVO>().transform(result, HealthPlaceHomeDetailsVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public MedicalAbnormalStatisticsVO medicalAbnormalStatistics(Integer medicalYear) {
|
||||||
|
if (null == medicalYear) {
|
||||||
|
medicalYear = DateUtil.year(new Date());
|
||||||
|
}
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("medicalYear", medicalYear);
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.MEDICAL_ABNORMAL_STATISTICS, buildTokenHeader(), param);
|
||||||
|
return BeanUtil.toBean(result.getData(), MedicalAbnormalStatisticsVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<MedicalAbnormalVO> medicalAbnormalList(MedicalAbnormalDTO param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.MEDICAL_ABNORMAL_LIST, buildTokenHeader(), param);
|
||||||
|
return new PageResultToBeanUtil<MedicalAbnormalVO>().transform(result, MedicalAbnormalVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String publicNetworkToken() {
|
||||||
|
String token = redisClientUtil.get(new RedisKeyPrefix(AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "publicToken", String.class);
|
||||||
|
if (StrUtil.isEmpty(token)) {
|
||||||
|
AuthResult authResult = publicNetworkTokenNoCache();
|
||||||
|
if (null != authResult) {
|
||||||
|
token = authResult.getAccess_token();
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "publicToken", token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 旧版公网获取token实现(SM4 + AnYanResult 包裹解密),保留备份
|
||||||
|
* @author PengJ
|
||||||
|
*/
|
||||||
|
public AuthResult publicNetworkTokenNoCacheBAK() {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
String password = anYanProperties.getPublicPassWrod();
|
||||||
|
String userName = anYanProperties.getPublicUserNmae();
|
||||||
|
try {
|
||||||
|
String sm4Password = SM4Utils.encryptSM4(password);
|
||||||
|
String encryptPassword = StringUtils.encryptByPublicKey(publicKey, password);
|
||||||
|
param.put("password", encryptPassword);
|
||||||
|
param.put("selfPassword", sm4Password);
|
||||||
|
param.put("loginName", userName);
|
||||||
|
param.put("timeStamp", UUID.randomUUID().toString());
|
||||||
|
ResponseEntity<AnYanResult> responseEntity = RestTemplateUtil.postExchangeForGetToken(AnYanApiEnum.PUBLIC_NETWORK_AUTH_TOKEN, param, AnYanResult.class);
|
||||||
|
//安眼提供的接口包过深 ,先从AnYanResult对象中取出加密的密文,后在解密密文拿出 AuthResult对象 , 再从AuthResult对象中拿出 access_token
|
||||||
|
AnYanResult anYanResult = responseEntity.getBody();
|
||||||
|
if (ObjectUtil.isNotEmpty(anYanResult) && ObjectUtil.isNotEmpty(anYanResult.getData())) {
|
||||||
|
String decryptAuthResult = SM4Utils.decryptSM4((String) anYanResult.getData());
|
||||||
|
AuthResult authResult = JSON.parseObject(decryptAuthResult).toJavaObject(AuthResult.class);
|
||||||
|
if (null != authResult && null != authResult.getAccess_token()) {
|
||||||
|
return authResult;
|
||||||
|
} else {
|
||||||
|
ExceptionAssertsUtil.fail("获取安眼系统token失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
ExceptionAssertsUtil.fail("获取安眼系统token失败");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 公网获取token(密码模式,调用方式与 getAuthTokenByPassword 保持一致)
|
||||||
|
* 表单提交 + 公网 host + QUERY_AUTH_TOKEN,仅 RSA 加密密码,不写 Redis(缓存由调用方负责)
|
||||||
|
* @author PengJ
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AuthResult publicNetworkTokenNoCache() {
|
||||||
|
String username = anYanProperties.getPublicUserNmae();
|
||||||
|
String password = anYanProperties.getPublicPassWrod();
|
||||||
|
try {
|
||||||
|
// 仅 RSA 加密密码,与 getAuthTokenByPassword 保持一致
|
||||||
|
String encryptPassword = StringUtils.encryptByPublicKey(publicKey, password);
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
|
||||||
|
formData.add("grant_type", "password");
|
||||||
|
formData.add("username", username);
|
||||||
|
formData.add("password", encryptPassword);
|
||||||
|
formData.add("client_id", anYanProperties.getClientId());
|
||||||
|
formData.add("client_secret", anYanProperties.getClientSecret());
|
||||||
|
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
||||||
|
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
||||||
|
&& ObjectUtils.isNotEmpty(authResult.getBody())) {
|
||||||
|
return authResult.getBody();
|
||||||
|
} else {
|
||||||
|
log.error("------安眼系统获取公网token失败{}------", authResult.getBody());
|
||||||
|
ExceptionAssertsUtil.fail("------安眼系统获取公网token失败------" + authResult.getBody());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (HttpClientErrorException e) {
|
||||||
|
log.error("------安眼系统获取公网token失败{}------", e.getMessage());
|
||||||
|
String replace = Objects.requireNonNull(e.getMessage()).replace("401 Unauthorized: ", "");
|
||||||
|
replace = replace.replace("\"", "");
|
||||||
|
AuthResult bean = JSONUtil.toBean(replace, AuthResult.class);
|
||||||
|
ExceptionAssertsUtil.fail(bean.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionAssertsUtil.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据token获取用户信息
|
||||||
|
* @author PengJ
|
||||||
|
* @date 2025/10/24 17:00
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanUserInfoResult getAnYanUserInfo(String token, String username) {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.add(AnYanConstants.AUTHORIZATION, AnYanConstants.TOKEN_TYPE + token);
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
|
ResponseEntity<AnYanUserInfoResult> exchange = RestTemplateUtil.getExchange(AnYanApiEnum.USER_INFO_UNIT_V2, headers, AnYanUserInfoResult.class);
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
log.info("根据token获取用户信息耗时:" + (time2 - time1) + "ms");
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(-1, AnYanConstants.AN_YAN_API_USERINFO_PREFIX), username, exchange);
|
||||||
|
return BeanUtil.toBean(exchange.getBody(), AnYanUserInfoResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<AnYanAedInfo> queryAnYanAedInfo() {
|
||||||
|
//安眼接口本身支持分页查询 , 因此方法用于定时任务批量查询更新 , 这里一次性查询所有
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_AN_YAN_AED, buildTokenHeader(), new AnYanAedParam());
|
||||||
|
IPage<AnYanAedInfo> aedPage = new PageResultToBeanUtil<AnYanAedInfo>().transform(result, AnYanAedInfo.class);
|
||||||
|
return aedPage.getRecords();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<CarePersonList> homeCarePersonList() {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_BY_TIME, buildTokenHeader(), null);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, CarePersonList.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public CareUserListVo careUserDetails(String anYanUserId, String employeeNum) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
if (StrUtil.isNotEmpty(anYanUserId)) {
|
||||||
|
param.put("id", anYanUserId);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(employeeNum)) {
|
||||||
|
param.put("employeeNum", employeeNum);
|
||||||
|
}
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_Details, buildTokenHeader(), param);
|
||||||
|
return BeanUtil.toBean(result.getData(), CareUserListVo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_PAGE_LIST, buildTokenHeader(), param);
|
||||||
|
return new PageResultToBeanUtil<CareUserListVo>().transform(result, CareUserListVo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_EMPLOYEE_CARE_PERSON, buildTokenHeader(), param);
|
||||||
|
return new PageResultToBeanUtil<EmergencyContactVO>().transform(result, EmergencyContactVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<AnYanUpdateUserBatchInfo> updateUserBatch(List<String> employeeNumList) {
|
||||||
|
Map<String, List<String>> map = new HashMap<>(1);
|
||||||
|
map.put("employeeNumList", employeeNumList);
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.FIND_VITAL_INFO, buildTokenHeader(), map);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, AnYanUpdateUserBatchInfo.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanUserEmployee updateEmployeeNum(String employeeNum) {
|
||||||
|
Map<String, String> map = new HashMap<>(1);
|
||||||
|
map.put("employeeNum", employeeNum);
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.FIND_BY_EMPLOYEENUM, buildTokenHeader(), map);
|
||||||
|
return BeanUtil.toBean(result.getData(), AnYanUserEmployee.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<AnYanHealthCheckNew> queryAnYanHealthCheckNew(AnYanHealthCheckNewParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_CHECK_NEW, buildTokenHeader(), param);
|
||||||
|
return new PageResultToBeanUtil<AnYanHealthCheckNew>().transform(result, AnYanHealthCheckNew.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanEmpHealthCheckNew queryEmpHealthCheckNew(String id) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.getExchange(AnYanApiEnum.CHECK_NEW_BY_ID, buildTokenHeader(), id);
|
||||||
|
return BeanUtil.toBean(result.getData(), AnYanEmpHealthCheckNew.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<HealthCheckProject> queryHealthCheckProject(AnYanHealthCheckProjectParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_CHECK_PROJECT, buildTokenHeader(), param);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HealthCheckProject.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package com.renkang.anyan.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanProperties
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "variable.anyan")
|
||||||
|
public class AnYanProperties {
|
||||||
|
/**
|
||||||
|
* 是否启用安眼的接口
|
||||||
|
*/
|
||||||
|
private boolean enable;
|
||||||
|
/**
|
||||||
|
*服务调用地址
|
||||||
|
*/
|
||||||
|
private String host = "";
|
||||||
|
/**
|
||||||
|
* clientId
|
||||||
|
*/
|
||||||
|
private String clientId = "";
|
||||||
|
/**
|
||||||
|
*clientSecret
|
||||||
|
*/
|
||||||
|
private String clientSecret = "";
|
||||||
|
/**
|
||||||
|
*公网可访问的接口地址 (目前或者大屏调转的toekn使用)
|
||||||
|
*/
|
||||||
|
private String publicHost = "";
|
||||||
|
/**
|
||||||
|
* 公网环境的鉴权账号 (目前或者大屏调转的toekn使用)
|
||||||
|
*/
|
||||||
|
private String publicUserNmae = "";
|
||||||
|
/**
|
||||||
|
*公网环境的鉴权密码 (目前或者大屏调转的toekn使用)
|
||||||
|
*/
|
||||||
|
private String publicPassWrod = "";
|
||||||
|
/**
|
||||||
|
*鉴权用户的身份证号,部分接口的请求头参数中需要传入
|
||||||
|
*/
|
||||||
|
private String publicUserCardNo = "737720666075238400";
|
||||||
|
/**
|
||||||
|
*链接超时时间
|
||||||
|
*/
|
||||||
|
private Long timeout = 3000L;
|
||||||
|
/**
|
||||||
|
*读取超时时间
|
||||||
|
*/
|
||||||
|
private Long readTimeout = 30000L;
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
package com.renkang.anyan.config;
|
||||||
|
|
||||||
|
import com.renkang.anyan.client.AnYanClient;
|
||||||
|
import com.renkang.anyan.config.AnYanProperties;
|
||||||
|
import com.renkang.anyan.enums.AnYanApiEnum;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.exception.ExceptionAssertsUtil;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||||
|
import org.springframework.http.client.ClientHttpResponse;
|
||||||
|
import org.springframework.http.converter.FormHttpMessageConverter;
|
||||||
|
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||||
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanClient xj安眼系统接口调用客户端
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AnYanRestTemplateConfig {
|
||||||
|
private final AnYanProperties properties;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RestTemplate anYanTemplate() {
|
||||||
|
ClientHttpRequestInterceptor authInterceptor = authInterceptor();
|
||||||
|
return new RestTemplateBuilder()
|
||||||
|
.setConnectTimeout(Duration.of(properties.getTimeout(), ChronoUnit.MILLIS))
|
||||||
|
.setReadTimeout(Duration.of(properties.getReadTimeout(), ChronoUnit.MILLIS))
|
||||||
|
.additionalMessageConverters(
|
||||||
|
new StringHttpMessageConverter(StandardCharsets.UTF_8),
|
||||||
|
new MappingJackson2HttpMessageConverter(),
|
||||||
|
new FormHttpMessageConverter()
|
||||||
|
)
|
||||||
|
.additionalInterceptors(authInterceptor)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义拦截器处理接口鉴权失败, 配合spring retry使用从而避免因token失效导致的接口调用失败
|
||||||
|
*/
|
||||||
|
public ClientHttpRequestInterceptor authInterceptor() {
|
||||||
|
return (httpRequest, bytes, clientHttpRequestExecution) -> {
|
||||||
|
ClientHttpResponse execute;
|
||||||
|
try {
|
||||||
|
execute = clientHttpRequestExecution.execute(httpRequest, bytes);
|
||||||
|
HttpStatus httpStatus = execute.getStatusCode();
|
||||||
|
if (Arrays.asList(HttpStatus.UNAUTHORIZED, HttpStatus.FORBIDDEN).contains(httpStatus)) {
|
||||||
|
// 获取请求URL
|
||||||
|
String url = httpRequest.getURI().toString();
|
||||||
|
// 排除特定接口不执行刷新token逻辑(获取token接口,根据token获取个人信息接口)
|
||||||
|
if (!url.contains(AnYanApiEnum.QUERY_AUTH_TOKEN.getMethodPath()) && !url.contains(AnYanApiEnum.USER_INFO_UNIT_V2.getMethodPath())) {
|
||||||
|
log.info("---------安眼token过期,触发刷新token机制-------已过期的token:{}", httpRequest.getHeaders().getFirst("authorization"));
|
||||||
|
SpringContextUtils.getBean("anYanClientExecutor", AnYanClient.class).refreshToken();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("---------安眼平台API调用异常-------e{},接口:{}", e.getMessage(), httpRequest.getURI(), e);
|
||||||
|
ExceptionAssertsUtil.fail("安眼平台API调用失败");
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
return execute;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+143
@@ -0,0 +1,143 @@
|
|||||||
|
package com.renkang.anyan.config;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.renkang.anyan.enums.AnYanApiEnum;
|
||||||
|
import com.renkang.anyan.model.vo.AnYanResult;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: RestTemplate 工具类 (更多请求方式自行封装)
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class RestTemplateUtil {
|
||||||
|
private static RestTemplate restTemplate;
|
||||||
|
private static AnYanProperties properties;
|
||||||
|
|
||||||
|
public static RestTemplate getRestTemplate() {
|
||||||
|
if (Objects.isNull(restTemplate)) {
|
||||||
|
restTemplate = SpringContextUtils.getBean("anYanTemplate", RestTemplate.class);
|
||||||
|
}
|
||||||
|
return restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AnYanProperties getProperties() {
|
||||||
|
if (Objects.isNull(properties)) {
|
||||||
|
properties = SpringContextUtils.getBean(AnYanProperties.class);
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求接口访问 token
|
||||||
|
*
|
||||||
|
* @param api 接口
|
||||||
|
* @param requestBody 参数
|
||||||
|
* @return ResponseEntity
|
||||||
|
*/
|
||||||
|
public static <T> ResponseEntity<T> postExchange(AnYanApiEnum api, HttpHeaders headers, Object requestBody, Class<T> responseType) {
|
||||||
|
String url = getProperties().getHost() + api.getMethodPath() + api.getMethodParam();
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody);
|
||||||
|
return getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公网请求接口访问 token(密码模式)
|
||||||
|
*
|
||||||
|
* @param api 接口
|
||||||
|
* @param formData 参数
|
||||||
|
* @return ResponseEntity
|
||||||
|
*/
|
||||||
|
public static <T> ResponseEntity<T> postExchangeForGetTokenByPassword(AnYanApiEnum api, MultiValueMap<String, String> formData, HttpHeaders headers, Class<T> responseType) {
|
||||||
|
String url = getProperties().getPublicHost() + api.getMethodPath();
|
||||||
|
HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(formData, headers);
|
||||||
|
log.info("开始发送请求到: {},入参:{}", url, formData);
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
|
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
|
log.info("收到响应: {}", response);
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
log.info("获取token(密码模式) 耗时:" + (time2 - time1) + "ms");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公网请求接口访问 token
|
||||||
|
*
|
||||||
|
* @param api 接口
|
||||||
|
* @param requestBody 参数
|
||||||
|
* @return ResponseEntity
|
||||||
|
*/
|
||||||
|
public static <T> ResponseEntity<T> postExchangeForGetToken(AnYanApiEnum api, Object requestBody, Class<T> responseType) {
|
||||||
|
String url = getProperties().getPublicHost() + api.getMethodPath() + api.getMethodParam();
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody);
|
||||||
|
// 打印请求入参,便于排查
|
||||||
|
String bodyJson = JSON.toJSONString(requestBody);
|
||||||
|
log.info("安眼获取token请求入参: url={}, body={}", url, bodyJson);
|
||||||
|
// 打印等价 curl(application/json),便于本地手动调试
|
||||||
|
log.info("安眼获取token等价curl: curl -X POST '{}' -H 'Content-Type: application/json' -d '{}'", url, bodyJson);
|
||||||
|
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
|
// 打印返回信息(状态码 + 响应体)
|
||||||
|
log.info("安眼获取token返回信息: statusCode={}, body={}", response.getStatusCode(), JSON.toJSONString(response.getBody()));
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用调用方法
|
||||||
|
*
|
||||||
|
* @param api 请求接口
|
||||||
|
* @param headers 请求头
|
||||||
|
* @param requestBody body参数
|
||||||
|
* @return Result对象
|
||||||
|
*/
|
||||||
|
public static AnYanResult<Object> postExchange(AnYanApiEnum api, HttpHeaders headers, Object requestBody) {
|
||||||
|
String url = getProperties().getHost() + api.getMethodPath() + api.getMethodParam();
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody, headers);
|
||||||
|
return responseHandler(getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, AnYanResult.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用调用方法
|
||||||
|
*
|
||||||
|
* @param api 请求接口
|
||||||
|
* @param headers 请求头
|
||||||
|
* @return Result对象
|
||||||
|
*/
|
||||||
|
public static <T> ResponseEntity<T> getExchange(AnYanApiEnum api, HttpHeaders headers, Class<T> responseType) {
|
||||||
|
String url = getProperties().getHost() + api.getMethodPath() + api.getMethodParam();
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(headers);
|
||||||
|
return getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AnYanResult<Object> getExchange(AnYanApiEnum api, HttpHeaders headers, String id) {
|
||||||
|
String url = getProperties().getHost() + api.getMethodPath() + "/" + id;
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(headers);
|
||||||
|
return responseHandler(getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, AnYanResult.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ResponseEntity 转 Result
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static <T extends AnYanResult<Object>> AnYanResult<Object> responseHandler(ResponseEntity<T> entity) {
|
||||||
|
if (HttpStatus.OK.equals(entity.getStatusCode()) && ObjectUtils.isNotEmpty(entity.getBody())) {
|
||||||
|
return entity.getBody();
|
||||||
|
} else {
|
||||||
|
return AnYanResult.error("外部平台API调用失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
package com.renkang.anyan.constants;
|
||||||
|
|
||||||
|
import org.jeecg.util.RedisKeyPrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanConstants 常量
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AnYanConstants {
|
||||||
|
/**
|
||||||
|
* token传递请求头参数
|
||||||
|
*/
|
||||||
|
String AUTHORIZATION = "authorization";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* token类型
|
||||||
|
*/
|
||||||
|
String TOKEN_TYPE = "bearer ";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部分业务接口需要代入的请求头参数X-Auth-Id
|
||||||
|
*/
|
||||||
|
String HEADER_PARAM_X_AUTH_ID = "X-Auth-Id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求头参数X-Auth-Id 固定前缀
|
||||||
|
*/
|
||||||
|
String X_AUTH_ID_PREFIX = "&id:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存调用安眼系统接口鉴权token缓存key
|
||||||
|
*/
|
||||||
|
String AN_YAN_API_TOKEN_PREFIX = "exterior:anyan:api:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存安眼用户登录token
|
||||||
|
*/
|
||||||
|
String AN_YAN_API_USER_TOKEN_PREFIX = "exterior:anyan:api:access_token";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存安眼用户信息
|
||||||
|
*/
|
||||||
|
String AN_YAN_API_USERINFO_PREFIX = "exterior:anyan:api:userinfo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部分业务接口需要代入的请求头参数Roles
|
||||||
|
*/
|
||||||
|
String HEADER_PARAM_ROLES = "Roles";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求头Roles参数值
|
||||||
|
*/
|
||||||
|
String HEADER_PARAM_ROLES_VALUES = "company-health,aygc";
|
||||||
|
}
|
||||||
+147
@@ -0,0 +1,147 @@
|
|||||||
|
package com.renkang.anyan.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: AnYanApiEnum xj安眼系统接口枚举类
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2025-8-1
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum AnYanApiEnum {
|
||||||
|
/**
|
||||||
|
* 1.获取token接口
|
||||||
|
*/
|
||||||
|
QUERY_AUTH_TOKEN("/oauth/oauth/token", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.体检人数统计查询
|
||||||
|
*/
|
||||||
|
HEALTH_EXAMINATION_STATISTICS("/aygc-znhpt-sys/0/aystatistics/peopleHealthExaminationStatistics", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.健康打卡数据统计查询(血压,减重,血糖)
|
||||||
|
*/
|
||||||
|
HEALTH_CHECK_STATISTICS("/aygc-znhpt-sys/0/aystatistics/healthCheckStatistics", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4.健康打卡异常数据详细查询(血压)
|
||||||
|
*/
|
||||||
|
BLOOD_PRESSURE_LIST("/aygc-znhpt-sys/0/aystatistics/bloodPressureList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5.健康打卡异常数据详细查询(减重)
|
||||||
|
*/
|
||||||
|
WEIGHT_PRESSURE_LIST("/aygc-znhpt-sys/0/aystatistics/weightPressureList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6.健康打卡异常数据详细查询(血糖)
|
||||||
|
*/
|
||||||
|
BLOOD_SUGAR_CLOCKS_LIST("/aygc-znhpt-sys/0/aystatistics/bloodSugarClockSList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7.体检异常数据统计查询(暂定)
|
||||||
|
*/
|
||||||
|
MEDICAL_ABNORMAL_STATISTICS("/aygc-znhpt-sys/0/aystatistics/checkstatistics", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8.体检异常数据清单(暂定)
|
||||||
|
*/
|
||||||
|
MEDICAL_ABNORMAL_LIST("/aygc-znhpt-sys/0/aystatistics/checkList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9.油田医院数据查询
|
||||||
|
*/
|
||||||
|
HOSPITAL_LIST("/aygc-znhpt-sys/0/aystatistics/HospitalList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10.健康小屋基础数据查询
|
||||||
|
*/
|
||||||
|
HEALTH_PLACE_ROOM_LIST("/aygc-znhpt-sys/0/aystatistics/HealthPlaceHomList", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11.健康小屋详细数据查询
|
||||||
|
*/
|
||||||
|
HEALTH_PLACE_ROOM_INFO_LIST("/aygc-znhpt-sys/0/aystatistics/initEmpHealthRoomCheckinInfoPages", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12.从外网地址获取安眼token接口
|
||||||
|
*/
|
||||||
|
PUBLIC_NETWORK_AUTH_TOKEN("/aygc-service-sys/0/api/xj/outside/getToken", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13.获取员工信息及单位-V2
|
||||||
|
*/
|
||||||
|
USER_INFO_UNIT_V2("/iosp-iam/v2/users/self", "?containsUnit=true", HttpMethod.GET),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14.查询AED信息
|
||||||
|
*/
|
||||||
|
QUERY_AN_YAN_AED("/aygc-znhpt-sys/0/api/aedEquipedInfo/findPage", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15.一人一案最新检查员工列表查询接口 (大屏首页重点关爱趋势预警滚动列表,固定查100前项)
|
||||||
|
*/
|
||||||
|
CARE_PERSON_BY_TIME("/aygc-znhpt-sys/0/api/empPersonFile/listByCreateTime", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16.一人一案信息详情接口 (用大屏首页重点关爱趋势预警滚动列表点击数据详情)
|
||||||
|
*/
|
||||||
|
CARE_PERSON_Details("/aygc-znhpt-sys/0/api/empPersonFile/fileDetails", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17.一人一案分页列表接口 (用大屏首页重点关爱趋势二级弹窗列表)
|
||||||
|
*/
|
||||||
|
CARE_PERSON_PAGE_LIST("/aygc-znhpt-sys/0/api/empPersonFile/findPage", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18.查询关爱联络员信息及急救人员查询接口
|
||||||
|
*/
|
||||||
|
QUERY_EMPLOYEE_CARE_PERSON("/aygc-znhpt-sys/0/api/empCareEmp/findPage", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19.批量更新员工关键信息接口
|
||||||
|
*/
|
||||||
|
FIND_VITAL_INFO("/aygc-znhpt-sys/0/api/empBasicInfo/find-vital-info","", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20.更新单个员工扩展信息
|
||||||
|
*/
|
||||||
|
FIND_BY_EMPLOYEENUM("/aygc-znhpt-sys/0/api/empBasicInfo/find-by-employeeNum","", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22.体检数据
|
||||||
|
*/
|
||||||
|
HEALTH_CHECK_NEW("/aygc-znhpt-sys/0/api/empHealthCheckNew/findPage","",HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23.根据体检id查询体检数据
|
||||||
|
*/
|
||||||
|
CHECK_NEW_BY_ID("/aygc-znhpt-sys/0/api/empHealthCheckNew","",HttpMethod.GET),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24.根据检查id、科室编号、科室名称查询体检记录
|
||||||
|
*/
|
||||||
|
HEALTH_CHECK_PROJECT("/aygc-znhpt-sys/0/api/empHealthCheckNew/getCheckProjects","",HttpMethod.POST);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口路径
|
||||||
|
*/
|
||||||
|
private String methodPath;
|
||||||
|
/**
|
||||||
|
* 接口的路径参数
|
||||||
|
*/
|
||||||
|
private String methodParam;
|
||||||
|
/**
|
||||||
|
* 接口请求方式
|
||||||
|
*/
|
||||||
|
private HttpMethod httpMethod;
|
||||||
|
|
||||||
|
AnYanApiEnum(String methodPath, String methodParam, HttpMethod httpMethod) {
|
||||||
|
this.methodPath = methodPath;
|
||||||
|
this.methodParam = methodParam;
|
||||||
|
this.httpMethod = httpMethod;
|
||||||
|
}
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "AED接口查询参数", description = "AED接口查询参数")
|
||||||
|
public class AnYanAedParam {
|
||||||
|
/**
|
||||||
|
* 二级单位名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "二级单位名称")
|
||||||
|
private String secondOfficeName;
|
||||||
|
/**
|
||||||
|
* 三级单位名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "三级单位名称")
|
||||||
|
private String thirdOfficeName;
|
||||||
|
/**
|
||||||
|
* 提供地点
|
||||||
|
*/
|
||||||
|
@Schema(title = "提供地点")
|
||||||
|
private String providePlace;
|
||||||
|
/**
|
||||||
|
* pageNo
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageNo")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
/**
|
||||||
|
* pageSize
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageSize")
|
||||||
|
private Integer pageSize = 9999;
|
||||||
|
/**
|
||||||
|
* pageType
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口参数", description = "安眼系统体检数据接口参数")
|
||||||
|
public class AnYanHealthCheckNewParam {
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("hospitalName")
|
||||||
|
@Schema(name = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
|
||||||
|
@JsonProperty("checkDateEnd")
|
||||||
|
@Schema(name = "结束检查日期")
|
||||||
|
private String checkDateEnd;
|
||||||
|
|
||||||
|
@JsonProperty("checkDateStart")
|
||||||
|
@Schema(name = "开始检查日期")
|
||||||
|
private String checkDateStart;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("pageNo")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
|
||||||
|
@JsonProperty("pageSize")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanHealthCheckProjectParam {
|
||||||
|
@Schema(title = "检查id")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统健康小屋接口参数", description = "安眼系统健康小屋接口参数")
|
||||||
|
public class AnYanHealthRoomParam {
|
||||||
|
|
||||||
|
@JsonProperty("checkInDateBegin")
|
||||||
|
@Schema(name = "检测开始时间")
|
||||||
|
private String checkInDateBegin;
|
||||||
|
|
||||||
|
@JsonProperty("checkInDateEnd")
|
||||||
|
@Schema(name = "检测结束时间")
|
||||||
|
private String checkInDateEnd;
|
||||||
|
|
||||||
|
@JsonProperty("checkType")
|
||||||
|
@Schema(name = "检测类型")
|
||||||
|
private String checkType;
|
||||||
|
|
||||||
|
@JsonProperty("healthRoomId")
|
||||||
|
@Schema(name = "小屋id")
|
||||||
|
private String healthRoomId;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("pageNo")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
|
||||||
|
@JsonProperty("pageSize")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@JsonProperty("successFlag")
|
||||||
|
@Schema(name = "是否成功空降 目前各个小屋没有这个值")
|
||||||
|
private String successFlag;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author PengJ
|
||||||
|
* @description: 密码鉴权入参
|
||||||
|
* @date 2025/10/24 11:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AuthByPasswordParam {
|
||||||
|
/**
|
||||||
|
* grant_type
|
||||||
|
*/
|
||||||
|
private String grant_type = "password";
|
||||||
|
/**
|
||||||
|
* username
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
/**
|
||||||
|
* password
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
/**
|
||||||
|
* client_id
|
||||||
|
*/
|
||||||
|
private String client_id;
|
||||||
|
/**
|
||||||
|
* client_secret
|
||||||
|
*/
|
||||||
|
private String client_secret;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AuthParam {
|
||||||
|
/**
|
||||||
|
*grant_type
|
||||||
|
*/
|
||||||
|
private String grant_type = "client_credentials";
|
||||||
|
/**
|
||||||
|
* client_id
|
||||||
|
*/
|
||||||
|
private String client_id;
|
||||||
|
/**
|
||||||
|
* client_secret
|
||||||
|
*/
|
||||||
|
private String client_secret;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "AED接口查询参数", description = "AED接口查询参数")
|
||||||
|
public class CareUserDetailsParam {
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 工作单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "工作单位")
|
||||||
|
private String workUnit;
|
||||||
|
/**
|
||||||
|
* 数据级别
|
||||||
|
*/
|
||||||
|
@Schema(title = "数据级别")
|
||||||
|
private String dataLevel = "0";
|
||||||
|
/**
|
||||||
|
* pageNo
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageNo")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
/**
|
||||||
|
* pageSize
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageSize")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
|
private int year = DateUtil.thisYear();
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "应急联系人查询参数", description = "应急联系人查询参数")
|
||||||
|
public class EmergencyContactParam {
|
||||||
|
/**
|
||||||
|
* 员工ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "员工ID")
|
||||||
|
private String emId;
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
@Schema(title = "工号")
|
||||||
|
private String employeeNum;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
/**
|
||||||
|
* 数据级别
|
||||||
|
*/
|
||||||
|
@Schema(title = "数据级别")
|
||||||
|
private String dataLevel = "0";
|
||||||
|
/**
|
||||||
|
* pageNo
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageNo")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
/**
|
||||||
|
* pageSize
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageSize")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HealthRoomDTO {
|
||||||
|
/**
|
||||||
|
* 健康小屋ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "健康小屋ID")
|
||||||
|
@NotNull
|
||||||
|
private String healthRoomId;
|
||||||
|
/**
|
||||||
|
* 检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加
|
||||||
|
*/
|
||||||
|
@Schema(title = "检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加")
|
||||||
|
@Dict(dicCode = "xj_check_type")
|
||||||
|
private String checkType;
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位名称")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Schema(title = "检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01")
|
||||||
|
private Date checkInDateBegin;
|
||||||
|
/**
|
||||||
|
* 检查日期止期 参数为空时,默认为今天
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Schema(title = "检查日期止期 参数为空时,默认为今天")
|
||||||
|
private Date checkInDateEnd;
|
||||||
|
/**
|
||||||
|
* 是否成功控降 是否成功空降,1:是/0.否
|
||||||
|
*/
|
||||||
|
@Schema(title = "是否成功控降 是否成功空降,1:是/0.否")
|
||||||
|
private String successFlag;
|
||||||
|
/**
|
||||||
|
* 页码 从1开始
|
||||||
|
*/
|
||||||
|
@Schema(title = "页码 从1开始")
|
||||||
|
private Integer pageNo;
|
||||||
|
/**
|
||||||
|
* 每页数量
|
||||||
|
*/
|
||||||
|
@Schema(title = "每页数量")
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
|
public HealthRoomDTO() {
|
||||||
|
Date date = new Date();
|
||||||
|
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
||||||
|
this.checkInDateEnd = DateUtil.endOfDay(date);
|
||||||
|
this.pageNo = 1;
|
||||||
|
this.pageSize = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康打卡异常数据详情查询参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HealthSignListParam {
|
||||||
|
/**
|
||||||
|
*单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@Schema(title = "开始时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date inputDateBegin;
|
||||||
|
/**
|
||||||
|
*结束时间
|
||||||
|
*/
|
||||||
|
@Schema(title = "结束时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date inputDateEnd;
|
||||||
|
/**
|
||||||
|
* pageNo
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageNo")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
/**
|
||||||
|
* pageSize
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageSize")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+71
@@ -0,0 +1,71 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MedicalAbnormalDTO {
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 体检年份
|
||||||
|
*/
|
||||||
|
private String medicalYear;
|
||||||
|
/**
|
||||||
|
* 体检医院
|
||||||
|
*/
|
||||||
|
private String hospitalName;
|
||||||
|
/**
|
||||||
|
* 检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Schema(title = "检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01")
|
||||||
|
private Date checkInDateBegin;
|
||||||
|
/**
|
||||||
|
* 检查日期止期 参数为空时,默认为今天
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Schema(title = "检查日期止期 参数为空时,默认为今天")
|
||||||
|
private Date checkInDateEnd;
|
||||||
|
/**
|
||||||
|
* 查询类型 1:心血管异常/2:脑血管异常/3:冠脉CT异常
|
||||||
|
*/
|
||||||
|
@Schema(title = "查询类型 1:心血管异常/2:脑血管异常/3:冠脉CT异常")
|
||||||
|
@NotNull
|
||||||
|
private String queryType;
|
||||||
|
/**
|
||||||
|
* 页码 从1开始
|
||||||
|
*/
|
||||||
|
@Schema(title = "页码 从1开始")
|
||||||
|
private Integer pageNo;
|
||||||
|
/**
|
||||||
|
* 每页数量
|
||||||
|
*/
|
||||||
|
@Schema(title = "每页数量")
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
|
public MedicalAbnormalDTO() {
|
||||||
|
Date date = new Date();
|
||||||
|
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
||||||
|
this.checkInDateEnd = DateUtil.endOfDay(date);
|
||||||
|
this.pageNo = 1;
|
||||||
|
this.pageSize = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统AED数据详情", description = "安眼系统AED数据详情")
|
||||||
|
public class AnYanAedInfo {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 二级单位名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "二级单位名称")
|
||||||
|
private String secondOfficeName;
|
||||||
|
/**
|
||||||
|
* 三级单位名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "三级单位名称")
|
||||||
|
private String thirdOfficeName;
|
||||||
|
/**
|
||||||
|
* 提供地点
|
||||||
|
*/
|
||||||
|
@Schema(title = "提供地点")
|
||||||
|
private String providePlace;
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
@Schema(title = "电话")
|
||||||
|
private String tel;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(title = "经度")
|
||||||
|
private String lon;
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(title = "纬度")
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createDate;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "更新时间")
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
|
public String getSecondOfficeName() {
|
||||||
|
if(null != secondOfficeName){
|
||||||
|
// 处理返数据中的空格和换行符
|
||||||
|
return secondOfficeName.replaceAll(" ","").replaceAll("\r\n","");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdOfficeName() {
|
||||||
|
if(null != thirdOfficeName){
|
||||||
|
// 处理返数据中的空格和换行符
|
||||||
|
return thirdOfficeName.replaceAll(" ","").replaceAll("\r\n","");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口返回", description = "安眼系统体检数据接口返回")
|
||||||
|
public class AnYanEmpHealthCheckNew {
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
@Schema(title = "性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
@Schema(title = "出生日期")
|
||||||
|
private String birthday;
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
@Schema(title = "单位全称")
|
||||||
|
private String workUnit;
|
||||||
|
@Schema(title = "民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
@Schema(title = "民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
@Schema(title = "电话号码")
|
||||||
|
private String phone;
|
||||||
|
@Schema(title = "员工编号 非统一认证编号")
|
||||||
|
private String empId;
|
||||||
|
@Schema(title = "体检数据")
|
||||||
|
private AnYanMedicalNew empHealthCheckNew;
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanHealthCheckDepart {
|
||||||
|
@Schema(title = "科室记录编号")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "科室体检编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
@Schema(title = "小结")
|
||||||
|
private String summary;
|
||||||
|
@Schema(title = "小结日期")
|
||||||
|
private String summaryDate;
|
||||||
|
@Schema(title = "小结医生(科室医生)")
|
||||||
|
private String summaryDoctor;
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口返回", description = "安眼系统体检数据接口返回")
|
||||||
|
public class AnYanHealthCheckNew {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(name = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("idCard")
|
||||||
|
@Schema(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("hospitalName")
|
||||||
|
@Schema(name = "员工体检医院")
|
||||||
|
private String hospitalName;
|
||||||
|
|
||||||
|
@JsonProperty("checkDate")
|
||||||
|
@Schema(name = "员工体检日期")
|
||||||
|
private String checkDate;
|
||||||
|
|
||||||
|
@JsonProperty("checkDoctor")
|
||||||
|
@Schema(name = "员工体检医生")
|
||||||
|
private String checkDoctor;
|
||||||
|
|
||||||
|
@JsonProperty("checkId")
|
||||||
|
@Schema(name = "员工体检编号")
|
||||||
|
private String checkId;
|
||||||
|
|
||||||
|
@JsonProperty("workUnit")
|
||||||
|
@Schema(name = "员工单位名称")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@JsonProperty("sexCode")
|
||||||
|
@Schema(name = "员工性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@JsonProperty("sexCodeText")
|
||||||
|
@Schema(name = "员工性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValue")
|
||||||
|
@Schema(name = "员工民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValueText")
|
||||||
|
@Schema(name = "员工民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
@Schema(name = "员工电话号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
}
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统健康小屋接口返回", description = "安眼系统健康小屋接口返回")
|
||||||
|
public class AnYanHealthRoom {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(name = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("departId")
|
||||||
|
@Schema(name = "单位id")
|
||||||
|
private String departId;
|
||||||
|
|
||||||
|
@JsonProperty("departName")
|
||||||
|
@Schema(name = "单位名称")
|
||||||
|
private String departName;
|
||||||
|
|
||||||
|
@JsonProperty("roomId")
|
||||||
|
@Schema(name = "健康小屋id")
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("idCard")
|
||||||
|
@Schema(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@JsonProperty("checkInDate")
|
||||||
|
@Schema(name = "检查日期")
|
||||||
|
private String checkInDate;
|
||||||
|
|
||||||
|
@JsonProperty("checkType")
|
||||||
|
@Schema(name = "检查类型")
|
||||||
|
private String checkType;
|
||||||
|
|
||||||
|
@JsonProperty("checkTypeName")
|
||||||
|
@Schema(name = "检查类型名称")
|
||||||
|
private String checkTypeName;
|
||||||
|
|
||||||
|
@JsonProperty("lastVal")
|
||||||
|
@Schema(name = "去年体检值 目前各个小屋没有这个值")
|
||||||
|
private String lastVal;
|
||||||
|
|
||||||
|
@JsonProperty("goalVal")
|
||||||
|
@Schema(name = "标值 各个小屋的指标并不一致")
|
||||||
|
private String goalVal;
|
||||||
|
|
||||||
|
@JsonProperty("currentVal")
|
||||||
|
@Schema(name = "当前测量值")
|
||||||
|
private String currentVal;
|
||||||
|
|
||||||
|
@JsonProperty("compareVal")
|
||||||
|
@Schema(name = "控降差值 目前各个小屋没有这个值")
|
||||||
|
private String compareVal;
|
||||||
|
|
||||||
|
@JsonProperty("successFlag")
|
||||||
|
@Schema(name = "是否成功空降 目前各个小屋没有这个值")
|
||||||
|
private String successFlag;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一编号")
|
||||||
|
private String employeeNum;
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanMedicalNew {
|
||||||
|
@Schema(title = "查询id")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
@Schema(title = "名称")
|
||||||
|
private String name;
|
||||||
|
@Schema(title = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
@Schema(title = "检查日期")
|
||||||
|
private String checkDate;
|
||||||
|
@Schema(title = "检查医生名称")
|
||||||
|
private String checkDoctor;
|
||||||
|
@Schema(title = "医院检查编号")
|
||||||
|
private String checkNo;
|
||||||
|
@Schema(title = "检查编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "体检综述")
|
||||||
|
private String checkResult;
|
||||||
|
@Schema(title = "体检建议")
|
||||||
|
private String checkSuggestion;
|
||||||
|
@Schema(title = "科室体检数据")
|
||||||
|
private List<AnYanHealthCheckDepart> healthCheckDepartList;
|
||||||
|
@Schema(title = "二级单位id")
|
||||||
|
private String secondOfficeId;
|
||||||
|
@Schema(title = "二级单位名称")
|
||||||
|
private String secondOfficeName;
|
||||||
|
@Schema(title = "三级单位id")
|
||||||
|
private String thirdOfficeId;
|
||||||
|
@Schema(title = "三级单位名称")
|
||||||
|
private String thirdOfficeName;
|
||||||
|
|
||||||
|
}
|
||||||
+170
@@ -0,0 +1,170 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统接口返回对象", description = "安眼系统接口返回对象")
|
||||||
|
public class AnYanResult<T> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功标志
|
||||||
|
*/
|
||||||
|
@Schema(title = "成功标志")
|
||||||
|
private boolean success = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回处理消息
|
||||||
|
*/
|
||||||
|
@Schema(title = "返回处理消息")
|
||||||
|
private String message = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回代码
|
||||||
|
*/
|
||||||
|
@Schema(title = "返回代码")
|
||||||
|
private Integer code = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回数据对象 data
|
||||||
|
*/
|
||||||
|
@Schema(title = "返回数据对象")
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳
|
||||||
|
*/
|
||||||
|
@Schema(title = "时间戳")
|
||||||
|
private long timestamp = System.currentTimeMillis();
|
||||||
|
@JsonIgnore
|
||||||
|
private String onlTable;
|
||||||
|
|
||||||
|
public AnYanResult() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兼容VUE3版token失效不跳转登录页面
|
||||||
|
*
|
||||||
|
* @param code
|
||||||
|
* @param message
|
||||||
|
*/
|
||||||
|
public AnYanResult(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> ok() {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> ok(String msg) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
//Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
|
||||||
|
r.setData((T) msg);
|
||||||
|
r.setMessage(msg);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> ok(T data) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setData(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> OK() {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此方法是为了兼容升级所创建
|
||||||
|
*
|
||||||
|
* @param msg
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> AnYanResult<T> OK(String msg) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setMessage(msg);
|
||||||
|
//Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
|
||||||
|
r.setData((T) msg);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> OK(T data) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setData(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> OK(String msg, T data) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setData(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> error(String msg, T data) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setSuccess(false);
|
||||||
|
r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setData(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> error(String msg) {
|
||||||
|
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> AnYanResult<T> error(int code, String msg) {
|
||||||
|
AnYanResult<T> r = new AnYanResult<T>();
|
||||||
|
r.setCode(code);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setSuccess(false);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无权限访问返回结果
|
||||||
|
*/
|
||||||
|
public static <T> AnYanResult<T> noauth(String msg) {
|
||||||
|
return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnYanResult<T> success(String message) {
|
||||||
|
this.message = message;
|
||||||
|
this.code = CommonConstant.SC_OK_200;
|
||||||
|
this.success = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnYanResult<T> error500(String message) {
|
||||||
|
this.message = message;
|
||||||
|
this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
|
||||||
|
this.success = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统批量更新员工关键信息接口返回对象", description = "安眼系统批量更新员工关键信息接口返回对象")
|
||||||
|
public class AnYanUpdateUserBatchInfo {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("idNo")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
}
|
||||||
+141
@@ -0,0 +1,141 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统更新单个员工扩展信息接口返回对象", description = "安眼系统更新单个员工扩展信息接口返回对象")
|
||||||
|
public class AnYanUserEmployee {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("sexCode")
|
||||||
|
@Schema(name = "员工性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@JsonProperty("sexCodeText")
|
||||||
|
@Schema(name = "员工性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValue")
|
||||||
|
@Schema(name = "员工民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValueText")
|
||||||
|
@Schema(name = "员工民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
@Schema(name = "员工手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("idNo")
|
||||||
|
@Schema(name = "员工身份证号")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
@JsonProperty("birthPlace")
|
||||||
|
@Schema(name = "出生地")
|
||||||
|
private String birthPlace;
|
||||||
|
|
||||||
|
@JsonProperty("educationCode")
|
||||||
|
@Schema(name = "文化程度编号")
|
||||||
|
private String educationCode;
|
||||||
|
|
||||||
|
@JsonProperty("educationCodeText")
|
||||||
|
@Schema(name = "文化程度")
|
||||||
|
private String educationCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("marriageCode")
|
||||||
|
@Schema(name = "婚姻概况编号")
|
||||||
|
private String marriageCode;
|
||||||
|
|
||||||
|
@JsonProperty("marriageCodeText")
|
||||||
|
@Schema(name = "婚姻概况")
|
||||||
|
private String marriageCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("householdTypeCode")
|
||||||
|
@Schema(name = "户籍性质")
|
||||||
|
private String householdTypeCode;
|
||||||
|
|
||||||
|
@JsonProperty("workUnitId")
|
||||||
|
@Schema(name = "单位id 原工作单位")
|
||||||
|
private String workUnitId;
|
||||||
|
|
||||||
|
@JsonProperty("parentWorkIds")
|
||||||
|
@Schema(name = "父单位id")
|
||||||
|
private String parentWorkIds;
|
||||||
|
|
||||||
|
@JsonProperty("currentOfficeId")
|
||||||
|
@Schema(name = "现工作单位id")
|
||||||
|
private String currentOfficeId;
|
||||||
|
|
||||||
|
@JsonProperty("currentOfficeIdText")
|
||||||
|
@Schema(name = "现工作单位")
|
||||||
|
private String currentOfficeIdText;
|
||||||
|
|
||||||
|
@JsonProperty("workUnit")
|
||||||
|
@Schema(name = "单位名称")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@JsonProperty("birthday")
|
||||||
|
@Schema(name = "出生日期")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
@JsonProperty("homeId")
|
||||||
|
@Schema(name = "健康小屋id")
|
||||||
|
private String homeId;
|
||||||
|
|
||||||
|
@JsonProperty("homePlace")
|
||||||
|
@Schema(name = "健康小屋地点")
|
||||||
|
private String homePlace;
|
||||||
|
|
||||||
|
@JsonProperty("posts")
|
||||||
|
@Schema(name = "职位编号")
|
||||||
|
private String posts;
|
||||||
|
|
||||||
|
@JsonProperty("postsText")
|
||||||
|
@Schema(name = "职位")
|
||||||
|
private String postsText;
|
||||||
|
|
||||||
|
@JsonProperty("heartBloodVesselCheck")
|
||||||
|
@Schema(name = "心血管检查 有/无")
|
||||||
|
private String heartBloodVesselCheck;
|
||||||
|
|
||||||
|
@JsonProperty("brainBloodVesselCheck")
|
||||||
|
@Schema(name = "脑血管检查 有/无")
|
||||||
|
private String brainBloodVesselCheck;
|
||||||
|
|
||||||
|
@JsonProperty("cancerCheck")
|
||||||
|
@Schema(name = "癌症筛查 有/无")
|
||||||
|
private String cancerCheck;
|
||||||
|
|
||||||
|
@JsonProperty("ctaResult")
|
||||||
|
@Schema(name = "冠状CTA检查结果 1: '无', 2: '轻度狭窄',3: '中度狭窄',4: '重度狭窄'")
|
||||||
|
private Integer ctaResult;
|
||||||
|
|
||||||
|
@JsonProperty("age")
|
||||||
|
@Schema(name = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@JsonProperty("isHealthAdmin")
|
||||||
|
@Schema(name = "是否为健康管理员 1-是 2-否")
|
||||||
|
private Integer isHealthAdmin;
|
||||||
|
|
||||||
|
@JsonProperty("inFormedBookAttached")
|
||||||
|
@Schema(name = "是否上传知情同意书 有值-是 null-否")
|
||||||
|
private String inFormedBookAttached;
|
||||||
|
|
||||||
|
@JsonProperty("existHealthAdmCommit")
|
||||||
|
@Schema(name = "是否上传保密承诺书 true-是 false-否")
|
||||||
|
private Boolean existHealthAdmCommit;
|
||||||
|
}
|
||||||
+149
@@ -0,0 +1,149 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Huawei
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2025/10/24 16:59
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class AnYanUserInfoResult {
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
@JsonProperty("loginName")
|
||||||
|
private String loginName;
|
||||||
|
@JsonProperty("email")
|
||||||
|
private String email;
|
||||||
|
@JsonProperty("organizationId")
|
||||||
|
private Integer organizationId;
|
||||||
|
@JsonProperty("realName")
|
||||||
|
private String realName;
|
||||||
|
@JsonProperty("phone")
|
||||||
|
private String phone;
|
||||||
|
@JsonProperty("gender")
|
||||||
|
private Integer gender;
|
||||||
|
@JsonProperty("tenantName")
|
||||||
|
private String tenantName;
|
||||||
|
@JsonProperty("tenantNum")
|
||||||
|
private String tenantNum;
|
||||||
|
@JsonProperty("roleMergeFlag")
|
||||||
|
private Integer roleMergeFlag;
|
||||||
|
@JsonProperty("tenantId")
|
||||||
|
private Integer tenantId;
|
||||||
|
@JsonProperty("currentRoleId")
|
||||||
|
private String currentRoleId;
|
||||||
|
@JsonProperty("currentRoleCode")
|
||||||
|
private String currentRoleCode;
|
||||||
|
@JsonProperty("currentRoleName")
|
||||||
|
private String currentRoleName;
|
||||||
|
@JsonProperty("currentRoleLevel")
|
||||||
|
private String currentRoleLevel;
|
||||||
|
@JsonProperty("employeeUnitDTO")
|
||||||
|
private EmployeeUnitDTO employeeUnitDTO;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class EmployeeUnitDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职工编号
|
||||||
|
*/
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@JsonProperty("name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*/
|
||||||
|
@JsonProperty("email")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机
|
||||||
|
*/
|
||||||
|
@JsonProperty("mobile")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别,0男,1女
|
||||||
|
*/
|
||||||
|
@JsonProperty("gender")
|
||||||
|
private Integer gender;
|
||||||
|
@JsonProperty("status")
|
||||||
|
private Object status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("enabledFlag")
|
||||||
|
private String enabledFlag;
|
||||||
|
@JsonProperty("unitName")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属二级单位unitCode
|
||||||
|
*/
|
||||||
|
@JsonProperty("unitCode")
|
||||||
|
private String unitCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科级单位名称
|
||||||
|
*/
|
||||||
|
@JsonProperty("sectionUnitName")
|
||||||
|
private String sectionUnitName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科级单位unitCode
|
||||||
|
*/
|
||||||
|
@JsonProperty("sectionUnitCode")
|
||||||
|
private String sectionUnitCode;
|
||||||
|
@JsonProperty("directDepartmentName")
|
||||||
|
private String directDepartmentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属部门unitCode
|
||||||
|
*/
|
||||||
|
@JsonProperty("directDepartmentCode")
|
||||||
|
private String directDepartmentCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 层级路径(unitCode拼接)
|
||||||
|
*/
|
||||||
|
@JsonProperty("levelPath")
|
||||||
|
private String levelPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完整组织机构路径(unitName拼接)
|
||||||
|
*/
|
||||||
|
@JsonProperty("unitNamePath")
|
||||||
|
private String unitNamePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 固定电话
|
||||||
|
*/
|
||||||
|
@JsonProperty("attribute1")
|
||||||
|
private String attribute1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职务
|
||||||
|
*/
|
||||||
|
@JsonProperty("attribute2")
|
||||||
|
private String attribute2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生日或年龄
|
||||||
|
*/
|
||||||
|
@JsonProperty("attribute3")
|
||||||
|
private Object attribute3;
|
||||||
|
}
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AuthResult {
|
||||||
|
/**
|
||||||
|
*范围
|
||||||
|
*/
|
||||||
|
private String scope;
|
||||||
|
/**
|
||||||
|
*有效期
|
||||||
|
*/
|
||||||
|
private Integer expires_in;
|
||||||
|
/**
|
||||||
|
* token_type
|
||||||
|
*/
|
||||||
|
private String token_type;
|
||||||
|
/**
|
||||||
|
* token
|
||||||
|
*/
|
||||||
|
private String access_token;
|
||||||
|
/**
|
||||||
|
* refresh_token
|
||||||
|
*/
|
||||||
|
private String refresh_token;
|
||||||
|
/**
|
||||||
|
* satoken
|
||||||
|
*/
|
||||||
|
private String satoken;
|
||||||
|
/**
|
||||||
|
* message
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
/**
|
||||||
|
* success
|
||||||
|
*/
|
||||||
|
private boolean success;
|
||||||
|
}
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Schema(title="健康打卡血压异常数据详细", description="健康打卡血压异常数据详细")
|
||||||
|
public class BloodPressureList extends XjUserBaseInfo {
|
||||||
|
/**
|
||||||
|
*收缩压
|
||||||
|
*/
|
||||||
|
@Schema(title = "收缩压")
|
||||||
|
private String sbp;
|
||||||
|
/**
|
||||||
|
*收缩压是否异常
|
||||||
|
*/
|
||||||
|
@Schema(title = "收缩压是否异常")
|
||||||
|
private String sbpFlag;
|
||||||
|
/**
|
||||||
|
*舒张压
|
||||||
|
*/
|
||||||
|
@Schema(title = "舒张压")
|
||||||
|
private String dbp;
|
||||||
|
/**
|
||||||
|
*舒张压是否异常
|
||||||
|
*/
|
||||||
|
@Schema(title = "舒张压是否异常")
|
||||||
|
private String dbpFlag;
|
||||||
|
/**
|
||||||
|
*填报时间 YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
@Schema(title = "填报时间")
|
||||||
|
private String inputDate;
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Schema(title="健康打卡血糖异常数据详细", description="健康打卡血糖异常数据详细")
|
||||||
|
public class BloodSugarClockSList extends XjUserBaseInfo {
|
||||||
|
/**
|
||||||
|
*血糖值
|
||||||
|
*/
|
||||||
|
@Schema(title = "血糖值")
|
||||||
|
private String bsVal;
|
||||||
|
/**
|
||||||
|
*血糖是否异常
|
||||||
|
*/
|
||||||
|
@Schema(title = "血糖是否异常")
|
||||||
|
private String bsFlag;
|
||||||
|
/**
|
||||||
|
*填报时间 YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
@Schema(title = "填报时间")
|
||||||
|
private String inputDate;
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CarePersonList {
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 员工ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "员工ID")
|
||||||
|
private String empId;
|
||||||
|
/**
|
||||||
|
* 性别 (返回的是'男''女',汉字)
|
||||||
|
*/
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sex;
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
/**
|
||||||
|
* 检查年份
|
||||||
|
*/
|
||||||
|
@Schema(title = "检查年份")
|
||||||
|
private String checkYear;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "最新检查时间")
|
||||||
|
private Date createDate;
|
||||||
|
}
|
||||||
+191
@@ -0,0 +1,191 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Period;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="重点关爱趋势预警信息",description="重点关爱趋势预警信息")
|
||||||
|
public class CareUserListVo {
|
||||||
|
@Schema(title = "ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(title = "员工ID")
|
||||||
|
private String empId;
|
||||||
|
|
||||||
|
@Schema(title = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
@Schema(title = "工作单位")
|
||||||
|
private String workUnit ;
|
||||||
|
|
||||||
|
@Schema(title = "单位ID")
|
||||||
|
private String workUnitId;
|
||||||
|
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private String createDate;
|
||||||
|
|
||||||
|
@Schema(title = "修改时间")
|
||||||
|
private String updateDate;
|
||||||
|
|
||||||
|
@Schema(title = "数据级别")
|
||||||
|
private Integer dataLevel;
|
||||||
|
|
||||||
|
@Schema(title = "负面清单")
|
||||||
|
private String negativeList;
|
||||||
|
|
||||||
|
@Schema(title = "一人一案")
|
||||||
|
private String caseInfo;
|
||||||
|
|
||||||
|
@Schema(title = "肥胖人员标识(1,是,2-否)")
|
||||||
|
private Integer flagFat;
|
||||||
|
|
||||||
|
@Schema(title = "BMI")
|
||||||
|
private Double bmi;
|
||||||
|
|
||||||
|
@Schema(title = "身高")
|
||||||
|
private Double height;
|
||||||
|
|
||||||
|
@Schema(title = "体重")
|
||||||
|
private Double weight;
|
||||||
|
|
||||||
|
@Schema(title = "体重管理目标")
|
||||||
|
private Double targetWeight;
|
||||||
|
|
||||||
|
@Schema(title = "目前BMI监测值")
|
||||||
|
private String bmiCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "高血压(0-否,1-是)")
|
||||||
|
private Integer hypertension;
|
||||||
|
|
||||||
|
@Schema(title = "收缩压均值")
|
||||||
|
private String systolicPressureAvg;
|
||||||
|
|
||||||
|
@Schema(title = "收缩压控制目标")
|
||||||
|
private String systolicPressureTarget;
|
||||||
|
|
||||||
|
@Schema(title = "目前收缩压检测值")
|
||||||
|
private String systolicPressureCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "舒张压平均值")
|
||||||
|
private String diastolicPressureAvg;
|
||||||
|
|
||||||
|
@Schema(title = "舒张压控制目标值")
|
||||||
|
private String diastolicPressureTarget;
|
||||||
|
|
||||||
|
@Schema(title = "舒张压当前检测值")
|
||||||
|
private String diastolicPressureCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "糖尿病标识(0-否,1-是)")
|
||||||
|
private Integer diabetes;
|
||||||
|
|
||||||
|
@Schema(title = "空腹葡萄糖(GLU)")
|
||||||
|
private String glu;
|
||||||
|
|
||||||
|
@Schema(title = "血糖控制目标值")
|
||||||
|
private String bloodSugarTarget;
|
||||||
|
|
||||||
|
@Schema(title = "目前血糖监测值:")
|
||||||
|
private String bloodSugarCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "低密度脂蛋白")
|
||||||
|
private String ldl;
|
||||||
|
|
||||||
|
@Schema(title = "低密度脂蛋白目标控制值")
|
||||||
|
private String ldlTarget;
|
||||||
|
|
||||||
|
@Schema(title = "低密度脂蛋白当前检测值")
|
||||||
|
private String ldlCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "总胆固醇")
|
||||||
|
private String tc;
|
||||||
|
|
||||||
|
@Schema(title = "总胆固醇目标控制值")
|
||||||
|
private String tcTarget;
|
||||||
|
|
||||||
|
@Schema(title = "总胆固醇目前监测值")
|
||||||
|
private String tcCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "甘油三酯")
|
||||||
|
private String tg;
|
||||||
|
|
||||||
|
@Schema(title = "甘油三酯目标控制值")
|
||||||
|
private String tgTarget;
|
||||||
|
|
||||||
|
@Schema(title = "甘油三酯当前监测值")
|
||||||
|
private String tgCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "尿酸")
|
||||||
|
private String uricAcid;
|
||||||
|
|
||||||
|
@Schema(title = "尿酸目标控制值")
|
||||||
|
private String uricAcidTarget;
|
||||||
|
|
||||||
|
@Schema(title = "尿酸当前监测值")
|
||||||
|
private String uricAcidCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "同型半胱氨酸")
|
||||||
|
private String homocysteine;
|
||||||
|
|
||||||
|
@Schema(title = "同型半胱氨酸目标控制值")
|
||||||
|
private String homocysteineTarget;
|
||||||
|
|
||||||
|
@Schema(title = "同型半胱氨酸当前监测值")
|
||||||
|
private String homocysteineCurrent;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员姓名")
|
||||||
|
private String careLiaisonName;
|
||||||
|
|
||||||
|
@Schema(title = "治疗方案反馈")
|
||||||
|
private String treatPlanResponse;
|
||||||
|
|
||||||
|
@Schema(title = "饮食建议反馈")
|
||||||
|
private String dietSuggestionResponse;
|
||||||
|
|
||||||
|
@Schema(title = "运动指导反馈")
|
||||||
|
private String sportGuideResponse;
|
||||||
|
|
||||||
|
@Schema(title = "日常生活管理反馈")
|
||||||
|
private String lifeManageResponse;
|
||||||
|
|
||||||
|
public Double getBmi() {
|
||||||
|
if (bmi == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Math.round(bmi * 10) / 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAge() {
|
||||||
|
if (age != null) {
|
||||||
|
return age;
|
||||||
|
}
|
||||||
|
if (idNo == null || idNo.length() != 18) {
|
||||||
|
return null; // 身份证号无效时返回null
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 截取出生日期字符串
|
||||||
|
String birthDateStr = idNo.substring(6, 14);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
|
LocalDate birthDate = LocalDate.parse(birthDateStr, formatter);
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
if (birthDate.isAfter(now)) {
|
||||||
|
return null; // 出生日期在未来,返回null
|
||||||
|
}
|
||||||
|
return Period.between(birthDate, now).getYears();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null; // 解析异常返回null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CareUserVO {
|
||||||
|
private String userId;
|
||||||
|
@Schema(title = "关爱联络员姓名")
|
||||||
|
private String careLiaisonName;
|
||||||
|
@Schema(title = "关爱联络员电话")
|
||||||
|
private String careLiaisonPhone;
|
||||||
|
@Schema(title = "关爱联络员职务")
|
||||||
|
private String careLiaisonJob;
|
||||||
|
@Schema(title = "急救人员姓名")
|
||||||
|
private String lifeguardName;
|
||||||
|
@Schema(title = "急救人员电话")
|
||||||
|
private String lifeguardPhone;
|
||||||
|
//20251223 改为两个急救人员 ,为改动最小化 没有改数据结构
|
||||||
|
@Schema(title = "急救人员2姓名")
|
||||||
|
private String lifeguardName2;
|
||||||
|
@Schema(title = "急救人员2电话")
|
||||||
|
private String lifeguardPhone2;
|
||||||
|
}
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="安眼员工关爱联络员信息及急救人员信息",description="安眼员工关爱联络员信息及急救人员信息")
|
||||||
|
public class EmergencyContactVO {
|
||||||
|
|
||||||
|
@Schema(title = "记录编号")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(title = "关爱员工编号")
|
||||||
|
private String empId;
|
||||||
|
|
||||||
|
@Schema(title = "单位名称")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@Schema(title = "关爱身份证号")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
@Schema(title = "联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(title = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(title = "单位id")
|
||||||
|
private String workUnitId;
|
||||||
|
|
||||||
|
@Schema(title = "性别标识(1-男,2-女)")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@Schema(title = "性别翻译")
|
||||||
|
private String sexCodeText;
|
||||||
|
|
||||||
|
@Schema(title = "办公场所周边4分钟内是否配备AED(1是 2否)")
|
||||||
|
private Integer officeAedAvailable;
|
||||||
|
|
||||||
|
@Schema(title = "办公场所AED是否能有专人管理(1是 2否)")
|
||||||
|
private Integer officeAedManaged;
|
||||||
|
|
||||||
|
@Schema(title = "办公场所AED管理人员姓名")
|
||||||
|
private String officeAedManagerName;
|
||||||
|
|
||||||
|
@Schema(title = "办公场所AED管理人员电话")
|
||||||
|
private String officeAedManagerPhone;
|
||||||
|
|
||||||
|
@Schema(title = "当班班组是否配备取证急救人员(1是 2否)")
|
||||||
|
private Integer teamHasFirstaider;
|
||||||
|
|
||||||
|
@Schema(title = "急救人员姓名")
|
||||||
|
private String firstAiderName;
|
||||||
|
|
||||||
|
@Schema(title = "急救人员电话")
|
||||||
|
private String firstAiderPhone;
|
||||||
|
|
||||||
|
@Schema(title = "急救人2员姓名")
|
||||||
|
private String firstAiderName2;
|
||||||
|
|
||||||
|
@Schema(title = "急救人2员电话")
|
||||||
|
private String firstAiderPhone2;
|
||||||
|
|
||||||
|
@Schema(title = "重点关爱人员是否倒班(1是 2否)")
|
||||||
|
private Integer keycareShiftWork;
|
||||||
|
|
||||||
|
@Schema(title = "夜晚是否在单位公寓住宿(1是 2否)")
|
||||||
|
private Integer keycareNightStay;
|
||||||
|
|
||||||
|
@Schema(title = "是否有陪同住宿人员(1是 2否)")
|
||||||
|
private Integer hasCompanion;
|
||||||
|
|
||||||
|
@Schema(title = "陪同住宿人员是否取得急救证(1是 2否)")
|
||||||
|
private Integer companionCertified;
|
||||||
|
|
||||||
|
@Schema(title = "宿舍是否安装一键报警(1是 2否)")
|
||||||
|
private Integer dormAlarmAvailable;
|
||||||
|
|
||||||
|
@Schema(title = "公寓周边4分钟内是否配备AED(1是 2否)")
|
||||||
|
private Integer dormAedAvailable;
|
||||||
|
|
||||||
|
@Schema(title = "公寓AED是否能有专人管理(1是 2否)")
|
||||||
|
private Integer dormAedManaged;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员id")
|
||||||
|
private String relationEmpId;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员名称")
|
||||||
|
private String relationEmpName;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员职务编码")
|
||||||
|
private String relationEmpPosts;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员职务翻译")
|
||||||
|
private String relationEmpPostsText;
|
||||||
|
|
||||||
|
@Schema(title = "关爱联络员手机号")
|
||||||
|
private String relationEmpPhone;
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HealthCheckProject {
|
||||||
|
@Schema(title = "项目记录编号")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "项目体检编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
@Schema(title = "项目编号")
|
||||||
|
private String projectNo;
|
||||||
|
@Schema(title = "项目名称")
|
||||||
|
private String projectName;
|
||||||
|
@Schema(title = "项目体检值")
|
||||||
|
private String resultValue;
|
||||||
|
@Schema(title = "是否异常")
|
||||||
|
private String abnormal;
|
||||||
|
@Schema(title = "异常结果")
|
||||||
|
private String abnormalResult;
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String unit;
|
||||||
|
@Schema(title = "参考值")
|
||||||
|
private String referenceValue;
|
||||||
|
@Schema(title = "是否心脑血管项目0否 1是")
|
||||||
|
private String bloodBrain;
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="健康小屋数据VO", description="健康小屋数据VO")
|
||||||
|
public class HealthPlaceHomListVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 地点
|
||||||
|
*/
|
||||||
|
@Schema(title = "地点")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(title = "经度")
|
||||||
|
private String lon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(title = "纬度")
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 建设时间 YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
@Schema(title = "建设时间(YYYY-MM-DD)")
|
||||||
|
private String buildDate;
|
||||||
|
}
|
||||||
+83
@@ -0,0 +1,83 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="健康小屋数据详情列表", description="健康小屋数据详情列表")
|
||||||
|
public class HealthPlaceHomeDetailsVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Schema(title = "id")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 单位id
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位id")
|
||||||
|
private String departId;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 健康小屋id
|
||||||
|
*/
|
||||||
|
@Schema(title = "健康小屋id")
|
||||||
|
private String roomId;
|
||||||
|
@Schema(title = "健康小屋名称")
|
||||||
|
private String roomName;
|
||||||
|
@Schema(title = "地址")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
/**
|
||||||
|
* 检查日期
|
||||||
|
*/
|
||||||
|
@Schema(title = "检查日期")
|
||||||
|
private String checkInDate;
|
||||||
|
/**
|
||||||
|
* 检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加
|
||||||
|
* 字典废弃 新接口返回了name
|
||||||
|
*/
|
||||||
|
@Schema(title = "检查类型")
|
||||||
|
private String checkType;
|
||||||
|
@Schema(title = "检查类型名称")
|
||||||
|
private String checkTypeName;
|
||||||
|
/**
|
||||||
|
* 去年体检值 前一年的体检值(初始值)
|
||||||
|
*/
|
||||||
|
@Schema(title = "去年体检值 前一年的体检值(初始值)")
|
||||||
|
private String lastVal;
|
||||||
|
/**
|
||||||
|
* 控降目标 一人一档(控降目标值)
|
||||||
|
*/
|
||||||
|
@Schema(title = "控降目标 一人一档(控降目标值")
|
||||||
|
private String goalVal;
|
||||||
|
/**
|
||||||
|
* 目前测量值 目前控降数值(可和健康打卡最新值一致)
|
||||||
|
*/
|
||||||
|
@Schema(title = "目前测量值 目前控降数值(可和健康打卡最新值一致)")
|
||||||
|
private String currentVal;
|
||||||
|
/**
|
||||||
|
* 控降差值 和控降目标对比
|
||||||
|
*/
|
||||||
|
@Schema(title = "控降差值 和控降目标对比")
|
||||||
|
private String compareVal;
|
||||||
|
/**
|
||||||
|
* 是否成功空降,1:是/0.否
|
||||||
|
*/
|
||||||
|
@Schema(title = "是否成功空降,1:是/0.否")
|
||||||
|
private String successFlag;
|
||||||
|
@Schema(title = "员工统一编号")
|
||||||
|
private String employeeNum;
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="新疆健康小屋对象", description="新疆健康小屋对象")
|
||||||
|
public class HealthRoomBaseVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
@Schema(title = "地址")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(title = "经度")
|
||||||
|
private String lon;
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(title = "纬度")
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 建设时间 yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@Schema(title = "建设时间")
|
||||||
|
private String buildDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在岗人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "在岗人数")
|
||||||
|
private Integer jobNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运转时间(分钟)
|
||||||
|
*/
|
||||||
|
@Schema(title = "运转时间(分钟)")
|
||||||
|
private Integer runTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理人员
|
||||||
|
*/
|
||||||
|
@Schema(title = "管理人员")
|
||||||
|
private String manager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
@Schema(title = "联系电话")
|
||||||
|
private String phone;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="打卡人数统计", description="打卡人数统计")
|
||||||
|
public class HealthSignStatVO {
|
||||||
|
/**
|
||||||
|
* 减重打卡总人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "减重打卡总人数")
|
||||||
|
private String weigtTotalCount;
|
||||||
|
/**
|
||||||
|
* 减重异常人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "减重异常人数")
|
||||||
|
private String weigtAbCount;
|
||||||
|
/**
|
||||||
|
* 血压打卡总人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "血压打卡总人数")
|
||||||
|
private String bpTotalCount;
|
||||||
|
/**
|
||||||
|
* 血压异常人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "血压异常人数")
|
||||||
|
private String bpAbCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 血糖打卡总人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "血糖打卡总人数")
|
||||||
|
private String bsTotalCount;
|
||||||
|
/**
|
||||||
|
* 血糖异常人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "血糖异常人数")
|
||||||
|
private String bsAbCount;
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title="油田医院VO", description="油田医院VO")
|
||||||
|
public class HospitalListVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Schema(title = "id")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 医院名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
/**
|
||||||
|
* 别名
|
||||||
|
*/
|
||||||
|
@Schema(title = "别名")
|
||||||
|
private String alias;
|
||||||
|
/**
|
||||||
|
* 地点
|
||||||
|
*/
|
||||||
|
@Schema(title = "地点")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
@Schema(title = "电话")
|
||||||
|
private String phone;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(title = "经度")
|
||||||
|
private String lon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(title = "纬度")
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 签约时间 YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
@Schema(title = "签约时间(YYYY-MM-DD)")
|
||||||
|
private String contractDate;
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MedicalAbnormalStatisticsVO {
|
||||||
|
private Integer totalCount;
|
||||||
|
// 冠脉CTA异常人数
|
||||||
|
private Integer cardiovaAbCount;
|
||||||
|
// 头颅CTA异常人数
|
||||||
|
private Integer cerebrovAbCount;
|
||||||
|
// 冠脉ct异常人数 (未返回)
|
||||||
|
private Integer cctaAbCount;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MedicalAbnormalVO {
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
@Schema(title = "性别")
|
||||||
|
@Dict(dicCode = "sex2")
|
||||||
|
private Integer sex;
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
/**
|
||||||
|
* 体检医院
|
||||||
|
*/
|
||||||
|
@Schema(title = "体检医院")
|
||||||
|
private String hospitalName;
|
||||||
|
/**
|
||||||
|
* 检查日期
|
||||||
|
*/
|
||||||
|
@Schema(title = "检查日期")
|
||||||
|
private String checkInDate;
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MedicalPeopleNumStatisticsVO {
|
||||||
|
/**
|
||||||
|
* 医院名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
/**
|
||||||
|
* 别名 为了显示或别的目的,医院名称过长导致不好显示,最好增加短的别名,如果没有则和hospitalName保持一致
|
||||||
|
*/
|
||||||
|
@Schema(title = "别名")
|
||||||
|
private String alias;
|
||||||
|
/**
|
||||||
|
* 已参检人数
|
||||||
|
*/
|
||||||
|
@Schema(title = "已参检人数")
|
||||||
|
private Integer checkedCount;
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Schema(title="健康打卡体重异常数据详细", description="健康打卡体重异常数据详细")
|
||||||
|
public class WeightPressureList extends XjUserBaseInfo {
|
||||||
|
/**
|
||||||
|
*腰围(CM)
|
||||||
|
*/
|
||||||
|
@Schema(title = "腰围(CM)")
|
||||||
|
private String waist;
|
||||||
|
/**
|
||||||
|
*身高(M)
|
||||||
|
*/
|
||||||
|
@Schema(title = "身高(M)")
|
||||||
|
private String height;
|
||||||
|
/**
|
||||||
|
*体重(KG)
|
||||||
|
*/
|
||||||
|
@Schema(title = "体重(KG)")
|
||||||
|
private String weight;
|
||||||
|
/**
|
||||||
|
*BMI
|
||||||
|
*/
|
||||||
|
@Schema(title = "BMI")
|
||||||
|
private String bmi;
|
||||||
|
/**
|
||||||
|
*BMI是否异常(1:是/0:否)
|
||||||
|
*/
|
||||||
|
@Schema(title = "BMI是否异常(1:是/0:否)")
|
||||||
|
private String bmiFlag;
|
||||||
|
/**
|
||||||
|
*填报时间 YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
@Schema(title = "填报时间")
|
||||||
|
private String inputDate;
|
||||||
|
}
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工基本信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class XjUserBaseInfo {
|
||||||
|
/**
|
||||||
|
*单位
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String departName;
|
||||||
|
/**
|
||||||
|
*姓名
|
||||||
|
*/
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
*身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
/**
|
||||||
|
*年龄
|
||||||
|
*/
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private String age;
|
||||||
|
/**
|
||||||
|
*性别
|
||||||
|
*/
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sex;
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.renkang.anyan.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.renkang.anyan.model.vo.AnYanResult;
|
||||||
|
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IPage 类型装换
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
|
public class PageResultToBeanUtil<T> {
|
||||||
|
|
||||||
|
public IPage<T> transform(AnYanResult<Object> result, Class<T> tClass) {
|
||||||
|
IPage<?> page = BeanUtil.toBean(result.getData(), Page.class);
|
||||||
|
IPage<T> iPage = new Page<>();
|
||||||
|
BeanUtil.copyProperties(page,iPage,"records");
|
||||||
|
if(page.getTotal() > 0){
|
||||||
|
iPage.setRecords(page.getRecords().stream().map(o ->BeanUtil.toBean(o, tClass)).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
return iPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.renkang.anyan.utils;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.Mode;
|
||||||
|
import cn.hutool.crypto.Padding;
|
||||||
|
import cn.hutool.crypto.symmetric.SM4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* XJ安眼平台提供的数据加密工具类 仅用于安眼系统外部登录接口的对接
|
||||||
|
*/
|
||||||
|
public class SM4Utils {
|
||||||
|
|
||||||
|
private static final String privateKey = "5tgb6yhn7ujm8ik,";
|
||||||
|
// private static final String privateKey = "123456789qwertyu";
|
||||||
|
|
||||||
|
private static final String iv = "5tgb6yhn7ujm8ik,";
|
||||||
|
// private static final String iv = "abcdefghi1234567";
|
||||||
|
private static SM4 sm4 = null;
|
||||||
|
|
||||||
|
private static SM4 getInstance() {
|
||||||
|
if (sm4 == null) {
|
||||||
|
sm4 = new SM4(Mode.CBC, Padding.PKCS5Padding, privateKey.getBytes(), iv.getBytes());
|
||||||
|
}
|
||||||
|
return sm4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 加密
|
||||||
|
* @author xj
|
||||||
|
* @time 2023/8/17
|
||||||
|
*/
|
||||||
|
public static String encryptSM4(String needEncryptText) {
|
||||||
|
return getInstance().encryptBase64(needEncryptText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 解密
|
||||||
|
* @author xj
|
||||||
|
* @time 2023/8/17
|
||||||
|
*/
|
||||||
|
public static String decryptSM4(String encryptText) {
|
||||||
|
if (encryptText == null || encryptText.isEmpty()) return "";
|
||||||
|
return getInstance().decryptStr(encryptText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+242
@@ -0,0 +1,242 @@
|
|||||||
|
package com.renkang.anyan.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.SecretKeyFactory;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.PBEKeySpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.security.KeyFactory;
|
||||||
|
import java.security.PublicKey;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.security.spec.KeySpec;
|
||||||
|
import java.security.spec.X509EncodedKeySpec;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安眼平台提供的数据加密工具类 仅用于安眼系统外部登录接口的对接
|
||||||
|
*/
|
||||||
|
public class StringUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公钥加密方法
|
||||||
|
*
|
||||||
|
* @param publicKeyText 公钥
|
||||||
|
* @param text 将要加密的信息
|
||||||
|
* @return Base64编码的字符串
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static String encryptByPublicKey(String publicKeyText, String text) throws Exception {
|
||||||
|
// 返回按照 X.509 标准进行编码的密钥的字节
|
||||||
|
// x509EncodedKeySpec2 是一种规范、规格
|
||||||
|
X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(Base64.getDecoder().decode(publicKeyText));
|
||||||
|
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||||
|
// 让密钥工厂按照指定的 规范 生成公钥
|
||||||
|
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2);
|
||||||
|
Cipher cipher = Cipher.getInstance("RSA");
|
||||||
|
// 对加密初始化,使用加密模式,公钥加密
|
||||||
|
// Cipher.ENCRYPT_MODE 可以用 1 代替
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||||
|
|
||||||
|
byte[] result = cipher.doFinal(text.getBytes());
|
||||||
|
// 返回 Base64编码的字符串
|
||||||
|
return Base64.getEncoder().encodeToString(result);
|
||||||
|
// return org.apache.commons.codec.binary.Base64.encodeBase64String(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String base64Encode(String input) {
|
||||||
|
return Base64.getEncoder().encodeToString(input.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String base64Decode(String encodedInput) {
|
||||||
|
byte[] decodedBytes = Base64.getDecoder().decode(encodedInput);
|
||||||
|
return new String(decodedBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String preprocessJsonString(String jsonStr) {
|
||||||
|
String a = StrUtil.removeAll(jsonStr, ' ', '\t', '\r', '\n');
|
||||||
|
String[] searchList = {"\":\"", "\",\"", "{\"", "\"}", "\":"};
|
||||||
|
String[] replacementList = {"$is$", "$center$", "$left$", "$right$", "$start$"};
|
||||||
|
String b = org.apache.commons.lang3.StringUtils.replaceEach(a, searchList, replacementList);
|
||||||
|
String c = b.replace("\"", "\\\"");
|
||||||
|
return org.apache.commons.lang3.StringUtils.replaceEach(c, replacementList, searchList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提取文件名中的扩展名
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @param needDot 需要点
|
||||||
|
* @return 文件扩展名,如果文件名中没有扩展名则返回 null
|
||||||
|
*/
|
||||||
|
public static String getFileExtension(String fileName, boolean needDot) {
|
||||||
|
// 检查文件名是否为 null 或空字符串
|
||||||
|
if (fileName == null || fileName.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 找到最后一个点的位置
|
||||||
|
int lastDotIndex = fileName.lastIndexOf('.');
|
||||||
|
|
||||||
|
// 如果找不到点,或者点在字符串的第一个位置,返回 null
|
||||||
|
if (lastDotIndex == -1 || lastDotIndex == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileName.substring(needDot ? lastDotIndex : (lastDotIndex + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取路径的最后一个元素(文件名或目录名)
|
||||||
|
*
|
||||||
|
* @param pathOrUrl 文件路径或 URL
|
||||||
|
* @return 路径的最后一个元素
|
||||||
|
*/
|
||||||
|
public static String baseName(String pathOrUrl) {
|
||||||
|
if (pathOrUrl == null || pathOrUrl.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 尝试将字符串解析为 URI
|
||||||
|
URI uri = new URI(pathOrUrl);
|
||||||
|
// 获取 URI 的路径部分
|
||||||
|
String path = uri.getPath();
|
||||||
|
// 使用 Path 类获取路径的最后一个元素
|
||||||
|
Path filePath = Paths.get(path);
|
||||||
|
return filePath.getFileName().toString();
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
// 如果解析 URI 失败,则直接将字符串作为路径处理
|
||||||
|
Path filePath = Paths.get(pathOrUrl);
|
||||||
|
return filePath.getFileName().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------- AES 加解密(带盐值处理)-------------------
|
||||||
|
|
||||||
|
/** 内部密钥,仅用于日志脱敏,非高强度安全场景 */
|
||||||
|
private static final String AES_PASSWORD = "XJPlatform@2024#Secure";
|
||||||
|
/** 盐值长度(字节) */
|
||||||
|
private static final int SALT_LENGTH = 8;
|
||||||
|
/** 初始化向量长度(字节) */
|
||||||
|
private static final int IV_LENGTH = 16;
|
||||||
|
/** AES 密钥长度 */
|
||||||
|
private static final int KEY_LENGTH = 128;
|
||||||
|
/** PBKDF2 迭代次数 */
|
||||||
|
private static final int PBKDF2_ITERATIONS = 1000;
|
||||||
|
/** AES 加密算法 */
|
||||||
|
private static final String AES_CIPHER = "AES/CBC/PKCS5Padding";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES 加密(带随机盐值和 IV,每次加密结果不同)
|
||||||
|
*
|
||||||
|
* @param plainText 明文
|
||||||
|
* @return Base64 密文(格式:盐值 + IV + 加密数据)
|
||||||
|
*/
|
||||||
|
public static String aesEncrypt(String plainText) {
|
||||||
|
if (plainText == null || plainText.isEmpty()) {
|
||||||
|
return plainText;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
SecureRandom random = new SecureRandom();
|
||||||
|
byte[] salt = new byte[SALT_LENGTH];
|
||||||
|
byte[] iv = new byte[IV_LENGTH];
|
||||||
|
random.nextBytes(salt);
|
||||||
|
random.nextBytes(iv);
|
||||||
|
|
||||||
|
SecretKeySpec keySpec = deriveKey(salt);
|
||||||
|
Cipher cipher = Cipher.getInstance(AES_CIPHER);
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv));
|
||||||
|
byte[] encrypted = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
|
byte[] combined = new byte[SALT_LENGTH + IV_LENGTH + encrypted.length];
|
||||||
|
System.arraycopy(salt, 0, combined, 0, SALT_LENGTH);
|
||||||
|
System.arraycopy(iv, 0, combined, SALT_LENGTH, IV_LENGTH);
|
||||||
|
System.arraycopy(encrypted, 0, combined, SALT_LENGTH + IV_LENGTH, encrypted.length);
|
||||||
|
|
||||||
|
return Base64.getEncoder().encodeToString(combined);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("AES加密失败: " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
return plainText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES 解密(解析盐值 + IV + 加密数据)
|
||||||
|
*
|
||||||
|
* @param cipherText Base64 密文
|
||||||
|
* @return 明文
|
||||||
|
*/
|
||||||
|
public static String aesDecrypt(String cipherText) {
|
||||||
|
if (cipherText == null || cipherText.isEmpty()) {
|
||||||
|
return cipherText;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
byte[] combined = Base64.getDecoder().decode(cipherText);
|
||||||
|
|
||||||
|
byte[] salt = new byte[SALT_LENGTH];
|
||||||
|
byte[] iv = new byte[IV_LENGTH];
|
||||||
|
byte[] encrypted = new byte[combined.length - SALT_LENGTH - IV_LENGTH];
|
||||||
|
System.arraycopy(combined, 0, salt, 0, SALT_LENGTH);
|
||||||
|
System.arraycopy(combined, SALT_LENGTH, iv, 0, IV_LENGTH);
|
||||||
|
System.arraycopy(combined, SALT_LENGTH + IV_LENGTH, encrypted, 0, encrypted.length);
|
||||||
|
|
||||||
|
SecretKeySpec keySpec = deriveKey(salt);
|
||||||
|
Cipher cipher = Cipher.getInstance(AES_CIPHER);
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec, new IvParameterSpec(iv));
|
||||||
|
byte[] decrypted = cipher.doFinal(encrypted);
|
||||||
|
|
||||||
|
return new String(decrypted, StandardCharsets.UTF_8);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("AES解密失败: " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
return cipherText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 PBKDF2 从盐值和内部密钥派生 AES 密钥
|
||||||
|
*/
|
||||||
|
private static SecretKeySpec deriveKey(byte[] salt) {
|
||||||
|
try {
|
||||||
|
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||||
|
KeySpec spec = new PBEKeySpec(AES_PASSWORD.toCharArray(), salt, PBKDF2_ITERATIONS, KEY_LENGTH);
|
||||||
|
SecretKey tmp = factory.generateSecret(spec);
|
||||||
|
return new SecretKeySpec(tmp.getEncoded(), "AES");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("派生AES密钥失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
// --- RSA 公钥加密测试(安眼平台)---
|
||||||
|
// String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJL0JkqsUoK6kt3JyogsgqNp9VDGDp+t3ZAGMbVoMPdHNT2nfiIVh9ZMNHF7g2XiAa8O8AQWyh2PjMR0NiUSVQMCAwEAAQ==";
|
||||||
|
// String password = "Aa%13999527523";
|
||||||
|
// String rsaEncrypted = encryptByPublicKey(publicKey, password);
|
||||||
|
// System.out.println("RSA加密: " + rsaEncrypted);
|
||||||
|
//
|
||||||
|
// // --- AES 加解密测试(日志脱敏)---
|
||||||
|
// String originalText = "Aa%13999527523";
|
||||||
|
// String aesEncrypted = aesEncrypt(originalText);
|
||||||
|
String aesDecrypted = aesDecrypt("RuKy7jFDJR0rEJiwxgcyX6RFq8qP5FEgWZuMNxuVkKlbHhjJ2SzLOA==");
|
||||||
|
// System.out.println("AES加密: " + aesEncrypted);
|
||||||
|
System.out.println("AES解密: " + aesDecrypted);
|
||||||
|
// System.out.println("匹配: " + originalText.equals(aesDecrypted));
|
||||||
|
|
||||||
|
// 验证每次加密结果不同(盐值和IV随机)
|
||||||
|
// String aesEncrypted2 = aesEncrypt(originalText);
|
||||||
|
// System.out.println("再次加密: " + aesEncrypted2);
|
||||||
|
// System.out.println("两次密文不同: " + !aesEncrypted.equals(aesEncrypted2));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>health-bank</artifactId>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>health-bank-api</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- feign -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 控制openfeign中bcpkix依赖的版本 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcpkix-jdk18on</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- sentinel限流熔断降级-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>${maven-source-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.renkang.bank.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
public interface HealthBankConstants {
|
||||||
|
/**
|
||||||
|
* 积分变化-增加积分
|
||||||
|
*/
|
||||||
|
Integer CHANGE_TYPE_ADD = 1;
|
||||||
|
/**
|
||||||
|
*积分变化-扣减积分
|
||||||
|
*/
|
||||||
|
Integer CHANGE_TYPE_DEDUCT = 2;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.renkang.bank.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: feng
|
||||||
|
* @description: 积分来源枚举类
|
||||||
|
* @date 2026/02/05 09:38
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PointsSourceEnum {
|
||||||
|
// 积分变更类型
|
||||||
|
TYPE_1_SURVEY(1, "survey", "积分打卡"),
|
||||||
|
TYPE_2_USE(2, "use", "礼品兑换"),
|
||||||
|
TYPE_2_VIOLATION(2, "violation", "违规扣除"),
|
||||||
|
TYPE_2_EXPIRED(2, "expired", "过期清除");
|
||||||
|
/**
|
||||||
|
* 类型1-获得积分,2-扣减积分
|
||||||
|
*/
|
||||||
|
public final Integer changeType;
|
||||||
|
/**
|
||||||
|
* source 标识
|
||||||
|
*/
|
||||||
|
public final String source;
|
||||||
|
/**
|
||||||
|
* 来源描述
|
||||||
|
*/
|
||||||
|
public final String desc;
|
||||||
|
|
||||||
|
PointsSourceEnum(Integer changeType, String source, String desc) {
|
||||||
|
this.changeType = changeType;
|
||||||
|
this.source = source;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PointsSourceEnum getBySource(String source) {
|
||||||
|
for (PointsSourceEnum value : PointsSourceEnum.values()) {
|
||||||
|
if (value.source.equals(source)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PointsRulePageDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "健康分类")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "状态1-启用,2停用")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 更新用户积分DTO
|
||||||
|
* @date 2026/2/6 9:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UpdUserPointsDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分标识(积分打卡:survey,礼品兑换:use,违规扣除:violation,过期清除:expired)
|
||||||
|
*/
|
||||||
|
private String sourceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务ID(积分任务id,兑换商品id等)
|
||||||
|
*/
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作积分(扣减)
|
||||||
|
*/
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作备注(扣减积分的说明等)
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(扣减的目标用户id)
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsPageDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
@Schema(title = "1收入,2支出")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "打卡日期(开始)")
|
||||||
|
private String startDate;
|
||||||
|
|
||||||
|
@Schema(title = "打卡日期(结束)")
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UserPointsRankingDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "榜单类型,0日榜,1周榜,2月榜,3季榜,4年榜,5选时排名,10总榜")
|
||||||
|
private String rankType;
|
||||||
|
|
||||||
|
@Schema(title = "开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@Schema(title = "截止时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
private List<String> userIds;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品表 -礼品基本信息
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_info")
|
||||||
|
@Schema(title = "礼品基本信息", description = "礼品基本信息")
|
||||||
|
public class GiftInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品名称")
|
||||||
|
private String giftName;
|
||||||
|
|
||||||
|
@Schema(title = "礼品主图(多个使用逗号分隔)")
|
||||||
|
private String giftImage;
|
||||||
|
|
||||||
|
@Schema(title = "礼品库存")
|
||||||
|
private Integer inventory;
|
||||||
|
|
||||||
|
@Schema(title = "礼品分类(1-实物礼品,2-虚拟礼品)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(title = "礼品价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(title = "用户限购数量")
|
||||||
|
private Integer purchaseLimit;
|
||||||
|
|
||||||
|
@Schema(title = "礼品详情(富文本内容描述)")
|
||||||
|
private String giftInfo;
|
||||||
|
|
||||||
|
@Schema(title = "状态(0-启用,1-停用)")
|
||||||
|
private Integer status = 0;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "修改时间")
|
||||||
|
private Date lastModifyDate;
|
||||||
|
}
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品库存变更记录表 -礼品库存变更记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_inventory_log")
|
||||||
|
@Schema(title = "礼品库存变更记录表", description = "礼品库存变更记录表")
|
||||||
|
public class GiftInventoryLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long giftId;
|
||||||
|
|
||||||
|
@Schema(title = "本次库存变化")
|
||||||
|
private Integer inventory;
|
||||||
|
|
||||||
|
@Schema(title = "1-加库存,2-减库存")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前库存")
|
||||||
|
private Integer beforeInventory;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后库存")
|
||||||
|
private Integer afterInventory;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品价格变更记录表 -礼品价格变更记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_price_log")
|
||||||
|
@Schema(title = "礼品价格变更记录表", description = "礼品价格变更记录表")
|
||||||
|
public class GiftPriceLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long giftId;
|
||||||
|
|
||||||
|
@Schema(title = "本次设定的价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前价格")
|
||||||
|
private BigDecimal beforePrice;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后价格")
|
||||||
|
private BigDecimal afterPrice;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.github.yulichang.annotation.EntityMapping;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单表 -积分兑换记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_order_form")
|
||||||
|
@Schema(title = "订单表(积分兑换记录表)", description = "订单表(积分兑换记录表)")
|
||||||
|
public class OrderForm implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "订单总额")
|
||||||
|
private BigDecimal orderPrice;
|
||||||
|
|
||||||
|
@Schema(title = "订单商品集合")
|
||||||
|
@TableField(exist = false)
|
||||||
|
@EntityMapping(thisField = OrderForm.Fields.id, joinField = OrderFormItem.Fields.orderId)
|
||||||
|
private List<OrderFormItem> orderFormItems;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "下单时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单子表 -订单明细表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_order_form_item")
|
||||||
|
@Schema(title = "订单明细表", description = "订单明细表")
|
||||||
|
public class OrderFormItem implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "订单ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long orderId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 积分规则表
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2026-02-05
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_points_rule")
|
||||||
|
@Schema(title = "积分规则表", description = "积分规则表")
|
||||||
|
public class PointsRule implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Excel(name = "行为周期", width = 15, replace = {"次_1", "日_2", "周_3", "月_4", "季度_5", "年_6"}, orderNum = "3")
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Excel(name = "健康分类", width = 15, dicCode = "points_rule_category", orderNum = "1")
|
||||||
|
@Dict(dicCode = "points_rule_category")
|
||||||
|
@Schema(title = "规则类别")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Excel(name = "健康行为", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "规则描述")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Excel(name = "奖励积分", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "奖励积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "状态1-启用,2停用")
|
||||||
|
private Integer status = 1;
|
||||||
|
|
||||||
|
@Schema(title = "删除标识0-正常,1已删除")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@Schema(title = "创建人ID")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "最后修改时间")
|
||||||
|
private Date lastModifyDate;
|
||||||
|
|
||||||
|
@Schema(title = "周期内打卡次数上限")
|
||||||
|
private Integer checkInUpper;
|
||||||
|
|
||||||
|
@Schema(title = "年额外积分上限")
|
||||||
|
private BigDecimal yearExtraPointUpper;
|
||||||
|
|
||||||
|
@Schema(title = "是否支持打卡叠加得分,0不支持,1支持")
|
||||||
|
private Integer supportCum;
|
||||||
|
|
||||||
|
@Schema(title = "是否需要填写补充信息,0不需要,1需要")
|
||||||
|
private Integer needRemark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分汇总表 -产生过积分的用户每人一条数据
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_user_points")
|
||||||
|
@Schema(title = "用户积分汇总表", description = "用户积分汇总表")
|
||||||
|
public class UserPoints implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "用户部门")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Excel(name = "当前可用积分", width = 15, orderNum = "7")
|
||||||
|
@Schema(title = "当前可用积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "累计获得积分", width = 15, orderNum = "8")
|
||||||
|
@Schema(title = "历史获得的积分总和")
|
||||||
|
private BigDecimal addPointsSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录所有扣除积分的总和,包含兑换消耗、手动扣除的积分
|
||||||
|
*/
|
||||||
|
@Schema(title = "历史扣除积分总和")
|
||||||
|
private BigDecimal deductPointsSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录总和,只记录积分兑换
|
||||||
|
*/
|
||||||
|
@Excel(name = "累计兑换积分", width = 15, orderNum = "9")
|
||||||
|
@Schema(title = "历史兑换积分总和")
|
||||||
|
private BigDecimal exchangePointsSum;
|
||||||
|
|
||||||
|
@Schema(title = "状态(1-正常,2-冻结)")
|
||||||
|
private Integer status = 1;
|
||||||
|
/**
|
||||||
|
* 注意:该字段记录最后一次获得积分当天收获的积分总和,该归档字段的更新会减少后期对积分明细表的查询次数
|
||||||
|
*/
|
||||||
|
@Schema(title = "最新一天获取积分的总和")
|
||||||
|
private BigDecimal latestAddDaySum;
|
||||||
|
/**
|
||||||
|
* 注意:该字段记录最后一次消费积分当天收获的积分总和,该归档字段的更新会减少后期对积分明细表的查询次数
|
||||||
|
*/
|
||||||
|
@Schema(title = "最新一天消耗积分的总和")
|
||||||
|
private BigDecimal latestDeductDaySum;
|
||||||
|
|
||||||
|
@Excel(name = "最近一次打卡时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "10")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "最新获得积分的日期")
|
||||||
|
private Date lastAddDate;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Schema(title = "最新消费积分的日期")
|
||||||
|
private Date lastDeductDate;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "首次获得积分时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "积分最后变更时间")
|
||||||
|
private Date lastVaryDate;
|
||||||
|
}
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.renkang.bank.enums.PointsSourceEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情表 -记录每次的积分变更
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_user_points_details")
|
||||||
|
@Schema(title = "用户积分详情表", description = "用户积分详情表")
|
||||||
|
public class UserPointsDetails implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前积分")
|
||||||
|
private BigDecimal beforePoints;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后积分")
|
||||||
|
private BigDecimal afterPoints;
|
||||||
|
|
||||||
|
@Schema(title = "1-获得积分,2-扣减积分")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see PointsSourceEnum 来源详见枚举类
|
||||||
|
*/
|
||||||
|
@Schema(title = "来源(survey-积分打卡,use-礼品兑换,violation-违规扣除,expired-过期清除)")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务详情(可选择性的冗余业务详情:待定)")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分榜单VO
|
||||||
|
* @date 2026/2/6 10:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointRankingVO {
|
||||||
|
|
||||||
|
@Excel(name = "排名", width = 15, orderNum = "8")
|
||||||
|
@Schema(title = "排名")
|
||||||
|
private Integer ranking;
|
||||||
|
|
||||||
|
@Schema(title = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "姓名", width = 15, orderNum = "3")
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Excel(name = "员工编号", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Excel(name = "年龄", width = 15, orderNum = "6")
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(title = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Excel(name = "所属单位", width = 15, orderNum = "1")
|
||||||
|
@Schema(title = "单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Excel(name = "所属部门", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Excel(name = "性别", width = 15, orderNum = "5")
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Excel(name = "日累计积分", width = 15, orderNum = "7")
|
||||||
|
@Schema(title = "积分")
|
||||||
|
private BigDecimal pointSum;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分明细VO
|
||||||
|
* @date 2026/2/6 10:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointRecordVO {
|
||||||
|
|
||||||
|
@Schema(title = "记录id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "得分说明")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public String getCreateMonthStr() {
|
||||||
|
if (createTime != null) {
|
||||||
|
return DateUtil.format(createTime, "yyyy年-MM月");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情VO
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(title = "用户积分详情VO", description = "用户积分详情VO")
|
||||||
|
public class UserPointsDeductDetailsVO {
|
||||||
|
|
||||||
|
@Schema(title = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "积分变化", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "支出信息", width = 25, orderNum = "1")
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Excel(name = "支出时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "3")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情VO
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(title = "用户积分详情VO", description = "用户积分详情VO")
|
||||||
|
public class UserPointsDetailsVO {
|
||||||
|
|
||||||
|
@Schema(title = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "积分变化", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "补充信息", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Excel(name = "健康行为", width = 25, orderNum = "1")
|
||||||
|
@Schema(title = "关联业务详情(可选择性的冗余业务详情:待定)")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Excel(name = "打卡时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "5")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Excel(name = "行为周期", width = 15, replace = {"次_1", "日_2", "周_3", "月_4", "季度_5", "年_6"}, orderNum = "3")
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
import com.fasterxml.jackson.annotation.Nulls;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分信息vo
|
||||||
|
* @date 2026/2/6 9:31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsInfoVO {
|
||||||
|
|
||||||
|
@Schema(title = "可用积分")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal points = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Schema(title = "累计积分")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal addPointsSum = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Schema(title = "累计兑换")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal exchangePointsSum = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
public BigDecimal getPoints() {
|
||||||
|
return points == null ? BigDecimal.ZERO : points;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAddPointsSum() {
|
||||||
|
return addPointsSum == null ? BigDecimal.ZERO : addPointsSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getExchangePointsSum() {
|
||||||
|
return exchangePointsSum == null ? BigDecimal.ZERO : exchangePointsSum;
|
||||||
|
}
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分信息列表VO
|
||||||
|
* @date 2026/2/5 18:51
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UserPointsListVO extends UserPoints {
|
||||||
|
|
||||||
|
@Excel(name = "姓名", width = 15, orderNum = "3")
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Excel(name = "员工编号", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Excel(name = "所属单位", width = 15, orderNum = "1")
|
||||||
|
@Schema(title = "所属单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Excel(name = "所属部门", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "所属部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Excel(name = "性别", width = 15, orderNum = "5")
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Excel(name = "年龄", width = 15, orderNum = "6")
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
}
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 员工打卡监测VO
|
||||||
|
* @date 2026/2/5 18:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsMonitorVO {
|
||||||
|
|
||||||
|
@Schema(title = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "周期")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Schema(title = "获取积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "打卡时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分任务VO
|
||||||
|
* @date 2026/2/6 9:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsTaskVO {
|
||||||
|
|
||||||
|
@Schema(title = "规则id")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Dict(dicCode = "points_rule_category")
|
||||||
|
@Schema(title = "规则类别")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Schema(title = "规则描述")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Schema(title = "奖励积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "打卡状态,0未打卡,1已打卡")
|
||||||
|
private Integer clockInStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>health-bank</artifactId>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>health-bank-biz</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>health-bank-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 引入分布式锁依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-lock</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 中文拼音转换依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-job</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>renkang-starter-aspose-word</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>font-resources</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>${maven-source-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
+97
@@ -0,0 +1,97 @@
|
|||||||
|
package com.renkang.bank.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.bank.model.dto.PointsRulePageDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.service.IPointsRuleService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则
|
||||||
|
* @date 2026/2/5 17:53
|
||||||
|
*/
|
||||||
|
@Tag(name = "积分规则")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bank/pointsRule")
|
||||||
|
public class PointsRuleController extends JeecgController<PointsRule, IPointsRuleService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPointsRuleService iPointsRuleService;
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-分页列表", description = "积分规则-分页列表")
|
||||||
|
// @RequiresPermissions("bank:points_rule:add")
|
||||||
|
@PostMapping(value = "/pageList")
|
||||||
|
public Result<IPage<PointsRule>> pageList(@RequestBody PointsRulePageDTO dto) {
|
||||||
|
return Result.OK(iPointsRuleService.pageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-添加", description = "积分规则-添加")
|
||||||
|
// @RequiresPermissions("bank:points_rule:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<Integer> add(@RequestBody PointsRule pointsRule) {
|
||||||
|
return Result.OK("添加成功", iPointsRuleService.add(pointsRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-修改", description = "积分规则-修改")
|
||||||
|
// @RequiresPermissions("bank:points_rule:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<Integer> edit(@RequestBody PointsRule pointsRule) {
|
||||||
|
return Result.OK("修改成功", iPointsRuleService.edit(pointsRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-修改状态", description = "积分规则-修改状态")
|
||||||
|
// @RequiresPermissions("bank:points_rule:edit")
|
||||||
|
@GetMapping(value = "/editStatus")
|
||||||
|
public Result<Integer> editStatus(@RequestParam(name = "id") Long id, @RequestParam(name = "status") Integer status) {
|
||||||
|
return Result.OK("修改成功", iPointsRuleService.editStatus(id, status));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-详情", description = "积分规则-详情")
|
||||||
|
// @RequiresPermissions("bank:points_rule:byId")
|
||||||
|
@GetMapping(value = "/byId")
|
||||||
|
public Result<PointsRule> byId(@RequestParam(name = "id") String id) {
|
||||||
|
return Result.OK(iPointsRuleService.byId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-删除", description = "积分规则-删除")
|
||||||
|
// @RequiresPermissions("bank:points_rule:del")
|
||||||
|
@GetMapping(value = "/delete")
|
||||||
|
public Result<Integer> delete(@RequestParam(name = "id") String id) {
|
||||||
|
return Result.OK("删除成功", iPointsRuleService.delete(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-批量删除", description = "积分规则-批量删除")
|
||||||
|
// @RequiresPermissions("bank:points_rule:del")
|
||||||
|
@GetMapping(value = "/deleteBatch")
|
||||||
|
public Result<Integer> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||||
|
if (StringUtils.isBlank(ids)) {
|
||||||
|
return Result.error("请选择需要删除的积分规则");
|
||||||
|
}
|
||||||
|
return Result.OK("删除成功", iPointsRuleService.deleteBatch(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param conHealthInfo
|
||||||
|
*/
|
||||||
|
@Operation(summary = "积分规则-导出", description = "积分规则-导出")
|
||||||
|
// @RequiresPermissions("bank:points_rule:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, PointsRule conHealthInfo) {
|
||||||
|
return super.exportXls(request, conHealthInfo, PointsRule.class, "积分规则");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
package com.renkang.bank.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.bank.model.dto.UpdUserPointsDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsPageDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.vo.*;
|
||||||
|
import com.renkang.bank.service.IUserPointsService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分汇总表
|
||||||
|
* @date 2026/2/5 16:42
|
||||||
|
*/
|
||||||
|
@Tag(name = "用户积分信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bank/userPoints")
|
||||||
|
public class UserPointsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUserPointsService iUserPointsService;
|
||||||
|
|
||||||
|
@Operation(summary = "测试积分变更", description = "测试积分变更")
|
||||||
|
@PostMapping(value = "/testUpdateUserPoints")
|
||||||
|
public Result<Boolean> testUpdateUserPoints(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.testUpdateUserPoints(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-分页列表", description = "用户积分信息-分页列表")
|
||||||
|
@PostMapping(value = "/pageList")
|
||||||
|
public Result<IPage<UserPointsListVO>> pageList(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-分页列表(导出)", description = "用户积分信息-分页列表(导出)")
|
||||||
|
@PostMapping(value = "/exportUserPoints")
|
||||||
|
public Result<String> exportUserPoints(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportUserPoints(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-积分明细", description = "用户积分信息-积分明细")
|
||||||
|
@PostMapping(value = "/detailPageList")
|
||||||
|
public Result<IPage<UserPointsDetailsVO>> detailPageList(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.detailPageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-积分明细(导出)", description = "用户积分信息-积分明细(导出)")
|
||||||
|
@PostMapping(value = "/exportPointsDetail")
|
||||||
|
public Result<String> exportPointsDetail(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportPointsDetail(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-扣除积分", description = "用户积分信息-扣除积分")
|
||||||
|
@PostMapping(value = "/deductPoint")
|
||||||
|
public Result<Boolean> deductPoint(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.deductPoint(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工打卡监测", description = "用户积分信息-员工打卡监测")
|
||||||
|
@PostMapping(value = "/clockInMonitor")
|
||||||
|
public Result<IPage<UserPointsMonitorVO>> clockInMonitor(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.clockInMonitor(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工打卡监测(导出)", description = "用户积分信息-员工打卡监测(导出)")
|
||||||
|
@PostMapping(value = "/exportClockInMonitor")
|
||||||
|
public Result<String> exportClockInMonitor(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportClockInMonitor(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工积分排名", description = "用户积分信息-员工积分排名")
|
||||||
|
@PostMapping(value = "/userRanking")
|
||||||
|
public Result<IPage<UserPointRankingVO>> userRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.userRanking(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工积分排名(导出)", description = "用户积分信息-员工积分排名(导出)")
|
||||||
|
@PostMapping(value = "/exportUserRanking")
|
||||||
|
public Result<String> exportUserRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
iUserPointsService.exportUserRanking(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app我的积分", description = "用户积分信息-app我的积分")
|
||||||
|
@GetMapping(value = "/app/myPoints")
|
||||||
|
public Result<UserPointsInfoVO> myPoints() {
|
||||||
|
return Result.OK(iUserPointsService.myPoints());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分任务", description = "用户积分信息-app积分任务")
|
||||||
|
@GetMapping(value = "/app/pointsTaskList")
|
||||||
|
public Result<List<UserPointsTaskVO>> pointsTaskList() {
|
||||||
|
return Result.OK(iUserPointsService.pointsTaskList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分打卡", description = "用户积分信息-app积分打卡")
|
||||||
|
@PostMapping(value = "/app/pointCheckIn")
|
||||||
|
public Result<Boolean> pointCheckIn(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointCheckIn(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分明细", description = "用户积分信息-app积分明细")
|
||||||
|
@PostMapping(value = "/app/pointRecord")
|
||||||
|
public Result<IPage<UserPointRecordVO>> pointRecord(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointRecord(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分榜单", description = "用户积分信息-app积分榜单")
|
||||||
|
@PostMapping(value = "/app/pointRanking")
|
||||||
|
public Result<IPage<UserPointRankingVO>> pointRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointRanking(dto));
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.model.vo.UserPointsTaskVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PointsRuleMapper extends MPJBaseMapper<PointsRule> {
|
||||||
|
|
||||||
|
List<UserPointsTaskVO> pointsTaskList(@Param("userId") String userId);
|
||||||
|
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.po.UserPointsDetails;
|
||||||
|
import com.renkang.bank.model.vo.UserPointRankingVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface UserPointsDetailsMapper extends MPJBaseMapper<UserPointsDetails> {
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> userRanking(IPage<UserPointRankingVO> page, Date startTime, Date endTime, UserPointsRankingDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> pointRanking(IPage<UserPointRankingVO> page, Date startTime, Date endTime, String secondOrgCode);
|
||||||
|
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: pj
|
||||||
|
* @description: 用户积分
|
||||||
|
* @date 2026/2/5 16:47
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserPointsMapper extends MPJBaseMapper<UserPoints> {
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
<?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.renkang.bank.mapper.PointsRuleMapper">
|
||||||
|
|
||||||
|
<select id="pointsTaskList" resultType="com.renkang.bank.model.vo.UserPointsTaskVO">
|
||||||
|
SELECT
|
||||||
|
a.id as ruleId,
|
||||||
|
a.frequency,
|
||||||
|
a.rule_category,
|
||||||
|
a.rule_desc,
|
||||||
|
a.icon,
|
||||||
|
a.points,
|
||||||
|
CASE
|
||||||
|
WHEN a.frequency = 1 THEN
|
||||||
|
CASE WHEN COUNT(b.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
WHEN a.frequency = 2 THEN
|
||||||
|
CASE WHEN COUNT(CASE WHEN TRUNC(b.create_time) = TRUNC(SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||||
|
WHEN a.frequency = 3 THEN
|
||||||
|
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'IYYY-IW') = TO_CHAR(SYSDATE, 'IYYY-IW') THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||||
|
WHEN a.frequency = 4 THEN
|
||||||
|
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM') THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||||
|
WHEN a.frequency = 5 THEN
|
||||||
|
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'Q') = TO_CHAR(SYSDATE, 'Q') AND EXTRACT(YEAR FROM b.create_time) = EXTRACT(YEAR FROM SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||||
|
WHEN a.frequency = 6 THEN
|
||||||
|
CASE WHEN COUNT(CASE WHEN EXTRACT(YEAR FROM b.create_time) = EXTRACT(YEAR FROM SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||||
|
ELSE 0
|
||||||
|
END AS clockInStatus
|
||||||
|
FROM
|
||||||
|
bank_points_rule a
|
||||||
|
LEFT JOIN bank_user_points_details b ON b.user_id = #{userId}
|
||||||
|
AND b.change_type = 1
|
||||||
|
AND b.business_id = a.id
|
||||||
|
GROUP BY
|
||||||
|
a.id,a.frequency
|
||||||
|
order by a.frequency
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+82
@@ -0,0 +1,82 @@
|
|||||||
|
<?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.renkang.bank.mapper.UserPointsDetailsMapper">
|
||||||
|
|
||||||
|
<select id="userRanking" resultType="com.renkang.bank.model.vo.UserPointRankingVO">
|
||||||
|
<!--定义公共表表达式用于计算每个用户的总积分-->
|
||||||
|
WITH UserPointsSummary AS (
|
||||||
|
SELECT
|
||||||
|
a.user_id,
|
||||||
|
SUM(CASE WHEN a.change_type = 1 THEN a.points ELSE 0 END) -
|
||||||
|
SUM(CASE WHEN a.change_type = 2 THEN a.points ELSE 0 END) AS pointSum
|
||||||
|
FROM
|
||||||
|
bank_user_points_details a
|
||||||
|
INNER JOIN bank_user_points b ON a.user_id = b.user_id
|
||||||
|
<if test="null != dto.orgCode and '' != dto.orgCode">
|
||||||
|
AND b.org_code like concat(#{dto.orgCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="null != dto.deptCode and '' != dto.deptCode">
|
||||||
|
AND b.org_code like concat(#{dto.deptCode},'%')
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
a.user_id
|
||||||
|
),
|
||||||
|
<!--计算所有用户的排名-->
|
||||||
|
RankedUsers AS (
|
||||||
|
SELECT
|
||||||
|
user_id,
|
||||||
|
pointSum,
|
||||||
|
ROW_NUMBER() OVER (ORDER BY pointSum DESC, user_id ASC) AS ranking
|
||||||
|
FROM
|
||||||
|
UserPointsSummary
|
||||||
|
)
|
||||||
|
<!--主查询:根据是否传入用户 ID 返回结果-->
|
||||||
|
SELECT
|
||||||
|
ranking,
|
||||||
|
user_id,
|
||||||
|
pointSum
|
||||||
|
FROM
|
||||||
|
RankedUsers
|
||||||
|
<where>
|
||||||
|
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
||||||
|
AND user_id in
|
||||||
|
<foreach collection="dto.userIds" item="userId" open="(" separator="," close=")">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY
|
||||||
|
pointSum DESC, user_id ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="pointRanking" resultType="com.renkang.bank.model.vo.UserPointRankingVO">
|
||||||
|
WITH UserPointsSummary AS (
|
||||||
|
SELECT
|
||||||
|
a.user_id,
|
||||||
|
SUM( CASE WHEN a.change_type = 1 THEN a.points ELSE 0 END ) - SUM( CASE WHEN a.change_type = 2 THEN a.points
|
||||||
|
ELSE 0 END ) AS pointSum
|
||||||
|
FROM
|
||||||
|
bank_user_points_details a
|
||||||
|
INNER JOIN bank_user_points b ON a.user_id = b.user_id
|
||||||
|
<if test="null != secondOrgCode and '' != secondOrgCode">
|
||||||
|
AND b.org_code like concat(#{secondOrgCode},'%')
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
<if test="startTime != null and endTime != null">
|
||||||
|
AND a.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
a.user_id
|
||||||
|
) SELECT
|
||||||
|
ROW_NUMBER() OVER ( ORDER BY pointSum DESC ) AS ranking,
|
||||||
|
user_id,
|
||||||
|
pointSum
|
||||||
|
FROM
|
||||||
|
UserPointsSummary
|
||||||
|
ORDER BY
|
||||||
|
pointSum DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.renkang.bank.redis.config;
|
||||||
|
|
||||||
|
import com.renkang.bank.redis.listener.BankAsyncListener;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.system.vo.SysUserModel;
|
||||||
|
import org.jeecg.enums.ServerEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamKeyEnum;
|
||||||
|
import org.jeecg.util.IPUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.task.TaskExecutor;
|
||||||
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
|
import org.springframework.data.redis.connection.stream.Consumer;
|
||||||
|
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
||||||
|
import org.springframework.data.redis.connection.stream.ReadOffset;
|
||||||
|
import org.springframework.data.redis.connection.stream.StreamOffset;
|
||||||
|
import org.springframework.data.redis.hash.Jackson2HashMapper;
|
||||||
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||||
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shunzhi Jiang
|
||||||
|
* @since 2023/6/13
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class BankRedisStreamConfig {
|
||||||
|
|
||||||
|
private final Consumer consumer = Consumer.from(ServerEnum.BANK.getCustomGroup(), IPUtil.getCurrentServiceIp());
|
||||||
|
|
||||||
|
private final ReadOffset readOffset = ReadOffset.lastConsumed();
|
||||||
|
|
||||||
|
private BankAsyncListener bankAsyncListener;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setDepartAsyncListener(BankAsyncListener bankAsyncListener) {
|
||||||
|
this.bankAsyncListener = bankAsyncListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public StreamMessageListenerContainer.StreamMessageListenerContainerOptions<String, ObjectRecord<String, SysUserModel>> sysUserModelInterveneStreamOptions(
|
||||||
|
@Qualifier("asyncTaskExecutor") TaskExecutor taskExecutor,
|
||||||
|
StringRedisSerializer stringSerializer,
|
||||||
|
GenericJackson2JsonRedisSerializer jsonSerializer
|
||||||
|
) {
|
||||||
|
return StreamMessageListenerContainer.StreamMessageListenerContainerOptions
|
||||||
|
.builder()
|
||||||
|
// 一次最多获取多少条消息
|
||||||
|
.batchSize(10)
|
||||||
|
// 运行 Stream 的 poll task
|
||||||
|
.executor(taskExecutor)
|
||||||
|
// 可以理解为 Stream Key 的序列化方式
|
||||||
|
.keySerializer(stringSerializer)
|
||||||
|
// 可以理解为 Stream 后方的字段的 key 的序列化方式
|
||||||
|
.hashKeySerializer(stringSerializer)
|
||||||
|
// 可以理解为 Stream 后方的字段的 value 的序列化方式
|
||||||
|
.hashValueSerializer(jsonSerializer)
|
||||||
|
// ObjectRecord 时,将 对象的 filed 和 value 转换成一个 Map 比如:将Book对象转换成map
|
||||||
|
.objectMapper(new Jackson2HashMapper(true))
|
||||||
|
// 将发送到Stream中的Record转换成ObjectRecord,转换成具体的类型是这个地方指定的类型
|
||||||
|
.targetType(SysUserModel.class)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||||
|
public StreamMessageListenerContainer<String, ObjectRecord<String, SysUserModel>> sysUserModelInterveneStreamMessageListenerContainer(
|
||||||
|
RedisConnectionFactory redisConnectionFactory,
|
||||||
|
StreamMessageListenerContainer.StreamMessageListenerContainerOptions<String, ObjectRecord<String, SysUserModel>> options
|
||||||
|
) {
|
||||||
|
StreamMessageListenerContainer<String, ObjectRecord<String, SysUserModel>> container =
|
||||||
|
StreamMessageListenerContainer.create(redisConnectionFactory, options);
|
||||||
|
// 修改用户
|
||||||
|
container.receive(
|
||||||
|
consumer,
|
||||||
|
createStreamOffset(RedisStreamKeyEnum.CHANGE_USER_DEPART),
|
||||||
|
bankAsyncListener
|
||||||
|
);
|
||||||
|
log.info("redisStream配置完成");
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StreamOffset<String> createStreamOffset(RedisStreamKeyEnum streamKeyEnum) {
|
||||||
|
return StreamOffset.create(streamKeyEnum.getKey(), readOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.renkang.bank.redis.listener;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.renkang.bank.mapper.UserPointsMapper;
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.system.vo.SysUserModel;
|
||||||
|
import org.jeecg.enums.ServerEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamKeyEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
||||||
|
import org.springframework.data.redis.connection.stream.RecordId;
|
||||||
|
import org.springframework.data.redis.stream.StreamListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shunzhi Jiang
|
||||||
|
* @since 2023/6/13
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class BankAsyncListener implements StreamListener<String, ObjectRecord<String, SysUserModel>> {
|
||||||
|
@Autowired
|
||||||
|
private RedisStreamUtil redisStreamUtil;
|
||||||
|
@Autowired
|
||||||
|
private UserPointsMapper userPointsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(ObjectRecord<String, SysUserModel> message) {
|
||||||
|
String streamKey = message.getStream();
|
||||||
|
SysUserModel model = message.getValue();
|
||||||
|
log.info("收到Redis Stream Key:{}", streamKey);
|
||||||
|
RecordId recordId = message.getId();
|
||||||
|
log.info("ID:{}, DATA: {}", recordId, JSON.toJSONString(model));
|
||||||
|
try {
|
||||||
|
if (RedisStreamKeyEnum.CHANGE_USER_DEPART.getKey().equals(streamKey)) {
|
||||||
|
if (StrUtil.isBlank(model.getId()) || StrUtil.isBlank(model.getOrgCode())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 修改用户积分主表单位信息
|
||||||
|
updateUserPointsInfo(model);
|
||||||
|
}
|
||||||
|
ack(message);
|
||||||
|
log.info("Redis Stream消费成功:Key: {}, ID: {}", streamKey, recordId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Redis Stream消费异常:Key: {}, ID: {}", streamKey, recordId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateUserPointsInfo(SysUserModel model) {
|
||||||
|
userPointsMapper.update(new LambdaUpdateWrapper<UserPoints>()
|
||||||
|
.eq(UserPoints::getUserId, model.getId())
|
||||||
|
.set(UserPoints::getOrgCode, model.getOrgCode())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ack(ObjectRecord<String, SysUserModel> message) {
|
||||||
|
redisStreamUtil.ack(ServerEnum.BANK.getCustomGroup(), message);
|
||||||
|
}
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.renkang.bank.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.renkang.bank.model.dto.PointsRulePageDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
|
||||||
|
public interface IPointsRuleService extends IService<PointsRule> {
|
||||||
|
|
||||||
|
IPage<PointsRule> pageList(PointsRulePageDTO dto);
|
||||||
|
|
||||||
|
int add(PointsRule pointsRule);
|
||||||
|
|
||||||
|
int edit(PointsRule pointsRule);
|
||||||
|
|
||||||
|
PointsRule byId(String id);
|
||||||
|
|
||||||
|
int delete(String id);
|
||||||
|
|
||||||
|
int editStatus(Long id, Integer status);
|
||||||
|
|
||||||
|
int deleteBatch(String ids);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user