Compare commits
181 Commits
prod
...
7ccf5e4469
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ccf5e4469 | |||
| 137ab4e802 | |||
| a941db7870 | |||
| 35c32d68c3 | |||
| 359600004d | |||
| 910801b057 | |||
| 7aa9d519a0 | |||
| 5d7b438745 | |||
| 204177afa0 | |||
| 1d8d9c0236 | |||
| 8ceade6227 | |||
| 5714079de3 | |||
| f21a298b8f | |||
| 09fbf237f0 | |||
| a6fd3e0cef | |||
| e47cd3eba7 | |||
| a6976aaac4 | |||
| dd970d200c | |||
| d1d6c443de | |||
| d26a99cdbb | |||
| 90dbc34a93 | |||
| 0408afb67e | |||
| 587cabc166 | |||
| 30f916f8eb | |||
| fae046885e | |||
| 05569d0471 | |||
| 8efeff20d4 | |||
| bc21aa3f41 | |||
| fedbb99b18 | |||
| 4b2b68d9ef | |||
| a663e30759 | |||
| b6a2d41f57 | |||
| cd87783ad0 | |||
| 7876a82ca4 | |||
| 0a18a0892a | |||
| b2e1cce667 | |||
| 64c1c84ed3 | |||
| f2301264ea | |||
| c83af6df6d | |||
| 22d9dfe138 | |||
| bcee164f48 | |||
| f6d8cb3ba7 | |||
| 659146a2cf | |||
| c17c084095 | |||
| 5962f694e2 | |||
| 373528b432 | |||
| e9f5e0fa03 | |||
| b88a92b7e1 | |||
| fb72063369 | |||
| 9809213a12 | |||
| 87e1cb7473 | |||
| c456ae215f | |||
| 091d7bfc0e | |||
| c9f80fe498 | |||
| 7a3deba52a | |||
| eb015fcecc | |||
| d9fab2a4a2 | |||
| 7f125b4548 | |||
| 88dcecc88c | |||
| 5458329252 | |||
| c4e275f5a8 | |||
| f8f89fd96e | |||
| b8ffa41a30 | |||
| f99cd08d57 | |||
| 45cae080a0 | |||
| 84a8f49e95 | |||
| e725991ece | |||
| c2a06a729c | |||
| 4a5e50a7a2 | |||
| 9b30a7bcec | |||
| ec383e44db | |||
| d3909f131f | |||
| a444d4c953 | |||
| 3c01ec861b | |||
| 365cf00644 | |||
| 4faff3b0bc | |||
| 866f2336c3 | |||
| e4132ea540 | |||
| 53208c36cf | |||
| 8f2a3e6e50 | |||
| b67a7d5370 | |||
| 07509c8e15 | |||
| e6c58a64ac | |||
| abb6b8c13a | |||
| de492728bc | |||
| 82fa732db6 | |||
| 275d640263 | |||
| 7e47b8a74f | |||
| d4301da0ec | |||
| fe5b5473dd | |||
| 0126d44761 | |||
| dbefd88e41 | |||
| 9a3b7ebe54 | |||
| 81be4a862c | |||
| 43f2db9f7e | |||
| abefa90408 | |||
| 08f48b7817 | |||
| 6b8ace60d4 | |||
| b997dd5f00 | |||
| 6174743858 | |||
| 82d55d7188 | |||
| aec5eacd0b | |||
| a320b85965 | |||
| b61a7c153d | |||
| fb9b01cf34 | |||
| 32f134873a | |||
| f4220be9d6 | |||
| 8252fd7216 | |||
| 57855f4307 | |||
| 6784eafe6e | |||
| 0b42c1d6a6 | |||
| 4b37a7327f | |||
| 0287f1e4ce | |||
| 5d8af1cab8 | |||
| 123896f08b | |||
| a8a198b51f | |||
| f00b98714a | |||
| 4ff87f3996 | |||
| 5f3ae0f9f1 | |||
| 786c864a27 | |||
| c61e802b85 | |||
| 9a568799f4 | |||
| 8aa38063bf | |||
| c4a11ec245 | |||
| 169b76589c | |||
| 199f51ea21 | |||
| 23572dfc07 | |||
| 570b0ce316 | |||
| f953a96c36 | |||
| 25c4eee464 | |||
| b209ef1fab | |||
| 77e9f4d9a2 | |||
| e73c808bc3 | |||
| edf0d1a5db | |||
| cc23a308c1 | |||
| bc891327c9 | |||
| 39bedfeb92 | |||
| 56fc4ff83e | |||
| 524ed30728 | |||
| 584304e744 | |||
| 56418600c5 | |||
| 40e57b18cb | |||
| ced6cb219c | |||
| 218ec5ea95 | |||
| 1c601bd68e | |||
| 7d6eba719b | |||
| 8cfc34dbcb | |||
| 23a749973d | |||
| 4b96702dc9 | |||
| a1af8711ef | |||
| 9e8cff931b | |||
| 5bccd71bdc | |||
| 544f35a601 | |||
| f920d4976e | |||
| cdcd665d43 | |||
| 08de61e455 | |||
| 025c3115b7 | |||
| 9e366554b7 | |||
| d934abf0fe | |||
| e16e9133e2 | |||
| d7854a35d7 | |||
| 97e0dd467f | |||
| e58a99e696 | |||
| 0d5a9eb505 | |||
| 45ac1817e1 | |||
| f2d4ff4237 | |||
| a4cc5c14f3 | |||
| 5be571cc30 | |||
| ff656dd046 | |||
| 20574d0037 | |||
| 42cf396e93 | |||
| 2a30b05dd7 | |||
| 4ecee185bf | |||
| 48ab59c67d | |||
| 806e8f3391 | |||
| 61244321a7 | |||
| ff1e613316 | |||
| 03161751fc | |||
| 9ebf4a3e5f | |||
| 3ba13e3ef8 | |||
| 8d3853fe6b |
1
xinnengyuan/.gitignore
vendored
1
xinnengyuan/.gitignore
vendored
@ -53,3 +53,4 @@ logs/
|
||||
docs
|
||||
/file
|
||||
.idea/
|
||||
chat-memory/
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8899
|
||||
--- # 监控中心配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
@ -32,6 +36,12 @@ snail-job:
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
ai:
|
||||
dashscope:
|
||||
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||
chat:
|
||||
options:
|
||||
model: qwen-plus
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
@ -56,27 +66,27 @@ spring:
|
||||
# username: xinnengyuan
|
||||
# password: mEZPC5Sdf3r2HENi
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: zmkgc
|
||||
password: nWKDKRNRT48tFBdh
|
||||
slave1:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: zmkgprod
|
||||
password: MaY8nehwWkJriWPm
|
||||
slave2:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: zmkgc
|
||||
password: nWKDKRNRT48tFBdh
|
||||
# slave:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: zmkgc
|
||||
# password: nWKDKRNRT48tFBdh
|
||||
# slave1:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: zmkgprod
|
||||
# password: MaY8nehwWkJriWPm
|
||||
# slave2:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: zmkgc
|
||||
# password: nWKDKRNRT48tFBdh
|
||||
# slave:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
@ -354,3 +364,7 @@ qrCode:
|
||||
# 无人机大图
|
||||
drone:
|
||||
url: http://192.168.110.2:9512
|
||||
# 聊天服务
|
||||
chat:
|
||||
server:
|
||||
port: 19099
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 9918
|
||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||
spring.servlet.multipart.location: /ruoyi/server/temp
|
||||
|
||||
@ -35,6 +39,12 @@ snail-job:
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
ai:
|
||||
dashscope:
|
||||
api-key: xxx
|
||||
chat:
|
||||
options:
|
||||
model: qwen-plus
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
@ -105,7 +115,7 @@ spring.data:
|
||||
# 端口,默认为6379
|
||||
port: 9287
|
||||
# 数据库索引
|
||||
database: 6
|
||||
database: 17
|
||||
# redis 密码必须配置
|
||||
password: syar23rdsaagdrsa
|
||||
# 连接超时时间
|
||||
@ -164,7 +174,7 @@ sms:
|
||||
# 配置源类型用于标定配置来源(interface,yaml)
|
||||
config-type: yaml
|
||||
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
|
||||
restricted: true
|
||||
restricted: false
|
||||
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
|
||||
minute-max: 1
|
||||
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
|
||||
@ -183,12 +193,45 @@ sms:
|
||||
signature: 您的短信签名
|
||||
sdk-app-id: 您的sdkAppId
|
||||
config2:
|
||||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
# 登录
|
||||
supplier: tencent
|
||||
access-key-id: 您的accessKey
|
||||
access-key-secret: 您的accessKeySecret
|
||||
signature: 您的短信签名
|
||||
sdk-app-id: 您的sdkAppId
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2491779
|
||||
config3:
|
||||
# 注册
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2491776
|
||||
config4:
|
||||
# 质量工单逾期
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534747
|
||||
config5:
|
||||
# 设计图纸
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534750
|
||||
config6:
|
||||
# 安全工单
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534848
|
||||
|
||||
--- # 三方授权
|
||||
justauth:
|
||||
@ -275,8 +318,11 @@ weather:
|
||||
dxf2GeoJson:
|
||||
file-name: main
|
||||
ys7:
|
||||
app-key: 3acf9f1a43dc4209841e0893003db0a2
|
||||
app-secret: 4bbf3e9394f55d3af6e3af27b2d3db36
|
||||
app-key: xxx
|
||||
app-secret: xxx
|
||||
job:
|
||||
capture-enabled: false # 控制是否启用萤石抓拍任务
|
||||
device-sync-enabled: false # 控制是否同步萤石设备
|
||||
# 斯巴达算法
|
||||
sparta:
|
||||
url: http://119.3.204.120:8040
|
||||
@ -286,10 +332,14 @@ sparta:
|
||||
id-card:
|
||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||
recognizer:
|
||||
url: http://192.168.110.5:50070
|
||||
url: http://192.168.110.5:50071
|
||||
|
||||
qrCode:
|
||||
url: http://xny.yj-3d.com:7171
|
||||
url: http://xny.yj-3d.com:7788
|
||||
# 无人机大图
|
||||
drone:
|
||||
url: http://192.168.110.2:9512
|
||||
# 聊天服务
|
||||
chat:
|
||||
server:
|
||||
port: 18088
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8899
|
||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||
spring.servlet.multipart.location: /ruoyi/server/temp
|
||||
|
||||
@ -35,6 +39,12 @@ snail-job:
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
ai:
|
||||
dashscope:
|
||||
api-key: xxx
|
||||
chat:
|
||||
options:
|
||||
model: qwen-plus
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
@ -326,7 +336,7 @@ ys7:
|
||||
app-key: 3acf9f1a43dc4209841e0893003db0a2
|
||||
app-secret: 09e29c70ae1161fbc3ce2030fc09ba2e
|
||||
job:
|
||||
capture-enabled: false # 控制是否启用萤石抓拍任务
|
||||
capture-enabled: true # 控制是否启用萤石抓拍任务
|
||||
device-sync-enabled: true # 控制是否同步萤石设备
|
||||
# 斯巴达算法
|
||||
sparta:
|
||||
@ -344,3 +354,7 @@ qrCode:
|
||||
# 无人机大图
|
||||
drone:
|
||||
url: http://192.168.110.2:9512
|
||||
# 聊天服务
|
||||
chat:
|
||||
server:
|
||||
port: 19099
|
||||
|
||||
@ -22,7 +22,7 @@ captcha:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8899
|
||||
# port: 8899
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -106,6 +106,10 @@ sa-token:
|
||||
is-share: false
|
||||
# jwt秘钥
|
||||
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
|
||||
# token有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
active-timeout: 86400
|
||||
|
||||
# security配置
|
||||
security:
|
||||
@ -130,6 +134,7 @@ security:
|
||||
# todo 仅测试
|
||||
- /facility/matrix/**
|
||||
- /hat/device/data
|
||||
- /websocket/ue
|
||||
|
||||
# 多租户配置
|
||||
tenant:
|
||||
@ -257,8 +262,6 @@ springdoc:
|
||||
packages-to-scan: org.dromara.ctr
|
||||
- group: 15.无人机模块
|
||||
packages-to-scan: org.dromara.drone
|
||||
- group: 20.代码生成模块
|
||||
packages-to-scan: org.dromara.generator
|
||||
- group: 16.app模块
|
||||
packages-to-scan: org.dromara.app
|
||||
- group: 17.材料设备模块
|
||||
@ -267,24 +270,30 @@ springdoc:
|
||||
packages-to-scan: org.dromara.out
|
||||
- group: 19.消息模块
|
||||
packages-to-scan: org.dromara.message
|
||||
- group: 20.代码生成模块
|
||||
packages-to-scan: org.dromara.generator
|
||||
- group: 21.分标策划模块
|
||||
packages-to-scan: org.dromara.tender
|
||||
- group: 22.大屏模块
|
||||
packages-to-scan: org.dromara.bigscreen
|
||||
- group: 22.投标管理模块
|
||||
packages-to-scan: org.dromara.bidding
|
||||
- group: 23.GPS定位模块
|
||||
packages-to-scan: org.dromara.gps
|
||||
- group: 24.招标模块
|
||||
packages-to-scan: org.dromara.tender
|
||||
# - group: 25.app版本模块
|
||||
# packages-to-scan: org.dromara.app
|
||||
- group: 25.数据迁移模块
|
||||
packages-to-scan: org.dromara.transferData
|
||||
- group: 26.netty消息模块
|
||||
packages-to-scan: org.dromara.websocket
|
||||
- group: 27.新中大模块
|
||||
packages-to-scan: org.dromara.xzd
|
||||
- group: 28.车辆模块
|
||||
packages-to-scan: org.dromara.vehicle
|
||||
- group: 29.app版本模块
|
||||
packages-to-scan: org.dromara.app
|
||||
- group: 30.AI 模块
|
||||
packages-to-scan: org.dromara.ai
|
||||
- group: 31.投标管理模块
|
||||
packages-to-scan: org.dromara.bidding
|
||||
# knife4j的增强配置,不需要增强可以不配
|
||||
knife4j:
|
||||
enable: true
|
||||
@ -300,6 +309,15 @@ xss:
|
||||
- /system/notice
|
||||
- /warm-flow/save-xml
|
||||
- /project/project
|
||||
- /xzd/contractDetails/**
|
||||
- /xzd/contractChange/**
|
||||
- /xzd/comprehensive/csContractChange/**
|
||||
- /xzd/comprehensive/csContractInformation/**
|
||||
- /xzd/hetongbiangeng/**
|
||||
- /xzd/fenbaohetongjungong/**
|
||||
- /xzd/fenbaohetongbiangg/**
|
||||
- /xzd/fenbaohetongxinxi/**
|
||||
- /xzd/contractManagement/**
|
||||
|
||||
# 全局线程池相关配置
|
||||
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
||||
|
||||
Binary file not shown.
BIN
xinnengyuan/ruoyi-admin/src/main/resources/template/设计更改通知单.docx
Normal file
BIN
xinnengyuan/ruoyi-admin/src/main/resources/template/设计更改通知单.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
xinnengyuan/ruoyi-admin/src/main/resources/template/设计验证表.docx
Normal file
BIN
xinnengyuan/ruoyi-admin/src/main/resources/template/设计验证表.docx
Normal file
Binary file not shown.
@ -29,6 +29,8 @@ import org.dromara.manager.ys7manager.Ys7Constant;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.manager.ys7manager.vo.Ys7ResponseVo;
|
||||
import org.dromara.other.domain.OthYs7Device;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgCreateByCapture;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.dromara.other.service.IOthYs7DeviceService;
|
||||
import org.dromara.out.domain.OutConstructionValue;
|
||||
import org.dromara.out.domain.OutConstructionValueRange;
|
||||
@ -55,6 +57,8 @@ import java.time.LocalDate;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -112,6 +116,9 @@ public class DemoTest {
|
||||
@Resource
|
||||
private IOthYs7DeviceService ys7DeviceService;
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceImgService ys7DeviceImgService;
|
||||
|
||||
@Resource
|
||||
private Ys7Manager ys7Manager;
|
||||
|
||||
@ -128,7 +135,7 @@ public class DemoTest {
|
||||
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", lastMonday, lastSunday);
|
||||
Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(lastMonday, lastSunday, null);*/
|
||||
LocalDate start = LocalDate.of(2024, 1, 1); // 起始时间(2024-01-01)
|
||||
LocalDate end = LocalDate.of(2025, 10, 20); // 截止时间(2025-09-15)
|
||||
LocalDate end = LocalDate.of(2025, 10, 27); // 截止时间(2025-09-15)
|
||||
|
||||
// 如果起始不是周一,调整到当周的周一
|
||||
if (start.getDayOfWeek() != DayOfWeek.MONDAY) {
|
||||
@ -143,12 +150,18 @@ public class DemoTest {
|
||||
System.out.println(monday + " ~ " + sunday);
|
||||
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", monday, sunday);
|
||||
// Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(start, now, null);
|
||||
List<BusProject> list = projectService.lambdaQuery()
|
||||
.eq(BusProject::getPId, 1968506669544656898L)
|
||||
.list();
|
||||
List<Long> list1 = new ArrayList<>(list.stream().map(BusProject::getId).toList());
|
||||
list1.add(1968506669544656898L);
|
||||
// 获取范围时间内的计划详情
|
||||
List<PgsProgressPlanDetail> planDetailList = progressPlanDetailService.lambdaQuery()
|
||||
.in(PgsProgressPlanDetail::getProjectId, list1)
|
||||
.ge(PgsProgressPlanDetail::getDate, monday)
|
||||
.le(PgsProgressPlanDetail::getDate, sunday)
|
||||
.ne(PgsProgressPlanDetail::getFinishedNumber, BigDecimal.ZERO)
|
||||
// .eq(PgsProgressPlanDetail::getStatus, "1")
|
||||
.eq(PgsProgressPlanDetail::getStatus, "1")
|
||||
.list();
|
||||
if (CollUtil.isEmpty(planDetailList)) {
|
||||
// 下一周
|
||||
@ -547,4 +560,38 @@ public class DemoTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void capturePic() {
|
||||
List<String> urlList = List.of(
|
||||
"http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/10/23/db8a379b456142459852b654f20d5f97.png",
|
||||
"http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/10/23/913dbcf0f7244c8b878e84b5525bec4b.png",
|
||||
"http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/10/23/2b904765f03f40b2ad0ddbf6ddeadb45.png"
|
||||
);
|
||||
for (String url : urlList) {
|
||||
Pattern pattern = Pattern.compile(".*/device/img/([^/]+)/.*");
|
||||
Matcher matcher = pattern.matcher(url);
|
||||
OthYs7Device ys7Device = ys7DeviceService.lambdaQuery()
|
||||
.eq(OthYs7Device::getDeviceSerial, "GA1730672")
|
||||
.last("limit 1")
|
||||
.one();
|
||||
if (ys7Device == null) {
|
||||
throw new ServiceException("设备不存在", HttpStatus.ERROR);
|
||||
}
|
||||
String deviceSerial = ys7Device.getDeviceSerial();
|
||||
// 如果没有预置位,则直接对默认通道抓图
|
||||
OthYs7DeviceImgCreateByCapture img = new OthYs7DeviceImgCreateByCapture();
|
||||
img.setProjectId(ys7Device.getProjectId());
|
||||
img.setDeviceSerial(deviceSerial);
|
||||
img.setDeviceName(ys7Device.getDeviceName());
|
||||
// String url = "http://xny.yj-3d.com:9000/xinnengyuan/ys7/device/img/GA1044315/2025-10-13_859fdfb7dde540608356f29cb9e3d63e.jpg";
|
||||
// String url = "http://xny.yj-3d.com:9000/xinnengyuan/ys7/device/img/GA1044315/2025-10-12_2801707255b84004acb5fee2a75299b2.jpg";
|
||||
img.setCreateTime(new Date());
|
||||
img.setUrl(url);
|
||||
log.info("图片:{},识别中", url);
|
||||
ys7DeviceImgService.saveCapturePic(List.of(img));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.materials.domain.MatMaterialIssue;
|
||||
import org.dromara.materials.domain.MatMaterialReceive;
|
||||
import org.dromara.materials.domain.MatMaterials;
|
||||
import org.dromara.materials.domain.MatMaterialsInventory;
|
||||
import org.dromara.materials.domain.enums.MatMaterialsInventoryOutPutEnum;
|
||||
import org.dromara.materials.service.IMatMaterialIssueService;
|
||||
import org.dromara.materials.service.IMatMaterialReceiveService;
|
||||
import org.dromara.materials.service.IMatMaterialsInventoryService;
|
||||
import org.dromara.materials.service.IMatMaterialsService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-10-30 15:58
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
public class MaterialsTest {
|
||||
|
||||
/**
|
||||
* 长顺项目id
|
||||
*/
|
||||
private static final Long PROJECT_ID = 1897161054676336641L;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialsService materialsService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialsInventoryService materialsInventoryService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialReceiveService materialReceiveService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialIssueService materialIssueService;
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
// 获取所有材料
|
||||
List<MatMaterials> materials = materialsService.lambdaQuery()
|
||||
.eq(MatMaterials::getProjectId, PROJECT_ID)
|
||||
.list();
|
||||
Set<Long> materialIds = materials.stream().map(MatMaterials::getId).collect(Collectors.toSet());
|
||||
// 获取所有材料的出库数据
|
||||
List<MatMaterialsInventory> inventoryList = materialsInventoryService.lambdaQuery()
|
||||
.in(MatMaterialsInventory::getMaterialsId, materialIds)
|
||||
.eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue())
|
||||
.list();
|
||||
// 按表单编号分组
|
||||
Map<String, List<MatMaterials>> map = materials.stream()
|
||||
.collect(Collectors.groupingBy(MatMaterials::getFormCode));
|
||||
for (Map.Entry<String, List<MatMaterials>> entry : map.entrySet()) {
|
||||
String formCode = entry.getKey();
|
||||
List<MatMaterials> materialsList = entry.getValue();
|
||||
// 获取入库数据
|
||||
MatMaterialReceive receive = materialReceiveService.lambdaQuery()
|
||||
.eq(MatMaterialReceive::getFormCode, formCode)
|
||||
.one();
|
||||
// 创建领料出库数据
|
||||
MatMaterialIssue issue = new MatMaterialIssue();
|
||||
issue.setProjectId(PROJECT_ID);
|
||||
issue.setMaterialSource("2");
|
||||
issue.setFormCode(formCode);
|
||||
issue.setProjectName(receive.getProjectName());
|
||||
issue.setMaterialName(receive.getMaterialName());
|
||||
issue.setOrderingUnit(receive.getOrderingUnit());
|
||||
issue.setSupplierUnit(receive.getSupplierUnit());
|
||||
// issue.setIssueUnit(inventory.getRecipient());
|
||||
// issue.setIssueUnitId(inventory.getRecipientId());
|
||||
// issue.setShipper(inventory.getShipper());
|
||||
|
||||
|
||||
|
||||
|
||||
// issue.setStorageUnit();
|
||||
issue.setCertCount(0);
|
||||
issue.setReportCount(0);
|
||||
issue.setTechDocCount(0);
|
||||
issue.setLicenseCount(0);
|
||||
log.info("领料出库数据:{}", issue);
|
||||
log.info("=============================");
|
||||
}
|
||||
|
||||
for (MatMaterials material : materials) {
|
||||
String formCode = material.getFormCode();
|
||||
// 查看入库数据
|
||||
MatMaterialReceive receive = materialReceiveService.lambdaQuery()
|
||||
.eq(MatMaterialReceive::getFormCode, formCode)
|
||||
.one();
|
||||
// 查看出库数据
|
||||
/* List<MatMaterialsInventory> inventoryList = materialsInventoryService.lambdaQuery()
|
||||
.eq(MatMaterialsInventory::getMaterialsId, material.getId())
|
||||
.eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue())
|
||||
.list();
|
||||
if (CollUtil.isEmpty(inventoryList)) {
|
||||
continue;
|
||||
}*/
|
||||
// 创建领料出库数据
|
||||
List<MatMaterialIssue> issueList = inventoryList.stream().map(inventory -> {
|
||||
MatMaterialIssue issue = new MatMaterialIssue();
|
||||
issue.setProjectId(PROJECT_ID);
|
||||
issue.setMaterialSource("2");
|
||||
issue.setFormCode(receive.getFormCode());
|
||||
issue.setProjectName(receive.getProjectName());
|
||||
issue.setMaterialName(receive.getMaterialName());
|
||||
issue.setOrderingUnit(receive.getOrderingUnit());
|
||||
issue.setSupplierUnit(receive.getSupplierUnit());
|
||||
issue.setIssueUnit(inventory.getRecipient());
|
||||
issue.setIssueUnitId(inventory.getRecipientId());
|
||||
issue.setShipper(inventory.getShipper());
|
||||
// issue.setStorageUnit();
|
||||
issue.setCertCount(0);
|
||||
issue.setReportCount(0);
|
||||
issue.setTechDocCount(0);
|
||||
issue.setLicenseCount(0);
|
||||
log.info("领料出库数据:{}", issue);
|
||||
log.info("=============================");
|
||||
return issue;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,7 @@ public class RecognizerTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.SOLAR));
|
||||
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
||||
log.info("recognize: {}", recognize);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,17 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordCreateDto;
|
||||
import org.dromara.safety.service.IHseViolationRecordService;
|
||||
import org.dromara.system.domain.SysMenu;
|
||||
import org.dromara.system.domain.vo.SysMenuVo;
|
||||
import org.dromara.system.mapper.SysMenuMapper;
|
||||
import org.dromara.system.service.ISysMenuService;
|
||||
import org.hamcrest.core.Is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -20,6 +28,9 @@ public class ViolationRecordTest {
|
||||
@Resource
|
||||
private IHseViolationRecordService violationRecordService;
|
||||
|
||||
@Autowired
|
||||
private SysMenuMapper sysMenuMapper;
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
List<HseViolationRecordCreateDto> list = new ArrayList<>();
|
||||
@ -55,4 +66,26 @@ public class ViolationRecordTest {
|
||||
list.add(dto5);
|
||||
violationRecordService.insertByMonitor(list);
|
||||
}
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
SysMenuVo sysMenuVo = sysMenusByList(1972500768346673154L);
|
||||
System.out.println(sysMenuVo.toString());
|
||||
|
||||
}
|
||||
|
||||
SysMenuVo sysMenusByList(Long id) {
|
||||
SysMenuVo sysMenus = new SysMenuVo();
|
||||
List<SysMenu> res = sysMenuMapper.selectList(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId, id));
|
||||
if (res != null && res.size() > 0 ) {
|
||||
sysMenus.setChildren(MapstructUtils.convert(res, SysMenuVo.class));
|
||||
res.forEach(sysMenu -> {
|
||||
sysMenusByList(sysMenu.getMenuId());
|
||||
});
|
||||
}
|
||||
return sysMenus;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,11 +5,14 @@ import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.task.VirtualThreadTaskExecutor;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 异步配置
|
||||
@ -32,6 +35,30 @@ public class AsyncConfig implements AsyncConfigurer {
|
||||
return SpringUtils.getBean("scheduledExecutorService");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增:自定义线程池(可以在 @Async("capturePicExecutor") 使用)
|
||||
*/
|
||||
@Bean("capturePicExecutor")
|
||||
public Executor customExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程数
|
||||
executor.setCorePoolSize(5);
|
||||
// 最大线程数
|
||||
executor.setMaxPoolSize(10);
|
||||
// 队列容量(超过核心线程数时,任务进入队列)
|
||||
executor.setQueueCapacity(50);
|
||||
// 空闲线程最大存活时间(秒)
|
||||
executor.setKeepAliveSeconds(60);
|
||||
// 线程名前缀,方便定位日志
|
||||
executor.setThreadNamePrefix("capturePic-async-");
|
||||
// 拒绝策略:当线程池满时
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// CallerRunsPolicy:由调用线程执行任务(相对安全)
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步执行异常处理
|
||||
*/
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package org.dromara.common.core.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class XzdCustomerSupplierVos implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型(1、供应商,2、客户)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 供应商-客户id
|
||||
*/
|
||||
private Long cSId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdCsContractInformationService {
|
||||
|
||||
String selectNameByIds(String ids);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
import org.dromara.common.core.domain.vo.XzdCustomerSupplierVos;
|
||||
|
||||
public interface XzdCustomerSupplierService {
|
||||
|
||||
/**
|
||||
* 查询供应商-客户中间
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 供应商-客户中间
|
||||
*/
|
||||
XzdCustomerSupplierVos queryByIdone(Long id);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdCustomerinformationService {
|
||||
|
||||
String selectNmaeByIds(String id);
|
||||
|
||||
String selectNmaeById(Long id);
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdJsCgJungonService {
|
||||
|
||||
String selectNameByIds(String ids);
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdProjectService {
|
||||
|
||||
String selectNmaeByIds(String ids);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdPurchaseContractInformationService {
|
||||
String selectNameByIds(String ids);
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdSupplierInfoService {
|
||||
|
||||
String selectNmaeByIds(String ids);
|
||||
|
||||
String selectNmaeById(Long id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdSupplierOpenBankService {
|
||||
|
||||
String selectNameByIds(String ids);
|
||||
}
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.map.MapUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.sse.dto.SseMessageDto;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -22,7 +23,14 @@ public class SseEmitterManager {
|
||||
/**
|
||||
* 订阅的频道
|
||||
*/
|
||||
private final static String SSE_TOPIC = "global:sse";
|
||||
// private final static String SSE_TOPIC = "global:sse";
|
||||
|
||||
private static String SSE_TOPIC;
|
||||
|
||||
@Value("${spring.data.redis.database:0}")
|
||||
public void setDatabase(int database) {
|
||||
SSE_TOPIC = "global:sse:db" + database;
|
||||
}
|
||||
|
||||
private final static Map<Long, Map<String, SseEmitter>> USER_TOKEN_EMITTERS = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
@ -37,4 +37,36 @@ public interface TransConstant {
|
||||
*/
|
||||
String PROJECT_ID_TO_NAME = "project_id_to_name";
|
||||
|
||||
|
||||
/**
|
||||
* 客户id转名称
|
||||
*/
|
||||
String XZD_KHXX_ID_TO_NAME = "khxx_id_to_name";
|
||||
|
||||
|
||||
// /**
|
||||
// * 供应商id转名称
|
||||
// */
|
||||
// String XZD_KHXX_ID_TO_NAME = "gysxx_id_to_name";
|
||||
|
||||
/**
|
||||
* 新中大项目id转名称
|
||||
*/
|
||||
String XZD_PROJECT_ID_TO_NAME = "xzd_project_id_to_name";
|
||||
/**
|
||||
* 采购合同id转名称
|
||||
*/
|
||||
String XZD_PURCHASE_CONTRACT_ID_TO_NAME = "xzd_purchase_contract_id_to_name";
|
||||
/**
|
||||
* 综合服务合同id转名称
|
||||
*/
|
||||
String XZD_CS_CONTRACT_INFORMATION_ID_TO_NAME = "xzd_cs_contract_information_id_to_name";
|
||||
/**
|
||||
* 结算-采购合同竣工结算id转名称
|
||||
*/
|
||||
String XZD_JS_CG_JUNGON_ID_TO_NAME = "xzd_js_cg_jungon_id_to_name";
|
||||
/**
|
||||
* 新中大供应商信息-开户银行id转银行名称
|
||||
*/
|
||||
String XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME = "xzd_supplier_open_bank_id_to_name";
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdCsContractInformationService;
|
||||
import org.dromara.common.core.service.XzdPurchaseContractInformationService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_CS_CONTRACT_INFORMATION_ID_TO_NAME)
|
||||
public class XzdCsContractInformationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdCsContractInformationService xzdCsContractInformationService;
|
||||
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdCsContractInformationService.selectNameByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdCsContractInformationService.selectNameByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdCustomerinformationService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_KHXX_ID_TO_NAME)
|
||||
public class XzdCustomerinformationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdCustomerinformationService xzdCustomerinformationService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdCustomerinformationService.selectNmaeByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdCustomerinformationService.selectNmaeByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdJsCgJungonService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_JS_CG_JUNGON_ID_TO_NAME)
|
||||
public class XzdJsCgJungonImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdJsCgJungonService xzdJsCgJungonService;
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdJsCgJungonService.selectNameByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdJsCgJungonService.selectNameByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdProjectService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_PROJECT_ID_TO_NAME)
|
||||
public class XzdProjectImpl implements TranslationInterface<String> {
|
||||
private final XzdProjectService xzdProjectService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdProjectService.selectNmaeByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdProjectService.selectNmaeByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import org.dromara.common.core.service.XzdPurchaseContractInformationService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_PURCHASE_CONTRACT_ID_TO_NAME)
|
||||
public class XzdPurchaseContractInformationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdPurchaseContractInformationService xzdCustomerinformationService;
|
||||
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdCustomerinformationService.selectNameByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdCustomerinformationService.selectNameByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdSupplierInfoService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
//@TranslationType(type = TransConstant.XZD_KHXX_ID_TO_NAME)
|
||||
public class XzdSupplierInfoImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdSupplierInfoService xzdSupplierInfoService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdSupplierInfoService.selectNmaeByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdSupplierInfoService.selectNmaeByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdSupplierOpenBankService;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME)
|
||||
public class XzdSupplierOpenBankImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdSupplierOpenBankService xzdSupplierOpenBankService;
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdSupplierOpenBankService.selectNameByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdSupplierOpenBankService.selectNameByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -5,3 +5,10 @@ org.dromara.common.translation.core.impl.OssUrlTranslationImpl
|
||||
org.dromara.common.translation.core.impl.UserNameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.NicknameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.ProjectNameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.XzdCustomerinformationImpl
|
||||
org.dromara.common.translation.core.impl.XzdProjectImpl
|
||||
org.dromara.common.translation.core.impl.XzdPurchaseContractInformationImpl
|
||||
org.dromara.common.translation.core.impl.XzdSupplierInfoImpl
|
||||
org.dromara.common.translation.core.impl.XzdJsCgJungonImpl
|
||||
org.dromara.common.translation.core.impl.XzdCsContractInformationImpl
|
||||
org.dromara.common.translation.core.impl.XzdSupplierOpenBankImpl
|
||||
|
||||
@ -15,9 +15,29 @@
|
||||
system系统模块
|
||||
</description>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud.ai</groupId>
|
||||
<artifactId>spring-ai-alibaba-bom</artifactId>
|
||||
<version>1.0.0.2</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud.ai</groupId>
|
||||
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.esotericsoftware</groupId>
|
||||
<artifactId>kryo</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
<!-- Java WebSocket 标准API -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>javax.websocket</groupId>-->
|
||||
@ -119,7 +139,6 @@
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- 支持中文字体 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.itextpdf</groupId>-->
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package org.dromara.ai.advisor;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.ai.chat.client.ChatClientMessageAggregator;
|
||||
import org.springframework.ai.chat.client.ChatClientRequest;
|
||||
import org.springframework.ai.chat.client.ChatClientResponse;
|
||||
import org.springframework.ai.chat.client.advisor.api.CallAdvisor;
|
||||
import org.springframework.ai.chat.client.advisor.api.CallAdvisorChain;
|
||||
import org.springframework.ai.chat.client.advisor.api.StreamAdvisor;
|
||||
import org.springframework.ai.chat.client.advisor.api.StreamAdvisorChain;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
/**
|
||||
* 自定义日志拦截器
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04 10:15
|
||||
*/
|
||||
@Slf4j
|
||||
public class CustomLoggerAdvisor implements CallAdvisor, StreamAdvisor {
|
||||
|
||||
private void before(ChatClientRequest request) {
|
||||
log.info("AI 请求参数:{}", request.prompt());
|
||||
}
|
||||
|
||||
private void observeAfter(ChatClientResponse response) {
|
||||
if (response.chatResponse() != null) {
|
||||
log.info("AI 响应结果:{}", response.chatResponse().getResult().getOutput().getText());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatClientResponse adviseCall(ChatClientRequest chatClientRequest, CallAdvisorChain callAdvisorChain) {
|
||||
before(chatClientRequest);
|
||||
ChatClientResponse chatClientResponse = callAdvisorChain.nextCall(chatClientRequest);
|
||||
observeAfter(chatClientResponse);
|
||||
return chatClientResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<ChatClientResponse> adviseStream(ChatClientRequest chatClientRequest, StreamAdvisorChain streamAdvisorChain) {
|
||||
before(chatClientRequest);
|
||||
Flux<ChatClientResponse> chatClientResponseFlux = streamAdvisorChain.nextStream(chatClientRequest);
|
||||
return (new ChatClientMessageAggregator()).aggregateChatClientResponse(chatClientResponseFlux, this::observeAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the advisor.
|
||||
*
|
||||
* @return the advisor name.
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package org.dromara.ai.chat;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.ai.advisor.CustomLoggerAdvisor;
|
||||
import org.dromara.ai.chatmemory.FileBasedChatMemory;
|
||||
import org.dromara.ai.domain.AIChatMemory;
|
||||
import org.dromara.ai.service.IAIChatMemoryService;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
|
||||
import org.springframework.ai.chat.memory.ChatMemory;
|
||||
import org.springframework.ai.chat.model.ChatModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-04 09:34
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DashScopeChat {
|
||||
|
||||
@Resource
|
||||
private SimpleChat simpleChat;
|
||||
|
||||
@Resource
|
||||
private IAIChatMemoryService chatMemoryService;
|
||||
|
||||
private final ChatClient chatClient;
|
||||
|
||||
private static final String DEFAULT_PROMPT = "你叫煤球,是一个博学的智能聊天助手,请根据用户提问回答!";
|
||||
|
||||
private static final String DEFAULT_FILE_DIR = System.getProperty("user.dir") + "/chat-memory";
|
||||
|
||||
public DashScopeChat(ChatModel dashScopeChatModel) {
|
||||
// 初始化基于文件的对话记忆
|
||||
ChatMemory chatMemory = new FileBasedChatMemory(DEFAULT_FILE_DIR);
|
||||
chatClient = ChatClient.builder(dashScopeChatModel)
|
||||
.defaultSystem(DEFAULT_PROMPT)
|
||||
.defaultAdvisors(
|
||||
MessageChatMemoryAdvisor.builder(chatMemory).build(),
|
||||
// 自定义日志输出
|
||||
new CustomLoggerAdvisor()
|
||||
).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 对话,流式输出
|
||||
*
|
||||
* @param message 用户输入
|
||||
* @param chatId 会话id
|
||||
* @return 流式输出结果
|
||||
*/
|
||||
public Flux<String> doChatStream(String message, String chatId, Boolean isFirst) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
return chatClient
|
||||
.prompt()
|
||||
.user(message)
|
||||
.advisors(spec -> spec.param(ChatMemory.CONVERSATION_ID, chatId))
|
||||
.stream()
|
||||
.content()// 收集所有 token,生成完整回复
|
||||
.collectList()
|
||||
.flatMapMany(tokens -> {
|
||||
String aiResponse = String.join("", tokens);
|
||||
if (isFirst) {
|
||||
// 异步生成标题
|
||||
generateChatTitleAsync(chatId, message, aiResponse, userId);
|
||||
}
|
||||
// 返回完整的流结果
|
||||
return Flux.fromIterable(tokens);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步生成标题
|
||||
*
|
||||
* @param chatId 会话id
|
||||
* @param userMessage 用户输入
|
||||
* @param aiResponse AI回复
|
||||
* @param userId 用户id
|
||||
*/
|
||||
private void generateChatTitleAsync(String chatId, String userMessage, String aiResponse, Long userId) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
// 先判断一下当前聊天是否存在
|
||||
Long count = chatMemoryService.lambdaQuery()
|
||||
.eq(AIChatMemory::getUserId, userId)
|
||||
.eq(AIChatMemory::getFileName, chatId)
|
||||
.count();
|
||||
if (count > 0) {
|
||||
return;
|
||||
}
|
||||
// 构建生成标题的提示词
|
||||
String prompt = String.format("""
|
||||
请以陈述句的形式总结下面这段用户与AI的对话生成一个简短的标题(不超过10个字):
|
||||
用户:%s
|
||||
AI:%s
|
||||
""", userMessage, aiResponse);
|
||||
String title = simpleChat.doChat(prompt);
|
||||
log.info("用户:{} 生成标题成功:{} -> {}", userId, chatId, title);
|
||||
// 保存对话数据
|
||||
AIChatMemory memory = new AIChatMemory();
|
||||
memory.setUserId(userId);
|
||||
memory.setFileName(chatId);
|
||||
memory.setFirstQuestion(title);
|
||||
chatMemoryService.save(memory);
|
||||
} catch (Exception e) {
|
||||
log.error("生成标题失败", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package org.dromara.ai.chat;
|
||||
|
||||
import com.alibaba.cloud.ai.dashscope.chat.DashScopeChatOptions;
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-04 15:26
|
||||
*/
|
||||
@Component
|
||||
public class SimpleChat {
|
||||
|
||||
private final ChatClient dashScopeChatClient;
|
||||
|
||||
public SimpleChat(ChatClient.Builder chatClientBuilder) {
|
||||
this.dashScopeChatClient = chatClientBuilder
|
||||
// 设置 ChatClient 中 ChatModel 的 Options 参数
|
||||
.defaultOptions(
|
||||
DashScopeChatOptions.builder()
|
||||
.withTopP(0.7)
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 对话
|
||||
*
|
||||
* @param message 用户输入
|
||||
* @return 响应结果
|
||||
*/
|
||||
public String doChat(String message) {
|
||||
return dashScopeChatClient.prompt(message).call().content();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package org.dromara.ai.chatmemory;
|
||||
|
||||
import com.esotericsoftware.kryo.Kryo;
|
||||
import com.esotericsoftware.kryo.io.Input;
|
||||
import com.esotericsoftware.kryo.io.Output;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.objenesis.strategy.StdInstantiatorStrategy;
|
||||
import org.springframework.ai.chat.memory.ChatMemory;
|
||||
import org.springframework.ai.chat.messages.Message;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基于文件持久化的对话记忆
|
||||
*/
|
||||
@Slf4j
|
||||
public class FileBasedChatMemory implements ChatMemory {
|
||||
|
||||
private final String BASE_DIR;
|
||||
private static final Kryo kryo = new Kryo();
|
||||
|
||||
static {
|
||||
kryo.setRegistrationRequired(false);
|
||||
// 设置实例化策略
|
||||
kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());
|
||||
}
|
||||
|
||||
// 构造对象时,指定文件保存目录
|
||||
public FileBasedChatMemory(String dir) {
|
||||
this.BASE_DIR = dir;
|
||||
File baseDir = new File(dir);
|
||||
if (!baseDir.exists()) {
|
||||
baseDir.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(String conversationId, List<Message> messages) {
|
||||
List<Message> conversationMessages = getOrCreateConversation(conversationId);
|
||||
conversationMessages.addAll(messages);
|
||||
saveConversation(conversationId, conversationMessages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Message> get(String conversationId) {
|
||||
List<Message> messages = getOrCreateConversation(conversationId);
|
||||
log.info("获取对话:{}", messages);
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(String conversationId) {
|
||||
File file = getConversationFile(conversationId);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private List<Message> getOrCreateConversation(String conversationId) {
|
||||
File file = getConversationFile(conversationId);
|
||||
List<Message> messages = new ArrayList<>();
|
||||
if (file.exists()) {
|
||||
try (Input input = new Input(new FileInputStream(file))) {
|
||||
messages = kryo.readObject(input, ArrayList.class);
|
||||
} catch (IOException e) {
|
||||
log.error("读取对话失败", e);
|
||||
}
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
|
||||
private void saveConversation(String conversationId, List<Message> messages) {
|
||||
File file = getConversationFile(conversationId);
|
||||
try (Output output = new Output(new FileOutputStream(file))) {
|
||||
kryo.writeObject(output, messages);
|
||||
} catch (IOException e) {
|
||||
log.error("保存对话失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private File getConversationFile(String conversationId) {
|
||||
return new File(BASE_DIR, conversationId + ".kryo");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package org.dromara.ai.controller;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.ai.chat.DashScopeChat;
|
||||
import org.dromara.ai.chatmemory.FileBasedChatMemory;
|
||||
import org.dromara.ai.domain.dto.AIChatReq;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.springframework.ai.chat.messages.Message;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-10-23 11:32
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/ai/chat")
|
||||
public class AIChatController {
|
||||
|
||||
@Resource
|
||||
private DashScopeChat dashScopeChat;
|
||||
|
||||
/**
|
||||
* ChatClient 流式调用
|
||||
*/
|
||||
@GetMapping("/stream")
|
||||
public Flux<String> streamChat(@Validated AIChatReq req, HttpServletResponse response) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
return dashScopeChat.doChatStream(req.getQuery(), req.getChatId(), req.getIsFirst());
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话记录
|
||||
*/
|
||||
@GetMapping("/history")
|
||||
public R<List<Message>> getChatHistory(String chatId) {
|
||||
FileBasedChatMemory memory = new FileBasedChatMemory(System.getProperty("user.dir") + "/chat-memory");
|
||||
return R.ok(memory.get(chatId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package org.dromara.ai.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryQueryReq;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryUpdateReq;
|
||||
import org.dromara.ai.domain.vo.AIChatMemoryVo;
|
||||
import org.dromara.ai.service.IAIChatMemoryService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI 对话记录信息
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ai/chatMemory")
|
||||
public class AIChatMemoryController extends BaseController {
|
||||
|
||||
private final IAIChatMemoryService aiChatMemoryService;
|
||||
|
||||
/**
|
||||
* 查询AI 对话记录信息列表
|
||||
*/
|
||||
@SaCheckPermission("ai:chatMemory:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AIChatMemoryVo> list(AIChatMemoryQueryReq req, PageQuery pageQuery) {
|
||||
return aiChatMemoryService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出AI 对话记录信息列表
|
||||
*/
|
||||
@SaCheckPermission("ai:chatMemory:export")
|
||||
@Log(title = "AI 对话记录信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AIChatMemoryQueryReq req, HttpServletResponse response) {
|
||||
List<AIChatMemoryVo> list = aiChatMemoryService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "AI 对话记录信息", AIChatMemoryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AI 对话记录信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ai:chatMemory:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AIChatMemoryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(aiChatMemoryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 AI 对话记录信息
|
||||
*/
|
||||
@SaCheckPermission("ai:chatMemory:edit")
|
||||
@Log(title = "AI 对话记录信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> updateAIChatMemory(@Validated AIChatMemoryUpdateReq req) {
|
||||
return toAjax(aiChatMemoryService.updateByReq(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI 对话记录信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ai:chatMemory:remove")
|
||||
@Log(title = "AI 对话记录信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(aiChatMemoryService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package org.dromara.ai.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* AI 对话记录信息对象 ai_chat_memory
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ai_chat_memory")
|
||||
public class AIChatMemory extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 第一条问题
|
||||
*/
|
||||
private String firstQuestion;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package org.dromara.ai.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-04 15:19
|
||||
*/
|
||||
@Data
|
||||
public class AIChatMemoryQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -4090176451164739134L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 第一条问题
|
||||
*/
|
||||
private String firstQuestion;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package org.dromara.ai.domain.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-05 11:28
|
||||
*/
|
||||
@Data
|
||||
public class AIChatMemoryUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6541297164616819137L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 第一条问题
|
||||
*/
|
||||
private String firstQuestion;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.ai.domain.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-05 09:31
|
||||
*/
|
||||
@Data
|
||||
public class AIChatReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -4669223630531267889L;
|
||||
|
||||
/**
|
||||
* 聊天内容
|
||||
*/
|
||||
@NotBlank(message = "请输入内容")
|
||||
private String query;
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
@NotBlank(message = "请输入会话id")
|
||||
private String chatId;
|
||||
|
||||
/**
|
||||
* 是否首次对话
|
||||
*/
|
||||
@NotNull(message = "请选择是否首次对话")
|
||||
private Boolean isFirst;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package org.dromara.ai.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.ai.domain.AIChatMemory;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* AI 对话记录信息视图对象 ai_chat_memory
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = AIChatMemory.class)
|
||||
public class AIChatMemoryVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ExcelProperty(value = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 第一条问题
|
||||
*/
|
||||
@ExcelProperty(value = "第一条问题")
|
||||
private String firstQuestion;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.ai.mapper;
|
||||
|
||||
import org.dromara.ai.domain.AIChatMemory;
|
||||
import org.dromara.ai.domain.vo.AIChatMemoryVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* AI 对话记录信息Mapper接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface AIChatMemoryMapper extends BaseMapperPlus<AIChatMemory, AIChatMemoryVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package org.dromara.ai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.ai.domain.AIChatMemory;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryQueryReq;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryUpdateReq;
|
||||
import org.dromara.ai.domain.vo.AIChatMemoryVo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI 对话记录信息Service接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface IAIChatMemoryService extends IService<AIChatMemory> {
|
||||
|
||||
/**
|
||||
* 查询AI 对话记录信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return AI 对话记录信息
|
||||
*/
|
||||
AIChatMemoryVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询AI 对话记录信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return AI 对话记录信息分页列表
|
||||
*/
|
||||
TableDataInfo<AIChatMemoryVo> queryPageList(AIChatMemoryQueryReq bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的AI 对话记录信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return AI 对话记录信息列表
|
||||
*/
|
||||
List<AIChatMemoryVo> queryList(AIChatMemoryQueryReq bo);
|
||||
|
||||
/**
|
||||
* 修改 AI 对话记录信息
|
||||
*
|
||||
* @param req 修改参数
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByReq(AIChatMemoryUpdateReq req);
|
||||
|
||||
/**
|
||||
* 校验并批量删除AI 对话记录信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package org.dromara.ai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.ai.domain.AIChatMemory;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryQueryReq;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryUpdateReq;
|
||||
import org.dromara.ai.domain.vo.AIChatMemoryVo;
|
||||
import org.dromara.ai.mapper.AIChatMemoryMapper;
|
||||
import org.dromara.ai.service.IAIChatMemoryService;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI 对话记录信息Service业务层处理
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Service
|
||||
public class AIChatMemoryServiceImpl extends ServiceImpl<AIChatMemoryMapper, AIChatMemory>
|
||||
implements IAIChatMemoryService {
|
||||
|
||||
/**
|
||||
* 查询AI 对话记录信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return AI 对话记录信息
|
||||
*/
|
||||
@Override
|
||||
public AIChatMemoryVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询AI 对话记录信息列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return AI 对话记录信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AIChatMemoryVo> queryPageList(AIChatMemoryQueryReq req, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AIChatMemory> lqw = buildQueryWrapper(req);
|
||||
Page<AIChatMemoryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的AI 对话记录信息列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return AI 对话记录信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<AIChatMemoryVo> queryList(AIChatMemoryQueryReq req) {
|
||||
LambdaQueryWrapper<AIChatMemory> lqw = buildQueryWrapper(req);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 AI 对话记录信息
|
||||
*
|
||||
* @param req 修改参数
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByReq(AIChatMemoryUpdateReq req) {
|
||||
AIChatMemory oldChatMemory = this.getById(req.getId());
|
||||
if (oldChatMemory == null) {
|
||||
throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
AIChatMemory update = new AIChatMemory();
|
||||
BeanUtils.copyProperties(req, update);
|
||||
return this.updateById(update);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AIChatMemory> buildQueryWrapper(AIChatMemoryQueryReq req) {
|
||||
LambdaQueryWrapper<AIChatMemory> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(AIChatMemory::getId);
|
||||
lqw.eq(req.getUserId() != null, AIChatMemory::getUserId, req.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(req.getFileName()), AIChatMemory::getFileName, req.getFileName());
|
||||
lqw.eq(StringUtils.isNotBlank(req.getFirstQuestion()), AIChatMemory::getFirstQuestion, req.getFirstQuestion());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除AI 对话记录信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -3,8 +3,12 @@ package org.dromara.app.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.app.domain.SysPackage;
|
||||
import org.dromara.app.domain.bo.SysPackageBo;
|
||||
import org.dromara.app.domain.vo.SysPackageVo;
|
||||
import org.dromara.app.service.SysPackageServiceImpl;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.impl.SysOssServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -26,6 +30,14 @@ public class SysPackageController {
|
||||
@Autowired
|
||||
private SysPackageServiceImpl sysPackageService;
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysPackageVo> list(SysPackageBo bo, PageQuery pageQuery) {
|
||||
return sysPackageService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新版本
|
||||
*/
|
||||
@ -42,7 +54,7 @@ public class SysPackageController {
|
||||
* 上传最新安装包及版本
|
||||
*/
|
||||
@GetMapping("/uploadNewVersion")
|
||||
public R<SysPackage> uploadNewVersion(String version, String type, MultipartFile file) {
|
||||
public R<SysPackage> uploadNewVersion(String version, String type, MultipartFile file, String context) {
|
||||
String originalFileName = "apk/package/app-release.apk";
|
||||
|
||||
// 先查询最新记录
|
||||
@ -57,11 +69,11 @@ public class SysPackageController {
|
||||
}
|
||||
|
||||
// 分离事务:再处理数据库操作
|
||||
return handleDatabaseOperations(version, type, upload, list);
|
||||
return handleDatabaseOperations(version, type, upload, list, context);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public R<SysPackage> handleDatabaseOperations(String version, String type, SysOssVo upload, List<SysPackage> existingPackages) {
|
||||
public R<SysPackage> handleDatabaseOperations(String version, String type, SysOssVo upload, List<SysPackage> existingPackages, String context) {
|
||||
try {
|
||||
// 先删除旧文件记录
|
||||
if (existingPackages != null && !existingPackages.isEmpty()) {
|
||||
@ -78,6 +90,7 @@ public class SysPackageController {
|
||||
sysPackage.setFileId(upload.getOssId());
|
||||
sysPackage.setFileUrl(upload.getUrl());
|
||||
sysPackage.setType(type);
|
||||
sysPackage.setContext(context);
|
||||
|
||||
boolean save = sysPackageService.save(sysPackage);
|
||||
if (!save) {
|
||||
|
||||
@ -30,4 +30,9 @@ public class SysPackage extends BaseEntity {
|
||||
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 更新内容
|
||||
*/
|
||||
private String context;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package org.dromara.app.domain.bo;
|
||||
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.xzd.domain.XzdContractDetails;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XzdContractDetails.class, reverseConvertGenerate = false)
|
||||
public class SysPackageBo extends BaseEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 0安卓1苹果2鸿蒙
|
||||
*/
|
||||
private String type;
|
||||
|
||||
private String version;
|
||||
|
||||
private Long fileId;
|
||||
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 更新内容
|
||||
*/
|
||||
private String context;
|
||||
}
|
||||
@ -27,4 +27,9 @@ public class SysPackageVo {
|
||||
|
||||
@ExcelProperty("安装包地址")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 更新内容
|
||||
*/
|
||||
private String context;
|
||||
}
|
||||
|
||||
@ -1,10 +1,24 @@
|
||||
package org.dromara.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.app.domain.SysPackage;
|
||||
import org.dromara.app.domain.bo.SysPackageBo;
|
||||
import org.dromara.app.domain.vo.SysPackageVo;
|
||||
import org.dromara.app.mapper.SysPackageMapper;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SysPackageServiceImpl extends ServiceImpl<SysPackageMapper, SysPackage> {
|
||||
|
||||
public TableDataInfo<SysPackageVo> queryPageList(SysPackageBo bo, PageQuery pageQuery) {
|
||||
// LambdaQueryWrapper<SysPackage> lqw = buildQueryWrapper(bo);
|
||||
Page<SysPackageVo> result = baseMapper.selectVoPage(pageQuery.build(), new LambdaQueryWrapper<>());
|
||||
// setValue(result.getRecords());
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package org.dromara.bigscreen.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 无人机消息redis订阅专用线程池
|
||||
*/
|
||||
@Configuration // 标记为配置类,让Spring扫描加载
|
||||
@EnableAsync // 启用Spring异步功能(若项目已在启动类加过,此处可省略,但加上更稳妥)
|
||||
public class AsyncConfig {
|
||||
|
||||
/**
|
||||
* 定义名为 "messageAsyncExecutor" 的线程池 Bean(与 @Async("messageAsyncExecutor") 对应)
|
||||
*/
|
||||
@Bean(name = "messageAsyncExecutor") // Bean名称必须是 "messageAsyncExecutor",大小写敏感
|
||||
public Executor messageAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
|
||||
// 1. 核心线程数:根据CPU核心数或业务量调整(示例:5个)
|
||||
executor.setCorePoolSize(5);
|
||||
// 2. 最大线程数:避免线程过多导致资源耗尽(示例:10个)
|
||||
executor.setMaxPoolSize(10);
|
||||
// 3. 任务队列容量:缓冲待处理的异步任务(示例:50个)
|
||||
executor.setQueueCapacity(50);
|
||||
// 4. 线程名前缀:便于日志排查(格式:message-async-1, message-async-2...)
|
||||
executor.setThreadNamePrefix("message-async-");
|
||||
// 5. 线程空闲时间:超过60秒空闲则销毁(释放资源)
|
||||
executor.setKeepAliveSeconds(60);
|
||||
// 6. 任务拒绝策略:队列满时,由提交任务的线程临时执行(避免消息丢失)
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
|
||||
// 7. 初始化线程池(必须调用,否则线程池不会生效)
|
||||
executor.initialize();
|
||||
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@ -12,8 +12,6 @@ import org.springframework.data.redis.listener.PatternTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 备忘录
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bwl/bwl")
|
||||
public class BusBwlController extends BaseController {
|
||||
|
||||
private final IBusBwlService busBwlService;
|
||||
|
||||
/**
|
||||
* 查询备忘录列表
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusBwlVo> list(BusBwlBo bo, PageQuery pageQuery) {
|
||||
return busBwlService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出备忘录列表
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:export")
|
||||
@Log(title = "备忘录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusBwlBo bo, HttpServletResponse response) {
|
||||
List<BusBwlVo> list = busBwlService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "备忘录", BusBwlVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备忘录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusBwlVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busBwlService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:add")
|
||||
@Log(title = "备忘录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBwlBo bo) {
|
||||
return toAjax(busBwlService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:edit")
|
||||
@Log(title = "备忘录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBwlBo bo) {
|
||||
return toAjax(busBwlService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除备忘录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:remove")
|
||||
@Log(title = "备忘录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBwlService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||
|
||||
import org.dromara.bigscreen.service.IBusSygjService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 实用工具
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bigscreen/sygj")
|
||||
public class BusSygjController extends BaseController {
|
||||
|
||||
private final IBusSygjService busSygjService;
|
||||
|
||||
/**
|
||||
* 查询实用工具列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusSygjVo> list(BusSygjBo bo, PageQuery pageQuery) {
|
||||
return busSygjService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出实用工具列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:export")
|
||||
@Log(title = "实用工具", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusSygjBo bo, HttpServletResponse response) {
|
||||
List<BusSygjVo> list = busSygjService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "实用工具", BusSygjVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实用工具详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusSygjVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busSygjService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增实用工具
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:add")
|
||||
@Log(title = "实用工具", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusSygjBo bo) {
|
||||
return toAjax(busSygjService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实用工具
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:edit")
|
||||
@Log(title = "实用工具", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusSygjBo bo) {
|
||||
return toAjax(busSygjService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除实用工具
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:sygj:remove")
|
||||
@Log(title = "实用工具", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busSygjService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文件中心
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bigscreen/wjzx")
|
||||
public class BusWjzxController extends BaseController {
|
||||
|
||||
private final IBusWjzxService busWjzxService;
|
||||
|
||||
/**
|
||||
* 查询文件中心列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusWjzxVo> list(BusWjzxBo bo, PageQuery pageQuery) {
|
||||
return busWjzxService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件中心列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:export")
|
||||
@Log(title = "文件中心", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusWjzxBo bo, HttpServletResponse response) {
|
||||
List<BusWjzxVo> list = busWjzxService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "文件中心", BusWjzxVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件中心详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusWjzxVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busWjzxService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件中心
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:add")
|
||||
@Log(title = "文件中心", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusWjzxBo bo) {
|
||||
return toAjax(busWjzxService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件中心
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:edit")
|
||||
@Log(title = "文件中心", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusWjzxBo bo) {
|
||||
return toAjax(busWjzxService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件中心
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:wjzx:remove")
|
||||
@Log(title = "文件中心", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busWjzxService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,316 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.ai.chat.DashScopeChat;
|
||||
import org.dromara.ai.chatmemory.FileBasedChatMemory;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryQueryReq;
|
||||
import org.dromara.ai.domain.dto.AIChatMemoryUpdateReq;
|
||||
import org.dromara.ai.domain.dto.AIChatReq;
|
||||
import org.dromara.ai.domain.vo.AIChatMemoryVo;
|
||||
import org.dromara.ai.service.IAIChatMemoryService;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||
import org.dromara.bigscreen.domain.dto.TaskInfoDto;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||
import org.dromara.bigscreen.domain.vo.MyProjectInfoVo;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.dromara.bigscreen.service.IBusSygjService;
|
||||
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.dto.UserDTO;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||
import org.dromara.patch.service.IPdMasterService;
|
||||
import org.dromara.system.domain.SysMenu;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||
import org.dromara.warm.flow.core.FlowEngine;
|
||||
import org.dromara.warm.flow.core.entity.User;
|
||||
import org.dromara.warm.flow.core.enums.NodeType;
|
||||
import org.dromara.warm.flow.orm.entity.FlowDefinition;
|
||||
import org.dromara.warm.flow.orm.mapper.FlowDefinitionMapper;
|
||||
import org.dromara.workflow.domain.bo.FlowTaskBo;
|
||||
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
||||
import org.dromara.workflow.mapper.FlwTaskMapper;
|
||||
import org.springframework.ai.chat.messages.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 个人首页接口
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/personalHome")
|
||||
public class PersonalHomeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private FlwTaskMapper flwTaskMapper;
|
||||
@Autowired
|
||||
private FlowDefinitionMapper flowDefinitionMapper;
|
||||
@Autowired
|
||||
private SysUserServiceImpl userService;
|
||||
|
||||
private final IBusWjzxService busWjzxService;
|
||||
|
||||
private final IBusSygjService busSygjService;
|
||||
@Autowired
|
||||
private IPdMasterService pdMasterService;
|
||||
|
||||
private final IBusBwlService busBwlService;
|
||||
|
||||
@Resource
|
||||
private DashScopeChat dashScopeChat;
|
||||
|
||||
@Resource
|
||||
private IAIChatMemoryService aiChatMemoryService;
|
||||
|
||||
private final SysRoleMapper roleMapper;
|
||||
private final SysMenuServiceImpl menuMapper;
|
||||
|
||||
// region AI 模块
|
||||
|
||||
/**
|
||||
* 获取新 AI 对话聊天id
|
||||
*/
|
||||
@GetMapping("/ai/chat/new")
|
||||
public R<String> getNewAIChat() {
|
||||
return R.ok(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 对话流式调用
|
||||
*/
|
||||
@GetMapping("/ai/chat/stream")
|
||||
public Flux<String> streamChat(@Validated AIChatReq req, HttpServletResponse response) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
return dashScopeChat.doChatStream(req.getQuery(), req.getChatId(), req.getIsFirst());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 AI 对话记录
|
||||
*/
|
||||
@GetMapping("/ai/chat/history")
|
||||
public R<List<Message>> getChatHistory(String chatId) {
|
||||
FileBasedChatMemory memory = new FileBasedChatMemory(System.getProperty("user.dir") + "/chat-memory");
|
||||
return R.ok(memory.get(chatId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 AI 对话记录信息列表
|
||||
*/
|
||||
@GetMapping("/ai/chatMemory/list")
|
||||
public TableDataInfo<AIChatMemoryVo> listAIChatMemory(AIChatMemoryQueryReq req, PageQuery pageQuery) {
|
||||
return aiChatMemoryService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 AI 对话记录信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/ai/chatMemory/{id}")
|
||||
public R<AIChatMemoryVo> getAIChatMemoryInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(aiChatMemoryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 AI 对话记录信息
|
||||
*/
|
||||
@Log(title = "AI 对话记录信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/ai/chatMemory")
|
||||
public R<Void> updateAIChatMemory(@Validated AIChatMemoryUpdateReq req) {
|
||||
return toAjax(aiChatMemoryService.updateByReq(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 AI 对话记录信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Log(title = "AI 对话记录信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/ai/chatMemory/{ids}")
|
||||
public R<Void> removeAIChatMemory(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(aiChatMemoryService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
/**
|
||||
* 获取我的项目信息
|
||||
*/
|
||||
@GetMapping("/getMyProjectInfo")
|
||||
public R<List<MyProjectInfoVo>> getMyProjectInfoList() {
|
||||
// todo
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页待办事项
|
||||
*
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getTaskList")
|
||||
public R<TaskInfoDto> getTaskList(String projectId) {
|
||||
TaskInfoDto taskInfoDto = new TaskInfoDto();
|
||||
|
||||
QueryWrapper<FlowTaskBo> queryWrapper = new QueryWrapper<>();
|
||||
List<Long> definitionIds = new ArrayList<>();
|
||||
if (!"0".equals(projectId)) {
|
||||
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper<FlowDefinition>()
|
||||
.select(FlowDefinition::getId)
|
||||
.like(FlowDefinition::getFlowCode, projectId));
|
||||
if (flowDefinitions != null && !flowDefinitions.isEmpty()) {
|
||||
flowDefinitions.forEach(flowDefinition -> {
|
||||
definitionIds.add(flowDefinition.getId());
|
||||
});
|
||||
}
|
||||
if (definitionIds.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
queryWrapper.eq("t.node_type", NodeType.BETWEEN.getKey());
|
||||
queryWrapper.in("t.processed_by", LoginHelper.getUserIdStr());
|
||||
queryWrapper.in("t.flow_status", BusinessStatusEnum.WAITING.getStatus());
|
||||
List<FlowTaskVo> page = this.getFlowTaskDefinitionIdsVoPage(definitionIds, queryWrapper);
|
||||
|
||||
//根据createTime过滤出本周数据
|
||||
// 获取本周一和本周日
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate monday = today.with(DayOfWeek.MONDAY);
|
||||
LocalDate sunday = today.with(DayOfWeek.SUNDAY);
|
||||
|
||||
// 筛选本周数据
|
||||
List<FlowTaskVo> weeklyTasks = page.stream()
|
||||
.filter(task -> {
|
||||
Date createTime = task.getCreateTime(); // 假设字段名为createTime
|
||||
if (createTime != null) {
|
||||
LocalDate createLocalDate = createTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
return !createLocalDate.isBefore(monday) && !createLocalDate.isAfter(sunday);
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.toList();
|
||||
|
||||
taskInfoDto.setList(page);
|
||||
taskInfoDto.setTotal((long) page.size());
|
||||
taskInfoDto.setWeekCount((long) weeklyTasks.size());
|
||||
|
||||
return R.ok(taskInfoDto);
|
||||
}
|
||||
|
||||
private List<FlowTaskVo> getFlowTaskDefinitionIdsVoPage(List<Long> definitionIds, QueryWrapper<FlowTaskBo> queryWrapper) {
|
||||
List<FlowTaskVo> records = flwTaskMapper.getListRunTaskDefinitionInfo(definitionIds, queryWrapper);
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
List<Long> taskIds = StreamUtils.toList(records, FlowTaskVo::getId);
|
||||
Map<Long, List<UserDTO>> listMap = currentTaskAllUser(taskIds);
|
||||
records.forEach(t -> {
|
||||
List<UserDTO> userList = listMap.getOrDefault(t.getId(), Collections.emptyList());
|
||||
if (CollUtil.isNotEmpty(userList)) {
|
||||
t.setAssigneeIds(StreamUtils.join(userList, e -> String.valueOf(e.getUserId())));
|
||||
t.setAssigneeNames(StreamUtils.join(userList, UserDTO::getNickName));
|
||||
}
|
||||
});
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
public Map<Long, List<UserDTO>> currentTaskAllUser(List<Long> taskIdList) {
|
||||
Map<Long, List<UserDTO>> map = new HashMap<>();
|
||||
// 获取与当前任务关联的用户列表
|
||||
List<User> associatedUsers = FlowEngine.userService().getByAssociateds(taskIdList);
|
||||
Map<Long, List<User>> listMap = StreamUtils.groupByKey(associatedUsers, User::getAssociated);
|
||||
for (Map.Entry<Long, List<User>> entry : listMap.entrySet()) {
|
||||
List<User> value = entry.getValue();
|
||||
if (CollUtil.isNotEmpty(value)) {
|
||||
List<UserDTO> userDtoList = userService.selectListByIds(StreamUtils.toList(value, e -> Convert.toLong(e.getProcessedBy())));
|
||||
map.put(entry.getKey(), userDtoList);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询实用工具列表
|
||||
*/
|
||||
// @SaCheckPermission("bigscreen:sygj:list")
|
||||
@GetMapping("/listsygj")
|
||||
public TableDataInfo<BusSygjVo> listsygj(BusSygjBo bo, PageQuery pageQuery) {
|
||||
return busSygjService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询文件中心列表
|
||||
*/
|
||||
// @SaCheckPermission("bigscreen:wjzx:list")
|
||||
@GetMapping("/listBywjzx")
|
||||
public TableDataInfo<BusWjzxVo> listBywjzx(BusWjzxBo bo, PageQuery pageQuery) {
|
||||
return busWjzxService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
*/
|
||||
// @SaCheckPermission("patch:master:list")
|
||||
@GetMapping("/listPd")
|
||||
public PdMasterBymiAndQt listPd(PdMasterBo bo, PageQuery pageQuery) {
|
||||
return pdMasterService.queryPageListBy(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询备忘录列表
|
||||
*/
|
||||
// @SaCheckPermission("bwl:bwl:list")
|
||||
@GetMapping("/listbwl")
|
||||
public TableDataInfo<BusBwlVo> listbwl(BusBwlBo bo, PageQuery pageQuery) {
|
||||
return busBwlService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
*/
|
||||
@GetMapping("/deptTree")
|
||||
public R<List<SysMenu>> deptTree() {
|
||||
// SysRole role = roleMapper.selectById(1);
|
||||
return R.ok(menuMapper.selectMenuTreeByUserId(SystemConstants.SUPER_ADMIN_ID, null));
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,13 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectUpdateDto;
|
||||
import org.dromara.bigscreen.domain.dto.TanchuangInfoReq;
|
||||
import org.dromara.bigscreen.domain.dto.Ys7DeviceUpdateReq;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectLandVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
import org.dromara.bigscreen.domain.vo.*;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.R;
|
||||
@ -20,7 +18,12 @@ import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.facility.domain.bo.FacRedLineBo;
|
||||
import org.dromara.facility.domain.vo.redline.FacRedLineVo;
|
||||
import org.dromara.facility.service.IFacRedLineService;
|
||||
import org.dromara.gps.domain.bo.GpsEquipmentBo;
|
||||
import org.dromara.land.domain.BusLandBlock;
|
||||
import org.dromara.land.domain.BusLandTransferLedger;
|
||||
@ -33,8 +36,8 @@ import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.other.domain.OthYs7Device;
|
||||
import org.dromara.other.service.IOthYs7DeviceService;
|
||||
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||
import org.dromara.project.service.IBusProjectNewsService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionGisReq;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionListGisVo;
|
||||
@ -76,8 +79,6 @@ public class ProjectBigScreenController extends BaseController {
|
||||
|
||||
private final IBusProjectService projectService;
|
||||
|
||||
private final IBusProjectNewsService projectNewsService;
|
||||
|
||||
private final IQltQualityInspectionService qualityInspectionService;
|
||||
|
||||
private final IHseSafetyInspectionService safetyInspectionService;
|
||||
@ -86,6 +87,8 @@ public class ProjectBigScreenController extends BaseController {
|
||||
|
||||
private final BusLandTransferLedgerSonServiceImpl busLandTransferLedgerSonService;
|
||||
|
||||
private final IFacRedLineService facRedLineService;
|
||||
|
||||
/**
|
||||
* 查询项目土地统计
|
||||
*/
|
||||
@ -218,6 +221,15 @@ public class ProjectBigScreenController extends BaseController {
|
||||
return R.ok(projectBigScreenService.getProjectImageProgress(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目形象进度详情
|
||||
*/
|
||||
@GetMapping("/imageProgress/detail")
|
||||
public R<List<ProjectImageProgressDetailVo>> getProjectImageProgressDetail(@Validated ProjectImageProgressDetailReq req) {
|
||||
List<ProjectImageProgressDetailVo> list = projectBigScreenService.getProjectImageProgressDetail(req);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目概括
|
||||
*/
|
||||
@ -334,6 +346,22 @@ public class ProjectBigScreenController extends BaseController {
|
||||
return toAjax(projectService.updatePosition(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目信息
|
||||
*/
|
||||
@GetMapping("/getProjectInfo/{projectId}")
|
||||
public R<ProjectInfo> getProjectInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
BusProjectVo projectVo = projectService.queryById(projectId);
|
||||
ProjectInfo info = new ProjectInfo();
|
||||
info.setLat(projectVo.getLat());
|
||||
info.setLng(projectVo.getLng());
|
||||
info.setPlan(projectVo.getPlan());
|
||||
info.setPosition(projectVo.getPosition());
|
||||
info.setProjectId(projectVo.getId().toString());
|
||||
return R.ok(info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询项目地域分散图
|
||||
@ -372,4 +400,12 @@ public class ProjectBigScreenController extends BaseController {
|
||||
return R.ok(projectBigScreenService.getInfoData(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设施-红线列表
|
||||
*/
|
||||
@GetMapping("/redLine/list")
|
||||
public TableDataInfo<FacRedLineVo> list(FacRedLineBo bo, PageQuery pageQuery) {
|
||||
return facRedLineService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||
import org.dromara.bigscreen.service.ISysRoleWorkService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色流程对应
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bigscreen/roleWork")
|
||||
public class SysRoleWorkController extends BaseController {
|
||||
|
||||
private final ISysRoleWorkService sysRoleWorkService;
|
||||
|
||||
/**
|
||||
* 查询角色流程对应列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysRoleWorkVo> list(SysRoleWorkBo bo, PageQuery pageQuery) {
|
||||
return sysRoleWorkService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色流程对应列表
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:export")
|
||||
@Log(title = "角色流程对应", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysRoleWorkBo bo, HttpServletResponse response) {
|
||||
List<SysRoleWorkVo> list = sysRoleWorkService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "角色流程对应", SysRoleWorkVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色流程对应详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysRoleWorkVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(sysRoleWorkService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色流程对应
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:add")
|
||||
@Log(title = "角色流程对应", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysRoleWorkBo bo) {
|
||||
return toAjax(sysRoleWorkService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色流程对应
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:edit")
|
||||
@Log(title = "角色流程对应", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysRoleWorkBo bo) {
|
||||
return toAjax(sysRoleWorkService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色流程对应
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bigscreen:roleWork:remove")
|
||||
@Log(title = "角色流程对应", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(sysRoleWorkService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package org.dromara.bigscreen.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 备忘录对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_bwl")
|
||||
public class BusBwl extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package org.dromara.bigscreen.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 实用工具对象 bus_sygj
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_sygj")
|
||||
public class BusSygj extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工具名
|
||||
*/
|
||||
private String gjm;
|
||||
|
||||
/**
|
||||
* 工具路径
|
||||
*/
|
||||
private String gjUrl;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
/**
|
||||
* 工具类型 1内部 ,2外部
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*/
|
||||
private String gnms;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package org.dromara.bigscreen.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文件中心对象 bus_wjzx
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_wjzx")
|
||||
public class BusWjzx extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String wjm;
|
||||
|
||||
/**
|
||||
* 文件上传路径
|
||||
*/
|
||||
private String wjId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private String wjlx;
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
private String gnms;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package org.dromara.bigscreen.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 角色流程对应对象 sys_role_work
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_role_work")
|
||||
public class SysRoleWork extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 绑定角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String lcmc;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String lcms;
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
*/
|
||||
private String lcxq;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package org.dromara.bigscreen.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 角色流程对应业务对象 sys_role_work
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = SysRoleWork.class, reverseConvertGenerate = false)
|
||||
public class SysRoleWorkBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 绑定角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String lcmc;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String lcms;
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
*/
|
||||
private String lcxq;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 备忘录业务对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusBwl.class, reverseConvertGenerate = false)
|
||||
public class BusBwlBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@NotNull(message = "备忘录ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusSygj;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 实用工具业务对象 bus_sygj
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusSygj.class, reverseConvertGenerate = false)
|
||||
public class BusSygjBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工具名
|
||||
*/
|
||||
private String gjm;
|
||||
|
||||
/**
|
||||
* 工具路径
|
||||
*/
|
||||
private String gjUrl;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
/**
|
||||
* 工具类型 1内部 ,2外部
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*/
|
||||
private String gnms;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 文件中心业务对象 bus_wjzx
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusWjzx.class, reverseConvertGenerate = false)
|
||||
public class BusWjzxBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String wjm;
|
||||
|
||||
/**
|
||||
* 文件上传路径
|
||||
*/
|
||||
private String wjId;
|
||||
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
private String gnms;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private String wjlx;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-03 18:53
|
||||
*/
|
||||
@Data
|
||||
public class ProjectImageProgressDetailReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2943732963243838829L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目主键不能为空")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 进度名称
|
||||
*/
|
||||
@NotNull(message = "进度名称不能为空")
|
||||
private String progressName;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TaskInfoDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 列表对象
|
||||
*/
|
||||
private List<FlowTaskVo> list;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Long total;
|
||||
|
||||
/**
|
||||
* 本周数
|
||||
*/
|
||||
private Long weekCount;
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 备忘录视图对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusBwl.class)
|
||||
public class BusBwlVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@ExcelProperty(value = "备忘录ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ExcelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=:未完成,1=:已完成")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划开始时间")
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划结束时间")
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusSygj;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 实用工具视图对象 bus_sygj
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusSygj.class)
|
||||
public class BusSygjVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工具名
|
||||
*/
|
||||
@ExcelProperty(value = "工具名")
|
||||
private String gjm;
|
||||
|
||||
/**
|
||||
* 工具路径
|
||||
*/
|
||||
@ExcelProperty(value = "工具路径")
|
||||
private String gjUrl;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
@ExcelProperty(value = "审核标志")
|
||||
private String auditStatus;
|
||||
|
||||
/**
|
||||
* 工具类型 1内部 ,2外部
|
||||
*/
|
||||
@ExcelProperty(value = "工具类型 1内部 ,2外部")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*/
|
||||
@ExcelProperty(value = "功能描述")
|
||||
private String gnms;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文件中心视图对象 bus_wjzx
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusWjzx.class)
|
||||
public class BusWjzxVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ExcelProperty(value = "文件名")
|
||||
private String wjm;
|
||||
|
||||
/**
|
||||
* 文件上传路径
|
||||
*/
|
||||
@ExcelProperty(value = "文件上传路径")
|
||||
private String wjId;
|
||||
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
private String gnms;
|
||||
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private String wjlx;
|
||||
|
||||
/**
|
||||
* 审核标志
|
||||
*/
|
||||
@ExcelProperty(value = "审核标志")
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-06 14:28
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MilestoneVo {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 对应项目结构
|
||||
*/
|
||||
private Long projectStructure;
|
||||
|
||||
/**
|
||||
* 对应项目结构名称
|
||||
*/
|
||||
private String projectStructureName;
|
||||
|
||||
/**
|
||||
* 预计开始时间
|
||||
*/
|
||||
private LocalDate planStartDate;
|
||||
|
||||
/**
|
||||
* 预计结束时间
|
||||
*/
|
||||
private LocalDate planEndDate;
|
||||
|
||||
/**
|
||||
* 实际开始时间
|
||||
*/
|
||||
private LocalDate practicalStartDate;
|
||||
|
||||
/**
|
||||
* 实际结束时间
|
||||
*/
|
||||
private LocalDate practicalEndDate;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-06 10:01
|
||||
*/
|
||||
@Data
|
||||
public class MyProjectInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2737004515142334438L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 项目概括
|
||||
*/
|
||||
private String projectGeneralize;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDate StartTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDate endTime;
|
||||
|
||||
/**
|
||||
* 里程碑
|
||||
*/
|
||||
private List<MilestoneVo> milestones;
|
||||
|
||||
/**
|
||||
* 进度
|
||||
*/
|
||||
private BigDecimal progress;
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-03 16:34
|
||||
*/
|
||||
@Data
|
||||
public class ProjectImageProgressDetailVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8317739851423164942L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 进度名称
|
||||
*/
|
||||
private String progressName;
|
||||
|
||||
/**
|
||||
* 计划进度
|
||||
*/
|
||||
private BigDecimal planProgress;
|
||||
|
||||
/**
|
||||
* 实际进度
|
||||
*/
|
||||
private BigDecimal actualProgress;
|
||||
|
||||
/**
|
||||
* 总进度
|
||||
*/
|
||||
private BigDecimal totalProgress;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@ -26,6 +26,16 @@ public class ProjectImageProgressVo implements Serializable {
|
||||
*/
|
||||
private BigDecimal progressTotal;
|
||||
|
||||
/**
|
||||
* 产值
|
||||
*/
|
||||
private BigDecimal valueTotal;
|
||||
|
||||
/**
|
||||
* 产值百分比
|
||||
*/
|
||||
private BigDecimal valuePercentage;
|
||||
|
||||
/**
|
||||
* 场区百分比
|
||||
*/
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-10-22 15:00
|
||||
*/
|
||||
@Data
|
||||
public class ProjectInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8436930470114636496L;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String lng;
|
||||
|
||||
/**
|
||||
* 计划
|
||||
*/
|
||||
private String plan;
|
||||
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String position;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private String projectId;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 角色流程对应视图对象 sys_role_work
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = SysRoleWork.class)
|
||||
public class SysRoleWorkVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ExcelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 绑定角色ID
|
||||
*/
|
||||
@ExcelProperty(value = "绑定角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@ExcelProperty(value = "流程名称")
|
||||
private String lcmc;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
@ExcelProperty(value = "流程描述")
|
||||
private String lcms;
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
*/
|
||||
@ExcelProperty(value = "流程详情")
|
||||
private String lcxq;
|
||||
|
||||
|
||||
}
|
||||
@ -5,7 +5,10 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.service.IAsyncMessageHandlerService;
|
||||
import org.dromara.common.websocket.dto.WebSocketMessageDto;
|
||||
import org.dromara.common.websocket.holder.WebSocketSessionHolder;
|
||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||
import org.dromara.drone.domain.DroProjectDrone;
|
||||
import org.dromara.drone.service.IDroProjectDroneService;
|
||||
@ -17,25 +20,18 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Redis消息监听器,用于处理订阅频道收到的消息
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RedisMessageListener implements MessageListener {
|
||||
|
||||
@Lazy
|
||||
private final StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
// 注入异步消息处理服务
|
||||
@Resource
|
||||
@Lazy
|
||||
private IDroProjectDroneService droProjectDroneService;
|
||||
|
||||
// 构造函数注入StringRedisTemplate
|
||||
public RedisMessageListener(StringRedisTemplate stringRedisTemplate) {
|
||||
this.stringRedisTemplate = stringRedisTemplate;
|
||||
}
|
||||
|
||||
private IAsyncMessageHandlerService asyncMessageHandlerService;
|
||||
/**
|
||||
* 处理接收到的消息
|
||||
* @param message 消息对象
|
||||
@ -43,50 +39,19 @@ public class RedisMessageListener implements MessageListener {
|
||||
*/
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
// 处理消息
|
||||
// System.out.println("返回:"+stringRedisTemplate.getStringSerializer().deserialize(message.getBody()));
|
||||
String gateway = JSONUtil.parseObj(stringRedisTemplate.getStringSerializer().deserialize(message.getBody())).getStr("gateway");
|
||||
String key = "";
|
||||
if (JSONUtil.parseObj(stringRedisTemplate.getStringSerializer().deserialize(message.getBody())).getJSONObject("data").get("job_number") != null) {
|
||||
key = "wrj:osd1:"+gateway;
|
||||
}else if (JSONUtil.parseObj(stringRedisTemplate.getStringSerializer().deserialize(message.getBody())).getJSONObject("data").get("wireless_link") != null) {
|
||||
key = "wrj:osd2:"+gateway;
|
||||
}else if (JSONUtil.parseObj(stringRedisTemplate.getStringSerializer().deserialize(message.getBody())).getJSONObject("data").get("network_state") != null) {
|
||||
key = "wrj:osd3:"+gateway;
|
||||
DroProjectDrone droProjectDrone = droProjectDroneService.getBaseMapper().selectOne(new LambdaQueryWrapper<DroProjectDrone>().eq(DroProjectDrone::getDroneSn, gateway));
|
||||
setWs(message, gateway, droProjectDrone);
|
||||
}else{
|
||||
key = "wrj:osd4:"+gateway;
|
||||
DroProjectDrone droProjectDrone = droProjectDroneService.getBaseMapper().selectOne(new LambdaQueryWrapper<DroProjectDrone>().eq(DroProjectDrone::getDroneSn, gateway));
|
||||
setWs(message, gateway, droProjectDrone);
|
||||
try {
|
||||
// 1. 快速日志记录(证明监听到消息)
|
||||
log.info("【Redis消息监听】收到消息,长度:{}字节,提交异步处理", message.getBody().length);
|
||||
|
||||
// 2. 提交给异步服务处理(核心:线程分离,监听线程立即返回)
|
||||
asyncMessageHandlerService.handleRedisMessageAsync(message);
|
||||
|
||||
} catch (Exception e) {
|
||||
// 捕获提交过程中的异常(如异步服务注入失败)
|
||||
log.error("【Redis消息监听】提交异步处理失败", e);
|
||||
}
|
||||
stringRedisTemplate
|
||||
.opsForValue()
|
||||
.set(key
|
||||
, Objects.requireNonNull(stringRedisTemplate.getStringSerializer().deserialize(message.getBody())));
|
||||
|
||||
}
|
||||
|
||||
private void setWs(Message message, String gateway, DroProjectDrone droProjectDrone) {
|
||||
String pushContent = buildPushMessage(gateway,stringRedisTemplate.getStringSerializer().deserialize(message.getBody()), droProjectDrone.getProjectId());
|
||||
// 发送给指定用户(equipment.getUserId())
|
||||
WebSocketMessageDto messageDto = new WebSocketMessageDto();
|
||||
messageDto.setMessage(pushContent);
|
||||
messageDto.setSessionKeys(Collections.singletonList(droProjectDrone.getProjectId()));
|
||||
WebSocketUtils.publishMessage(messageDto);
|
||||
}
|
||||
|
||||
private String buildPushMessage(String key, String message, Long projectId) {
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "wrj_DATA_UPDATE");
|
||||
messageObj.put("projectId",projectId.toString());
|
||||
messageObj.put("clientId",key);
|
||||
// 位置信息
|
||||
JSONObject locationObj = new JSONObject();
|
||||
locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
||||
locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
||||
messageObj.put("location", locationObj);
|
||||
return messageObj.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,20 @@
|
||||
package org.dromara.bigscreen.manager;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.websocket.websocket.service.InitOnStartWebSocketServer;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.drone.domain.DroProjectDrone;
|
||||
import org.dromara.drone.service.IDroProjectDroneService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.redis.listener.PatternTopic;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.listener.ChannelTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -39,17 +41,24 @@ public class RedisSubscribeManager {
|
||||
private IDroProjectDroneService droProjectDroneService;
|
||||
|
||||
// 3. 维护已订阅的主题关系:key=完整主题(如wrj:8UUXN4P00A06NK),value=对应的PatternTopic
|
||||
private final Map<String, PatternTopic> subscribedTopics = new ConcurrentHashMap<>();
|
||||
private final Map<String, ChannelTopic> subscribedTopics = new ConcurrentHashMap<>();
|
||||
|
||||
// 定义锁对象
|
||||
private final Object lock = new Object();
|
||||
|
||||
// 注入 RedisConnectionFactory
|
||||
@Resource
|
||||
private RedisConnectionFactory redisConnectionFactory;
|
||||
|
||||
|
||||
/**
|
||||
* 项目启动后立即执行一次订阅(避免等待定时任务首次执行)
|
||||
*/
|
||||
@PostConstruct
|
||||
// @PostConstruct
|
||||
public void initSubscribe() {
|
||||
log.info("项目启动,初始化Redis订阅...");
|
||||
// 步骤1:从数据库获取最新的主题列表(原逻辑:getTopicsByKeyPrefix)
|
||||
List<String> latestKeys = droProjectDroneService.getTopicsByKeyPrefix();
|
||||
List<DroProjectDrone> latestKeys = droProjectDroneService.getBaseMapper().selectList(new LambdaQueryWrapper<DroProjectDrone>().groupBy(DroProjectDrone::getDroneSn));
|
||||
if (latestKeys == null || latestKeys.isEmpty()) {
|
||||
log.warn("未获取到任何主题,将取消所有现有订阅");
|
||||
cancelAllSubscribes();
|
||||
@ -58,11 +67,13 @@ public class RedisSubscribeManager {
|
||||
|
||||
// 步骤2:构建最新的完整主题(格式:wrj:key)
|
||||
Set<String> latestFullTopics = new HashSet<>();
|
||||
for (String key : latestKeys) {
|
||||
latestFullTopics.add("wrj:osd1:" + key);
|
||||
latestFullTopics.add("wrj:osd2:" + key);
|
||||
latestFullTopics.add("wrj:osd3:" + key);
|
||||
latestFullTopics.add("wrj:osd4:" + key);
|
||||
for (DroProjectDrone key : latestKeys) {
|
||||
latestFullTopics.add("wrj:osd1:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd2:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd3:" + key.getDroneSn());
|
||||
if (key.getAirplaneSn() != null && !key.getAirplaneSn().isEmpty()) {
|
||||
latestFullTopics.add("wrj:osd4:" + key.getAirplaneSn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +88,7 @@ public class RedisSubscribeManager {
|
||||
* 4. 定时任务:定期更新订阅(每5分钟执行一次,可调整cron表达式)
|
||||
* cron格式:秒 分 时 日 月 周 年(示例:0 0/5 * * * ? 表示每5分钟)
|
||||
*/
|
||||
@Scheduled(cron = "0 0/6 * * * ?")
|
||||
// @Scheduled(cron = "0 0/6 * * * ?")
|
||||
public void dynamicUpdateSubscribe() {
|
||||
try {
|
||||
Object object = RedisUtils.getCacheObject("xmjdap:ws");
|
||||
@ -94,7 +105,7 @@ public class RedisSubscribeManager {
|
||||
return;
|
||||
}
|
||||
// 步骤1:从数据库获取最新的主题列表(原逻辑:getTopicsByKeyPrefix)
|
||||
List<String> latestKeys = droProjectDroneService.getTopicsByKeyPrefix();
|
||||
List<DroProjectDrone> latestKeys = droProjectDroneService.getBaseMapper().selectList(new LambdaQueryWrapper<DroProjectDrone>().groupBy(DroProjectDrone::getDroneSn));
|
||||
if (latestKeys == null || latestKeys.isEmpty()) {
|
||||
log.warn("定时任务未获取到任何主题,将取消所有现有订阅");
|
||||
cancelAllSubscribes();
|
||||
@ -103,11 +114,13 @@ public class RedisSubscribeManager {
|
||||
|
||||
// 步骤2:构建最新的完整主题(格式:wrj:key)
|
||||
Set<String> latestFullTopics = new HashSet<>();
|
||||
for (String key : latestKeys) {
|
||||
latestFullTopics.add("wrj:osd1:" + key);
|
||||
latestFullTopics.add("wrj:osd2:" + key);
|
||||
latestFullTopics.add("wrj:osd3:" + key);
|
||||
latestFullTopics.add("wrj:osd4:" + key);
|
||||
for (DroProjectDrone key : latestKeys) {
|
||||
latestFullTopics.add("wrj:osd1:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd2:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd3:" + key.getDroneSn());
|
||||
if (key.getAirplaneSn() != null && !key.getAirplaneSn().isEmpty()) {
|
||||
latestFullTopics.add("wrj:osd4:" + key.getAirplaneSn());
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤3:对比现有订阅,删除过期主题
|
||||
@ -123,10 +136,71 @@ public class RedisSubscribeManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "0/10 * * * * ?")
|
||||
// @JobExecutor(name = "ueWsConnect")
|
||||
public void ueWsConnect() {
|
||||
synchronized (lock) { // 确保同一时间只有一个线程修改
|
||||
try {
|
||||
int onlineCount = InitOnStartWebSocketServer.getOnlineCount();
|
||||
Object object = RedisUtils.getCacheObject("xmjdap:ws");
|
||||
log.info("开始执行Redis订阅更新定时任务...");
|
||||
if (onlineCount == 0 && object == null) {
|
||||
cancelAllSubscribes();
|
||||
return;
|
||||
}
|
||||
if (object != null) {
|
||||
long oldTime = Long.parseLong(String.valueOf(object));
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - oldTime > 300000) {
|
||||
RedisUtils.deleteObject("xmjdap:ws");
|
||||
cancelAllSubscribes();
|
||||
return;
|
||||
}
|
||||
log.info("Redis时间缓存更新定时任务");
|
||||
}
|
||||
// 步骤1:从数据库获取最新的主题列表(原逻辑:getTopicsByKeyPrefix)
|
||||
List<DroProjectDrone> latestKeys = droProjectDroneService.getBaseMapper().selectList(new LambdaQueryWrapper<DroProjectDrone>().groupBy(DroProjectDrone::getDroneSn));
|
||||
if (latestKeys == null || latestKeys.isEmpty()) {
|
||||
log.warn("定时任务未获取到任何主题,将取消所有现有订阅");
|
||||
cancelAllSubscribes();
|
||||
return;
|
||||
}
|
||||
|
||||
// 步骤2:构建最新的完整主题(格式:wrj:key)
|
||||
Set<String> latestFullTopics = new HashSet<>();
|
||||
for (DroProjectDrone key : latestKeys) {
|
||||
latestFullTopics.add("wrj:osd1:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd2:" + key.getDroneSn());
|
||||
latestFullTopics.add("wrj:osd3:" + key.getDroneSn());
|
||||
if (key.getAirplaneSn() != null && !key.getAirplaneSn().isEmpty()) {
|
||||
latestFullTopics.add("wrj:osd4:" + key.getAirplaneSn());
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤3:对比现有订阅,删除过期主题
|
||||
cancelExpiredSubscribes(latestFullTopics);
|
||||
|
||||
// 步骤4:对比现有订阅,新增未订阅的主题
|
||||
addNewSubscribes(latestFullTopics);
|
||||
|
||||
log.info("Redis订阅更新完成,当前已订阅主题数:{}", subscribedTopics.size());
|
||||
} catch (Exception e) {
|
||||
log.error("Redis订阅更新定时任务执行失败", e);
|
||||
// 异常时不修改现有订阅,避免误删
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消过期的订阅(现有订阅不在最新列表中的主题)
|
||||
*/
|
||||
private void cancelExpiredSubscribes(Set<String> latestFullTopics) {
|
||||
public void cancelExpiredSubscribes(Set<String> latestFullTopics) {
|
||||
synchronized (lock) { // 确保同一时间只有一个线程修改
|
||||
if (!redisMessageListenerContainer.isRunning()) {
|
||||
log.error("RedisMessageListenerContainer 未运行,无法取消订阅");
|
||||
return;
|
||||
}
|
||||
// 遍历现有订阅,找出需要删除的主题
|
||||
Set<String> expiredTopics = subscribedTopics.keySet().stream()
|
||||
.filter(topic -> !latestFullTopics.contains(topic))
|
||||
@ -139,7 +213,7 @@ public class RedisSubscribeManager {
|
||||
|
||||
// 取消每个过期主题的订阅
|
||||
for (String expiredTopic : expiredTopics) {
|
||||
PatternTopic topic = subscribedTopics.get(expiredTopic);
|
||||
ChannelTopic topic = subscribedTopics.get(expiredTopic);
|
||||
if (topic != null) {
|
||||
// 从容器中移除监听器(取消订阅)
|
||||
redisMessageListenerContainer.removeMessageListener(redisMessageListenerAdapter, topic);
|
||||
@ -148,11 +222,25 @@ public class RedisSubscribeManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增未订阅的主题(最新列表中有但现有订阅没有的主题)
|
||||
*/
|
||||
private void addNewSubscribes(Set<String> latestFullTopics) {
|
||||
public void addNewSubscribes(Set<String> latestFullTopics) {
|
||||
synchronized (lock) { // 确保同一时间只有一个线程修改
|
||||
if (!redisMessageListenerContainer.isRunning()) {
|
||||
log.error("RedisMessageListenerContainer 未运行,无法添加订阅");
|
||||
return;
|
||||
}
|
||||
// // 测试 Redis 连接
|
||||
// try (RedisConnection conn = redisConnectionFactory.getConnection()) {
|
||||
// conn.ping(); // 发送 ping 命令,验证连接
|
||||
// log.info("Redis 连接正常,可执行命令");
|
||||
// } catch (Exception e) {
|
||||
// log.error("Redis 连接失败,无法订阅主题", e);
|
||||
// return; // 连接失败,终止订阅
|
||||
// }
|
||||
// 遍历最新主题,找出需要新增的主题
|
||||
Set<String> newTopics = latestFullTopics.stream()
|
||||
.filter(topic -> !subscribedTopics.containsKey(topic))
|
||||
@ -162,16 +250,21 @@ public class RedisSubscribeManager {
|
||||
log.info("无新增订阅主题,无需添加");
|
||||
return;
|
||||
}
|
||||
// Object delegate = redisMessageListenerAdapter.getDelegate();
|
||||
// log.info("适配器绑定的监听器实例:{}",
|
||||
// delegate.getClass().getName());
|
||||
|
||||
// 为每个新主题添加订阅
|
||||
for (String newTopic : newTopics) {
|
||||
PatternTopic topic = new PatternTopic(newTopic);
|
||||
ChannelTopic topic = new ChannelTopic(newTopic);
|
||||
// 向容器中添加监听器(新增订阅)
|
||||
// log.info("添加订阅前,容器状态:{}", redisMessageListenerContainer.isRunning() ? "运行中" : "已停止");
|
||||
redisMessageListenerContainer.addMessageListener(redisMessageListenerAdapter, topic);
|
||||
subscribedTopics.put(newTopic, topic);
|
||||
log.info("已新增订阅:{}", newTopic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消所有现有订阅(兜底方法)
|
||||
@ -181,7 +274,7 @@ public class RedisSubscribeManager {
|
||||
return;
|
||||
}
|
||||
// 遍历所有已订阅主题,取消订阅
|
||||
for (Map.Entry<String, PatternTopic> entry : subscribedTopics.entrySet()) {
|
||||
for (Map.Entry<String, ChannelTopic> entry : subscribedTopics.entrySet()) {
|
||||
redisMessageListenerContainer.removeMessageListener(redisMessageListenerAdapter, entry.getValue());
|
||||
log.info("已取消订阅:{}", entry.getKey());
|
||||
}
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package org.dromara.bigscreen.manager;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 项目启动完成后执行 Redis 订阅初始化
|
||||
*/
|
||||
@Component
|
||||
public class RedisSubscribeStartupRunner implements ApplicationRunner {
|
||||
|
||||
// 注入 Redis 订阅管理器
|
||||
@Resource
|
||||
private RedisSubscribeManager redisSubscribeManager;
|
||||
|
||||
/**
|
||||
* 项目完全启动后执行(替代 @PostConstruct)
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
// 此时 Spring 容器已完全启动,所有组件就绪
|
||||
redisSubscribeManager.initSubscribe();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package org.dromara.bigscreen.mapper;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 备忘录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface BusBwlMapper extends BaseMapperPlus<BusBwl, BusBwlVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.bigscreen.mapper;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusSygj;
|
||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 实用工具Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface BusSygjMapper extends BaseMapperPlus<BusSygj, BusSygjVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.bigscreen.mapper;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 文件中心Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface BusWjzxMapper extends BaseMapperPlus<BusWjzx, BusWjzxVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.bigscreen.mapper;
|
||||
|
||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 角色流程对应Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
public interface SysRoleWorkMapper extends BaseMapperPlus<SysRoleWork, SysRoleWorkVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.springframework.data.redis.connection.Message;
|
||||
|
||||
/**
|
||||
* 异步消息处理服务接口(扩展原有接口,增加Redis消息处理方法)
|
||||
*/
|
||||
public interface IAsyncMessageHandlerService {
|
||||
/**
|
||||
* 异步处理Redis消息(核心:接收Message对象,处理业务逻辑)
|
||||
* @param message Redis消息对象
|
||||
*/
|
||||
void handleRedisMessageAsync(Message message);
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备忘录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface IBusBwlService extends IService<BusBwl>{
|
||||
|
||||
/**
|
||||
* 查询备忘录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 备忘录
|
||||
*/
|
||||
BusBwlVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 备忘录分页列表
|
||||
*/
|
||||
TableDataInfo<BusBwlVo> queryPageList(BusBwlBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 备忘录列表
|
||||
*/
|
||||
List<BusBwlVo> queryList(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除备忘录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
TableDataInfo<BusBwlVo> queryPageListbwl(BusBwlBo bo, PageQuery pageQuery);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||
import org.dromara.bigscreen.domain.BusSygj;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实用工具Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface IBusSygjService extends IService<BusSygj>{
|
||||
|
||||
/**
|
||||
* 查询实用工具
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实用工具
|
||||
*/
|
||||
BusSygjVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询实用工具列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 实用工具分页列表
|
||||
*/
|
||||
TableDataInfo<BusSygjVo> queryPageList(BusSygjBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的实用工具列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 实用工具列表
|
||||
*/
|
||||
List<BusSygjVo> queryList(BusSygjBo bo);
|
||||
|
||||
/**
|
||||
* 新增实用工具
|
||||
*
|
||||
* @param bo 实用工具
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusSygjBo bo);
|
||||
|
||||
/**
|
||||
* 修改实用工具
|
||||
*
|
||||
* @param bo 实用工具
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusSygjBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除实用工具信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件中心Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface IBusWjzxService extends IService<BusWjzx>{
|
||||
|
||||
/**
|
||||
* 查询文件中心
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 文件中心
|
||||
*/
|
||||
BusWjzxVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询文件中心列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 文件中心分页列表
|
||||
*/
|
||||
TableDataInfo<BusWjzxVo> queryPageList(BusWjzxBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的文件中心列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 文件中心列表
|
||||
*/
|
||||
List<BusWjzxVo> queryList(BusWjzxBo bo);
|
||||
|
||||
/**
|
||||
* 新增文件中心
|
||||
*
|
||||
* @param bo 文件中心
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusWjzxBo bo);
|
||||
|
||||
/**
|
||||
* 修改文件中心
|
||||
*
|
||||
* @param bo 文件中心
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusWjzxBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除文件中心信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色流程对应Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
public interface ISysRoleWorkService extends IService<SysRoleWork>{
|
||||
|
||||
/**
|
||||
* 查询角色流程对应
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 角色流程对应
|
||||
*/
|
||||
SysRoleWorkVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询角色流程对应列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 角色流程对应分页列表
|
||||
*/
|
||||
TableDataInfo<SysRoleWorkVo> queryPageList(SysRoleWorkBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的角色流程对应列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 角色流程对应列表
|
||||
*/
|
||||
List<SysRoleWorkVo> queryList(SysRoleWorkBo bo);
|
||||
|
||||
/**
|
||||
* 新增角色流程对应
|
||||
*
|
||||
* @param bo 角色流程对应
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(SysRoleWorkBo bo);
|
||||
|
||||
/**
|
||||
* 修改角色流程对应
|
||||
*
|
||||
* @param bo 角色流程对应
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(SysRoleWorkBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除角色流程对应信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.dto.TanchuangInfoReq;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressDetailVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
@ -66,6 +68,14 @@ public interface ProjectBigScreenService {
|
||||
*/
|
||||
List<ProjectImageProgressVo> getProjectImageProgress(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取项目形象进度详情
|
||||
*
|
||||
* @param req 项目形象进度名称
|
||||
* @return 项目形象进度详情
|
||||
*/
|
||||
List<ProjectImageProgressDetailVo> getProjectImageProgressDetail(ProjectImageProgressDetailReq req);
|
||||
|
||||
/**
|
||||
* 获取项目概括
|
||||
*
|
||||
@ -79,6 +89,7 @@ public interface ProjectBigScreenService {
|
||||
void setList(GpsEquipmentBo bo);
|
||||
|
||||
List<Map<String, Object>> getClientList(Long projectId);
|
||||
List<String> getUeClientList();
|
||||
|
||||
/**
|
||||
* 更新无人机缓存
|
||||
|
||||
@ -0,0 +1,181 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.service.IAsyncMessageHandlerService;
|
||||
import org.dromara.common.websocket.dto.WebSocketMessageDto;
|
||||
import org.dromara.common.websocket.holder.WebSocketSessionHolder;
|
||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||
import org.dromara.drone.domain.DroProjectDrone;
|
||||
import org.dromara.drone.mapper.DroProjectDroneMapper;
|
||||
import org.dromara.websocket.websocket.service.InitOnStartWebSocketServer;
|
||||
import org.springframework.data.redis.connection.Message;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 异步消息处理实现(核心:原onMessage逻辑迁移至此)
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerService {
|
||||
|
||||
@Resource
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
@Resource
|
||||
private DroProjectDroneMapper droProjectDroneMapper; // 直接注入Mapper,减少Service层调用开销
|
||||
|
||||
/**
|
||||
* 异步处理消息(指定线程池:messageAsyncExecutor)
|
||||
*/
|
||||
@Override
|
||||
@Async("messageAsyncExecutor")
|
||||
public void handleRedisMessageAsync(Message message) {
|
||||
try {
|
||||
// 1. 解析消息体(只解析一次,避免重复操作)
|
||||
byte[] messageBody = message.getBody();
|
||||
if (messageBody == null || messageBody.length == 0) {
|
||||
log.warn("【异步消息处理】消息体为空,忽略处理");
|
||||
return;
|
||||
}
|
||||
String messageContent = stringRedisTemplate.getStringSerializer().deserialize(messageBody);
|
||||
if (messageContent == null) {
|
||||
log.warn("【异步消息处理】消息反序列化失败,内容:{}", new String(messageBody));
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 解析JSON(使用框架兼容的JSONUtil,处理可能的解析异常)
|
||||
JSONObject messageJson;
|
||||
try {
|
||||
messageJson = JSONUtil.parseObj(messageContent);
|
||||
} catch (Exception e) {
|
||||
log.error("【异步消息处理】JSON解析失败,内容:{}", messageContent, e);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 获取gateway字段(核心业务参数)
|
||||
String gateway = messageJson.getStr("gateway");
|
||||
if (gateway == null) {
|
||||
log.warn("【异步消息处理】消息缺少gateway字段,内容:{}", messageContent);
|
||||
return;
|
||||
}
|
||||
|
||||
// 4. 解析data字段,判断key类型
|
||||
JSONObject dataJson = messageJson.getJSONObject("data");
|
||||
if (dataJson == null) {
|
||||
log.warn("【异步消息处理】消息缺少data字段,gateway:{}", gateway);
|
||||
return;
|
||||
}
|
||||
|
||||
String key = "";
|
||||
DroProjectDrone droProjectDrone = null;
|
||||
boolean isOsd4 = false;
|
||||
|
||||
// 5. 根据data字段内容判断key类型,并查询无人机信息
|
||||
if (dataJson.get("job_number") != null) {
|
||||
key = "wrj:osd1:" + gateway;
|
||||
} else if (dataJson.get("wireless_link") != null) {
|
||||
key = "wrj:osd2:" + gateway;
|
||||
} else if (dataJson.get("network_state") != null) {
|
||||
key = "wrj:osd3:" + gateway;
|
||||
// 查询无人机信息(使用LambdaQueryWrapper,框架规范)
|
||||
droProjectDrone = droProjectDroneMapper.selectOne(
|
||||
new LambdaQueryWrapper<DroProjectDrone>()
|
||||
.eq(DroProjectDrone::getDroneSn, gateway)
|
||||
);
|
||||
// log.info("【异步消息处理】osd3类型消息,gateway:{}", gateway);
|
||||
// 调用setWs方法(非osd4类型)
|
||||
setWs(messageContent, gateway, droProjectDrone, false);
|
||||
} else {
|
||||
key = "wrj:osd4:" + gateway;
|
||||
droProjectDrone = droProjectDroneMapper.selectOne(
|
||||
new LambdaQueryWrapper<DroProjectDrone>()
|
||||
.eq(DroProjectDrone::getAirplaneSn, gateway)
|
||||
);
|
||||
// log.info("【异步消息处理】osd4类型消息,gateway:{}", gateway);
|
||||
isOsd4 = true;
|
||||
// 调用setWs方法(osd4类型)
|
||||
setWs(messageContent, gateway, droProjectDrone, true);
|
||||
}
|
||||
|
||||
// 6. 存储消息到Redis(使用Objects.requireNonNull避免空指针)
|
||||
stringRedisTemplate.opsForValue().set(key, Objects.requireNonNull(messageContent));
|
||||
// log.info("【异步消息处理】Redis存储成功,key:{}", key);
|
||||
|
||||
} catch (Exception e) {
|
||||
// 捕获所有异常,避免线程终止
|
||||
log.error("【异步消息处理】整体逻辑异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void setWs(String message, String gateway, DroProjectDrone droProjectDrone, boolean b) {
|
||||
//判断是否有连接
|
||||
Set<Long> sessionsAll = WebSocketSessionHolder.getSessionsAll();
|
||||
if (!sessionsAll.isEmpty()) {
|
||||
String pushContent = buildPushMessage(gateway, message, droProjectDrone.getProjectId());
|
||||
// 发送给指定用户(equipment.getUserId())
|
||||
WebSocketMessageDto messageDto = new WebSocketMessageDto();
|
||||
messageDto.setMessage(pushContent);
|
||||
messageDto.setSessionKeys(Collections.singletonList(droProjectDrone.getProjectId()));
|
||||
WebSocketUtils.publishMessage(messageDto);
|
||||
System.out.println("大屏已推送消息");
|
||||
}
|
||||
int onlineCount = InitOnStartWebSocketServer.getOnlineCount();
|
||||
if (onlineCount > 0){
|
||||
String modleId = b ? droProjectDrone.getAirplaneModleId() : droProjectDrone.getDroneModleId();
|
||||
if (modleId != null) {
|
||||
String ued = ueStructureJsonMessage(message, modleId);
|
||||
InitOnStartWebSocketServer.sendToAll(ued);
|
||||
System.out.println("ue已推送消息");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String buildPushMessage(String key, String message, Long projectId) {
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "wrj_DATA_UPDATE");
|
||||
messageObj.put("projectId",projectId.toString());
|
||||
messageObj.put("clientId",key);
|
||||
// 位置信息
|
||||
JSONObject locationObj = new JSONObject();
|
||||
locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
||||
locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
||||
messageObj.put("location", locationObj);
|
||||
return messageObj.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建推送消息内容(String类型)
|
||||
*/
|
||||
private String ueStructureJsonMessage(String message, String modelId) {
|
||||
// 构造消息对象(包含关键信息)
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "location"); // 消息类型
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("id", modelId);
|
||||
|
||||
// 位置信息
|
||||
JSONObject position = new JSONObject();
|
||||
position.put("lat", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度
|
||||
position.put("lng", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度
|
||||
position.put("alt", JSONUtil.parseObj(message).getJSONObject("data").get("height")); // 海拔
|
||||
|
||||
data.put("position", position);
|
||||
messageObj.put("data", data); // 设备唯一标识
|
||||
|
||||
// 转换为String类型返回
|
||||
return messageObj.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.mapper.BusBwlMapper;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 备忘录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusBwlServiceImpl extends ServiceImpl<BusBwlMapper, BusBwl> implements IBusBwlService {
|
||||
|
||||
private final BusBwlMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询备忘录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 备忘录
|
||||
*/
|
||||
@Override
|
||||
public BusBwlVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 备忘录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusBwlVo> queryPageList(BusBwlBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBwlVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BusBwlVo> queryPageListbwl(BusBwlBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
lqw.eq(BusBwl::getCreateBy, LoginHelper.getUserId());
|
||||
Page<BusBwlVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 备忘录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusBwlVo> queryList(BusBwlBo bo) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusBwl> buildQueryWrapper(BusBwlBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusBwl> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusBwl::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BusBwl::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), BusBwl::getContent, bo.getContent());
|
||||
lqw.eq(bo.getStatus() != null, BusBwl::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getCreateBy() != null, BusBwl::getCreateBy, bo.getCreateBy());
|
||||
lqw.eq(bo.getJhkssj() != null, BusBwl::getJhkssj, bo.getJhkssj());
|
||||
lqw.eq(bo.getJhjssj() != null, BusBwl::getJhjssj, bo.getJhjssj());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusBwlBo bo) {
|
||||
BusBwl add = MapstructUtils.convert(bo, BusBwl.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusBwlBo bo) {
|
||||
BusBwl update = MapstructUtils.convert(bo, BusBwl.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBwl entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除备忘录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,195 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||
import org.dromara.bigscreen.domain.BusSygj;
|
||||
import org.dromara.bigscreen.mapper.BusSygjMapper;
|
||||
import org.dromara.bigscreen.service.IBusSygjService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 实用工具Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusSygjServiceImpl extends ServiceImpl<BusSygjMapper, BusSygj> implements IBusSygjService {
|
||||
|
||||
private final BusSygjMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询实用工具
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实用工具
|
||||
*/
|
||||
@Override
|
||||
public BusSygjVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实用工具列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 实用工具分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusSygjVo> queryPageList(BusSygjBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusSygj> lqw = buildQueryWrapper(bo);
|
||||
Page<BusSygjVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的实用工具列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 实用工具列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusSygjVo> queryList(BusSygjBo bo) {
|
||||
LambdaQueryWrapper<BusSygj> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusSygj> buildQueryWrapper(BusSygjBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusSygj> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusSygj::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGjm()), BusSygj::getGjm, bo.getGjm());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGjUrl()), BusSygj::getGjUrl, bo.getGjUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), BusSygj::getAuditStatus, bo.getAuditStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), BusSygj::getType, bo.getType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGnms()), BusSygj::getGnms, bo.getGnms());
|
||||
lqw.eq(bo.getCreateBy() != null, BusSygj::getCreateBy, bo.getCreateBy());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增实用工具
|
||||
*
|
||||
* @param bo 实用工具
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusSygjBo bo) {
|
||||
BusSygj add = MapstructUtils.convert(bo, BusSygj.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实用工具
|
||||
*
|
||||
* @param bo 实用工具
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusSygjBo bo) {
|
||||
BusSygj update = MapstructUtils.convert(bo, BusSygj.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusSygj entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除实用工具信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('grsygj')")
|
||||
public void processPlansHandlErequipmentList(ProcessEvent processEvent) {
|
||||
log.info("文件中心审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
BusSygj vo = baseMapper.selectById(Long.valueOf(id));
|
||||
if (vo == null) {
|
||||
return;
|
||||
}
|
||||
vo.setAuditStatus(processEvent.getStatus());
|
||||
this.updateById(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('grsygj')")
|
||||
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("文件中心审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('grsygj')")
|
||||
public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("文件中心删除流程事件,文件中心审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,202 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.system.service.impl.SysOssServiceImpl;
|
||||
import org.dromara.xzd.biddingManagement.biddingDocument.domain.XzdBiddingFileEstimate;
|
||||
import org.dromara.xzd.biddingManagement.biddingDocument.domain.vo.XzdBiddingFileEstimateVo;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||
import org.dromara.bigscreen.domain.BusWjzx;
|
||||
import org.dromara.bigscreen.mapper.BusWjzxMapper;
|
||||
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文件中心Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusWjzxServiceImpl extends ServiceImpl<BusWjzxMapper, BusWjzx> implements IBusWjzxService {
|
||||
|
||||
private final BusWjzxMapper baseMapper;
|
||||
|
||||
private final SysOssServiceImpl sysOssService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询文件中心
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 文件中心
|
||||
*/
|
||||
@Override
|
||||
public BusWjzxVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询文件中心列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 文件中心分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusWjzxVo> queryPageList(BusWjzxBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusWjzx> lqw = buildQueryWrapper(bo);
|
||||
Page<BusWjzxVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的文件中心列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 文件中心列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusWjzxVo> queryList(BusWjzxBo bo) {
|
||||
LambdaQueryWrapper<BusWjzx> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusWjzx> buildQueryWrapper(BusWjzxBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusWjzx> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusWjzx::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWjm()), BusWjzx::getWjm, bo.getWjm());
|
||||
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), BusWjzx::getAuditStatus, bo.getAuditStatus());
|
||||
lqw.eq(bo.getCreateBy() != null, BusWjzx::getCreateBy, bo.getCreateBy());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件中心
|
||||
*
|
||||
* @param bo 文件中心
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusWjzxBo bo) {
|
||||
BusWjzx add = MapstructUtils.convert(bo, BusWjzx.class);
|
||||
validEntityBeforeSave(add);
|
||||
if (add != null && StringUtils.isNotBlank(add.getWjm())){
|
||||
String[] split = add.getWjm().split("\\.");
|
||||
add.setWjlx(split[split.length - 1]);
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件中心
|
||||
*
|
||||
* @param bo 文件中心
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusWjzxBo bo) {
|
||||
BusWjzx update = MapstructUtils.convert(bo, BusWjzx.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusWjzx entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除文件中心信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
ArrayList<Long> temp = new ArrayList<>();
|
||||
for (Long id : ids) {
|
||||
BusWjzxVo busWjzxVo = baseMapper.selectVoById(id);
|
||||
temp.add(Long.valueOf(busWjzxVo.getWjId()));
|
||||
}
|
||||
sysOssService.deleteWithValidByIds(temp, false);
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('grwjzx')")
|
||||
public void processPlansHandlErequipmentList(ProcessEvent processEvent) {
|
||||
log.info("文件中心审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
BusWjzx vo = baseMapper.selectById(Long.valueOf(id));
|
||||
if (vo == null) {
|
||||
return;
|
||||
}
|
||||
vo.setAuditStatus(processEvent.getStatus());
|
||||
this.updateById(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('grwjzx')")
|
||||
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("文件中心审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('grwjzx')")
|
||||
public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("文件中心删除流程事件,文件中心审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
}
|
||||
@ -4,12 +4,11 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.dto.TanchuangInfoReq;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectTeamAttendanceVo;
|
||||
import org.dromara.bigscreen.domain.vo.*;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
@ -17,9 +16,9 @@ import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.utils.BigDecimalUtil;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.drone.domain.vo.DroProjectDroneVo;
|
||||
import org.dromara.drone.service.IDroProjectDroneService;
|
||||
import org.dromara.gps.domain.bo.GpsEquipmentBo;
|
||||
import org.dromara.gps.domain.vo.DeviceVo;
|
||||
import org.dromara.gps.domain.vo.GpsEquipmentSonVo;
|
||||
import org.dromara.gps.domain.vo.LocationVo;
|
||||
import org.dromara.gps.service.IDeviceService;
|
||||
@ -286,13 +285,19 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
// 如果有叶子节点,统计进度和状态;否则初始化为未完成
|
||||
if (CollUtil.isNotEmpty(leafNodesByTopIds)) {
|
||||
topVo.setProgressTotal(progressCategoryService.getCompletedPercentage(leafNodesByTopIds));
|
||||
topVo.setValueTotal(progressCategoryService.getValueTotal(leafNodesByTopIds, true));
|
||||
} else {
|
||||
topVo.setProgressTotal(BigDecimal.ZERO);
|
||||
topVo.setValueTotal(BigDecimal.ZERO);
|
||||
}
|
||||
// 加入结果集
|
||||
topList.add(topVo);
|
||||
}
|
||||
}
|
||||
// 计算总完成产值
|
||||
BigDecimal valueTotal = topList.stream().map(ProjectImageProgressVo::getValueTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
topList.forEach(vo -> vo.setValuePercentage(BigDecimalUtil.toPercentage(vo.getValueTotal(), valueTotal)));
|
||||
return topList;
|
||||
/* ProjectImageProgressVo vo = new ProjectImageProgressVo();
|
||||
// 获取所有子项目列表
|
||||
@ -422,6 +427,110 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
return vo;*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目形象进度详情
|
||||
*
|
||||
* @param req 项目形象进度名称
|
||||
* @return 项目形象进度详情
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectImageProgressDetailVo> getProjectImageProgressDetail(ProjectImageProgressDetailReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
String progressName = req.getProgressName();
|
||||
checkProject(projectId);
|
||||
// 获取当前项目的所有子级
|
||||
List<BusProject> subProjects = projectService.lambdaQuery()
|
||||
.eq(BusProject::getPId, projectId)
|
||||
.list();
|
||||
Set<Long> projectIds = subProjects.stream().map(BusProject::getId).collect(Collectors.toSet());
|
||||
projectIds.add(projectId);
|
||||
// 获取对应进度
|
||||
PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery()
|
||||
.in(PgsProgressCategory::getProjectId, projectIds)
|
||||
.eq(PgsProgressCategory::getName, progressName)
|
||||
.last("limit 1")
|
||||
.one();
|
||||
if (progressCategory == null) {
|
||||
return List.of();
|
||||
}
|
||||
Long topId = progressCategory.getId();
|
||||
final List<String> gfcqName = List.of("场地平整", "桩基成孔", "桩基浇筑", "支架安装", "组件安装");
|
||||
// 查出所有属于该顶级节点的子孙节点
|
||||
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
||||
Wrappers.<PgsProgressCategory>lambdaQuery()
|
||||
.in(progressName.equals("光伏场区"), PgsProgressCategory::getName, gfcqName)
|
||||
.and(wrapper -> {
|
||||
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
||||
.or()
|
||||
.like(PgsProgressCategory::getAncestors, "," + topId);
|
||||
})
|
||||
);
|
||||
if (allChildren.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (progressName.equals("集电线路")) {
|
||||
Set<Long> parentIds = allChildren.stream()
|
||||
.map(PgsProgressCategory::getParentId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<PgsProgressCategory> dierList = allChildren.stream()
|
||||
.filter(item -> !parentIds.contains(item.getId()))
|
||||
.toList();
|
||||
return dierList.stream().map(c -> {
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
vo.setId(c.getId());
|
||||
vo.setUnit(c.getUnit());
|
||||
vo.setProgressName(c.getName());
|
||||
vo.setPlanProgress(c.getPlanTotal());
|
||||
vo.setActualProgress(c.getCompleted());
|
||||
vo.setTotalProgress(c.getTotal());
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
// 判断层级
|
||||
Set<Long> parentIds = allChildren.stream()
|
||||
.map(PgsProgressCategory::getParentId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<PgsProgressCategory> dierList = allChildren.stream()
|
||||
.filter(item -> parentIds.contains(item.getId()))
|
||||
.toList();
|
||||
if (CollUtil.isEmpty(dierList)) {
|
||||
return allChildren.stream().map(c -> {
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
vo.setId(c.getId());
|
||||
vo.setUnit(c.getUnit());
|
||||
vo.setProgressName(c.getName());
|
||||
vo.setPlanProgress(c.getPlanTotal());
|
||||
vo.setActualProgress(c.getCompleted());
|
||||
vo.setTotalProgress(c.getTotal());
|
||||
return vo;
|
||||
}).toList();
|
||||
} else {
|
||||
return dierList.stream().map(c -> {
|
||||
// 获取子集
|
||||
List<PgsProgressCategory> children = allChildren.stream()
|
||||
.filter(item -> item.getParentId().equals(c.getId()))
|
||||
.toList();
|
||||
// 计算
|
||||
BigDecimal plan = children.stream().map(PgsProgressCategory::getPlanTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal actual = children.stream().map(PgsProgressCategory::getCompleted)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
vo.setId(c.getId());
|
||||
vo.setUnit(c.getUnit());
|
||||
vo.setProgressName(c.getName());
|
||||
vo.setPlanProgress(plan);
|
||||
vo.setActualProgress(actual);
|
||||
vo.setTotalProgress(total);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目概括
|
||||
*
|
||||
@ -625,6 +734,111 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
return maps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getUeClientList() {
|
||||
// 获取当天的开始时间(00:00:00)
|
||||
LocalDateTime startOfDay = LocalDateTime.now().with(LocalTime.MIN);
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<GpsEquipmentSonVo> voList = gpsEquipmentService.getUeClientList(startOfDay, now);
|
||||
List<GpsEquipmentSonVo> appList = gpsEquipmentService.getUeUserListByProjectId(startOfDay, now);
|
||||
// List<LocationVo> anqmList = deviceService.getUeUserListByProjectId( startOfDay, now);
|
||||
// List<OthYs7Device> othYs7DeviceList = othYs7DeviceService.lambdaQuery()
|
||||
// .list();
|
||||
List<DroProjectDroneVo> wrjKeys = droProjectDroneService.getUeTopicsByProjectId();
|
||||
List<String> maps = new ArrayList<>();
|
||||
if (voList != null && !voList.isEmpty()) {
|
||||
for (GpsEquipmentSonVo item : voList) {
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "location"); // 消息类型
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("id", item.getModelId());
|
||||
|
||||
// 位置信息
|
||||
JSONObject position = new JSONObject();
|
||||
position.put("lat", item.getLocLatitude()); // 纬度
|
||||
position.put("lng", item.getLocLongitude()); // 经度
|
||||
position.put("alt", item.getLocAltitude()); // 海拔
|
||||
|
||||
data.put("position", position);
|
||||
messageObj.put("data", data); // 设备唯一标识
|
||||
maps.add(messageObj.toString());
|
||||
}
|
||||
}
|
||||
if (appList != null && !appList.isEmpty()) {
|
||||
for (GpsEquipmentSonVo item : appList) {
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "location"); // 消息类型
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("id", item.getModelId());
|
||||
|
||||
// 位置信息
|
||||
JSONObject position = new JSONObject();
|
||||
position.put("lat", item.getLocLatitude()); // 纬度
|
||||
position.put("lng", item.getLocLongitude()); // 经度
|
||||
position.put("alt", item.getLocAltitude()); // 海拔
|
||||
|
||||
data.put("position", position);
|
||||
messageObj.put("data", data); // 设备唯一标识
|
||||
maps.add(messageObj.toString());
|
||||
}
|
||||
}
|
||||
if (wrjKeys != null && !wrjKeys.isEmpty()) {
|
||||
for (DroProjectDroneVo key : wrjKeys) {
|
||||
Object object = stringRedisTemplate.opsForValue().get("wrj:osd4:" + key.getAirplaneSn());
|
||||
Object object6 = stringRedisTemplate.opsForValue().get("wrj:osd2:" + key.getDroneSn());
|
||||
String status = "";
|
||||
if (object6 != null) {
|
||||
JSONObject object1 = JSONUtil.parseObj(object6);
|
||||
status = object1.getJSONObject("data").get("flighttask_step_code").toString();
|
||||
}
|
||||
if (object != null) {
|
||||
JSONObject object1 = JSONUtil.parseObj(object);
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "location"); // 消息类型
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("id", key.getAirplaneModleId());
|
||||
|
||||
// 位置信息
|
||||
JSONObject position = new JSONObject();
|
||||
position.put("lat", object1.getJSONObject("data").get("latitude")); // 纬度
|
||||
position.put("lng", object1.getJSONObject("data").get("longitude")); // 经度
|
||||
position.put("alt", object1.getJSONObject("data").get("height")); // 海拔
|
||||
|
||||
data.put("position", position);
|
||||
messageObj.put("data", data); // 设备唯一标识
|
||||
maps.add(messageObj.toString());
|
||||
} else {
|
||||
Object object2 = stringRedisTemplate.opsForValue().get("wrj:osd3:" + key);
|
||||
if (object2 != null) {
|
||||
JSONObject object3 = JSONUtil.parseObj(object2);
|
||||
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "location"); // 消息类型
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("id", key.getDroneModleId());
|
||||
|
||||
// 位置信息
|
||||
JSONObject position = new JSONObject();
|
||||
position.put("lat", object3.getJSONObject("data").get("latitude")); // 纬度
|
||||
position.put("lng", object3.getJSONObject("data").get("longitude")); // 经度
|
||||
position.put("alt", object3.getJSONObject("data").get("height")); // 海拔
|
||||
|
||||
data.put("position", position);
|
||||
messageObj.put("data", data); // 设备唯一标识
|
||||
maps.add(messageObj.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return maps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWrjHc() {
|
||||
RedisUtils.setCacheObject("xmjdap:ws", System.currentTimeMillis());
|
||||
|
||||
@ -0,0 +1,165 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||
import org.dromara.bigscreen.mapper.SysRoleWorkMapper;
|
||||
import org.dromara.bigscreen.service.ISysRoleWorkService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.domain.vo.SysRoleVo;
|
||||
import org.dromara.system.service.impl.SysRoleServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色流程对应Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRoleWork> implements ISysRoleWorkService {
|
||||
|
||||
private final SysRoleWorkMapper baseMapper;
|
||||
@Autowired
|
||||
private SysRoleServiceImpl roleService;
|
||||
|
||||
/**
|
||||
* 查询角色流程对应
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 角色流程对应
|
||||
*/
|
||||
@Override
|
||||
public SysRoleWorkVo queryById(Long id){
|
||||
SysRoleWorkVo sysRoleWorkVo = baseMapper.selectVoById(id);
|
||||
List<SysRoleWorkVo> sysRoleWorkVo1 = new ArrayList<>();
|
||||
if (sysRoleWorkVo != null) {
|
||||
sysRoleWorkVo1 = List.of(sysRoleWorkVo);
|
||||
setValue(sysRoleWorkVo1);
|
||||
}
|
||||
return sysRoleWorkVo1.getFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询角色流程对应列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 角色流程对应分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysRoleWorkVo> queryPageList(SysRoleWorkBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysRoleWork> lqw = buildQueryWrapper(bo);
|
||||
Page<SysRoleWorkVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
setValue(result.getRecords());
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的角色流程对应列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 角色流程对应列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysRoleWorkVo> queryList(SysRoleWorkBo bo) {
|
||||
LambdaQueryWrapper<SysRoleWork> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysRoleWork> buildQueryWrapper(SysRoleWorkBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysRoleWork> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(SysRoleWork::getId);
|
||||
lqw.eq(bo.getRoleId() != null, SysRoleWork::getRoleId, bo.getRoleId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLcmc()), SysRoleWork::getLcmc, bo.getLcmc());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLcms()), SysRoleWork::getLcms, bo.getLcms());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLcxq()), SysRoleWork::getLcxq, bo.getLcxq());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色流程对应
|
||||
*
|
||||
* @param bo 角色流程对应
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SysRoleWorkBo bo) {
|
||||
LambdaQueryWrapper<SysRoleWork> lqw = buildQueryWrapper(bo);
|
||||
lqw.eq(SysRoleWork::getRoleId, bo.getRoleId());
|
||||
if (baseMapper.selectCount(lqw) > 0) {
|
||||
throw new RuntimeException("此角色已绑定流程");
|
||||
}
|
||||
|
||||
SysRoleWork add = MapstructUtils.convert(bo, SysRoleWork.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色流程对应
|
||||
*
|
||||
* @param bo 角色流程对应
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SysRoleWorkBo bo) {
|
||||
SysRoleWork update = MapstructUtils.convert(bo, SysRoleWork.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysRoleWork entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除角色流程对应信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
public void setValue(List<SysRoleWorkVo> vos){
|
||||
for (SysRoleWorkVo vo : vos) {
|
||||
if (vo.getRoleId() != null){
|
||||
SysRoleVo sysRoleVo = roleService.selectRoleById(vo.getRoleId());
|
||||
if (sysRoleVo != null){
|
||||
vo.setRoleName(sysRoleVo.getRoleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user