Compare commits
152 Commits
0a18a0892a
...
flowUpdate
| Author | SHA1 | Date | |
|---|---|---|---|
| f6e01abe0e | |||
| 02f324e1d4 | |||
| 96392dbf57 | |||
| e39e788ddc | |||
| e17ab16821 | |||
| 8a928e852d | |||
| 397f8ee768 | |||
| 8e25b416ec | |||
| e6b0527e44 | |||
| 403848cb4b | |||
| a4b1820e1c | |||
| c2afe05e81 | |||
| 1902ba9d59 | |||
| 1d1a0e45c6 | |||
| 72c775b1e3 | |||
| bec0848cd9 | |||
| 4e78886a82 | |||
| 292a56bccd | |||
| 3f12c15cf8 | |||
| 1ab47ccb57 | |||
| 321fc67c4f | |||
| b6e8031cef | |||
| d7265b08a8 | |||
| 2f0ad8a8cd | |||
| 22c58031d2 | |||
| 473f6943d5 | |||
| 08ef9ccfea | |||
| 94b5736241 | |||
| 95b4bc85b3 | |||
| dfaadd4977 | |||
| f372f22934 | |||
| bc91c44596 | |||
| 480d7be81d | |||
| 1c0be9b5ee | |||
| 9c7d8ffc96 | |||
| 167cbf256b | |||
| c3ce1c22d3 | |||
| 891c205233 | |||
| 3b184abc96 | |||
| 9a20cf0e43 | |||
| faf434e4d2 | |||
| 73988b8828 | |||
| 0c3b14e010 | |||
| d764fbe473 | |||
| 073f704c0e | |||
| 5f64f3aef4 | |||
| baa492b799 | |||
| a668381101 | |||
| 4f2ac72edc | |||
| b501965d25 | |||
| 57b662837d | |||
| f11ed11629 | |||
| cdcbfaa1a9 | |||
| ef775a3cfb | |||
| 818b67b5aa | |||
| a0554e47fd | |||
| 49c9ef8878 | |||
| 3265a58813 | |||
| 5a9044786c | |||
| d8d0828f8e | |||
| 8bade20502 | |||
| be944595e3 | |||
| 1eaf29b282 | |||
| 4bb24fe464 | |||
| e704522965 | |||
| 3440b885ee | |||
| 3e85e79bdd | |||
| 90b0eb82f4 | |||
| ef2c1ff455 | |||
| 074fb5bf86 | |||
| 3f4b127cdf | |||
| e93ea2fdfd | |||
| cf368db9af | |||
| 034d01d604 | |||
| af247d917b | |||
| a51d836dc2 | |||
| 1f233c142a | |||
| 4b3a56eb5f | |||
| 2b25ec1483 | |||
| 0736552eb7 | |||
| d99d59ffa0 | |||
| 5da05dcf24 | |||
| fceb06eca8 | |||
| 24219b6942 | |||
| 8566231790 | |||
| b96cc95741 | |||
| 8478cd2997 | |||
| 1bbc1e52ae | |||
| 9221cb50a3 | |||
| e8e15f4a98 | |||
| 0941197ca9 | |||
| 23dc2f2759 | |||
| 7321db3419 | |||
| be7576f8ea | |||
| cc72b1bd64 | |||
| e1d713b23e | |||
| 5ebc46d2e1 | |||
| 0da63144e7 | |||
| 347bd92b69 | |||
| 6d859c6a8c | |||
| 733b95632b | |||
| b905320413 | |||
| 8d4059bbf4 | |||
| b1b8ced0a8 | |||
| 9d3c212856 | |||
| ceec388f5f | |||
| 44f604ff57 | |||
| fae9c61f07 | |||
| e48b27715f | |||
| feb0e49da3 | |||
| 245cdb40f7 | |||
| a2d2431bce | |||
| 048a175526 | |||
| d9d2688e24 | |||
| 15382b5aba | |||
| 8500469918 | |||
| 864eb1462f | |||
| 86b44282ea | |||
| 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 |
1
xinnengyuan/.gitignore
vendored
1
xinnengyuan/.gitignore
vendored
@ -53,3 +53,4 @@ logs/
|
|||||||
docs
|
docs
|
||||||
/file
|
/file
|
||||||
.idea/
|
.idea/
|
||||||
|
chat-memory/
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
<mybatis.version>3.5.16</mybatis.version>
|
<mybatis.version>3.5.16</mybatis.version>
|
||||||
<springdoc.version>2.8.4</springdoc.version>
|
<springdoc.version>2.3.0</springdoc.version>
|
||||||
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
||||||
<easyexcel.version>4.0.3</easyexcel.version>
|
<easyexcel.version>4.0.3</easyexcel.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<!-- 面向运行时的D-ORM依赖 -->
|
<!-- 面向运行时的D-ORM依赖 -->
|
||||||
<anyline.version>8.7.2-20250101</anyline.version>
|
<anyline.version>8.7.2-20250101</anyline.version>
|
||||||
<!--工作流配置-->
|
<!--工作流配置-->
|
||||||
<warm-flow.version>1.7.4</warm-flow.version>
|
<warm-flow.version>1.8.2</warm-flow.version>
|
||||||
|
|
||||||
<!-- 插件版本 -->
|
<!-- 插件版本 -->
|
||||||
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
||||||
|
|||||||
@ -59,9 +59,9 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev-update?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: xinnengyuandev
|
username: xinnengyuandev-update
|
||||||
password: StRWCZdZirysNSs2
|
password: cp7cAbWLZnRc6wyp
|
||||||
# url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: xinnengyuan
|
# username: xinnengyuan
|
||||||
# password: mEZPC5Sdf3r2HENi
|
# password: mEZPC5Sdf3r2HENi
|
||||||
|
|||||||
@ -41,10 +41,10 @@ snail-job:
|
|||||||
spring:
|
spring:
|
||||||
ai:
|
ai:
|
||||||
dashscope:
|
dashscope:
|
||||||
api-key: xxx
|
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||||
chat:
|
chat:
|
||||||
options:
|
options:
|
||||||
model: qwen-plus
|
model: qwen3-max
|
||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||||
|
|||||||
@ -110,6 +110,8 @@ sa-token:
|
|||||||
timeout: 2592000
|
timeout: 2592000
|
||||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||||
active-timeout: 86400
|
active-timeout: 86400
|
||||||
|
# 同一账号最大登录数量,-1代表不限
|
||||||
|
max-login-count: -1
|
||||||
|
|
||||||
# security配置
|
# security配置
|
||||||
security:
|
security:
|
||||||
@ -135,6 +137,7 @@ security:
|
|||||||
- /facility/matrix/**
|
- /facility/matrix/**
|
||||||
- /hat/device/data
|
- /hat/device/data
|
||||||
- /websocket/ue
|
- /websocket/ue
|
||||||
|
- /websocket/vehicle
|
||||||
|
|
||||||
# 多租户配置
|
# 多租户配置
|
||||||
tenant:
|
tenant:
|
||||||
@ -207,6 +210,10 @@ api-decrypt:
|
|||||||
- /gps/equipment/dataAcceptance # GPS数据接收接口
|
- /gps/equipment/dataAcceptance # GPS数据接收接口
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
|
default-flat-param-object: true
|
||||||
|
swagger-ui:
|
||||||
|
path: /swagger-ui.html
|
||||||
|
tags-sorter: alpha
|
||||||
api-docs:
|
api-docs:
|
||||||
# 是否开启接口文档
|
# 是否开启接口文档
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -226,10 +233,14 @@ springdoc:
|
|||||||
components:
|
components:
|
||||||
# 鉴权方式配置
|
# 鉴权方式配置
|
||||||
security-schemes:
|
security-schemes:
|
||||||
apiKey:
|
Authorization:
|
||||||
type: APIKEY
|
type: HTTP
|
||||||
in: HEADER
|
in: HEADER
|
||||||
name: ${sa-token.token-name}
|
name: ${sa-token.token-name}
|
||||||
|
Clientid:
|
||||||
|
type: HTTP
|
||||||
|
in: HEADER
|
||||||
|
name: Clientid
|
||||||
#这里定义了两个分组,可定义多个,也可以不定义
|
#这里定义了两个分组,可定义多个,也可以不定义
|
||||||
group-configs:
|
group-configs:
|
||||||
- group: 1.通用模块
|
- group: 1.通用模块
|
||||||
@ -262,8 +273,6 @@ springdoc:
|
|||||||
packages-to-scan: org.dromara.ctr
|
packages-to-scan: org.dromara.ctr
|
||||||
- group: 15.无人机模块
|
- group: 15.无人机模块
|
||||||
packages-to-scan: org.dromara.drone
|
packages-to-scan: org.dromara.drone
|
||||||
- group: 20.代码生成模块
|
|
||||||
packages-to-scan: org.dromara.generator
|
|
||||||
- group: 16.app模块
|
- group: 16.app模块
|
||||||
packages-to-scan: org.dromara.app
|
packages-to-scan: org.dromara.app
|
||||||
- group: 17.材料设备模块
|
- group: 17.材料设备模块
|
||||||
@ -272,18 +281,16 @@ springdoc:
|
|||||||
packages-to-scan: org.dromara.out
|
packages-to-scan: org.dromara.out
|
||||||
- group: 19.消息模块
|
- group: 19.消息模块
|
||||||
packages-to-scan: org.dromara.message
|
packages-to-scan: org.dromara.message
|
||||||
|
- group: 20.代码生成模块
|
||||||
|
packages-to-scan: org.dromara.generator
|
||||||
- group: 21.分标策划模块
|
- group: 21.分标策划模块
|
||||||
packages-to-scan: org.dromara.tender
|
packages-to-scan: org.dromara.tender
|
||||||
- group: 22.大屏模块
|
- group: 22.大屏模块
|
||||||
packages-to-scan: org.dromara.bigscreen
|
packages-to-scan: org.dromara.bigscreen
|
||||||
- group: 22.投标管理模块
|
|
||||||
packages-to-scan: org.dromara.bidding
|
|
||||||
- group: 23.GPS定位模块
|
- group: 23.GPS定位模块
|
||||||
packages-to-scan: org.dromara.gps
|
packages-to-scan: org.dromara.gps
|
||||||
- group: 24.招标模块
|
- group: 24.招标模块
|
||||||
packages-to-scan: org.dromara.tender
|
packages-to-scan: org.dromara.tender
|
||||||
- group: 29.app版本模块
|
|
||||||
packages-to-scan: org.dromara.app
|
|
||||||
- group: 25.数据迁移模块
|
- group: 25.数据迁移模块
|
||||||
packages-to-scan: org.dromara.transferData
|
packages-to-scan: org.dromara.transferData
|
||||||
- group: 26.netty消息模块
|
- group: 26.netty消息模块
|
||||||
@ -292,6 +299,12 @@ springdoc:
|
|||||||
packages-to-scan: org.dromara.xzd
|
packages-to-scan: org.dromara.xzd
|
||||||
- group: 28.车辆模块
|
- group: 28.车辆模块
|
||||||
packages-to-scan: org.dromara.vehicle
|
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的增强配置,不需要增强可以不配
|
||||||
knife4j:
|
knife4j:
|
||||||
enable: true
|
enable: true
|
||||||
@ -316,6 +329,8 @@ xss:
|
|||||||
- /xzd/fenbaohetongbiangg/**
|
- /xzd/fenbaohetongbiangg/**
|
||||||
- /xzd/fenbaohetongxinxi/**
|
- /xzd/fenbaohetongxinxi/**
|
||||||
- /xzd/contractManagement/**
|
- /xzd/contractManagement/**
|
||||||
|
- /xzd/jixiehetongxinxi/contractMachinery/**
|
||||||
|
- /xzd/jixiehetongbiang/machineryContractAlteration/**
|
||||||
|
|
||||||
# 全局线程池相关配置
|
# 全局线程池相关配置
|
||||||
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import org.dromara.facility.domain.FacMatrix;
|
|||||||
import org.dromara.facility.service.IFacMatrixService;
|
import org.dromara.facility.service.IFacMatrixService;
|
||||||
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
||||||
import org.dromara.facility.service.IFacPhotovoltaicPanelService;
|
import org.dromara.facility.service.IFacPhotovoltaicPanelService;
|
||||||
|
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
|
||||||
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
||||||
import org.dromara.manager.ys7manager.Ys7Constant;
|
import org.dromara.manager.ys7manager.Ys7Constant;
|
||||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||||
@ -403,7 +404,8 @@ public class DemoTest {
|
|||||||
@Test
|
@Test
|
||||||
void testImport() {
|
void testImport() {
|
||||||
photovoltaicPanelService.updateFinishNumberByCoordinate(List.of(1968510961294921730L),
|
photovoltaicPanelService.updateFinishNumberByCoordinate(List.of(1968510961294921730L),
|
||||||
List.of(new RecognizeConvertCoordinateResult("107.124334530", "23.830557974")));
|
List.of(new RecognizeConvertCoordinateResult("107.124334530", "23.830557974")),
|
||||||
|
RecognizerTypeEnum.BRACKET.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -26,4 +26,9 @@ public class RecognizerTest {
|
|||||||
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
||||||
log.info("recognize: {}", recognize);
|
log.info("recognize: {}", recognize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testChange() {
|
||||||
|
recognizerManager.convertCoordinate("http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/11/11/d48767a62bc04867a552e06ba6712004.tif", List.of());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,11 +5,14 @@ import org.dromara.common.core.exception.ServiceException;
|
|||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.core.task.VirtualThreadTaskExecutor;
|
import org.springframework.core.task.VirtualThreadTaskExecutor;
|
||||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步配置
|
* 异步配置
|
||||||
@ -32,6 +35,30 @@ public class AsyncConfig implements AsyncConfigurer {
|
|||||||
return SpringUtils.getBean("scheduledExecutorService");
|
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,45 @@
|
|||||||
|
package org.dromara.common.core.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例业务扩展对象
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2025-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FlowInstanceBizExtDTO implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务ID
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务编码
|
||||||
|
*/
|
||||||
|
private String businessCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务标题
|
||||||
|
*/
|
||||||
|
private String businessTitle;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.common.core.domain.dto;
|
package org.dromara.common.core.domain.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -30,11 +31,21 @@ public class StartProcessDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String flowCode;
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||||
|
*/
|
||||||
|
private String handler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程业务扩展信息
|
||||||
|
*/
|
||||||
|
private FlowInstanceBizExtDTO bizExt;
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
public Map<String, Object> getVariables() {
|
||||||
if (variables == null) {
|
if (variables == null) {
|
||||||
return new HashMap<>(16);
|
return new HashMap<>(16);
|
||||||
@ -42,4 +53,11 @@ public class StartProcessDTO implements Serializable {
|
|||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FlowInstanceBizExtDTO getBizExt() {
|
||||||
|
if (ObjectUtil.isNull(bizExt)) {
|
||||||
|
bizExt = new FlowInstanceBizExtDTO();
|
||||||
|
}
|
||||||
|
return bizExt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,21 +52,23 @@ public class TaskAssigneeDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static <T> List<TaskHandler> convertToHandlerList(
|
public static <T> List<TaskHandler> convertToHandlerList(
|
||||||
List<T> sourceList,
|
List<T> sourceList,
|
||||||
Function<T, Long> storageId,
|
Function<T, String> storageId,
|
||||||
Function<T, String> handlerCode,
|
Function<T, String> handlerCode,
|
||||||
Function<T, String> handlerName,
|
Function<T, String> handlerName,
|
||||||
Function<T, Long> groupName,
|
Function<T, String> groupName,
|
||||||
Function<T, Date> createTimeMapper) {
|
Function<T, Date> createTimeMapper) {
|
||||||
return sourceList.stream()
|
return sourceList.stream()
|
||||||
.map(item -> new TaskHandler(
|
.map(item -> new TaskHandler(
|
||||||
String.valueOf(storageId.apply(item)),
|
storageId.apply(item),
|
||||||
handlerCode.apply(item),
|
handlerCode.apply(item),
|
||||||
handlerName.apply(item),
|
handlerName.apply(item),
|
||||||
groupName != null ? String.valueOf(groupName.apply(item)) : null,
|
groupName.apply(item),
|
||||||
createTimeMapper.apply(item)
|
createTimeMapper.apply(item)
|
||||||
)).collect(Collectors.toList());
|
)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|||||||
@ -62,4 +62,10 @@ public class ProcessEvent implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Boolean submit;
|
private Boolean submit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实例id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程办理监听
|
* 流程办理监听
|
||||||
@ -56,4 +57,14 @@ public class ProcessTaskEvent implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实例id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理参数
|
||||||
|
*/
|
||||||
|
private Map<String, Object> params;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.core.exception;
|
package org.dromara.common.core.exception;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.StrFormatter;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -56,4 +57,8 @@ public final class ServiceException extends RuntimeException {
|
|||||||
this.detailMessage = detailMessage;
|
this.detailMessage = detailMessage;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ServiceException(String message, Object... args) {
|
||||||
|
this.message = StrFormatter.format(message, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,6 +82,7 @@ public interface WorkflowService {
|
|||||||
* completeTask.getVariables().put("ignore", true);
|
* completeTask.getVariables().put("ignore", true);
|
||||||
*
|
*
|
||||||
* @param completeTask 参数
|
* @param completeTask 参数
|
||||||
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean completeTask(CompleteTaskDTO completeTask);
|
boolean completeTask(CompleteTaskDTO completeTask);
|
||||||
|
|
||||||
@ -90,6 +91,15 @@ public interface WorkflowService {
|
|||||||
*
|
*
|
||||||
* @param taskId 任务ID
|
* @param taskId 任务ID
|
||||||
* @param message 办理意见
|
* @param message 办理意见
|
||||||
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean completeTask(Long taskId, String message);
|
boolean completeTask(Long taskId, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程并办理第一个任务
|
||||||
|
*
|
||||||
|
* @param startProcess 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean startCompleteTask(StartProcessDTO startProcess);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
public interface XzdCbysZjhcbService {
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机械合同信息Service接口
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-12
|
||||||
|
*/
|
||||||
|
public interface XzdContractMachineryService {
|
||||||
|
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
public interface XzdProjectManagerApprovalService {
|
||||||
|
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
}
|
||||||
@ -7,7 +7,6 @@ import lombok.NoArgsConstructor;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -31,8 +30,10 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
return collection.stream().filter(function).collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,13 +41,26 @@ public class StreamUtils {
|
|||||||
*
|
*
|
||||||
* @param collection 需要查询的集合
|
* @param collection 需要查询的集合
|
||||||
* @param function 过滤方法
|
* @param function 过滤方法
|
||||||
|
* @return 找到符合条件的第一个元素,没有则返回 Optional.empty()
|
||||||
|
*/
|
||||||
|
public static <E> Optional<E> findFirst(Collection<E> collection, Predicate<E> function) {
|
||||||
|
if (CollUtil.isEmpty(collection)) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找到流中满足条件的第一个元素值
|
||||||
|
*
|
||||||
|
* @param collection 需要查询的集合
|
||||||
|
* @param function 过滤方法
|
||||||
* @return 找到符合条件的第一个元素,没有则返回 null
|
* @return 找到符合条件的第一个元素,没有则返回 null
|
||||||
*/
|
*/
|
||||||
public static <E> E findFirst(Collection<E> collection, Predicate<E> function) {
|
public static <E> E findFirstValue(Collection<E> collection, Predicate<E> function) {
|
||||||
if (CollUtil.isEmpty(collection)) {
|
return findFirst(collection,function).orElse(null);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return collection.stream().filter(function).findFirst().orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,13 +68,26 @@ public class StreamUtils {
|
|||||||
*
|
*
|
||||||
* @param collection 需要查询的集合
|
* @param collection 需要查询的集合
|
||||||
* @param function 过滤方法
|
* @param function 过滤方法
|
||||||
* @return 找到符合条件的任意一个元素,没有则返回null
|
* @return 找到符合条件的任意一个元素,没有则返回 Optional.empty()
|
||||||
*/
|
*/
|
||||||
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
|
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
|
||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(function).findAny();
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
|
.findAny();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找到流中任意一个满足条件的元素值
|
||||||
|
*
|
||||||
|
* @param collection 需要查询的集合
|
||||||
|
* @param function 过滤方法
|
||||||
|
* @return 找到符合条件的任意一个元素,没有则返回null
|
||||||
|
*/
|
||||||
|
public static <E> E findAnyValue(Collection<E> collection, Predicate<E> function) {
|
||||||
|
return findAny(collection,function).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +113,10 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter));
|
return collection.stream()
|
||||||
|
.map(function)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.joining(delimiter));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,8 +130,11 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.sorted(comparing)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
return collection.stream().filter(Objects::nonNull).sorted(comparing).collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,7 +151,9 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,7 +172,25 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, value, (l, r) -> l));
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(key, value, (l, r) -> l));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 map 中的数据作为新 Map 的 value ,key 不变
|
||||||
|
* @param map 需要处理的map
|
||||||
|
* @param take 取值函数
|
||||||
|
* @param <K> map中的key类型
|
||||||
|
* @param <E> map中的value类型
|
||||||
|
* @param <V> 新map中的value类型
|
||||||
|
* @return 新的map
|
||||||
|
*/
|
||||||
|
public static <K, E, V> Map<K, V> toMap(Map<K, E> map, BiFunction<K, E, V> take) {
|
||||||
|
if (CollUtil.isEmpty(map)) {
|
||||||
|
return MapUtil.newHashMap();
|
||||||
|
}
|
||||||
|
return toMap(map.entrySet(), Map.Entry::getKey, entry -> take.apply(entry.getKey(), entry.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,8 +207,8 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,8 +228,8 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
|
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,11 +246,11 @@ public class StreamUtils {
|
|||||||
* @return 分类后的map
|
* @return 分类后的map
|
||||||
*/
|
*/
|
||||||
public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1, Function<E, U> key2) {
|
public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1, Function<E, U> key2) {
|
||||||
if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
|
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,8 +268,7 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream()
|
|
||||||
.map(function)
|
.map(function)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
@ -234,11 +286,10 @@ public class StreamUtils {
|
|||||||
* @return 转化后的Set
|
* @return 转化后的Set
|
||||||
*/
|
*/
|
||||||
public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
|
public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
|
||||||
if (CollUtil.isEmpty(collection) || function == null) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newHashSet();
|
return CollUtil.newHashSet();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream()
|
|
||||||
.map(function)
|
.map(function)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
@ -258,26 +309,20 @@ public class StreamUtils {
|
|||||||
* @return 合并后的map
|
* @return 合并后的map
|
||||||
*/
|
*/
|
||||||
public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
|
public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
|
||||||
if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) {
|
if (CollUtil.isEmpty(map1) && CollUtil.isEmpty(map2)) {
|
||||||
|
// 如果两个 map 都为空,则直接返回空的 map
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
} else if (MapUtil.isEmpty(map1)) {
|
} else if (CollUtil.isEmpty(map1)) {
|
||||||
map1 = MapUtil.newHashMap();
|
// 如果 map1 为空,则直接处理返回 map2
|
||||||
} else if (MapUtil.isEmpty(map2)) {
|
return toMap(map2.entrySet(), Map.Entry::getKey, entry -> merge.apply(null, entry.getValue()));
|
||||||
map2 = MapUtil.newHashMap();
|
} else if (CollUtil.isEmpty(map2)) {
|
||||||
|
// 如果 map2 为空,则直接处理返回 map1
|
||||||
|
return toMap(map1.entrySet(), Map.Entry::getKey, entry -> merge.apply(entry.getValue(), null));
|
||||||
}
|
}
|
||||||
Set<K> key = new HashSet<>();
|
Set<K> keySet = new HashSet<>();
|
||||||
key.addAll(map1.keySet());
|
keySet.addAll(map1.keySet());
|
||||||
key.addAll(map2.keySet());
|
keySet.addAll(map2.keySet());
|
||||||
Map<K, V> map = new HashMap<>();
|
return toMap(keySet, key -> key, key -> merge.apply(map1.get(key), map2.get(key)));
|
||||||
for (K t : key) {
|
|
||||||
X x = map1.get(t);
|
|
||||||
Y y = map2.get(t);
|
|
||||||
V z = merge.apply(x, y);
|
|
||||||
if (z != null) {
|
|
||||||
map.put(t, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -351,4 +351,14 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
return noSpaces.matches("\\d+");
|
return noSpaces.matches("\\d+");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将可迭代对象中的元素使用逗号拼接成字符串
|
||||||
|
*
|
||||||
|
* @param iterable 可迭代对象,如 List、Set 等
|
||||||
|
* @return 拼接后的字符串
|
||||||
|
*/
|
||||||
|
public static String joinComma(Iterable<?> iterable) {
|
||||||
|
return StringUtils.join(iterable, SEPARATOR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||||
<version>4.4.0</version>
|
<version>4.5.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.common.doc.config;
|
package org.dromara.common.doc.config;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.Paths;
|
import io.swagger.v3.oas.models.Paths;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
@ -9,6 +11,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|||||||
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
||||||
import org.dromara.common.doc.handler.OpenApiHandler;
|
import org.dromara.common.doc.handler.OpenApiHandler;
|
||||||
import org.springdoc.core.configuration.SpringDocConfiguration;
|
import org.springdoc.core.configuration.SpringDocConfiguration;
|
||||||
|
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||||
import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
|
import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
|
||||||
import org.springdoc.core.customizers.OpenApiCustomizer;
|
import org.springdoc.core.customizers.OpenApiCustomizer;
|
||||||
import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
|
import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
|
||||||
@ -23,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|||||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -61,7 +65,6 @@ public class SpringDocConfig {
|
|||||||
keySet.forEach(securityRequirement::addList);
|
keySet.forEach(securityRequirement::addList);
|
||||||
list.add(securityRequirement);
|
list.add(securityRequirement);
|
||||||
openApi.security(list);
|
openApi.security(list);
|
||||||
|
|
||||||
return openApi;
|
return openApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +110,15 @@ public class SpringDocConfig {
|
|||||||
}
|
}
|
||||||
PlusPaths newPaths = new PlusPaths();
|
PlusPaths newPaths = new PlusPaths();
|
||||||
oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v));
|
oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v));
|
||||||
|
newPaths.forEach((s, pathItem) -> {
|
||||||
|
// 为所有接口添加鉴权
|
||||||
|
pathItem.readOperations().forEach(operation -> {
|
||||||
|
operation.addSecurityItem(new SecurityRequirement()
|
||||||
|
.addList(HttpHeaders.AUTHORIZATION)
|
||||||
|
.addList("Clientid")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
openApi.setPaths(newPaths);
|
openApi.setPaths(newPaths);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -123,4 +135,26 @@ public class SpringDocConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
|
||||||
|
return openApi -> {
|
||||||
|
// 全局添加鉴权参数
|
||||||
|
if(openApi.getPaths()!=null){
|
||||||
|
openApi.getPaths().forEach((s, pathItem) -> {
|
||||||
|
// 为所有接口添加鉴权
|
||||||
|
List<Operation> operations = pathItem.readOperations();
|
||||||
|
operations.forEach(operation -> {
|
||||||
|
operation.addSecurityItem(new SecurityRequirement()
|
||||||
|
.addList(HttpHeaders.AUTHORIZATION)
|
||||||
|
.addList("Clientid")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,40 @@
|
|||||||
|
package org.dromara.common.excel.handler;
|
||||||
|
|
||||||
|
import com.alibaba.excel.write.handler.CellWriteHandler;
|
||||||
|
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class LockColumnHandler implements CellWriteHandler {
|
||||||
|
|
||||||
|
private final Set<Integer> lockColumns;
|
||||||
|
|
||||||
|
public LockColumnHandler(Collection<Integer> lockColumns) {
|
||||||
|
this.lockColumns = new HashSet<>(lockColumns);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCellDispose(CellWriteHandlerContext context) {
|
||||||
|
Cell cell = context.getCell();
|
||||||
|
if (cell == null) return;
|
||||||
|
|
||||||
|
Workbook workbook = cell.getSheet().getWorkbook();
|
||||||
|
|
||||||
|
// 必须为所有单元格创建一个新的 CellStyle
|
||||||
|
CellStyle style = workbook.createCellStyle();
|
||||||
|
|
||||||
|
// 锁定指定列
|
||||||
|
if (lockColumns.contains(cell.getColumnIndex())) {
|
||||||
|
style.setLocked(true);
|
||||||
|
} else {
|
||||||
|
style.setLocked(false); // 非锁定列必须明确设置为 false!
|
||||||
|
}
|
||||||
|
|
||||||
|
cell.setCellStyle(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package org.dromara.common.excel.handler;
|
||||||
|
|
||||||
|
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-11-14 15:05
|
||||||
|
*/
|
||||||
|
public class SheetProtectHandler implements SheetWriteHandler {
|
||||||
|
|
||||||
|
private final String password;
|
||||||
|
|
||||||
|
public SheetProtectHandler(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder,
|
||||||
|
WriteSheetHolder writeSheetHolder) {
|
||||||
|
Sheet sheet = writeSheetHolder.getSheet();
|
||||||
|
sheet.protectSheet(password); // 可为空字符串
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,7 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.ExcelReader;
|
||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
|
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
|
||||||
|
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||||
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
|
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
||||||
@ -14,27 +17,27 @@ import jakarta.servlet.ServletOutputStream;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
||||||
import org.dromara.common.excel.core.*;
|
import org.dromara.common.excel.core.*;
|
||||||
import org.dromara.common.excel.handler.DataWriteHandler;
|
import org.dromara.common.excel.handler.DataWriteHandler;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.dromara.common.excel.handler.LockColumnHandler;
|
||||||
|
import org.dromara.common.excel.handler.SheetProtectHandler;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel相关处理
|
* Excel相关处理
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class ExcelUtil {
|
public class ExcelUtil {
|
||||||
|
|
||||||
@ -48,6 +51,41 @@ public class ExcelUtil {
|
|||||||
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
|
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步读取 Excel(支持读取多个 Sheet)
|
||||||
|
*
|
||||||
|
* @param is 输入流(一次性读取)
|
||||||
|
* @param clazz Excel 映射实体类
|
||||||
|
* @return 所有 Sheet 的数据汇总
|
||||||
|
*/
|
||||||
|
public static <T> List<T> importExcelAllSheet(InputStream is, Class<T> clazz) {
|
||||||
|
// 用于存放所有 sheet 的数据
|
||||||
|
List<T> allData = new ArrayList<>();
|
||||||
|
// 1. 构建 ExcelReader
|
||||||
|
ExcelReaderBuilder readerBuilder = EasyExcel.read(is);
|
||||||
|
ExcelReader reader = readerBuilder.build();
|
||||||
|
// 2. 获取 Excel 中全部 Sheet 信息(包含 SheetNo、页名等)
|
||||||
|
List<ReadSheet> readSheets = reader.excelExecutor().sheetList();
|
||||||
|
// 3. 遍历每一个 Sheet
|
||||||
|
for (ReadSheet sheet : readSheets) {
|
||||||
|
// 为每个 Sheet 创建独立监听器,用于接收读取结果
|
||||||
|
DefaultExcelListener<T> listener = new DefaultExcelListener<>(false);
|
||||||
|
// 4. 构建当前 Sheet 的读取器 使用 sheet.getSheetNo() 指定当前 sheet
|
||||||
|
ReadSheet readSheet = EasyExcel.readSheet(sheet.getSheetNo())
|
||||||
|
// 设置头映射实体类
|
||||||
|
.head(clazz)
|
||||||
|
// 注册读取监听器
|
||||||
|
.registerReadListener(listener)
|
||||||
|
.build();
|
||||||
|
// 5. 开始读取当前 Sheet
|
||||||
|
reader.read(readSheet);
|
||||||
|
// 6. 收集当前 Sheet 读取的数据
|
||||||
|
allData.addAll(listener.getExcelResult().getList());
|
||||||
|
}
|
||||||
|
// 7. 关闭读取器,释放资源
|
||||||
|
reader.finish();
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用校验监听器 异步导入 同步返回
|
* 使用校验监听器 异步导入 同步返回
|
||||||
@ -205,6 +243,37 @@ public class ExcelUtil {
|
|||||||
builder.doWrite(list);
|
builder.doWrite(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param list 导出数据集合
|
||||||
|
* @param sheetName 工作表的名称
|
||||||
|
* @param clazz 实体类
|
||||||
|
* @param lockColumns 锁定列
|
||||||
|
* @param merge 是否合并单元格
|
||||||
|
* @param os 输出流
|
||||||
|
*/
|
||||||
|
public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, List<Integer> lockColumns,
|
||||||
|
boolean merge, OutputStream os, List<DropDownOptions> options) {
|
||||||
|
ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz)
|
||||||
|
.registerWriteHandler(new LockColumnHandler(lockColumns)) // 锁定第3列
|
||||||
|
.registerWriteHandler(new SheetProtectHandler("dawdawdwad")) // 保护整张 sheet
|
||||||
|
.autoCloseStream(false)
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
// 大数值自动转换 防止失真
|
||||||
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
|
.sheet(sheetName);
|
||||||
|
if (merge) {
|
||||||
|
// 合并处理器
|
||||||
|
builder.registerWriteHandler(new CellMergeStrategy(list, true));
|
||||||
|
}
|
||||||
|
// 添加下拉框操作
|
||||||
|
builder.registerWriteHandler(new ExcelDownHandler(options));
|
||||||
|
builder.doWrite(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出多sheet excel(增强版,解决XML安全问题)
|
* 导出多sheet excel(增强版,解决XML安全问题)
|
||||||
*
|
*
|
||||||
@ -213,7 +282,9 @@ public class ExcelUtil {
|
|||||||
* @param clazz 实体类
|
* @param clazz 实体类
|
||||||
* @param optionsList 级联下拉选内容列表
|
* @param optionsList 级联下拉选内容列表
|
||||||
*/
|
*/
|
||||||
public static <T> void exportMultiSheetExcelEnhanced(List<List<T>> sheetData, List<String> sheetNames, Class<T> clazz, List<List<DropDownOptions>> optionsList,HttpServletResponse response) throws IOException {
|
public static <T> void exportMultiSheetExcelEnhanced(List<List<T>> sheetData, List<String> sheetNames,
|
||||||
|
Class<T> clazz, List<List<DropDownOptions>> optionsList,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
resetResponse("file", response);
|
resetResponse("file", response);
|
||||||
ExcelWriter excelWriter = null;
|
ExcelWriter excelWriter = null;
|
||||||
ServletOutputStream os = response.getOutputStream();
|
ServletOutputStream os = response.getOutputStream();
|
||||||
@ -224,6 +295,9 @@ public class ExcelUtil {
|
|||||||
.head(clazz)
|
.head(clazz)
|
||||||
.autoCloseStream(false)
|
.autoCloseStream(false)
|
||||||
.registerConverter(new ExcelBigNumberConvert())
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
@ -252,12 +326,71 @@ public class ExcelUtil {
|
|||||||
excelWriter.finish();
|
excelWriter.finish();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 记录日志但不中断主流程
|
// 记录日志但不中断主流程
|
||||||
e.printStackTrace();
|
log.error("Excel 导出错误", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出多sheet excel(增强版,解决XML安全问题)
|
||||||
|
*
|
||||||
|
* @param sheetData 多个sheet的数据
|
||||||
|
* @param sheetNames 多个sheet的名称
|
||||||
|
* @param clazz 实体类
|
||||||
|
* @param optionsList 级联下拉选内容列表
|
||||||
|
*/
|
||||||
|
public static <T> void exportExcel(List<List<T>> sheetData, List<String> sheetNames, List<Integer> lockColumns,
|
||||||
|
Class<T> clazz, List<List<DropDownOptions>> optionsList,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
resetResponse("file", response);
|
||||||
|
ExcelWriter excelWriter = null;
|
||||||
|
ServletOutputStream os = response.getOutputStream();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用SXSSFWorkbook避免内存问题,并减少XML处理复杂度
|
||||||
|
excelWriter = EasyExcel.write(os)
|
||||||
|
.head(clazz)
|
||||||
|
.registerWriteHandler(new LockColumnHandler(lockColumns)) // 锁定第3列
|
||||||
|
// .registerWriteHandler(new SheetProtectHandler("dawdawdwad")) // 保护整张 sheet
|
||||||
|
.autoCloseStream(false)
|
||||||
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
// 为每个sheet写入数据
|
||||||
|
for (int i = 0; i < sheetData.size(); i++) {
|
||||||
|
// 创建基本sheet配置
|
||||||
|
WriteSheet writeSheet = EasyExcel.writerSheet(i, sheetNames.get(i))
|
||||||
|
.head(clazz)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 添加下拉选项(如果存在)
|
||||||
|
if (optionsList != null && optionsList.size() > i && optionsList.get(i) != null) {
|
||||||
|
ExcelDownHandler handler = new ExcelDownHandler(optionsList.get(i));
|
||||||
|
writeSheet.setCustomWriteHandlerList(
|
||||||
|
Collections.singletonList(handler));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入数据
|
||||||
|
excelWriter.write(sheetData.get(i), writeSheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
// 确保资源正确释放
|
||||||
|
if (excelWriter != null) {
|
||||||
|
try {
|
||||||
|
excelWriter.finish();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录日志但不中断主流程
|
||||||
|
log.error("Excel 导出错误", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单表多数据模板导出 模板格式为 {.属性}
|
* 单表多数据模板导出 模板格式为 {.属性}
|
||||||
@ -493,6 +626,4 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.core.map.MapUtil;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import org.dromara.common.sse.dto.SseMessageDto;
|
import org.dromara.common.sse.dto.SseMessageDto;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
|
|
||||||
import java.io.IOException;
|
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<>();
|
private final static Map<Long, Map<String, SseEmitter>> USER_TOKEN_EMITTERS = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|||||||
@ -44,10 +44,6 @@ public interface TransConstant {
|
|||||||
String XZD_KHXX_ID_TO_NAME = "khxx_id_to_name";
|
String XZD_KHXX_ID_TO_NAME = "khxx_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 供应商id转名称
|
|
||||||
// */
|
|
||||||
// String XZD_KHXX_ID_TO_NAME = "gysxx_id_to_name";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新中大项目id转名称
|
* 新中大项目id转名称
|
||||||
@ -57,6 +53,12 @@ public interface TransConstant {
|
|||||||
* 采购合同id转名称
|
* 采购合同id转名称
|
||||||
*/
|
*/
|
||||||
String XZD_PURCHASE_CONTRACT_ID_TO_NAME = "xzd_purchase_contract_id_to_name";
|
String XZD_PURCHASE_CONTRACT_ID_TO_NAME = "xzd_purchase_contract_id_to_name";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机械合同id转名称
|
||||||
|
*/
|
||||||
|
String XZD_PURCHASE_JXXIE_ID_TO_NAME = "xzd_purchase_contract_jixie_id_to_name";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 综合服务合同id转名称
|
* 综合服务合同id转名称
|
||||||
*/
|
*/
|
||||||
@ -69,4 +71,16 @@ public interface TransConstant {
|
|||||||
* 新中大供应商信息-开户银行id转银行名称
|
* 新中大供应商信息-开户银行id转银行名称
|
||||||
*/
|
*/
|
||||||
String XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME = "xzd_supplier_open_bank_id_to_name";
|
String XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME = "xzd_supplier_open_bank_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新中大-项目经理推荐及审批id转名称
|
||||||
|
*/
|
||||||
|
String XZD_PROJECT_MANAGER_APPROVAL_ID_TO_NAME = "xzd_project_manager_approval_id_to_name";
|
||||||
|
/**
|
||||||
|
* 新中大-立项及成本-成本预算-总体计划成本id转名称
|
||||||
|
*/
|
||||||
|
String XZD_CBYS_ZJHCB_ID_TO_NAME = "xzd_cbys_zjhcb_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.XzdSupplierInfoService;
|
import org.dromara.common.core.service.XzdCbysZjhcbService;
|
||||||
|
import org.dromara.common.core.service.XzdProjectManagerApprovalService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
//@TranslationType(type = TransConstant.XZD_KHXX_ID_TO_NAME)
|
@TranslationType(type = TransConstant.XZD_CBYS_ZJHCB_ID_TO_NAME)
|
||||||
public class XzdSupplierInfoImpl implements TranslationInterface<String> {
|
public class XzdCbysZjhcbImpl implements TranslationInterface<String> {
|
||||||
|
private final XzdCbysZjhcbService xzdCbysZjhcbService;
|
||||||
private final XzdSupplierInfoService xzdSupplierInfoService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
if (key instanceof String ids) {
|
if (key instanceof String ids) {
|
||||||
return xzdSupplierInfoService.selectNmaeByIds(ids);
|
return xzdCbysZjhcbService.selectNmaeByIds(ids);
|
||||||
} else if (key instanceof Long id) {
|
} else if (key instanceof Long id) {
|
||||||
return xzdSupplierInfoService.selectNmaeByIds(id.toString());
|
return xzdCbysZjhcbService.selectNmaeByIds(id.toString());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.dromara.common.core.service.XzdContractMachineryService;
|
||||||
|
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_PURCHASE_JXXIE_ID_TO_NAME)
|
||||||
|
public class XzdJXHTTranslation implements TranslationInterface<String> {
|
||||||
|
|
||||||
|
private final XzdContractMachineryService xzdContractMachineryService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String translation(Object key, String other) {
|
||||||
|
if (key instanceof String ids) {
|
||||||
|
return xzdContractMachineryService.selectNmaeByIds(ids);
|
||||||
|
} else if (key instanceof Long id) {
|
||||||
|
return xzdContractMachineryService.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.XzdProjectManagerApprovalService;
|
||||||
|
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_MANAGER_APPROVAL_ID_TO_NAME)
|
||||||
|
public class XzdProjectManagerApprovalImpl implements TranslationInterface<String> {
|
||||||
|
private final XzdProjectManagerApprovalService xzdProjectManagerApprovalService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String translation(Object key, String other) {
|
||||||
|
if (key instanceof String ids) {
|
||||||
|
return xzdProjectManagerApprovalService.selectNmaeByIds(ids);
|
||||||
|
} else if (key instanceof Long id) {
|
||||||
|
return xzdProjectManagerApprovalService.selectNmaeByIds(id.toString());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,9 @@ org.dromara.common.translation.core.impl.ProjectNameTranslationImpl
|
|||||||
org.dromara.common.translation.core.impl.XzdCustomerinformationImpl
|
org.dromara.common.translation.core.impl.XzdCustomerinformationImpl
|
||||||
org.dromara.common.translation.core.impl.XzdProjectImpl
|
org.dromara.common.translation.core.impl.XzdProjectImpl
|
||||||
org.dromara.common.translation.core.impl.XzdPurchaseContractInformationImpl
|
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.XzdJsCgJungonImpl
|
||||||
org.dromara.common.translation.core.impl.XzdCsContractInformationImpl
|
org.dromara.common.translation.core.impl.XzdCsContractInformationImpl
|
||||||
org.dromara.common.translation.core.impl.XzdSupplierOpenBankImpl
|
org.dromara.common.translation.core.impl.XzdSupplierOpenBankImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdProjectManagerApprovalImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdCbysZjhcbImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdJXHTTranslation
|
||||||
|
|||||||
@ -45,8 +45,7 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
||||||
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
||||||
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
||||||
String projectIdStr = ServletUtils.getRequest().getParameter("projectId");
|
String projectIdStr = ServletUtils.getRequest().getParameter(LoginHelper.PROJECT_KEY);
|
||||||
Long projectId = Long.parseLong(projectIdStr);
|
|
||||||
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
||||||
// token 无效
|
// token 无效
|
||||||
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
||||||
@ -55,7 +54,10 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attributes.put(LOGIN_USER_KEY, loginUser);
|
attributes.put(LOGIN_USER_KEY, loginUser);
|
||||||
|
if (projectIdStr != null && !projectIdStr.isEmpty()) {
|
||||||
|
Long projectId = Long.parseLong(projectIdStr);
|
||||||
attributes.put(PROJECT_ID,projectId);
|
attributes.put(PROJECT_ID,projectId);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (NotLoginException e) {
|
} catch (NotLoginException e) {
|
||||||
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
||||||
|
|||||||
@ -29,10 +29,32 @@
|
|||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- TwelveMonkeys ImageIO 扩展 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
|
<artifactId>imageio-core</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
|
<artifactId>imageio-webp</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.sejda.imageio/webp-imageio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sejda.imageio</groupId>
|
||||||
|
<artifactId>webp-imageio</artifactId>
|
||||||
|
<version>0.1.6</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud.ai</groupId>
|
<groupId>com.alibaba.cloud.ai</groupId>
|
||||||
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.esotericsoftware</groupId>
|
||||||
|
<artifactId>kryo</artifactId>
|
||||||
|
<version>5.6.2</version>
|
||||||
|
</dependency>
|
||||||
<!-- Java WebSocket 标准API -->
|
<!-- Java WebSocket 标准API -->
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>javax.websocket</groupId>-->
|
<!-- <groupId>javax.websocket</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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package org.dromara.ai.controller;
|
|
||||||
|
|
||||||
import com.alibaba.cloud.ai.dashscope.chat.DashScopeChatOptions;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.ai.chat.client.ChatClient;
|
|
||||||
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
|
|
||||||
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.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import reactor.core.publisher.Flux;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lilemy
|
|
||||||
* @date 2025-10-23 11:32
|
|
||||||
*/
|
|
||||||
@Validated
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ai")
|
|
||||||
public class AIController {
|
|
||||||
|
|
||||||
private static final String DEFAULT_PROMPT = "你是一个博学的智能聊天助手,请根据用户提问回答!";
|
|
||||||
|
|
||||||
private final ChatClient dashScopeChatClient;
|
|
||||||
|
|
||||||
public AIController(ChatClient.Builder chatClientBuilder) {
|
|
||||||
this.dashScopeChatClient = chatClientBuilder
|
|
||||||
.defaultSystem(DEFAULT_PROMPT)
|
|
||||||
// 实现 Logger 的 Advisor
|
|
||||||
.defaultAdvisors(
|
|
||||||
new SimpleLoggerAdvisor()
|
|
||||||
)
|
|
||||||
// 设置 ChatClient 中 ChatModel 的 Options 参数
|
|
||||||
.defaultOptions(
|
|
||||||
DashScopeChatOptions.builder()
|
|
||||||
.withTopP(0.7)
|
|
||||||
.build()
|
|
||||||
)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ChatClient 流式调用
|
|
||||||
*/
|
|
||||||
@GetMapping("/stream/chat")
|
|
||||||
public Flux<String> streamChat(@RequestParam(value = "query", defaultValue = "你好,很高兴认识你,能简单介绍一下自己吗?") String query, HttpServletResponse response) {
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
return dashScopeChatClient.prompt(query).stream().content();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,12 +4,45 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.*;
|
||||||
|
import org.dromara.bigscreen.service.IBusBwlService;
|
||||||
|
import org.dromara.bigscreen.service.IBusSygjService;
|
||||||
|
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.domain.dto.UserDTO;
|
import org.dromara.common.core.domain.dto.UserDTO;
|
||||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
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.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.web.core.BaseController;
|
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.project.service.IBusProjectService;
|
||||||
|
import org.dromara.system.domain.SysMenu;
|
||||||
|
import org.dromara.system.domain.vo.RouterVo;
|
||||||
|
import org.dromara.system.mapper.SysRoleMapper;
|
||||||
|
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
||||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||||
import org.dromara.warm.flow.core.FlowEngine;
|
import org.dromara.warm.flow.core.FlowEngine;
|
||||||
import org.dromara.warm.flow.core.entity.User;
|
import org.dromara.warm.flow.core.entity.User;
|
||||||
@ -19,19 +52,24 @@ import org.dromara.warm.flow.orm.mapper.FlowDefinitionMapper;
|
|||||||
import org.dromara.workflow.domain.bo.FlowTaskBo;
|
import org.dromara.workflow.domain.bo.FlowTaskBo;
|
||||||
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
||||||
import org.dromara.workflow.mapper.FlwTaskMapper;
|
import org.dromara.workflow.mapper.FlwTaskMapper;
|
||||||
|
import org.springframework.ai.chat.messages.Message;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import reactor.core.publisher.Flux;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
import java.time.DayOfWeek;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人首页接口
|
* 个人首页接口
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/personalHome")
|
@RequestMapping("/personalHome")
|
||||||
public class PersonalHomeController extends BaseController {
|
public class PersonalHomeController extends BaseController {
|
||||||
|
|
||||||
@ -42,14 +80,121 @@ public class PersonalHomeController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysUserServiceImpl userService;
|
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;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
private final SysRoleMapper roleMapper;
|
||||||
|
private final SysMenuServiceImpl sysMenuService;
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
return R.ok(projectService.getMyProjectInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页待办事项
|
||||||
|
*
|
||||||
|
* @param projectId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/getTaskList")
|
@GetMapping("/getTaskList")
|
||||||
public R<List<FlowTaskVo>> getTaskList(FlowTaskBo flowTaskBo) {
|
public R<TaskInfoDto> getTaskList(String projectId) {
|
||||||
|
TaskInfoDto taskInfoDto = new TaskInfoDto();
|
||||||
|
|
||||||
QueryWrapper<FlowTaskBo> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<FlowTaskBo> queryWrapper = new QueryWrapper<>();
|
||||||
List<Long> definitionIds = new ArrayList<>();
|
List<Long> definitionIds = new ArrayList<>();
|
||||||
if (!"0".equals(flowTaskBo.getProjectId())){
|
if (!"0".equals(projectId)) {
|
||||||
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper<FlowDefinition>()
|
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper<FlowDefinition>()
|
||||||
.select(FlowDefinition::getId)
|
.select(FlowDefinition::getId)
|
||||||
.like(FlowDefinition::getFlowCode, flowTaskBo.getProjectId()));
|
.like(FlowDefinition::getFlowCode, projectId));
|
||||||
if (flowDefinitions != null && !flowDefinitions.isEmpty()) {
|
if (flowDefinitions != null && !flowDefinitions.isEmpty()) {
|
||||||
flowDefinitions.forEach(flowDefinition -> {
|
flowDefinitions.forEach(flowDefinition -> {
|
||||||
definitionIds.add(flowDefinition.getId());
|
definitionIds.add(flowDefinition.getId());
|
||||||
@ -63,7 +208,36 @@ public class PersonalHomeController extends BaseController {
|
|||||||
queryWrapper.in("t.processed_by", LoginHelper.getUserIdStr());
|
queryWrapper.in("t.processed_by", LoginHelper.getUserIdStr());
|
||||||
queryWrapper.in("t.flow_status", BusinessStatusEnum.WAITING.getStatus());
|
queryWrapper.in("t.flow_status", BusinessStatusEnum.WAITING.getStatus());
|
||||||
List<FlowTaskVo> page = this.getFlowTaskDefinitionIdsVoPage(definitionIds, queryWrapper);
|
List<FlowTaskVo> page = this.getFlowTaskDefinitionIdsVoPage(definitionIds, queryWrapper);
|
||||||
return R.ok(page);
|
|
||||||
|
//根据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());
|
||||||
|
|
||||||
|
BusPdSjVo busPdSjVo = pdMasterService.queryPageListByDate();
|
||||||
|
BusWjzxSjDateVo busWjzxSjDateVo = busWjzxService.queryWjzx();
|
||||||
|
|
||||||
|
taskInfoDto.setBusWjzxSjDateVo(busWjzxSjDateVo);
|
||||||
|
taskInfoDto.setBusPdSjVo(busPdSjVo);
|
||||||
|
|
||||||
|
return R.ok(taskInfoDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<FlowTaskVo> getFlowTaskDefinitionIdsVoPage(List<Long> definitionIds, QueryWrapper<FlowTaskBo> queryWrapper) {
|
private List<FlowTaskVo> getFlowTaskDefinitionIdsVoPage(List<Long> definitionIds, QueryWrapper<FlowTaskBo> queryWrapper) {
|
||||||
@ -97,4 +271,56 @@ public class PersonalHomeController extends BaseController {
|
|||||||
return map;
|
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<RouterVo>> deptTree() {
|
||||||
|
// SysRole role = roleMapper.selectById(1);
|
||||||
|
List<SysMenu> menus = sysMenuService.selectMenuTreeByUserId(LoginHelper.getUserId(), null);
|
||||||
|
// menus = menus.stream().filter(menu -> "2".equals(menu.getMenuSource())).collect(Collectors.toList());
|
||||||
|
menus = menus.stream().filter(menu -> "1".equals(menu.getMenuSource())).collect(Collectors.toList());
|
||||||
|
return R.ok(sysMenuService.buildMenus(menus));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -211,6 +212,22 @@ public class ProjectBigScreenController extends BaseController {
|
|||||||
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目人员情况
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("project:big:screen")
|
||||||
|
@GetMapping("/ue/people/{projectId}")
|
||||||
|
public R<ProjectPeopleVo> getProjectPeopleUe(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
final Long tdyq = 1897160897167638529L;
|
||||||
|
final Long tdeq = 1968506669544656898L;
|
||||||
|
if (Objects.equals(projectId, tdeq) || Objects.equals(projectId, tdyq)) {
|
||||||
|
return R.ok(projectBigScreenService.getProjectPeopleTianDong());
|
||||||
|
} else {
|
||||||
|
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目形象进度
|
* 查询项目形象进度
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,151 @@
|
|||||||
|
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.SysRoleWork;
|
||||||
|
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||||
|
import org.dromara.bigscreen.service.impl.SysRoleWorkServiceImpl;
|
||||||
|
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.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
|
import org.dromara.system.domain.vo.SysRoleVo;
|
||||||
|
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 SysRoleWorkServiceImpl 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户在制定项目下有流程的角色列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleList/{projectId}")
|
||||||
|
public R<List<SysRoleVo>> getRoleList(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.getRoleList(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前用户在所有项目下所有角色是否有角色流程
|
||||||
|
*/
|
||||||
|
@GetMapping("/isHaveValue")
|
||||||
|
public R<Boolean> isHaveValue() {
|
||||||
|
return R.ok(sysRoleWorkService.isHaveValue(LoginHelper.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户和项目判断是否有角色流程
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleWork/{projectId}")
|
||||||
|
public R<Boolean> getRoleWorkByProject(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.isHaveValueByProject(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取角色对应流程 弃用
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleToWork/{projectId}")
|
||||||
|
public R<SysRoleWork> getRoleWork(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.getRoleWork(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取有对应流程并且包含角色列表的项目列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getProjectRoles")
|
||||||
|
public R<List<BusProjectVo>> getProjectRoles() {
|
||||||
|
return R.ok(sysRoleWorkService.getProjectRoles());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,58 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusAttendanceByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private String userName; // 人员姓名
|
|
||||||
|
|
||||||
private String pacePhoto; // 人脸照
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String clockOn; // 上午打卡
|
|
||||||
|
|
||||||
private String clockOff; // 下午打卡
|
|
||||||
|
|
||||||
private String printingDate; // 年月日打卡时间
|
|
||||||
|
|
||||||
private String isPinch; // 1正常,2迟到,3早退,4缺勤,5补卡
|
|
||||||
|
|
||||||
private String openid; // 微信id
|
|
||||||
|
|
||||||
private String pinchOpenId; // 代打id
|
|
||||||
|
|
||||||
private String clockRecord; // 多次打卡时间记录
|
|
||||||
|
|
||||||
private String pinchUserName; // 代打人姓名
|
|
||||||
|
|
||||||
private String commuter; // 上下班(1上班 2下班)
|
|
||||||
|
|
||||||
private String punchRange; // 打卡范围
|
|
||||||
|
|
||||||
private BigDecimal dailyWage; // 日薪
|
|
||||||
|
|
||||||
private String lng; // 经度
|
|
||||||
|
|
||||||
private String lat; // 纬度
|
|
||||||
|
|
||||||
private String location; // 逆编码地址信息
|
|
||||||
|
|
||||||
private LocalDateTime missing; // 缺卡统一处理时间
|
|
||||||
}
|
|
||||||
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,91 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("bus_construction_user")
|
|
||||||
public class BusConstructionUser {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private String openid; // 微信id
|
|
||||||
|
|
||||||
private String nickName; // 微信名称
|
|
||||||
|
|
||||||
private Long teamId; // 班组id
|
|
||||||
|
|
||||||
private String headIcon; // 登陆照片
|
|
||||||
|
|
||||||
private String pacePhoto; // 人脸照
|
|
||||||
|
|
||||||
private String userName; // 人员姓名
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String status; // 状态(0在职 1离职)-字典position_status
|
|
||||||
|
|
||||||
private String isPinch; // 是否代打
|
|
||||||
|
|
||||||
private String ifManagement; // 是否班组管理
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String phone; // 电话
|
|
||||||
|
|
||||||
private String sex; // 1:男,2女,3保密
|
|
||||||
|
|
||||||
private String sfzNation; // 身份证民族
|
|
||||||
|
|
||||||
private String sfzNumber; // 身份证号码
|
|
||||||
|
|
||||||
private String sfzStart; // 身份证有效开始期
|
|
||||||
|
|
||||||
private String sfzEnd; // 身份证有效结束期
|
|
||||||
|
|
||||||
private String sfzSite; // 身份证地址
|
|
||||||
|
|
||||||
private String sfzBirth; // 身份证出生日期
|
|
||||||
|
|
||||||
private String nativePlace; // 籍贯
|
|
||||||
|
|
||||||
private String yhkNumber; // 银行卡号
|
|
||||||
|
|
||||||
private String yhkOpeningBank; // 开户行
|
|
||||||
|
|
||||||
private String yhkCardholder; // 持卡人
|
|
||||||
|
|
||||||
private String typeOfWork; // 工种(字典)
|
|
||||||
|
|
||||||
private String clock; // 打卡(1启用打卡 2禁止打卡)
|
|
||||||
|
|
||||||
private Long labourserviceId; // 劳务公司id
|
|
||||||
|
|
||||||
private String entryDate; // 入场时间
|
|
||||||
|
|
||||||
private String leaveDate; // 离场时间
|
|
||||||
|
|
||||||
private BigDecimal salary; // 薪水(为0表示无效)
|
|
||||||
|
|
||||||
private String projectRecord; // 是否开启项目备案(1开启 2不开启)
|
|
||||||
|
|
||||||
private String wxOrPc; // 哪添加的(1表示pc 2表示小程序)
|
|
||||||
|
|
||||||
private String subscription; // 消息订阅状态(1订阅 2无订阅)
|
|
||||||
|
|
||||||
private String devNum; // 安全帽设备标识
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业大事记
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("bus_corporate_events")
|
|
||||||
public class BusCorporateEvents {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
private String headline;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private Long createdBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private Long updatedBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime updatedAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除时间(软删除标记)
|
|
||||||
*/
|
|
||||||
private LocalDateTime deletedAt;
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusProjectTeamByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String name; // 班组名称
|
|
||||||
|
|
||||||
private String isClockIn; // 范围内打卡(0范围内打卡 1任何地点打卡)
|
|
||||||
|
|
||||||
private String punchRange; // 打卡范围(id串)
|
|
||||||
|
|
||||||
private String remark; // 备注
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private Long createDept; // 创建部门
|
|
||||||
|
|
||||||
private LocalDateTime createTime; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updateTime; // 更新时间
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusProjectTeamMemberByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long teamId; // 班组id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private Long memberId; // 施工人员id
|
|
||||||
|
|
||||||
private String postId; // 岗位(0普通员工,1组长)
|
|
||||||
|
|
||||||
private String remark; // 备注
|
|
||||||
|
|
||||||
private LocalDateTime createTime; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updateTime; // 更新时间
|
|
||||||
}
|
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片id
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
private Long imgId;
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核标志
|
||||||
|
*/
|
||||||
|
private String auditStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工具类型 1内部 ,2外部
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*/
|
||||||
|
private String gnms;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusTour {
|
|
||||||
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String tourCategory; // 类别字典(如:无人机识别、监控拍摄)
|
|
||||||
|
|
||||||
private String tourType; // 类型字典(如:安全帽、安全带)
|
|
||||||
|
|
||||||
private String picture; // 图片路径
|
|
||||||
|
|
||||||
private Integer num; // 违规数量
|
|
||||||
|
|
||||||
private String describe; // 故障描述
|
|
||||||
|
|
||||||
private Date createdAt; // 创建时间
|
|
||||||
|
|
||||||
private Date updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private Date deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String tableName; // 表名
|
|
||||||
|
|
||||||
private Long tableId; // 表id
|
|
||||||
|
|
||||||
private String sxtName; // 摄像头名称
|
|
||||||
}
|
|
||||||
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,34 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("sys_project_introduce")
|
|
||||||
public class SysProjectIntroduce {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String headline; // 标题
|
|
||||||
|
|
||||||
private String richText; // 富文本
|
|
||||||
|
|
||||||
private String createdBy; // 创建人
|
|
||||||
|
|
||||||
private String updatedBy; // 更新人
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String files; // 附件
|
|
||||||
}
|
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String lcmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程描述
|
||||||
|
*/
|
||||||
|
private String lcms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程详情
|
||||||
|
*/
|
||||||
|
private String lcxq;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
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,62 @@
|
|||||||
|
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 Long imgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核标志
|
||||||
|
*/
|
||||||
|
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,39 @@
|
|||||||
|
package org.dromara.bigscreen.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*知识库上传数据
|
||||||
|
*/
|
||||||
|
private BusWjzxSjDateVo busWjzxSjDateVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单数据
|
||||||
|
*/
|
||||||
|
private BusPdSjVo busPdSjVo;
|
||||||
|
|
||||||
|
}
|
||||||
@ -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,19 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusPdSjVo {
|
||||||
|
/**
|
||||||
|
* 我的派单
|
||||||
|
*/
|
||||||
|
private Long wdpdrw;
|
||||||
|
/**
|
||||||
|
* 其他派单
|
||||||
|
*/
|
||||||
|
private Long qtbmpd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
private Long imgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工具类型 1内部 ,2外部
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工具类型 1内部 ,2外部")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "功能描述")
|
||||||
|
private String gnms;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusWjzxSjDateVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最近上传
|
||||||
|
*/
|
||||||
|
private Long zjsc;
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
*/
|
||||||
|
private Long zs;
|
||||||
|
}
|
||||||
@ -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,72 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为当前节点(0不是 1是)
|
||||||
|
*/
|
||||||
|
private Integer active = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
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 principal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目概括
|
||||||
|
*/
|
||||||
|
private String projectGeneralize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDate StartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDate endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 里程碑
|
||||||
|
*/
|
||||||
|
private List<MilestoneVo> milestones;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度
|
||||||
|
*/
|
||||||
|
private BigDecimal progress;
|
||||||
|
}
|
||||||
@ -16,6 +16,11 @@ public class ProjectImageProgressDetailVo implements Serializable {
|
|||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = -8317739851423164942L;
|
private static final long serialVersionUID = -8317739851423164942L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进度名称
|
* 进度名称
|
||||||
*/
|
*/
|
||||||
@ -36,4 +41,9 @@ public class ProjectImageProgressDetailVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal totalProgress;
|
private BigDecimal totalProgress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,69 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "绑定项目ID")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色名称
|
||||||
|
*/
|
||||||
|
private String roleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "流程名称")
|
||||||
|
private String lcmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "流程描述")
|
||||||
|
private String lcms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程详情
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "流程详情")
|
||||||
|
private String lcxq;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -41,7 +41,7 @@ public class RedisMessageListener implements MessageListener {
|
|||||||
public void onMessage(Message message, byte[] pattern) {
|
public void onMessage(Message message, byte[] pattern) {
|
||||||
try {
|
try {
|
||||||
// 1. 快速日志记录(证明监听到消息)
|
// 1. 快速日志记录(证明监听到消息)
|
||||||
log.info("【Redis消息监听】收到消息,长度:{}字节,提交异步处理", message.getBody().length);
|
// log.info("【Redis消息监听】收到消息,长度:{}字节,提交异步处理", message.getBody().length);
|
||||||
|
|
||||||
// 2. 提交给异步服务处理(核心:线程分离,监听线程立即返回)
|
// 2. 提交给异步服务处理(核心:线程分离,监听线程立即返回)
|
||||||
asyncMessageHandlerService.handleRedisMessageAsync(message);
|
asyncMessageHandlerService.handleRedisMessageAsync(message);
|
||||||
|
|||||||
@ -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,31 @@
|
|||||||
|
package org.dromara.bigscreen.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||||
|
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.dromara.system.domain.SysUserRole;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色流程对应Mapper接口
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-06
|
||||||
|
*/
|
||||||
|
public interface SysRoleWorkMapper extends BaseMapperPlus<SysRoleWork, SysRoleWorkVo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录人id和项目ID获取对应角色
|
||||||
|
*/
|
||||||
|
@Select("select * from sys_user_role where user_id = #{userId} and project_id = #{projectId}")
|
||||||
|
List<SysUserRole> getRoleList(Long userId,Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录人id获取所有项目下所有角色
|
||||||
|
*/
|
||||||
|
@Select("select * from sys_user_role where user_id = #{userId}")
|
||||||
|
List<SysUserRole> getAllRoleList(Long userId);
|
||||||
|
|
||||||
|
}
|
||||||
@ -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,76 @@
|
|||||||
|
package org.dromara.bigscreen.service;
|
||||||
|
|
||||||
|
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
|
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); /**
|
||||||
|
* 分页查询文件中心列表
|
||||||
|
*
|
||||||
|
* @return 文件中心分页列表
|
||||||
|
*/
|
||||||
|
BusWjzxSjDateVo queryWjzx();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的文件中心列表
|
||||||
|
*
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
@ -60,6 +60,13 @@ public interface ProjectBigScreenService {
|
|||||||
*/
|
*/
|
||||||
ProjectPeopleVo getProjectPeople(Long projectId);
|
ProjectPeopleVo getProjectPeople(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员(田东一二期)
|
||||||
|
*
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
ProjectPeopleVo getProjectPeopleTianDong();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目形象进度
|
* 获取项目形象进度
|
||||||
*
|
*
|
||||||
@ -89,6 +96,7 @@ public interface ProjectBigScreenService {
|
|||||||
void setList(GpsEquipmentBo bo);
|
void setList(GpsEquipmentBo bo);
|
||||||
|
|
||||||
List<Map<String, Object>> getClientList(Long projectId);
|
List<Map<String, Object>> getClientList(Long projectId);
|
||||||
|
|
||||||
List<String> getUeClientList();
|
List<String> getUeClientList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
try {
|
try {
|
||||||
// 1. 解析消息体(只解析一次,避免重复操作)
|
// 1. 解析消息体(只解析一次,避免重复操作)
|
||||||
byte[] messageBody = message.getBody();
|
byte[] messageBody = message.getBody();
|
||||||
if (messageBody == null || messageBody.length == 0) {
|
if (messageBody.length == 0) {
|
||||||
log.warn("【异步消息处理】消息体为空,忽略处理");
|
log.warn("【异步消息处理】消息体为空,忽略处理");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -76,8 +76,8 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String key = "";
|
String key;
|
||||||
DroProjectDrone droProjectDrone = null;
|
DroProjectDrone droProjectDrone;
|
||||||
boolean isOsd4 = false;
|
boolean isOsd4 = false;
|
||||||
|
|
||||||
// 5. 根据data字段内容判断key类型,并查询无人机信息
|
// 5. 根据data字段内容判断key类型,并查询无人机信息
|
||||||
@ -143,14 +143,14 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
|
|
||||||
private String buildPushMessage(String key, String message, Long projectId) {
|
private String buildPushMessage(String key, String message, Long projectId) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "wrj_DATA_UPDATE");
|
messageObj.set("type", "wrj_DATA_UPDATE");
|
||||||
messageObj.put("projectId",projectId.toString());
|
messageObj.set("projectId", projectId.toString());
|
||||||
messageObj.put("clientId",key);
|
messageObj.set("clientId", key);
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject locationObj = new JSONObject();
|
JSONObject locationObj = new JSONObject();
|
||||||
locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
locationObj.set("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
||||||
locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
locationObj.set("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
||||||
messageObj.put("location", locationObj);
|
messageObj.set("location", locationObj);
|
||||||
return messageObj.toString();
|
return messageObj.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,19 +161,19 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
private String ueStructureJsonMessage(String message, String modelId) {
|
private String ueStructureJsonMessage(String message, String modelId) {
|
||||||
// 构造消息对象(包含关键信息)
|
// 构造消息对象(包含关键信息)
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", modelId);
|
data.set("id", modelId);
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", JSONUtil.parseObj(message).getJSONObject("data").get("height")); // 海拔
|
position.set("alt", JSONUtil.parseObj(message).getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
|
|
||||||
// 转换为String类型返回
|
// 转换为String类型返回
|
||||||
return messageObj.toString();
|
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,207 @@
|
|||||||
|
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.bigscreen.domain.vo.BusWjzxVo;
|
||||||
|
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.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.ArrayList;
|
||||||
|
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;
|
||||||
|
|
||||||
|
private final SysOssServiceImpl sysOssService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询实用工具
|
||||||
|
*
|
||||||
|
* @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 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<Long> temp = new ArrayList<>();
|
||||||
|
for (Long id : ids) {
|
||||||
|
BusSygjVo busSygjVo = baseMapper.selectVoById(id);
|
||||||
|
temp.add(busSygjVo.getImgId());
|
||||||
|
}
|
||||||
|
sysOssService.deleteWithValidByIds(temp, false);
|
||||||
|
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,216 @@
|
|||||||
|
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.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
|
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.common.satoken.utils.LoginHelper;
|
||||||
|
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.time.LocalDate;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusWjzxSjDateVo queryWjzx() {
|
||||||
|
BusWjzxSjDateVo busWjzxSjDateVo = new BusWjzxSjDateVo();
|
||||||
|
Long zjsc = baseMapper.selectCount(new LambdaQueryWrapper<BusWjzx>().ge(BusWjzx::getCreateTime, LocalDate.now()));
|
||||||
|
Long zs = this.count();
|
||||||
|
busWjzxSjDateVo.setZs(zs);
|
||||||
|
busWjzxSjDateVo.setZjsc(zjsc);
|
||||||
|
|
||||||
|
return busWjzxSjDateVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的文件中心列表
|
||||||
|
*
|
||||||
|
* @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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -234,6 +234,91 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员
|
||||||
|
*
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProjectPeopleVo getProjectPeopleTianDong() {
|
||||||
|
final Long tdyq = 1897160897167638529L;
|
||||||
|
final Long tdeq = 1968506669544656898L;
|
||||||
|
List<Long> ids = List.of(tdeq, tdyq);
|
||||||
|
BusProject project = projectService.getById(tdyq);
|
||||||
|
// 获取大屏数据
|
||||||
|
ProjectPeopleVo vo = new ProjectPeopleVo();
|
||||||
|
// 获取施工人员总数
|
||||||
|
List<SubConstructionUser> list = constructionUserService.lambdaQuery()
|
||||||
|
.in(SubConstructionUser::getProjectId, ids)
|
||||||
|
.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId).list();
|
||||||
|
List<Long> sysUserIdList = list.stream().map(SubConstructionUser::getSysUserId).toList();
|
||||||
|
int count = list.size();
|
||||||
|
BigDecimal countDec = BigDecimal.valueOf(count);
|
||||||
|
vo.setPeopleCount(countDec);
|
||||||
|
// 获取考勤数据
|
||||||
|
List<Long> attendancePeopleList1 = attendanceService.listAttendancePeopleByProjectId(tdyq);
|
||||||
|
List<Long> attendancePeopleList2 = attendanceService.listAttendancePeopleByProjectId(tdeq);
|
||||||
|
List<Long> attendancePeopleList = new ArrayList<>();
|
||||||
|
attendancePeopleList.addAll(attendancePeopleList1);
|
||||||
|
attendancePeopleList.addAll(attendancePeopleList2);
|
||||||
|
BigDecimal attendanceSize = BigDecimal.valueOf(attendancePeopleList.size());
|
||||||
|
vo.setAttendanceCount(attendanceSize);
|
||||||
|
// 计算考勤率
|
||||||
|
vo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceSize, countDec));
|
||||||
|
if (count != 0) {
|
||||||
|
// 统计班组人数
|
||||||
|
List<BusProjectTeamMember> memberList = projectTeamMemberService.lambdaQuery()
|
||||||
|
.select(BusProjectTeamMember::getId, BusProjectTeamMember::getTeamId)
|
||||||
|
.in(BusProjectTeamMember::getProjectId, ids)
|
||||||
|
.in(BusProjectTeamMember::getMemberId, sysUserIdList)
|
||||||
|
.list();
|
||||||
|
Map<Long, List<BusProjectTeamMember>> memberMap = memberList.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusProjectTeamMember::getTeamId));
|
||||||
|
// 统计班组考勤数据
|
||||||
|
Map<Long, List<SubConstructionUser>> userTeamMap = new HashMap<>();
|
||||||
|
if (CollUtil.isNotEmpty(attendancePeopleList)) {
|
||||||
|
List<SubConstructionUser> users = constructionUserService.lambdaQuery()
|
||||||
|
.in(SubConstructionUser::getSysUserId, attendancePeopleList)
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId)
|
||||||
|
.list();
|
||||||
|
userTeamMap = users.stream()
|
||||||
|
.collect(Collectors.groupingBy(SubConstructionUser::getTeamId));
|
||||||
|
}
|
||||||
|
List<BusProjectTeam> teamList = projectTeamService.lambdaQuery()
|
||||||
|
.in(BusProjectTeam::getProjectId, ids)
|
||||||
|
.list();
|
||||||
|
String punchRange = project.getPunchRange();
|
||||||
|
String punchTime = "";
|
||||||
|
if (punchRange != null) {
|
||||||
|
String start = punchRange.split(",")[0];
|
||||||
|
punchTime = LocalDate.now() + " ";
|
||||||
|
}
|
||||||
|
List<ProjectTeamAttendanceVo> listVo = new ArrayList<>();
|
||||||
|
for (BusProjectTeam projectTeam : teamList) {
|
||||||
|
ProjectTeamAttendanceVo teamAttendanceVo = new ProjectTeamAttendanceVo();
|
||||||
|
Long id = projectTeam.getId();
|
||||||
|
teamAttendanceVo.setId(id);
|
||||||
|
teamAttendanceVo.setTeamName(projectTeam.getTeamName());
|
||||||
|
teamAttendanceVo.setAttendanceTime(punchTime);
|
||||||
|
BigDecimal allNumber = BigDecimal.ZERO;
|
||||||
|
if (memberMap.containsKey(id)) {
|
||||||
|
allNumber = BigDecimal.valueOf(memberMap.get(id).size());
|
||||||
|
}
|
||||||
|
BigDecimal attendanceNumber = BigDecimal.ZERO;
|
||||||
|
if (CollUtil.isNotEmpty(userTeamMap) && userTeamMap.containsKey(id)) {
|
||||||
|
attendanceNumber = BigDecimal.valueOf(userTeamMap.get(id).size());
|
||||||
|
}
|
||||||
|
teamAttendanceVo.setAttendanceNumber(attendanceNumber);
|
||||||
|
teamAttendanceVo.setAllNumber(allNumber);
|
||||||
|
teamAttendanceVo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceNumber, allNumber));
|
||||||
|
listVo.add(teamAttendanceVo);
|
||||||
|
}
|
||||||
|
vo.setTeamAttendanceList(listVo);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目形象进度
|
* 获取项目形象进度
|
||||||
*
|
*
|
||||||
@ -438,9 +523,15 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
Long projectId = req.getProjectId();
|
Long projectId = req.getProjectId();
|
||||||
String progressName = req.getProgressName();
|
String progressName = req.getProgressName();
|
||||||
checkProject(projectId);
|
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()
|
PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery()
|
||||||
.eq(PgsProgressCategory::getProjectId, projectId)
|
.in(PgsProgressCategory::getProjectId, projectIds)
|
||||||
.eq(PgsProgressCategory::getName, progressName)
|
.eq(PgsProgressCategory::getName, progressName)
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
.one();
|
.one();
|
||||||
@ -448,18 +539,38 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
Long topId = progressCategory.getId();
|
Long topId = progressCategory.getId();
|
||||||
|
final List<String> gfcqName = List.of("场地平整", "桩基成孔", "桩基浇筑", "支架安装", "组件安装");
|
||||||
// 查出所有属于该顶级节点的子孙节点
|
// 查出所有属于该顶级节点的子孙节点
|
||||||
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
||||||
Wrappers.<PgsProgressCategory>lambdaQuery()
|
Wrappers.<PgsProgressCategory>lambdaQuery()
|
||||||
.and(wrapper -> {
|
.in(progressName.equals("光伏场区"), PgsProgressCategory::getName, gfcqName)
|
||||||
|
.and(wrapper ->
|
||||||
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
||||||
.or()
|
.or()
|
||||||
.like(PgsProgressCategory::getAncestors, "," + topId);
|
.like(PgsProgressCategory::getAncestors, "," + topId))
|
||||||
})
|
|
||||||
);
|
);
|
||||||
if (allChildren.isEmpty()) {
|
if (allChildren.isEmpty()) {
|
||||||
return Collections.emptyList();
|
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()
|
Set<Long> parentIds = allChildren.stream()
|
||||||
.map(PgsProgressCategory::getParentId)
|
.map(PgsProgressCategory::getParentId)
|
||||||
@ -471,6 +582,8 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (CollUtil.isEmpty(dierList)) {
|
if (CollUtil.isEmpty(dierList)) {
|
||||||
return allChildren.stream().map(c -> {
|
return allChildren.stream().map(c -> {
|
||||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||||
|
vo.setId(c.getId());
|
||||||
|
vo.setUnit(c.getUnit());
|
||||||
vo.setProgressName(c.getName());
|
vo.setProgressName(c.getName());
|
||||||
vo.setPlanProgress(c.getPlanTotal());
|
vo.setPlanProgress(c.getPlanTotal());
|
||||||
vo.setActualProgress(c.getCompleted());
|
vo.setActualProgress(c.getCompleted());
|
||||||
@ -491,6 +604,8 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||||
|
vo.setId(c.getId());
|
||||||
|
vo.setUnit(c.getUnit());
|
||||||
vo.setProgressName(c.getName());
|
vo.setProgressName(c.getName());
|
||||||
vo.setPlanProgress(plan);
|
vo.setPlanProgress(plan);
|
||||||
vo.setActualProgress(actual);
|
vo.setActualProgress(actual);
|
||||||
@ -720,38 +835,38 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (voList != null && !voList.isEmpty()) {
|
if (voList != null && !voList.isEmpty()) {
|
||||||
for (GpsEquipmentSonVo item : voList) {
|
for (GpsEquipmentSonVo item : voList) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", item.getModelId());
|
data.set("id", item.getModelId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", item.getLocLatitude()); // 纬度
|
position.set("lat", item.getLocLatitude()); // 纬度
|
||||||
position.put("lng", item.getLocLongitude()); // 经度
|
position.set("lng", item.getLocLongitude()); // 经度
|
||||||
position.put("alt", item.getLocAltitude()); // 海拔
|
position.set("alt", item.getLocAltitude()); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (appList != null && !appList.isEmpty()) {
|
if (appList != null && !appList.isEmpty()) {
|
||||||
for (GpsEquipmentSonVo item : appList) {
|
for (GpsEquipmentSonVo item : appList) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", item.getModelId());
|
data.set("id", item.getModelId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", item.getLocLatitude()); // 纬度
|
position.set("lat", item.getLocLatitude()); // 纬度
|
||||||
position.put("lng", item.getLocLongitude()); // 经度
|
position.set("lng", item.getLocLongitude()); // 经度
|
||||||
position.put("alt", item.getLocAltitude()); // 海拔
|
position.set("alt", item.getLocAltitude()); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -767,19 +882,19 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (object != null) {
|
if (object != null) {
|
||||||
JSONObject object1 = JSONUtil.parseObj(object);
|
JSONObject object1 = JSONUtil.parseObj(object);
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", key.getAirplaneModleId());
|
data.set("id", key.getAirplaneModleId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", object1.getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", object1.getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", object1.getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", object1.getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", object1.getJSONObject("data").get("height")); // 海拔
|
position.set("alt", object1.getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
} else {
|
} else {
|
||||||
Object object2 = stringRedisTemplate.opsForValue().get("wrj:osd3:" + key);
|
Object object2 = stringRedisTemplate.opsForValue().get("wrj:osd3:" + key);
|
||||||
@ -787,19 +902,19 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
JSONObject object3 = JSONUtil.parseObj(object2);
|
JSONObject object3 = JSONUtil.parseObj(object2);
|
||||||
|
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", key.getDroneModleId());
|
data.set("id", key.getDroneModleId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", object3.getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", object3.getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", object3.getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", object3.getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", object3.getJSONObject("data").get("height")); // 海拔
|
position.set("alt", object3.getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,320 @@
|
|||||||
|
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.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.project.domain.dto.project.BusProjectQueryReq;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
|
import org.dromara.project.service.impl.BusProjectServiceImpl;
|
||||||
|
import org.dromara.system.domain.SysUserRole;
|
||||||
|
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;
|
||||||
|
@Autowired
|
||||||
|
private BusProjectServiceImpl projectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询角色流程对应
|
||||||
|
*
|
||||||
|
* @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::getCreateTime);
|
||||||
|
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 = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, bo.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId, bo.getProjectId());
|
||||||
|
List<SysRoleWork> workVos = list(lqw);
|
||||||
|
if (!workVos.isEmpty()) {
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SysRoleVo> getRoleList(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
List<SysUserRole> list = baseMapper.getRoleList(userId,projectId);
|
||||||
|
List<SysRoleVo> roleList = new ArrayList<>();
|
||||||
|
for (SysUserRole sysUserRole : list) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
SysRoleWork one = getOne(lqw);
|
||||||
|
|
||||||
|
if (one != null){
|
||||||
|
SysRoleVo sysRoleVo = roleService.selectRoleById(sysUserRole.getRoleId());
|
||||||
|
if (sysRoleVo != null){
|
||||||
|
roleList.add(sysRoleVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return roleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断此角色在所有项目下所有角色是否有流程
|
||||||
|
*/
|
||||||
|
public Boolean isHaveValue(Long userId){
|
||||||
|
List<SysUserRole> allRoleList = baseMapper.getAllRoleList(userId);
|
||||||
|
for (SysUserRole sysUserRole : allRoleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,sysUserRole.getProjectId());
|
||||||
|
List<SysRoleWork> list = list(lqw);
|
||||||
|
if (list != null && !list.isEmpty()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据当前登录人获取角色流程对应
|
||||||
|
*/
|
||||||
|
public SysRoleWork getRoleWork(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
|
||||||
|
List<SysUserRole> roleList = baseMapper.getRoleList(userId,projectId);
|
||||||
|
|
||||||
|
if (roleList == null || roleList.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SysUserRole userRole : roleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, userRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
SysRoleWork one = getOne(lqw);
|
||||||
|
if (one != null){
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录人在所有项目下有流程的角色列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<BusProjectVo> getProjectRoles(){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
// 获取当前登录用户的所有项目及对应所有角色
|
||||||
|
List<SysUserRole> allRoleList = baseMapper.getAllRoleList(userId);
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
// LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
List<BusProjectVo> busProjectVoList = new ArrayList<>();
|
||||||
|
|
||||||
|
//获取到该用户所有有流程的项目 说明在该项目下该用户有角色有所属流程
|
||||||
|
for (SysUserRole sysUserRole : allRoleList) {
|
||||||
|
// lqw.clear();
|
||||||
|
// lqw.eq(SysRoleWork::getProjectId,sysUserRole.getProjectId());
|
||||||
|
// lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
// SysRoleWork one = getOne(lqw);
|
||||||
|
// if (one != null){
|
||||||
|
// //先拿到该项目
|
||||||
|
// BusProjectQueryReq req = new BusProjectQueryReq();
|
||||||
|
// req.setId(sysUserRole.getProjectId());
|
||||||
|
// List<BusProjectVo> vos = projectService.queryList(req);
|
||||||
|
// if (vos != null && !vos.isEmpty()){
|
||||||
|
// if(!busProjectVoList.contains(vos.getFirst())){
|
||||||
|
// busProjectVoList.add(vos.getFirst());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
BusProjectQueryReq req = new BusProjectQueryReq();
|
||||||
|
req.setId(sysUserRole.getProjectId());
|
||||||
|
List<BusProjectVo> vos = projectService.queryList(req);
|
||||||
|
if (vos != null && !vos.isEmpty()){
|
||||||
|
if(!busProjectVoList.contains(vos.getFirst())){
|
||||||
|
busProjectVoList.add(vos.getFirst());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历
|
||||||
|
List<SysRoleVo> roleVos;
|
||||||
|
for (BusProjectVo projectVo : busProjectVoList) {
|
||||||
|
roleVos = new ArrayList<>();
|
||||||
|
//通过项目查找所有角色
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw1 = new LambdaQueryWrapper<>();
|
||||||
|
lqw1.eq(SysRoleWork::getProjectId,projectVo.getId());
|
||||||
|
//获取角色
|
||||||
|
List<SysRoleWork> roleWorkList = list(lqw1);
|
||||||
|
for (SysRoleWork sysRoleWork : roleWorkList) {
|
||||||
|
SysRoleVo sysRoleVo = roleService.selectRoleById(sysRoleWork.getRoleId());
|
||||||
|
if (sysRoleVo != null){
|
||||||
|
roleVos.add(sysRoleVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectVo.setRoleVos(roleVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return busProjectVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户和项目判断是否有角色流程
|
||||||
|
*/
|
||||||
|
public Boolean isHaveValueByProject(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
List<SysUserRole> roleList = baseMapper.getRoleList(userId, projectId);
|
||||||
|
if (roleList != null && !roleList.isEmpty()){
|
||||||
|
for (SysUserRole userRole : roleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, userRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
List<SysRoleWork> list = list(lqw);
|
||||||
|
if (list != null && !list.isEmpty()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.RemainingReq;
|
import org.dromara.cailiaoshebei.domain.bo.RemainingReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||||
@ -75,6 +76,15 @@ public class BusMrpBaseController extends BaseController {
|
|||||||
return busMrpBaseService.queryPageList(bo, pageQuery);
|
return busMrpBaseService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物资-批次需求计划基础信息列表
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("cailiaoshebei:mrpBase:getListByName")
|
||||||
|
@GetMapping("/getListByName")
|
||||||
|
public R<List<BusMrpBaseVo>> getListByName(BusMrpBaseReq req) {
|
||||||
|
return R.ok(busMrpBaseService.getListByName(req));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出物资-批次需求计划基础信息列表
|
* 导出物资-批次需求计划基础信息列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,37 @@
|
|||||||
|
package org.dromara.cailiaoshebei.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资-批次需求计划基础信息业务对象 bus_mrp_base
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-08-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BusMrpBaseReq implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划编号
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
@ -146,6 +146,11 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal tenderQuantity;
|
private BigDecimal tenderQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已使用数量
|
||||||
|
*/
|
||||||
|
private BigDecimal useQuantity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,4 +57,8 @@ public class BusPlanDocAssociationVo implements Serializable {
|
|||||||
* 需求数量
|
* 需求数量
|
||||||
*/
|
*/
|
||||||
private BigDecimal demandQuantity;
|
private BigDecimal demandQuantity;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.cailiaoshebei.service;
|
package org.dromara.cailiaoshebei.service;
|
||||||
|
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||||
@ -87,4 +88,6 @@ public interface IBusMrpBaseService extends IService<BusMrpBase>{
|
|||||||
* 获取物资已有数量
|
* 获取物资已有数量
|
||||||
*/
|
*/
|
||||||
Map<String, Object> remaining(Long projectId,Long limitListId,Long mrpBaseId);
|
Map<String, Object> remaining(Long projectId,Long limitListId,Long mrpBaseId);
|
||||||
|
|
||||||
|
List<BusMrpBaseVo> getListByName(BusMrpBaseReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user