Compare commits
38 Commits
Author | SHA1 | Date |
---|---|---|
|
c06430f904 | 3 weeks ago |
|
6c7282d275 | 1 month ago |
|
4350264ab7 | 1 month ago |
|
e7f940fba4 | 2 months ago |
|
5fbb50aed4 | 2 months ago |
|
05da6b3509 | 2 months ago |
|
e3d69d5974 | 2 months ago |
|
bfaea94246 | 2 months ago |
|
df5ea5134f | 2 months ago |
|
d343149a94 | 2 months ago |
|
49cbb52d0f | 2 months ago |
|
9c1ac62646 | 2 months ago |
|
7837d3fae4 | 2 months ago |
|
d9af9243ab | 3 months ago |
|
f609375f54 | 4 months ago |
|
1939579464 | 4 months ago |
|
c03745dff5 | 4 months ago |
|
6a0a5c9157 | 5 months ago |
|
cc41f73e97 | 5 months ago |
|
128d481468 | 6 months ago |
|
a73cce8cc1 | 6 months ago |
|
725f50b7a6 | 6 months ago |
|
ec869c79e5 | 6 months ago |
|
9632c38e94 | 6 months ago |
|
fcdb4459e7 | 6 months ago |
|
76cc6e097a | 6 months ago |
|
5244faf3f9 | 7 months ago |
|
70c2d0c799 | 9 months ago |
|
3d86d8470d | 9 months ago |
|
62d42395ba | 9 months ago |
|
a95118c199 | 10 months ago |
|
34887bef26 | 10 months ago |
|
d46728c994 | 10 months ago |
|
2f766cd9de | 10 months ago |
|
62a1db74e7 | 10 months ago |
|
8e6071330e | 12 months ago |
|
9deefe0bb4 | 1 year ago |
|
abdfda1f9c | 1 year ago |
272 changed files with 21238 additions and 228 deletions
@ -0,0 +1,287 @@ |
|||
--- # 临时文件存储位置 避免临时文件被系统清理报错 |
|||
spring.servlet.multipart.location: /ruoyi/server/temp |
|||
|
|||
--- # 监控中心配置 |
|||
spring.boot.admin.client: |
|||
# 增加客户端开关 |
|||
enabled: true |
|||
url: http://localhost:9090/admin |
|||
instance: |
|||
service-host-type: IP |
|||
metadata: |
|||
username: ${spring.boot.admin.client.username} |
|||
userpassword: ${spring.boot.admin.client.password} |
|||
username: ruoyi |
|||
password: 123456 |
|||
server: |
|||
# 端口号 |
|||
port: 8078 |
|||
--- # snail-job 配置 |
|||
snail-job: |
|||
enabled: false |
|||
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务 |
|||
group: "ruoyi_group" |
|||
# SnailJob 接入验证令牌 详见 script/sql/snail_job.sql `sj_group_config` 表 |
|||
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT" |
|||
server: |
|||
host: 127.0.0.1 |
|||
port: 17888 |
|||
# 详见 script/sql/snail_job.sql `sj_namespace` 表 |
|||
namespace: ${spring.profiles.active} |
|||
# 随主应用端口飘逸 |
|||
port: 3${server.port} |
|||
|
|||
--- # 数据源配置 |
|||
spring: |
|||
datasource: |
|||
type: com.zaxxer.hikari.HikariDataSource |
|||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content |
|||
dynamic: |
|||
# 性能分析插件(有性能损耗 不建议生产环境使用) |
|||
p6spy: false |
|||
# 设置默认的数据源或者数据源组,默认值即为 master |
|||
primary: master |
|||
# 严格模式 匹配不到数据源则报错 |
|||
strict: true |
|||
datasource: |
|||
# 主库数据源 |
|||
master: |
|||
type: ${spring.datasource.type} |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
|||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) |
|||
url: jdbc:mysql://localhost:3306/sjjtable?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
|||
username: root |
|||
password: HXj-6nR|D8xy*h#!I&:( |
|||
# 从库数据源 |
|||
# slave: |
|||
# lazy: true |
|||
# type: ${spring.datasource.type} |
|||
# driverClassName: com.mysql.cj.jdbc.Driver |
|||
# url: jdbc:mysql://116.62.210.190:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
|||
# username: root |
|||
# password: Guoyan83086775 |
|||
# oracle: |
|||
# type: ${spring.datasource.type} |
|||
# driverClassName: oracle.jdbc.OracleDriver |
|||
# url: jdbc:oracle:thin:@//localhost:1521/XE |
|||
# username: ROOT |
|||
# password: root |
|||
# postgres: |
|||
# type: ${spring.datasource.type} |
|||
# driverClassName: org.postgresql.Driver |
|||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true |
|||
# username: root |
|||
# password: root |
|||
# sqlserver: |
|||
# type: ${spring.datasource.type} |
|||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver |
|||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true |
|||
# username: SA |
|||
# password: root |
|||
hikari: |
|||
# 最大连接池数量 |
|||
maxPoolSize: 20 |
|||
# 最小空闲线程数量 |
|||
minIdle: 10 |
|||
# 配置获取连接等待超时的时间 |
|||
connectionTimeout: 30000 |
|||
# 校验超时时间 |
|||
validationTimeout: 5000 |
|||
# 空闲连接存活最大时间,默认10分钟 |
|||
idleTimeout: 600000 |
|||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 |
|||
maxLifetime: 1800000 |
|||
# 多久检查一次连接的活性 |
|||
keepaliveTime: 30000 |
|||
|
|||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) |
|||
spring.data: |
|||
redis: |
|||
# 地址 |
|||
host: localhost |
|||
# 端口,默认为6379 |
|||
port: 6381 |
|||
# 数据库索引 |
|||
database: 0 |
|||
# redis 密码必须配置 |
|||
password: F*Nx=BZli+ZCCI-Fil+3 |
|||
# 连接超时时间 |
|||
timeout: 10s |
|||
# 是否开启ssl |
|||
ssl.enabled: false |
|||
|
|||
# redisson 配置 |
|||
redisson: |
|||
# redis key前缀 |
|||
keyPrefix: |
|||
# 线程池数量 |
|||
threads: 16 |
|||
# Netty线程池数量 |
|||
nettyThreads: 32 |
|||
# 单节点配置 |
|||
singleServerConfig: |
|||
# 客户端名称 |
|||
clientName: ${ruoyi.name} |
|||
# 最小空闲连接数 |
|||
connectionMinimumIdleSize: 32 |
|||
# 连接池大小 |
|||
connectionPoolSize: 64 |
|||
# 连接空闲超时,单位:毫秒 |
|||
idleConnectionTimeout: 10000 |
|||
# 命令等待超时,单位:毫秒 |
|||
timeout: 3000 |
|||
# 发布和订阅连接池大小 |
|||
subscriptionConnectionPoolSize: 50 |
|||
|
|||
--- # mail 邮件发送 |
|||
mail: |
|||
enabled: false |
|||
host: smtp.163.com |
|||
port: 465 |
|||
# 是否需要用户名密码验证 |
|||
auth: true |
|||
# 发送方,遵循RFC-822标准 |
|||
from: xxx@163.com |
|||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号) |
|||
user: xxx@163.com |
|||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助) |
|||
pass: xxxxxxxxxx |
|||
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。 |
|||
starttlsEnable: true |
|||
# 使用SSL安全连接 |
|||
sslEnable: true |
|||
# SMTP超时时长,单位毫秒,缺省值不超时 |
|||
timeout: 0 |
|||
# Socket连接超时值,单位毫秒,缺省值不超时 |
|||
connectionTimeout: 0 |
|||
|
|||
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商 |
|||
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用 |
|||
sms: |
|||
# 配置源类型用于标定配置来源(interface,yaml) |
|||
config-type: yaml |
|||
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制 |
|||
restricted: true |
|||
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效 |
|||
minute-max: 1 |
|||
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效 |
|||
account-max: 30 |
|||
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中 |
|||
blends: |
|||
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可 |
|||
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户 |
|||
config1: |
|||
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分 |
|||
supplier: alibaba |
|||
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。 |
|||
access-key-id: 您的accessKey |
|||
# 称为accessSecret有些称之为apiSecret |
|||
access-key-secret: 您的accessKeySecret |
|||
signature: 您的短信签名 |
|||
sdk-app-id: 您的sdkAppId |
|||
config2: |
|||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分 |
|||
supplier: tencent |
|||
access-key-id: 您的accessKey |
|||
access-key-secret: 您的accessKeySecret |
|||
signature: 您的短信签名 |
|||
sdk-app-id: 您的sdkAppId |
|||
|
|||
--- # 三方授权 |
|||
justauth: |
|||
# 前端外网访问地址 |
|||
address: http://localhost:80 |
|||
type: |
|||
maxkey: |
|||
# maxkey 服务器地址 |
|||
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据 |
|||
server-url: http://sso.maxkey.top |
|||
client-id: 876892492581044224 |
|||
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8 |
|||
redirect-uri: ${justauth.address}/social-callback?source=maxkey |
|||
topiam: |
|||
# topiam 服务器地址 |
|||
server-url: http://127.0.0.1:1989/api/v1/authorize/y0q************spq***********8ol |
|||
client-id: 449c4*********937************759 |
|||
client-secret: ac7***********1e0************28d |
|||
redirect-uri: ${justauth.address}/social-callback?source=topiam |
|||
scopes: [ openid, email, phone, profile ] |
|||
qq: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=qq |
|||
union-id: false |
|||
weibo: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=weibo |
|||
gitee: |
|||
client-id: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98 |
|||
client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac |
|||
redirect-uri: ${justauth.address}/social-callback?source=gitee |
|||
dingtalk: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=dingtalk |
|||
baidu: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=baidu |
|||
csdn: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=csdn |
|||
coding: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=coding |
|||
coding-group-name: xx |
|||
oschina: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=oschina |
|||
alipay_wallet: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet |
|||
alipay-public-key: MIIB**************DAQAB |
|||
wechat_open: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=wechat_open |
|||
wechat_mp: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp |
|||
wechat_enterprise: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise |
|||
agent-id: 1000002 |
|||
gitlab: |
|||
client-id: 10**********6 |
|||
client-secret: 1f7d08**********5b7**********29e |
|||
redirect-uri: ${justauth.address}/social-callback?source=gitlab |
|||
#elasticsearch: |
|||
# # es host ip 地址(集群),多个以","间隔 |
|||
# uris: localhost:9200 |
|||
# username: elastic |
|||
# password: 123456789 |
|||
# # es 请求方式 |
|||
# scheme: http |
|||
# # es 连接超时时间(ms) |
|||
# connectTimeOut: 1000 |
|||
# # es socket 连接超时时间(ms) |
|||
# socketTimeOut: 30000 |
|||
# # es 请求超时时间(ms) |
|||
# connectionRequestTimeOut: 500 |
|||
# # es 最大连接数 |
|||
# maxConnectNum: 100 |
|||
# # es 每个路由的最大连接数 |
|||
# maxConnectNumPerRoute: 100 |
|||
chat: |
|||
# 聊天机器人配置 |
|||
filePath: /guoYanXinXi/data/software/sjjapp/minio/data/sjj/ |
|||
tempfilePath: /guoYanXinXi/data/software/sjjapp/app/tempfile |
|||
chatUrl: http://127.0.0.1:8081 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,32 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
|
|||
<parent> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common</artifactId> |
|||
<version>${revision}</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>guoyan-common-elasticsearch</artifactId> |
|||
<description> |
|||
guoyan-common-elasticsearch elasticsearch模块 |
|||
</description> |
|||
<dependencies> |
|||
<!-- <dependency>--> |
|||
<!-- <groupId>org.elasticsearch</groupId>--> |
|||
<!-- <artifactId>elasticsearch</artifactId>--> |
|||
<!-- </dependency>--> |
|||
<!-- <dependency>--> |
|||
<!-- <groupId>org.elasticsearch.client</groupId>--> |
|||
<!-- <artifactId>elasticsearch-rest-high-level-client</artifactId>--> |
|||
<!-- </dependency>--> |
|||
<!-- 序列化模块 --> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-json</artifactId> |
|||
</dependency> |
|||
</dependencies> |
|||
</project> |
@ -0,0 +1,209 @@ |
|||
package org.dromara.common.elasticsearch.config; |
|||
|
|||
//import org.apache.http.HttpHost;
|
|||
//import org.apache.http.auth.AuthScope;
|
|||
//import org.apache.http.auth.UsernamePasswordCredentials;
|
|||
//import org.apache.http.client.CredentialsProvider;
|
|||
//import org.apache.http.impl.client.BasicCredentialsProvider;
|
|||
//import org.elasticsearch.client.RestClient;
|
|||
//import org.elasticsearch.client.RestClientBuilder;
|
|||
//import org.elasticsearch.client.RestHighLevelClient;
|
|||
//import org.springframework.beans.factory.annotation.Value;
|
|||
//import org.springframework.context.annotation.Bean;
|
|||
//import org.springframework.context.annotation.Configuration;
|
|||
//
|
|||
//import java.util.ArrayList;
|
|||
//import java.util.List;
|
|||
|
|||
/** |
|||
* ElasticSearch 配置 |
|||
* |
|||
* @author wqliu |
|||
* @date 2024-02-21 |
|||
*/ |
|||
//@Configuration
|
|||
|
|||
public class ElasticSearchConfig { |
|||
// @Value("${elasticsearch.uris}")
|
|||
// private String hosts;
|
|||
//
|
|||
// @Value("${elasticsearch.username}")
|
|||
// private String userName;
|
|||
//
|
|||
// @Value("${elasticsearch.password}")
|
|||
// private String password;
|
|||
//
|
|||
// /**
|
|||
// * es 请求方式
|
|||
// */
|
|||
// @Value("${elasticsearch.scheme}")
|
|||
// private String scheme;
|
|||
// /**
|
|||
// * es 连接超时时间
|
|||
// */
|
|||
// @Value("${elasticsearch.connectTimeOut}")
|
|||
//
|
|||
// private int connectTimeOut;
|
|||
// /**
|
|||
// * es socket 连接超时时间
|
|||
// */
|
|||
// @Value("${elasticsearch.socketTimeOut}")
|
|||
//
|
|||
// private int socketTimeOut;
|
|||
// /**
|
|||
// * es 请求超时时间
|
|||
// */
|
|||
// @Value("${elasticsearch.connectionRequestTimeOut}")
|
|||
// private int connectionRequestTimeOut;
|
|||
// /**
|
|||
// * es 最大连接数
|
|||
// */
|
|||
// @Value("${elasticsearch.maxConnectNum}")
|
|||
// private int maxConnectNum;
|
|||
// /**
|
|||
// * es 每个路由的最大连接数
|
|||
// */
|
|||
// @Value("${elasticsearch.maxConnectNumPerRoute}")
|
|||
// private int maxConnectNumPerRoute;
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 如果@Bean没有指定bean的名称,那么方法名就是bean的名称
|
|||
// */
|
|||
// @Bean
|
|||
// public RestHighLevelClient restHighLevelClient() {
|
|||
// // 构建连接对象
|
|||
// RestClientBuilder builder = RestClient.builder(getEsHost());
|
|||
//
|
|||
// // 连接延时配置
|
|||
// builder.setRequestConfigCallback(requestConfigBuilder -> {
|
|||
// requestConfigBuilder.setConnectTimeout(connectTimeOut);
|
|||
// requestConfigBuilder.setSocketTimeout(socketTimeOut);
|
|||
// requestConfigBuilder.setConnectionRequestTimeout(connectionRequestTimeOut);
|
|||
// return requestConfigBuilder;
|
|||
// });
|
|||
//
|
|||
// // 连接数配置
|
|||
// builder.setHttpClientConfigCallback(httpClientBuilder -> {
|
|||
// httpClientBuilder.setMaxConnTotal(maxConnectNum);
|
|||
// httpClientBuilder.setMaxConnPerRoute(maxConnectNumPerRoute);
|
|||
// httpClientBuilder.setDefaultCredentialsProvider(getCredentialsProvider());
|
|||
//
|
|||
// return httpClientBuilder;
|
|||
// });
|
|||
// return new RestHighLevelClient(builder);
|
|||
// }
|
|||
//
|
|||
// private HttpHost[] getEsHost() {
|
|||
// // 拆分地址(es为多节点时,不同host以逗号间隔)
|
|||
// List<HttpHost> hostLists = new ArrayList<>();
|
|||
// String[] hostList = hosts.split(",");
|
|||
// for (String addr : hostList) {
|
|||
// String host = addr.split(":")[0];
|
|||
// String port = addr.split(":")[1];
|
|||
// hostLists.add(new HttpHost(host, Integer.parseInt(port), scheme));
|
|||
// }
|
|||
// // 转换成 HttpHost 数组
|
|||
// return hostLists.toArray(new HttpHost[]{});
|
|||
// }
|
|||
//
|
|||
// private CredentialsProvider getCredentialsProvider() {
|
|||
// // 设置用户名、密码
|
|||
// CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
|||
// credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
|
|||
// return credentialsProvider;
|
|||
// }
|
|||
|
|||
/** |
|||
* 同步方式 |
|||
* |
|||
* @return |
|||
*/ |
|||
// @Bean
|
|||
// public ElasticsearchClient elasticsearchClient() throws Exception {
|
|||
//// HttpHost[] httpHosts = toHttpHost();
|
|||
// final CredentialsProvider credentialsProvider =
|
|||
// new BasicCredentialsProvider();
|
|||
// credentialsProvider.setCredentials(AuthScope.ANY,
|
|||
// new UsernamePasswordCredentials(userName, passWord));
|
|||
//
|
|||
// ClassPathResource resource = new ClassPathResource("http_ca.crt");
|
|||
// CertificateFactory factory =
|
|||
// CertificateFactory.getInstance("X.509");
|
|||
// Certificate trustedCa;
|
|||
// try (InputStream is = resource.getInputStream()) {
|
|||
// trustedCa = factory.generateCertificate(is);
|
|||
// }
|
|||
// KeyStore trustStore = KeyStore.getInstance("pkcs12");
|
|||
// trustStore.load(null, null);
|
|||
// trustStore.setCertificateEntry("ca", trustedCa);
|
|||
// SSLContextBuilder sslContextBuilder = SSLContexts.custom()
|
|||
// .loadTrustMaterial(trustStore, null);
|
|||
// final SSLContext sslContext = sslContextBuilder.build();
|
|||
//
|
|||
// RestClientBuilder builder = RestClient.builder(
|
|||
// new HttpHost("localhost", 9200, "https"))
|
|||
// .setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
|
|||
// @Override
|
|||
// public HttpAsyncClientBuilder customizeHttpClient(
|
|||
// HttpAsyncClientBuilder httpClientBuilder) {
|
|||
// return httpClientBuilder.setSSLContext(sslContext)
|
|||
// .setDefaultCredentialsProvider(credentialsProvider);
|
|||
// }
|
|||
// });
|
|||
//
|
|||
// RestClient restClient = builder.build();
|
|||
//
|
|||
// // Create the transport with a Jackson mapper
|
|||
// ElasticsearchTransport transport = new RestClientTransport(
|
|||
// restClient, new JacksonJsonpMapper());
|
|||
//
|
|||
// return new ElasticsearchClient(transport);
|
|||
//// asyncClient = new ElasticsearchAsyncClient(transport);
|
|||
//
|
|||
// }
|
|||
|
|||
// /**
|
|||
// * 解析配置的字符串hosts,转为HttpHost对象数组
|
|||
// *
|
|||
// * @return
|
|||
// */
|
|||
// private HttpHost[] toHttpHost() {
|
|||
// if (!StringUtils.hasLength(hosts)) {
|
|||
// throw new RuntimeException("invalid elasticsearch configuration. elasticsearch.hosts不能为空!");
|
|||
// }
|
|||
// // 多个IP逗号隔开
|
|||
// String[] hostArray = hosts.split(",");
|
|||
// HttpHost[] httpHosts = new HttpHost[hostArray.length];
|
|||
// HttpHost httpHost;
|
|||
// for (int i = 0; i < hostArray.length; i++) {
|
|||
// String[] strings = hostArray[i].split(":");
|
|||
// httpHost = new HttpHost(strings[0], Integer.parseInt(strings[1]), "https");
|
|||
// httpHosts[i] = httpHost;
|
|||
// }
|
|||
// return httpHosts;
|
|||
// }
|
|||
|
|||
// @Bean
|
|||
// ElasticsearchConverter elasticsearchConverter(SimpleElasticsearchMappingContext mappingContext) {
|
|||
// DefaultConversionService defaultConversionService = new DefaultConversionService();
|
|||
// defaultConversionService.addConverter(LongToLocalDateTimeConverter.INSTANCE);
|
|||
// return new MappingElasticsearchConverter(mappingContext, defaultConversionService);
|
|||
// }
|
|||
//
|
|||
// @ReadingConverter
|
|||
// static enum LongToLocalDateTimeConverter implements Converter<Long, LocalDateTime> {
|
|||
// /**
|
|||
// * 单例模式
|
|||
// */
|
|||
// INSTANCE;
|
|||
//
|
|||
// private LongToLocalDateTimeConverter() {
|
|||
// }
|
|||
//
|
|||
// @Override
|
|||
// public LocalDateTime convert(Long source) {
|
|||
// return Instant.ofEpochMilli(source).atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|||
// }
|
|||
// }
|
|||
} |
@ -0,0 +1,147 @@ |
|||
package org.dromara.common.elasticsearch.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
|
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
* |
|||
*/ |
|||
@Data |
|||
@JsonIgnoreProperties(ignoreUnknown = true) |
|||
public class SupplierProductsDTO { |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
@JsonProperty(value ="supplier_information_id") |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 厂商产品型号id |
|||
*/ |
|||
@JsonProperty(value ="model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
@JsonProperty(value ="product_specifications") |
|||
private String productSpecifications; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@JsonProperty(value ="product_name") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
@JsonProperty(value ="product_identity") |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@JsonProperty(value ="product_price") |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
@JsonProperty(value ="source_information") |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@JsonProperty(value ="remarks") |
|||
private String remarks; |
|||
/** |
|||
* 产品图片 |
|||
*/ |
|||
@JsonProperty(value ="image") |
|||
private String image; |
|||
|
|||
/** |
|||
* 产品品牌 |
|||
*/ |
|||
@JsonProperty(value ="brand") |
|||
private String brand; |
|||
|
|||
/** |
|||
* 产品单位*/ |
|||
@JsonProperty(value ="unit") |
|||
private String unit; |
|||
|
|||
/** |
|||
* 除税价格 |
|||
*/ |
|||
@JsonProperty(value ="ex_tax_price") |
|||
private BigDecimal exTaxPrice; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
@JsonProperty(value ="taxrate") |
|||
private BigDecimal taxrate; |
|||
/** |
|||
* 分类id |
|||
*/ |
|||
@JsonProperty(value ="category_id") |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 逻辑删除 |
|||
*/ |
|||
@JsonProperty(value ="delete_flag") |
|||
protected String deleteFlag; |
|||
/** |
|||
* 创建人标识 |
|||
*/ |
|||
|
|||
@JsonProperty(value ="create_id") |
|||
private String createId; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
// @JsonProperty(value ="create_time")
|
|||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
|||
// @DateTimeFormat(pattern = "yyyy-MM-dd")
|
|||
// private Date createTime;
|
|||
|
|||
/** |
|||
* 更新人标识 |
|||
*/ |
|||
|
|||
@JsonProperty(value ="update_id") |
|||
private String updateId; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
// @JsonProperty(value ="update_time")
|
|||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
|||
// @DateTimeFormat(pattern = "yyyy-MM-dd")
|
|||
// private Date updateTime;
|
|||
|
|||
/** |
|||
* 版本 |
|||
*/ |
|||
|
|||
@JsonProperty(value ="version") |
|||
private Integer version; |
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,69 @@ |
|||
package org.dromara.common.encrypt.utils; |
|||
|
|||
import org.bouncycastle.crypto.engines.SM4Engine; |
|||
import org.bouncycastle.crypto.params.KeyParameter; |
|||
import org.bouncycastle.util.encoders.Hex; |
|||
|
|||
import java.nio.charset.StandardCharsets; |
|||
import java.security.SecureRandom; |
|||
|
|||
public class SM4Util { |
|||
|
|||
private static final int BLOCK_SIZE = 16; // 块大小
|
|||
|
|||
// 随机生成 SM4 密钥
|
|||
public static String generateKey() { |
|||
byte[] key = new byte[BLOCK_SIZE]; |
|||
new SecureRandom().nextBytes(key); |
|||
return Hex.toHexString(key); |
|||
} |
|||
|
|||
// 加密
|
|||
public static String encrypt(String plainText, String hexKey) throws Exception { |
|||
byte[] input = plainText.getBytes(StandardCharsets.UTF_8); |
|||
byte[] keyBytes = Hex.decode(hexKey); |
|||
// 计算填充长度
|
|||
int paddingLength = BLOCK_SIZE - (input.length % BLOCK_SIZE); |
|||
byte[] paddedInput = new byte[input.length + paddingLength]; |
|||
|
|||
// 复制原始数据
|
|||
System.arraycopy(input, 0, paddedInput, 0, input.length); |
|||
// PKCS7填充
|
|||
for (int i = input.length; i < paddedInput.length; i++) { |
|||
paddedInput[i] = (byte) paddingLength; |
|||
} |
|||
|
|||
SM4Engine sm4 = new SM4Engine(); |
|||
sm4.init(true, new KeyParameter(keyBytes)); |
|||
|
|||
byte[] encrypted = new byte[paddedInput.length]; |
|||
for (int i = 0; i < paddedInput.length; i += BLOCK_SIZE) { |
|||
sm4.processBlock(paddedInput, i, encrypted, i); |
|||
} |
|||
// SM4Engine sm4 = new SM4Engine();
|
|||
// sm4.init(true, new KeyParameter(keyBytes)); // 加密模式
|
|||
//
|
|||
// byte[] encrypted = new byte[input.length];
|
|||
// for (int i = 0; i < input.length; i += BLOCK_SIZE) {
|
|||
// sm4.processBlock(input, i, encrypted, i);
|
|||
// }
|
|||
|
|||
return Hex.toHexString(encrypted); |
|||
} |
|||
|
|||
// 解密
|
|||
public static String decrypt(String cipherText, String hexKey) throws Exception { |
|||
byte[] keyBytes = Hex.decode(hexKey); |
|||
byte[] encrypted = Hex.decode(cipherText); |
|||
|
|||
SM4Engine sm4 = new SM4Engine(); |
|||
sm4.init(false, new KeyParameter(keyBytes)); // 解密模式
|
|||
|
|||
byte[] decrypted = new byte[encrypted.length]; |
|||
for (int i = 0; i < encrypted.length; i += BLOCK_SIZE) { |
|||
sm4.processBlock(encrypted, i, decrypted, i); |
|||
} |
|||
|
|||
return new String(decrypted, StandardCharsets.UTF_8).trim(); |
|||
} |
|||
} |
@ -0,0 +1,231 @@ |
|||
package org.dromara.common.excel.utils; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.excel.EasyExcel; |
|||
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.NotEmpty; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.io.IOException; |
|||
import java.net.URLEncoder; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* EasyExcel工具类 |
|||
*/ |
|||
public class EasyExcelUtils { |
|||
|
|||
|
|||
/** |
|||
* 注入的具有排序功能的handle |
|||
*/ |
|||
// private static final SortRowWriteHandler SORT_ROW_WRITE_HANDLER = new SortRowWriteHandler();
|
|||
|
|||
/** |
|||
* 导出excel-按指定顺序 |
|||
* |
|||
* @param <T> 类(必须是小写,并遵守阿里开发规范) |
|||
* @param list 列表数据 |
|||
* @param fileName 文件名称 |
|||
* @param useDefaultStyle 是否使用默认样式 |
|||
* @param response 响应 |
|||
*/ |
|||
public static <T> Map<String, Object> exportExcelInclude(List<T> list, String fileName,Boolean useDefaultStyle, HttpServletResponse response) throws IOException { |
|||
Map<String, Object> resultMap = new HashMap<>(); |
|||
if (list.size() == 0) { |
|||
resultMap.put("msg", "数据长度为空"); |
|||
resultMap.put("result", -1); |
|||
return resultMap; |
|||
} |
|||
|
|||
Class<?> clazz = list.get(0).getClass(); |
|||
|
|||
/*定义编码,格式*/ |
|||
response.setContentType("application/vnd.ms-excel"); |
|||
response.setCharacterEncoding("utf-8"); |
|||
String exportFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
|||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + exportFileName + ".xlsx"); |
|||
response.setHeader("filename", exportFileName + ".xlsx"); |
|||
response.setHeader("Access-Control-Expose-Headers", "filename"); |
|||
/** |
|||
* .head(head(headNameList)) |
|||
* 改行代码不可以用ExcelWriterSheetBuilder类型的变量单独写,否则会包错:表头长度与字段列表长度不符 |
|||
*/ |
|||
/*导出表格*/ |
|||
ExcelWriterSheetBuilder excelWriterSheetBuilder = EasyExcel.write(response.getOutputStream(), clazz) |
|||
.useDefaultStyle(useDefaultStyle) |
|||
.sheet(fileName); |
|||
excelWriterSheetBuilder.doWrite(list); |
|||
|
|||
resultMap.put("msg", "excel export success"); |
|||
resultMap.put("result", 0); |
|||
return resultMap; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 导出excel-默认顺序 |
|||
* |
|||
* @param <T> 类(必须是小写,并遵守阿里开发规范) |
|||
* @param list 列表数据 |
|||
* @param fileName 文件名称 |
|||
* @param useDefaultStyle 是否使用默认样式 |
|||
* @param response 响应 |
|||
* @param headNameList |
|||
* @param columnList 设置列字段(必须是小写) |
|||
*/ |
|||
public static <T> Map<String, Object> exportExcelInclude(List<T> list, String fileName,Boolean useDefaultStyle, HttpServletResponse response, List<String> columnList, List<String> headNameList) throws IOException { |
|||
Map<String, Object> resultMap = new HashMap<>(); |
|||
if (list.size() == 0) { |
|||
resultMap.put("msg", "数据长度为空"); |
|||
resultMap.put("result", -1); |
|||
return resultMap; |
|||
} |
|||
|
|||
if (CollectionUtils.isEmpty(headNameList)) { |
|||
/*设置表头*/ |
|||
resultMap.put("msg", "表头长度为空"); |
|||
resultMap.put("result", -2); |
|||
return resultMap; |
|||
} |
|||
|
|||
if (CollectionUtils.isEmpty(columnList)) { |
|||
/*设置列字段*/ |
|||
resultMap.put("msg", "列字段长度为空"); |
|||
resultMap.put("result", -3); |
|||
return resultMap; |
|||
} |
|||
|
|||
Class<?> clazz = list.get(0).getClass(); |
|||
|
|||
/*定义编码,格式*/ |
|||
response.setContentType("application/vnd.ms-excel"); |
|||
response.setCharacterEncoding("utf-8"); |
|||
String exportFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
|||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + exportFileName + ".xlsx"); |
|||
response.setHeader("filename", exportFileName + ".xlsx"); |
|||
response.setHeader("Access-Control-Expose-Headers", "filename"); |
|||
/** |
|||
* .head(head(headNameList)) |
|||
* 改行代码不可以用ExcelWriterSheetBuilder类型的变量单独写,否则会包错:表头长度与字段列表长度不符 |
|||
*/ |
|||
/*导出表格*/ |
|||
ExcelWriterSheetBuilder excelWriterSheetBuilder = EasyExcel.write(response.getOutputStream(), clazz) |
|||
.head(head(headNameList)) |
|||
/*设置列字段(会按顺序)*/ |
|||
.includeColumnFiledNames(columnList) |
|||
/*注入的具有排序功能的handle*/ |
|||
// .registerWriteHandler(SORT_ROW_WRITE_HANDLER)
|
|||
.useDefaultStyle(useDefaultStyle) |
|||
.sheet(fileName); |
|||
excelWriterSheetBuilder.doWrite(list); |
|||
|
|||
resultMap.put("msg", "excel export success"); |
|||
resultMap.put("result", 0); |
|||
return resultMap; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 支持动态头,行列合并导出 |
|||
* |
|||
* @param response web响应 |
|||
* @param headList 动态头 |
|||
* @param dataList 数据列表 |
|||
* @param columnMergeHandler 注入列合并 |
|||
* @param rowMergeHandler 注入行合并 |
|||
* @throws IOException |
|||
*/ |
|||
public static Map<String, Object> writeDynamicExcel(HttpServletResponse response, @NotEmpty List<List<String>> headList, @NotEmpty List<List<Object>> dataList, @NotNull ExcelColumnMergeHandler columnMergeHandler, @NotNull ExcelRowMergeHandler rowMergeHandler) throws IOException { |
|||
Map<String, Object> resultMap = new HashMap<>(); |
|||
if (dataList.size() == 0) { |
|||
resultMap.put("msg", "数据长度为空"); |
|||
resultMap.put("result", -1); |
|||
return resultMap; |
|||
} |
|||
|
|||
if (CollectionUtils.isEmpty(headList)) { |
|||
/*设置表头*/ |
|||
resultMap.put("msg", "表头长度为空"); |
|||
resultMap.put("result", -2); |
|||
return resultMap; |
|||
} |
|||
|
|||
if (columnMergeHandler == null || rowMergeHandler == null) { |
|||
/*设置列字段*/ |
|||
resultMap.put("msg", "行列处理器为空"); |
|||
resultMap.put("result", -3); |
|||
return resultMap; |
|||
} |
|||
|
|||
EasyExcel.write(response.getOutputStream()) |
|||
// 设置动态头
|
|||
.head(headList) |
|||
.sheet("模板") |
|||
/*注入列合并*/ |
|||
.registerWriteHandler(columnMergeHandler) |
|||
/*注入行合并*/ |
|||
.registerWriteHandler(rowMergeHandler) |
|||
/*传需要写入的数据,类型List<List<Object>>*/ |
|||
.doWrite(dataList); |
|||
|
|||
resultMap.put("msg", "excel export success"); |
|||
resultMap.put("result", 0); |
|||
return resultMap; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 支持动态头导出 |
|||
* |
|||
* @param response web响应 |
|||
* @param headList 动态头 |
|||
* @param dataList 数据列表 |
|||
* @throws IOException |
|||
*/ |
|||
public static void writeDynamicExcel(HttpServletResponse response,List<List<String>> headList, List<List<Object>> dataList) throws IOException { |
|||
EasyExcel.write(response.getOutputStream()) |
|||
// 设置动态头
|
|||
.head(headList) |
|||
.sheet("模板") |
|||
/*传需要写入的数据,类型List<List<Object>>*/ |
|||
.doWrite(dataList); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 设置Excel头 |
|||
* |
|||
* @param headList Excel头信息 |
|||
* @return |
|||
*/ |
|||
public static List<List<String>> head(List<String> headList) { |
|||
List<List<String>> list = new ArrayList<>(); |
|||
for (String value : headList) { |
|||
List<String> head = new ArrayList<>(); |
|||
head.add(value); |
|||
list.add(head); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* Excel头对应的字段转换小写 |
|||
* |
|||
* @param ColumnListTemp Excel字段 |
|||
* @return |
|||
*/ |
|||
public static List<String> castLowerCase(List<String> ColumnListTemp) { |
|||
List<String> ColumnList = new ArrayList<>(); |
|||
for (String name : ColumnListTemp) { |
|||
ColumnList.add(StrUtil.lowerFirst(name)); |
|||
} |
|||
return ColumnList; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
package org.dromara.common.excel.utils; |
|||
|
|||
import com.alibaba.excel.metadata.Head; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.write.handler.CellWriteHandler; |
|||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
|||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
|||
import lombok.Data; |
|||
import org.apache.poi.ss.usermodel.Cell; |
|||
import org.apache.poi.ss.usermodel.CellType; |
|||
import org.apache.poi.ss.usermodel.Row; |
|||
import org.apache.poi.ss.usermodel.Sheet; |
|||
import org.apache.poi.ss.util.CellRangeAddress; |
|||
|
|||
import java.util.List; |
|||
|
|||
/*** |
|||
* 列合并处理器 |
|||
* |
|||
*/ |
|||
@Data |
|||
public class ExcelColumnMergeHandler implements CellWriteHandler { |
|||
/** |
|||
* 合并字段的下标,如new int[]{0,1,2,3,4,10},0-4合并,10合并 |
|||
*/ |
|||
private int[] mergeColumnIndex; |
|||
/** |
|||
* 从第几行开始合并,如果表头占两行,这个数字就是2 |
|||
*/ |
|||
private int mergeRowIndex; |
|||
|
|||
public ExcelColumnMergeHandler() { |
|||
} |
|||
|
|||
public ExcelColumnMergeHandler(int mergeRowIndex, int[] mergeColumnIndex) { |
|||
this.mergeRowIndex = mergeRowIndex; |
|||
this.mergeColumnIndex = mergeColumnIndex; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, |
|||
Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, |
|||
Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
|||
WriteCellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
|||
List<WriteCellData<?>> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
//当前行
|
|||
int curRowIndex = cell.getRowIndex(); |
|||
//当前列
|
|||
int curColIndex = cell.getColumnIndex(); |
|||
|
|||
if (curRowIndex > mergeRowIndex) { |
|||
for (int i = 0; i < mergeColumnIndex.length; i++) { |
|||
if (curColIndex == mergeColumnIndex[i]) { |
|||
mergeWithPrevRow(writeSheetHolder, cell, curRowIndex, curColIndex); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void mergeWithPrevRow(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex) { |
|||
//获取当前行的当前列的数据和上一行的当前列列数据,通过上一行数据是否相同进行合并
|
|||
Object curData = cell.getCellType() == CellType.STRING ? cell.getStringCellValue() : |
|||
cell.getNumericCellValue(); |
|||
Cell preCell = cell.getSheet().getRow(curRowIndex - 1).getCell(curColIndex); |
|||
Object preData = preCell.getCellType() == CellType.STRING ? preCell.getStringCellValue() : |
|||
preCell.getNumericCellValue(); |
|||
// 比较当前行的第一列的单元格与上一行是否相同,相同合并当前单元格与上一行
|
|||
//
|
|||
if (curData.equals(preData)) { |
|||
Sheet sheet = writeSheetHolder.getSheet(); |
|||
List<CellRangeAddress> mergeRegions = sheet.getMergedRegions(); |
|||
boolean isMerged = false; |
|||
for (int i = 0; i < mergeRegions.size() && !isMerged; i++) { |
|||
CellRangeAddress cellRangeAddr = mergeRegions.get(i); |
|||
// 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元
|
|||
if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) { |
|||
sheet.removeMergedRegion(i); |
|||
cellRangeAddr.setLastRow(curRowIndex); |
|||
sheet.addMergedRegion(cellRangeAddr); |
|||
isMerged = true; |
|||
} |
|||
} |
|||
// 若上一个单元格未被合并,则新增合并单元
|
|||
if (!isMerged) { |
|||
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, |
|||
curColIndex); |
|||
sheet.addMergedRegion(cellRangeAddress); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,87 @@ |
|||
package org.dromara.common.excel.utils; |
|||
|
|||
import com.alibaba.excel.metadata.Head; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.write.handler.CellWriteHandler; |
|||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
|||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
|||
import org.apache.poi.ss.usermodel.Cell; |
|||
import org.apache.poi.ss.usermodel.Row; |
|||
import org.apache.poi.ss.usermodel.Sheet; |
|||
import org.apache.poi.ss.util.CellRangeAddress; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 行合并处理器 |
|||
* |
|||
*/ |
|||
public class ExcelRowMergeHandler implements CellWriteHandler { |
|||
private static final String KEY ="%s-%s"; |
|||
//所有的合并信息都存在了这个map里面
|
|||
Map<String, Integer> mergeInfo = new HashMap<>(); |
|||
|
|||
public ExcelRowMergeHandler() { |
|||
} |
|||
public ExcelRowMergeHandler(Map<String, Integer> mergeInfo) { |
|||
this.mergeInfo = mergeInfo; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, WriteCellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<WriteCellData<?>> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
//当前行
|
|||
int curRowIndex = cell.getRowIndex(); |
|||
//当前列
|
|||
int curColIndex = cell.getColumnIndex(); |
|||
|
|||
Integer num = mergeInfo.get(String.format(KEY, curRowIndex, curColIndex)); |
|||
if(null != num){ |
|||
// 合并最后一行 ,列
|
|||
mergeWithPrevCol(writeSheetHolder, cell, curRowIndex, curColIndex,num); |
|||
} |
|||
} |
|||
|
|||
public void mergeWithPrevCol(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex, int num) { |
|||
Sheet sheet = writeSheetHolder.getSheet(); |
|||
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex, curRowIndex, curColIndex, curColIndex + num); |
|||
sheet.addMergedRegion(cellRangeAddress); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加合并行 |
|||
* 比如参数:(3,0,2) |
|||
* 从第三行的地0列开始向右合并2格 |
|||
* 这样,第三行的地0列到第2列就会合并 |
|||
* |
|||
* 注意: |
|||
* 合并不能冲突,如果合并到已经被合并的地方会报一个POI错误 |
|||
* (java.lang.IllegalStateException: Cannot add merged region B3:B6 to sheet because it overlaps with an existing merged region (A6:C6).) |
|||
* |
|||
* @param curRowIndex 当前行: 需要合并的哪一行(一般用数据List的“index”+“表头的行数”,表头站的行数是1就+1,是2就+2) |
|||
* @param curColIndex 合并开始列:从第几行开始合并 |
|||
* @param num 合并列的数量:从第curColIndex行开始,向右合并多少格 |
|||
*/ |
|||
public void add (int curRowIndex, int curColIndex , int num){ |
|||
mergeInfo.put(String.format(KEY, curRowIndex, curColIndex),num); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,21 @@ |
|||
package org.dromara.common.sse.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Created by WeiRan on 2023.03.20 19:19 |
|||
*/ |
|||
@Data |
|||
public class ChatGlmDto { |
|||
|
|||
private String messageId; |
|||
|
|||
private Object context; |
|||
|
|||
private String requestTaskNo; |
|||
|
|||
private boolean incremental = true; |
|||
|
|||
private boolean notSensitive = true; |
|||
|
|||
} |
@ -0,0 +1,122 @@ |
|||
package org.dromara.common.sse.listener; |
|||
|
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import lombok.Data; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import okhttp3.Response; |
|||
import okhttp3.sse.EventSource; |
|||
import okhttp3.sse.EventSourceListener; |
|||
import com.alibaba.fastjson.JSON; |
|||
import org.dromara.common.sse.dto.ChatGlmDto; |
|||
|
|||
import java.util.concurrent.CountDownLatch; |
|||
|
|||
@Slf4j |
|||
@Data |
|||
public class SSEListener extends EventSourceListener { |
|||
|
|||
private CountDownLatch countDownLatch = new CountDownLatch(1); |
|||
|
|||
private ChatGlmDto chatGlmDto; |
|||
|
|||
private HttpServletResponse rp; |
|||
|
|||
private StringBuffer output = new StringBuffer(); |
|||
|
|||
public SSEListener(ChatGlmDto chatGlmDto, HttpServletResponse response) { |
|||
this.chatGlmDto = chatGlmDto; |
|||
this.rp = response; |
|||
} |
|||
|
|||
/** |
|||
* {@inheritDoc} |
|||
* 建立sse连接 |
|||
*/ |
|||
// @Override
|
|||
public void onOpen(final EventSource eventSource, final Response |
|||
response) { |
|||
if (rp != null) { |
|||
rp.setContentType("text/event-stream"); |
|||
rp.setCharacterEncoding("UTF-8"); |
|||
rp.setStatus(200); |
|||
log.info("建立sse连接..." + JSON.toJSONString(chatGlmDto)); |
|||
} else { |
|||
log.info("客户端非sse推送" + JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 事件 |
|||
* |
|||
* @param eventSource |
|||
* @param id |
|||
* @param type |
|||
* @param data |
|||
*/ |
|||
@Override |
|||
public void onEvent(EventSource eventSource, String id, String type, String data) { |
|||
try { |
|||
output.append(data); |
|||
if ("finish".equals(type)) { |
|||
log.info("请求结束{} {}", chatGlmDto.getMessageId(), output.toString()); |
|||
} |
|||
if ("error".equals(type)) { |
|||
log.info("{}: {}source {}", chatGlmDto.getMessageId(), data, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
if (rp != null) { |
|||
if ("\n".equals(data)) { |
|||
rp.getWriter().write("event:" + type + "\n"); |
|||
rp.getWriter().write("id:" + chatGlmDto.getMessageId() + "\n"); |
|||
rp.getWriter().write("data:\n\n"); |
|||
rp.getWriter().flush(); |
|||
} else { |
|||
String[] dataArr = data.split("\\n"); |
|||
for (int i = 0; i < dataArr.length; i++) { |
|||
if (i == 0) { |
|||
rp.getWriter().write("event:" + type + "\n"); |
|||
rp.getWriter().write("id:" + chatGlmDto.getMessageId() + "\n"); |
|||
} |
|||
if (i == dataArr.length - 1) { |
|||
rp.getWriter().write("data:" + dataArr[i] + "\n\n"); |
|||
rp.getWriter().flush(); |
|||
} else { |
|||
rp.getWriter().write("data:" + dataArr[i] + "\n"); |
|||
rp.getWriter().flush(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
} catch (Exception e) { |
|||
log.error("消息错误[" + JSON.toJSONString(chatGlmDto) + "]", e); |
|||
countDownLatch.countDown(); |
|||
throw new RuntimeException(e); |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* {@inheritDoc} |
|||
*/ |
|||
@Override |
|||
public void onClosed(final EventSource eventSource) { |
|||
log.info("sse连接关闭:{}", chatGlmDto.getMessageId()); |
|||
log.info("结果输出:{}" + output.toString()); |
|||
countDownLatch.countDown(); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritDoc} |
|||
*/ |
|||
@Override |
|||
public void onFailure(final EventSource eventSource, final Throwable t, final Response response) { |
|||
log.error("使用事件源时出现异常... [响应:{}]...", chatGlmDto.getMessageId()); |
|||
countDownLatch.countDown(); |
|||
} |
|||
|
|||
public CountDownLatch getCountDownLatch() { |
|||
return this.countDownLatch; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,33 @@ |
|||
package org.dromara.common.sse.utils; |
|||
|
|||
import okhttp3.MediaType; |
|||
import okhttp3.OkHttpClient; |
|||
import okhttp3.Request; |
|||
import okhttp3.RequestBody; |
|||
import okhttp3.sse.EventSource; |
|||
import okhttp3.sse.EventSources; |
|||
import org.dromara.common.sse.listener.SSEListener; |
|||
|
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
public class ExecuteSSEUtil { |
|||
private static OkHttpClient okHttpClient = new OkHttpClient.Builder()//构建器
|
|||
.connectTimeout(600, TimeUnit.SECONDS)//连接超时
|
|||
.writeTimeout(600, TimeUnit.SECONDS)//写入超时
|
|||
.readTimeout(600, TimeUnit.SECONDS)//读取超时
|
|||
.build(); |
|||
|
|||
|
|||
public static void executeSSE(String url, SSEListener eventSourceListener, String chatGlm) throws Exception { |
|||
RequestBody formBody = RequestBody.create(chatGlm, MediaType.parse("application/json; charset=utf-8")); |
|||
Request.Builder requestBuilder = new Request.Builder(); |
|||
Request request = requestBuilder.url(url).get().build(); |
|||
okHttpClient.dispatcher().setMaxRequestsPerHost(200); |
|||
okHttpClient.dispatcher().setMaxRequests(200); |
|||
EventSource.Factory factory = EventSources.createFactory(okHttpClient); |
|||
//创建事件
|
|||
factory.newEventSource(request, eventSourceListener); |
|||
eventSourceListener.getCountDownLatch().await(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from './model'; |
|||
|
|||
/** |
|||
* 查询${functionName}列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}List(params?: ${BusinessName}Query) { |
|||
return defHttp.get<${BusinessName}VO[]>({ url: '/${moduleName}/${businessName}/list', params }); |
|||
} |
|||
|
|||
#if($tplCategory != 'tree') |
|||
/** |
|||
* 导出${functionName}列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}Export(params?: ${BusinessName}Query) { |
|||
return commonExport('/${moduleName}/${businessName}/export', params ?? {}); |
|||
} |
|||
#end |
|||
|
|||
/** |
|||
* 查询${functionName}详细 |
|||
* @param ${pkColumn.javaField} id |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}Info(${pkColumn.javaField}: ID) { |
|||
return defHttp.get<${BusinessName}VO>({ url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField} }); |
|||
} |
|||
|
|||
/** |
|||
* 新增${functionName} |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}Add(data: ${BusinessName}Form) { |
|||
return defHttp.postWithMsg<void>({ url: '/${moduleName}/${businessName}', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新${functionName} |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}Update(data: ${BusinessName}Form) { |
|||
return defHttp.putWithMsg<void>({ url: '/${moduleName}/${businessName}', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除${functionName} |
|||
* @param ${pkColumn.javaField} id |
|||
* @returns |
|||
*/ |
|||
export function ${businessName}Remove(${pkColumn.javaField}: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField} },); |
|||
} |
@ -0,0 +1,57 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface ${BusinessName}VO { |
|||
#foreach ($column in $columns) |
|||
#if($column.list) |
|||
/** |
|||
* $column.columnComment |
|||
*/ |
|||
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; |
|||
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; |
|||
#elseif($column.javaType == 'Boolean') boolean; |
|||
#else string; |
|||
#end |
|||
#end |
|||
#end |
|||
#if ($table.tree) |
|||
/** |
|||
* 子对象 |
|||
*/ |
|||
children: ${BusinessName}VO[]; |
|||
#end |
|||
} |
|||
|
|||
export interface ${BusinessName}Form extends BaseEntity { |
|||
#foreach ($column in $columns) |
|||
#if($column.insert || $column.edit) |
|||
/** |
|||
* $column.columnComment |
|||
*/ |
|||
$column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; |
|||
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; |
|||
#elseif($column.javaType == 'Boolean') boolean; |
|||
#else string; |
|||
#end |
|||
#end |
|||
#end |
|||
} |
|||
|
|||
export interface ${BusinessName}Query #if(!${treeCode})extends PageQuery #end{ |
|||
|
|||
#foreach ($column in $columns) |
|||
#if($column.query) |
|||
/** |
|||
* $column.columnComment |
|||
*/ |
|||
$column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; |
|||
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; |
|||
#elseif($column.javaType == 'Boolean') boolean; |
|||
#else string; |
|||
#end |
|||
#end |
|||
#end |
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,144 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
#if(${dicts} != '') |
|||
import { getDictOptions } from '@/utils/dict'; |
|||
import { useRender } from '@/hooks/component/useRender'; |
|||
#end |
|||
export const formSchemas: FormSchema[] = [ |
|||
#foreach($column in $columns) |
|||
#if($column.query) |
|||
#if($column.dictType) |
|||
#set($dictType=$column.dictType) |
|||
#else |
|||
#set($dictType="") |
|||
#end |
|||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
|||
#if($parentheseIndex != -1) |
|||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
|||
#else |
|||
#set($comment=$column.columnComment) |
|||
#end |
|||
#if($column.htmlType == "input") |
|||
#set($component="Input") |
|||
#elseif($column.htmlType == "textarea") |
|||
#set($component="InputTextArea") |
|||
#elseif($column.htmlType == "select") |
|||
#set($component="Select") |
|||
#elseif($column.htmlType == "radio") |
|||
#set($component="RadioButtonGroup") |
|||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") |
|||
#set($component="DatePicker") |
|||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
|||
#set($component="RangePicker") |
|||
#else |
|||
#set($component="Input") |
|||
#end |
|||
{ |
|||
label: '${comment}', |
|||
field: '${column.javaField}', |
|||
component: '${component}', |
|||
#if($dictType != "") |
|||
componentProps: { |
|||
options: getDictOptions('$dictType') |
|||
}, |
|||
#elseif($component == "DatePicker" || $component == "RangePicker") |
|||
componentProps: { |
|||
showTime: true, |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
}, |
|||
#end |
|||
}, |
|||
#end |
|||
#end |
|||
]; |
|||
|
|||
#if(${dicts} != '') |
|||
const { renderDict } = useRender(); |
|||
#end |
|||
export const columns: BasicColumn[] = [ |
|||
#foreach($column in $columns) |
|||
#if($column.list) |
|||
#if($column.dictType) |
|||
#set($dictType=$column.dictType) |
|||
#else |
|||
#set($dictType="") |
|||
#end |
|||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
|||
#if($parentheseIndex != -1) |
|||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
|||
#else |
|||
#set($comment=$column.columnComment) |
|||
#end |
|||
{ |
|||
title: '${comment}', |
|||
dataIndex: '${column.javaField}', |
|||
#if($dictType != "") |
|||
customRender: ({ value }) => renderDict(value, '$dictType'), |
|||
#end |
|||
}, |
|||
#end |
|||
#end |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
#foreach($column in $columns) |
|||
#if($column.edit) |
|||
#if($column.dictType) |
|||
#set($dictType=$column.dictType) |
|||
#else |
|||
#set($dictType="") |
|||
#end |
|||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
|||
#if($parentheseIndex != -1) |
|||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
|||
#else |
|||
#set($comment=$column.columnComment) |
|||
#end |
|||
#if($column.htmlType == "input") |
|||
#set($component="Input") |
|||
#elseif($column.htmlType == "textarea") |
|||
#set($component="InputTextArea") |
|||
#elseif($column.htmlType == "select") |
|||
#set($component="Select") |
|||
#elseif($column.htmlType == "radio") |
|||
#set($component="RadioButtonGroup") |
|||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") |
|||
#set($component="DatePicker") |
|||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
|||
#set($component="RangePicker") |
|||
#else |
|||
#set($component="Input") |
|||
#end |
|||
#if($column.required) |
|||
#set($required='true') |
|||
#else |
|||
#set($required='false') |
|||
#end |
|||
{ |
|||
label: '${comment}', |
|||
field: '${column.javaField}', |
|||
required: ${required}, |
|||
#if("" != $treeParentCode && $column.javaField == $treeParentCode) |
|||
component: 'TreeSelect', |
|||
#else |
|||
component: '${component}', |
|||
#end |
|||
#if($dictType != "") |
|||
componentProps: { |
|||
options: getDictOptions('$dictType') |
|||
}, |
|||
#elseif($component == "DatePicker" || $component == "RangePicker") |
|||
componentProps: { |
|||
showTime: true, |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
}, |
|||
#end |
|||
#if(${column.pk}) |
|||
show: false, |
|||
#end |
|||
}, |
|||
#end |
|||
#end |
|||
]; |
@ -0,0 +1,115 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click="downloadExcel(${businessName}Export, '${functionName}数据', getForm().getFieldsValue())" |
|||
v-auth="'${permissionPrefix}:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(${businessName}Remove)" |
|||
:disabled="!selected" |
|||
v-auth="'${permissionPrefix}:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
@click="handleAdd" |
|||
v-auth="'${permissionPrefix}:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: '${permissionPrefix}:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: '${permissionPrefix}:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除${functionName}[' + record.${pkColumn.javaField} + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<${BusinessName}Modal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { ${businessName}List, ${businessName}Export, ${businessName}Remove } from '@/api/${moduleName}/${businessName}'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import ${BusinessName}Modal from './${BusinessName}Modal.vue'; |
|||
import { formSchemas, columns } from './${businessName}.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
|
|||
defineOptions({ name: '${BusinessName}' }); |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
|||
rowSelection: { |
|||
type: 'checkbox', |
|||
}, |
|||
title: '${functionName}列表', |
|||
api: ${businessName}List, |
|||
showIndexColumn: false, |
|||
rowKey: '${pkColumn.javaField}', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await ${businessName}Remove([record.${pkColumn.javaField}]); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,111 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button @click="expandAll">展开</a-button |
|||
> |
|||
<a-button @click="collapseAll">折叠</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
@click="handleAdd" |
|||
v-auth="'${permissionPrefix}:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: '${permissionPrefix}:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: '${permissionPrefix}:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除${functionName}[' + record.${pkColumn.javaField} + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<${BusinessName}Modal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { ${businessName}List, ${businessName}Remove } from '@/api/${moduleName}/${businessName}'; |
|||
import type { ${BusinessName}VO } from '@/api/${moduleName}/${businessName}/model'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import ${BusinessName}Modal from './${BusinessName}Modal.vue'; |
|||
import { formSchemas, columns } from './${businessName}.data'; |
|||
import { listToTree, removeEmptyChildren } from '@/utils/helper/treeHelper'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
|
|||
defineOptions({ name: '${BusinessName}' }); |
|||
|
|||
const [registerTable, { reload, expandAll, collapseAll }] = useTable({ |
|||
api: ${businessName}List, |
|||
title: '${functionName}列表', |
|||
showIndexColumn: false, |
|||
isTreeTable: true, |
|||
pagination: false, |
|||
rowKey: '$treeCode}', |
|||
afterFetch(data: ${BusinessName}VO[]) { |
|||
const ret = listToTree(data, { id: '${treeCode}', pid: '${treeParentCode}' }); |
|||
removeEmptyChildren(ret); |
|||
return ret; |
|||
}, |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await ${businessName}Remove(record.${pkColumn.javaField}); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,68 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
> |
|||
<BasicForm @register="registerForm" /> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { ${businessName}Info, ${businessName}Add, ${businessName}Update } from '@/api/${moduleName}/${businessName}'; |
|||
import { modalSchemas } from './${businessName}.data'; |
|||
|
|||
defineOptions({ name: '${BusinessName}Modal' }); |
|||
|
|||
const emit = defineEmits(['register', 'reload']); |
|||
|
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑${functionName}' : '新增${functionName}'; |
|||
}); |
|||
|
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await ${businessName}Info(record.${pkColumn.javaField}); |
|||
await setFieldsValue(ret); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
await ${businessName}Update(data); |
|||
} else { |
|||
await ${businessName}Add(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,86 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
> |
|||
<BasicForm @register="registerForm" /> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { ${businessName}Info, ${businessName}Add, ${businessName}Update, ${businessName}List } from '@/api/${moduleName}/${businessName}'; |
|||
import { modalSchemas } from './${businessName}.data'; |
|||
import { listToTree } from '@/utils/helper/treeHelper'; |
|||
|
|||
defineOptions({ name: '${BusinessName}Modal' }); |
|||
|
|||
const emit = defineEmits(['register', 'reload']); |
|||
|
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑${functionName}' : '新增${functionName}'; |
|||
}); |
|||
|
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await ${businessName}Info(record.${pkColumn.javaField}); |
|||
await setFieldsValue(ret); |
|||
} |
|||
// 下拉框初始化 |
|||
await init${BusinessName}Select(); |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
async function init${BusinessName}Select() { |
|||
// 需要动态更新TreeSelect组件 这里允许为空 |
|||
const listData = await ${businessName}List(); |
|||
const treeData = listToTree(listData, { id: '${treeCode}', pid: '${treeParentCode}' }); |
|||
await updateSchema({ |
|||
field: '${treeParentCode}', |
|||
componentProps: { |
|||
treeData, |
|||
treeLine: { showLeafIcon: false }, |
|||
fieldNames: { label: '${businessName}Name', value: '${businessName}Id' }, |
|||
treeDefaultExpandAll: true, |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate, updateSchema }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
await ${businessName}Update(data); |
|||
} else { |
|||
await ${businessName}Add(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<artifactId>ruoyi-vue-plus</artifactId> |
|||
<groupId>org.dromara</groupId> |
|||
<version>${revision}</version> |
|||
</parent> |
|||
<modules> |
|||
<module>zaojia-productManagement</module> |
|||
</modules> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>zaojiaManagement</artifactId> |
|||
<packaging>pom</packaging> |
|||
|
|||
<description> |
|||
zaojiaManagement相关业务模块 |
|||
</description> |
|||
|
|||
</project> |
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>zaojiaManagement</artifactId> |
|||
<version>${revision}</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<packaging>jar</packaging> |
|||
|
|||
<artifactId>zaojia-productManagement</artifactId> |
|||
|
|||
<description> |
|||
产品管理模块 |
|||
</description> |
|||
<dependencies> |
|||
<!-- 通用工具--> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-core</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-doc</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-mybatis</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-translation</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- OSS功能模块 --> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-oss</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-log</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- excel--> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-excel</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- SMS功能模块 --> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-sms</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-tenant</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-security</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-web</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-idempotent</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-sensitive</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-encrypt</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-websocket</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-common-sse</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-system</artifactId> |
|||
</dependency> |
|||
<!-- Markdown to HTML --> |
|||
<dependency> |
|||
<groupId>com.vladsch.flexmark</groupId> |
|||
<artifactId>flexmark-all</artifactId> |
|||
<version>0.64.8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>net.lingala.zip4j</groupId> |
|||
<artifactId>zip4j</artifactId> |
|||
<version>2.11.5</version> |
|||
</dependency> |
|||
<!-- HTML to PDF --> |
|||
<dependency> |
|||
<groupId>org.xhtmlrenderer</groupId> |
|||
<artifactId>flying-saucer-pdf</artifactId> |
|||
<version>9.1.22</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.pdfbox</groupId> |
|||
<artifactId>pdfbox</artifactId> |
|||
<version>2.0.27</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
|
|||
</project> |
@ -0,0 +1,273 @@ |
|||
package org.dromara.productManagement.common.service; |
|||
|
|||
import cn.dev33.satoken.stp.StpUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.common.core.service.DictService; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.ModelPrompts; |
|||
import org.dromara.productManagement.domain.ModelUserPromptssetting; |
|||
|
|||
import org.dromara.productManagement.domain.bo.BaseTaskBo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksPermissionsVo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.enums.TaskEnum; |
|||
import org.dromara.productManagement.mapper.DocumentTasksMapper; |
|||
import org.dromara.productManagement.mapper.DocumentTasksPermissionsMapper; |
|||
import org.dromara.productManagement.mapper.ModelPromptsMapper; |
|||
import org.dromara.productManagement.mapper.ModelUserPromptssettingMapper; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsService; |
|||
import org.dromara.productManagement.service.IDocumentTasksService; |
|||
import org.dromara.productManagement.utils.MyHttpUtils; |
|||
import org.dromara.system.domain.vo.SysOssVo; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.dromara.system.service.ISysUserService; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 任务处理抽象基类 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Data |
|||
public abstract class BaseTaskService<T extends BaseTaskBo> { |
|||
|
|||
|
|||
protected final ISysOssService ossService; |
|||
protected final ISysUserService userService; |
|||
protected final ModelPromptsMapper modelPromptsMapper; |
|||
|
|||
protected final ModelUserPromptssettingMapper modelUserPromptssettingMapper; |
|||
protected final DocumentTasksPermissionsMapper documentTasksPermissionsMapper; |
|||
protected final IDocumentTasksPermissionsService documentTasksPermissionsService; |
|||
protected final DictService dictTypeService; |
|||
protected final DocumentTasksMapper baseMapper; |
|||
|
|||
|
|||
@Value("${chat.filePath}") |
|||
protected String fileRootPath; |
|||
|
|||
@Value("${chat.chatUrl}") |
|||
protected String chatUrl; |
|||
@Value("${chat.tempfilePath}") |
|||
protected String tempfilePath; |
|||
/** |
|||
* 文件处理结果内部类 |
|||
*/ |
|||
@Data |
|||
@AllArgsConstructor |
|||
protected static class FileProcessResult { |
|||
private String fileName; |
|||
private String filePath; |
|||
} |
|||
/** |
|||
* 查询任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 合同任务 |
|||
*/ |
|||
protected DocumentTasksVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
/** |
|||
* 处理任务的抽象方法 |
|||
*/ |
|||
protected Boolean handleTask(T bo, String taskType) throws IOException, InterruptedException { |
|||
List<String> taskNames = bo.getTaskNameList(); |
|||
Long userId = LoginHelper.getUserId(); |
|||
|
|||
// 校验提示词
|
|||
validatePrompts(taskNames, bo, taskType); |
|||
|
|||
// 处理用户提示词设置
|
|||
handleUserPromptsSetting(userId, bo, taskType); |
|||
|
|||
// 验证用户任务权限
|
|||
documentTasksPermissionsService.validateUserTaskPermissions(taskType,taskNames, userId); |
|||
|
|||
// 处理文件相关操作
|
|||
FileProcessResult fileResult = processFile(bo.getOssId()); |
|||
|
|||
return processTaskItems(taskNames, bo, fileResult, taskType); |
|||
} |
|||
|
|||
/** |
|||
* 校验提示词 |
|||
*/ |
|||
private void validatePrompts(List<String> taskNames, T bo, String taskType) { |
|||
taskNames.forEach(taskName -> { |
|||
ModelPrompts modelPrompts = modelPromptsMapper.selectOne(Wrappers.<ModelPrompts>lambdaQuery() |
|||
.eq(ModelPrompts::getTaskType, taskType) |
|||
.eq(ModelPrompts::getTaskName, taskName) |
|||
.eq(ModelPrompts::getTaskIndustry, bo.getTaskIndustry()) |
|||
.eq(ModelPrompts::getTaskRegion, bo.getTaskRegion())); |
|||
if(modelPrompts == null) { |
|||
String label = dictTypeService.getDictLabel(taskType, taskName); |
|||
throw new RuntimeException("任务名称:["+label+"],当前任务所属区域或所属行业不存在模型,请联系管理员配置"); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 处理用户提示词设置 |
|||
*/ |
|||
private void handleUserPromptsSetting(Long userId, T bo, String taskType) { |
|||
ModelUserPromptssetting promptssetting = modelUserPromptssettingMapper.selectOne( |
|||
Wrappers.<ModelUserPromptssetting>lambdaQuery() |
|||
.eq(ModelUserPromptssetting::getUserId, userId) |
|||
.eq(ModelUserPromptssetting::getTaskType, taskType)); |
|||
|
|||
if(promptssetting != null) { |
|||
promptssetting.setTaskIndustry(bo.getTaskIndustry()); |
|||
promptssetting.setTaskRegion(bo.getTaskRegion()); |
|||
promptssetting.setTaskType(taskType); |
|||
modelUserPromptssettingMapper.updateById(promptssetting); |
|||
} else { |
|||
ModelUserPromptssetting userPromptssetting = new ModelUserPromptssetting(); |
|||
userPromptssetting.setUserId(userId); |
|||
userPromptssetting.setTaskIndustry(bo.getTaskIndustry()); |
|||
userPromptssetting.setTaskRegion(bo.getTaskRegion()); |
|||
userPromptssetting.setTaskType(taskType); |
|||
modelUserPromptssettingMapper.insert(userPromptssetting); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 处理文件操作 |
|||
*/ |
|||
protected FileProcessResult processFile(Long ossId) throws IOException, InterruptedException { |
|||
SysOssVo fileInfo = ossService.getById(ossId); |
|||
String fileName = fileInfo.getOriginalName(); |
|||
String filePath = fileRootPath + fileInfo.getFileName(); |
|||
|
|||
// 处理文件转换
|
|||
if(!fileName.toLowerCase().endsWith(".docx")) { |
|||
filePath = convertToDocx(filePath, fileName); |
|||
} |
|||
|
|||
return new FileProcessResult(fileInfo.getOriginalName(), filePath); |
|||
} |
|||
|
|||
/** |
|||
* 转换文件为docx格式 |
|||
*/ |
|||
private String convertToDocx(String filePath, String fileName) throws IOException, InterruptedException { |
|||
String parentPath = new File(filePath).getParent(); |
|||
ProcessBuilder builder = new ProcessBuilder("libreoffice", "--headless", "--convert-to", "docx", filePath, "--outdir", parentPath); |
|||
Process process = builder.start(); |
|||
|
|||
int completed = process.waitFor(); |
|||
if (completed != 0) { |
|||
InputStream errorStream = process.getErrorStream(); |
|||
String errorMessage = new String(errorStream.readAllBytes()); |
|||
process.destroyForcibly(); |
|||
throw new RuntimeException(fileName + "转docx失败,请检查文件是否正确~ 错误信息: " + errorMessage); |
|||
} |
|||
|
|||
process.destroyForcibly(); |
|||
return getDocxFilePath(filePath); |
|||
} |
|||
|
|||
/** |
|||
* 获取转换后的docx文件路径 |
|||
*/ |
|||
private String getDocxFilePath(String filePath) { |
|||
int lastDotIndex = filePath.lastIndexOf('.'); |
|||
return lastDotIndex == -1 ? filePath + ".docx" : filePath.substring(0, lastDotIndex) + ".docx"; |
|||
} |
|||
/** |
|||
* 计算任务优先级 |
|||
* @param taskName 任务名称 |
|||
* @return 优先级 |
|||
*/ |
|||
protected Long calculatePriority(String taskName) { |
|||
// 默认优先级为1
|
|||
Long priority = 1L; |
|||
|
|||
// 如果不是超级管理员,则获取用户特定的任务优先级
|
|||
if (!StpUtil.hasRole("superadmin")) { |
|||
DocumentTasksPermissionsVo permissionsVo = documentTasksPermissionsMapper |
|||
.selectDocumentPermissionsByUserIdAndTaskName( |
|||
LoginHelper.getUserId(), |
|||
taskName |
|||
); |
|||
if (permissionsVo != null) { |
|||
priority = permissionsVo.getPriority(); |
|||
} |
|||
} |
|||
|
|||
return priority; |
|||
} |
|||
|
|||
/** |
|||
* 处理具体任务项 |
|||
*/ |
|||
// protected abstract Boolean processTaskItems(List<String> taskNames, BaseTaskBo bo, FileProcessResult fileResult, String taskType);
|
|||
protected Boolean processTaskItems(List<String> taskNames, T bo, FileProcessResult fileResult, String taskType) { |
|||
boolean flag = false; |
|||
for (String taskName : taskNames) { |
|||
|
|||
DocumentTasks add = MapstructUtils.convert(bo, DocumentTasks.class); |
|||
add.setTaskName(taskName); |
|||
add.setDocumentName(fileResult.getFileName()); |
|||
add.setProgressStatus("PENDING"); |
|||
add.setTaskType(taskType); |
|||
// 在插入数据库前调用扩展点
|
|||
beforeTaskInsert(bo, taskName, fileResult); |
|||
|
|||
flag = baseMapper.insert(add) > 0; |
|||
// 在发送消息前调用扩展点
|
|||
beforeTaskMessageSent(add.getId(), taskName, bo); |
|||
Long priority = calculatePriority(taskName); |
|||
MyHttpUtils.sendTaskStartMessage(chatUrl + "/back/taskStart", |
|||
add.getId(), taskName, fileResult.getFilePath(), priority); |
|||
|
|||
if (!flag) { |
|||
throw new RuntimeException("新增文档任务失败"); |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
|
|||
|
|||
protected LambdaQueryWrapper<DocumentTasks> buildQueryWrapper(DocumentTasksBo bo) { |
|||
LambdaQueryWrapper<DocumentTasks> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskIndustry()), DocumentTasks::getTaskIndustry, bo.getTaskIndustry()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskRegion()), DocumentTasks::getTaskRegion, bo.getTaskRegion()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), DocumentTasks::getDocumentName, bo.getDocumentName()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getProgressStatus()), DocumentTasks::getProgressStatus, bo.getProgressStatus()); |
|||
List<String> taskNames = bo.getTaskNameList(); |
|||
if (taskNames != null && !taskNames.isEmpty()) { |
|||
lqw.in(DocumentTasks::getTaskName, taskNames); |
|||
} |
|||
lqw.orderByDesc(DocumentTasks::getCreateTime); |
|||
return lqw; |
|||
} |
|||
/** |
|||
* 任务插入数据库前的扩展点 |
|||
* 子类可以覆盖此方法添加额外逻辑 |
|||
*/ |
|||
protected void beforeTaskInsert(T task, String taskName, FileProcessResult fileResult) { |
|||
// 默认空实现
|
|||
} |
|||
|
|||
/** |
|||
* 任务消息发送前的扩展点 |
|||
* 子类可以覆盖此方法添加额外逻辑 |
|||
*/ |
|||
protected void beforeTaskMessageSent(Long taskId, String taskName,T bo) { |
|||
// 默认空实现
|
|||
} |
|||
} |
@ -0,0 +1,122 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.dromara.productManagement.domain.bo.PmgPersonProductsBo; |
|||
import org.dromara.productManagement.domain.bo.ProductsBo; |
|||
import org.dromara.productManagement.domain.vo.ProductsVo; |
|||
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.productManagement.domain.vo.CmgCostItemDetailVo; |
|||
import org.dromara.productManagement.domain.bo.CmgCostItemDetailBo; |
|||
import org.dromara.productManagement.service.ICmgCostItemDetailService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 造价编制详情 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-29 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/costItemDetail") |
|||
public class CmgCostItemDetailController extends BaseController { |
|||
|
|||
private final ICmgCostItemDetailService cmgCostItemDetailService; |
|||
|
|||
/** |
|||
* 获取产品类型列表根据不同的分类 |
|||
* @param bo |
|||
* @param pageQuery |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getProductsPageByType") |
|||
public TableDataInfo<ProductsVo> getProductsPageByType(ProductsBo bo, PageQuery pageQuery) { |
|||
//查询数据
|
|||
TableDataInfo<ProductsVo> pageVO =cmgCostItemDetailService.getProductsPageByType(bo, pageQuery); |
|||
return pageVO; |
|||
} |
|||
/** |
|||
* 查询造价编制详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<CmgCostItemDetailVo> list(CmgCostItemDetailBo bo, PageQuery pageQuery) { |
|||
return cmgCostItemDetailService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出造价编制详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:export") |
|||
@Log(title = "造价编制详情", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(CmgCostItemDetailBo bo, HttpServletResponse response) { |
|||
List<CmgCostItemDetailVo> list = cmgCostItemDetailService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "造价编制详情", CmgCostItemDetailVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取造价编制详情详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:query") |
|||
@GetMapping("/{id}") |
|||
public R<CmgCostItemDetailVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(cmgCostItemDetailService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增造价编制详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:add") |
|||
@Log(title = "造价编制详情", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmgCostItemDetailBo bo) { |
|||
return toAjax(cmgCostItemDetailService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改造价编制详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:edit") |
|||
@Log(title = "造价编制详情", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmgCostItemDetailBo bo) { |
|||
return toAjax(cmgCostItemDetailService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除造价编制详情 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costItemDetail:remove") |
|||
@Log(title = "造价编制详情", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(cmgCostItemDetailService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,148 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.vo.CostDetailViewVo; |
|||
import org.springframework.http.ResponseEntity; |
|||
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.productManagement.domain.vo.CmgCostTableVo; |
|||
import org.dromara.productManagement.domain.bo.CmgCostTableBo; |
|||
import org.dromara.productManagement.service.ICmgCostTableService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 造价编制信息 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-29 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/costTable") |
|||
public class CmgCostTableController extends BaseController { |
|||
|
|||
private final ICmgCostTableService cmgCostTableService; |
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/addCostTable") |
|||
@RepeatSubmit() |
|||
@Log(title = "新增造价编制信息", businessType = BusinessType.INSERT) |
|||
@SaCheckPermission("productManagement:costTable:add") |
|||
|
|||
public R<Void> addCostTable(@Validated @RequestBody CostDetailViewVo vo) { |
|||
cmgCostTableService.addCostTable(vo); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/modifyCostTable") |
|||
@RepeatSubmit() |
|||
@Log(title = "修改造价编制信息", businessType = BusinessType.UPDATE) |
|||
@SaCheckPermission("productManagement:costTable:edit") |
|||
|
|||
public R<Void> modifyCostTable(@Validated @RequestBody CostDetailViewVo vo) { |
|||
cmgCostTableService.modifyCostTable(vo); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/getCostTableDetail/{id}") |
|||
@SaCheckPermission("productManagement:costTable:query") |
|||
public R<CostDetailViewVo> getCostTableDetail(@PathVariable("id") String id) { |
|||
CostDetailViewVo vo = cmgCostTableService.getCostTableDetail(id); |
|||
return R.ok(vo); |
|||
} |
|||
/** |
|||
* 导出单条数据表格文件 |
|||
*/ |
|||
@PostMapping("/exportData") |
|||
@SaCheckPermission("productManagement:costTable:export") |
|||
public void exportData( String id, HttpServletResponse response) throws IOException { |
|||
cmgCostTableService.exportData(id,response); |
|||
} |
|||
/** |
|||
* 查询造价编制信息列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<CmgCostTableVo> list(CmgCostTableBo bo, PageQuery pageQuery) { |
|||
return cmgCostTableService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出造价编制信息列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:export") |
|||
@Log(title = "造价编制信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(CmgCostTableBo bo, HttpServletResponse response) { |
|||
List<CmgCostTableVo> list = cmgCostTableService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "造价编制信息", CmgCostTableVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取造价编制信息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:query") |
|||
@GetMapping("/{id}") |
|||
public R<CmgCostTableVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(cmgCostTableService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增造价编制信息 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:add") |
|||
@Log(title = "造价编制信息", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmgCostTableBo bo) { |
|||
return toAjax(cmgCostTableService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改造价编制信息 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:edit") |
|||
@Log(title = "造价编制信息", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmgCostTableBo bo) { |
|||
return toAjax(cmgCostTableService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除造价编制信息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:costTable:remove") |
|||
@Log(title = "造价编制信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(cmgCostTableService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,108 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.DocumentTaskGroup; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
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.productManagement.domain.vo.ContractualTasksVo; |
|||
import org.dromara.productManagement.domain.bo.ContractualTasksBo; |
|||
import org.dromara.productManagement.service.IContractualTasksService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 合同任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-11 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/ContractualTasks") |
|||
public class ContractualTasksController extends BaseController { |
|||
|
|||
private final IContractualTasksService contractualTasksService; |
|||
|
|||
/** |
|||
* 查询合同任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ContractualTasksVo> list(ContractualTasksBo bo, PageQuery pageQuery) { |
|||
return contractualTasksService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出合同任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:export") |
|||
@Log(title = "合同任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ContractualTasksBo bo, HttpServletResponse response) { |
|||
List<DocumentTasksVo> list = contractualTasksService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "合同任务", DocumentTasksVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取合同任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(contractualTasksService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增合同任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:add") |
|||
@Log(title = "合同任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ContractualTasksBo bo) throws IOException, InterruptedException { |
|||
return toAjax(contractualTasksService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改合同任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:edit") |
|||
@Log(title = "合同任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ContractualTasksBo bo) { |
|||
return toAjax(contractualTasksService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除合同任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ContractualTasks:remove") |
|||
@Log(title = "合同任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(contractualTasksService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,153 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import cn.dev33.satoken.secure.BCrypt; |
|||
import cn.dev33.satoken.stp.SaLoginModel; |
|||
import cn.dev33.satoken.stp.StpUtil; |
|||
import cn.dev33.satoken.util.SaResult; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.domain.model.LoginUser; |
|||
import org.dromara.common.core.domain.model.PasswordLoginBody; |
|||
import org.dromara.common.core.enums.LoginType; |
|||
import org.dromara.common.core.enums.UserStatus; |
|||
import org.dromara.common.core.exception.user.UserException; |
|||
import org.dromara.common.core.utils.ValidatorUtils; |
|||
import org.dromara.common.json.utils.JsonUtils; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.common.tenant.helper.TenantHelper; |
|||
import org.dromara.productManagement.service.IDocAiService; |
|||
import org.dromara.system.domain.SysUser; |
|||
import org.dromara.system.domain.vo.SysUserVo; |
|||
import org.dromara.system.mapper.SysUserMapper; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.HashMap; |
|||
|
|||
/** |
|||
* DocAiController类,处理与文档AI相关的HTTP请求。 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/docAi") |
|||
@Validated |
|||
public class DocAiController { |
|||
|
|||
private final IDocAiService docAiService; |
|||
private final SysUserMapper userMapper; |
|||
/** |
|||
* SSE调用接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse-invoke", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void sse(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/stream", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 检查地名接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/checkPlaceName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void checkPlaceName(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/checkPlaceName", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 检查重复文本接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/checkRepeatText", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void checkRepeatText(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/checkRepeatText", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 检查公司名称接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/checkCompanyName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void checkCompanyName(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/checkCompanyName", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 检查文档错误接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/checkDocumentError", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void checkDocumentError(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/checkDocumentErrorWeb", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 检查标题名称接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/checkTitleName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void checkTitleName(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/checkTitleName", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 文档评估接口 |
|||
* @param originalFilename 原始文件名 |
|||
* @param context 请求上下文 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/documentEvaluate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = "text/event-stream;charset=UTF-8") |
|||
public void documentEvaluate(@RequestPart(name = "originalFilename", required = false) String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
docAiService.executeSSE("/sse/documentEvaluate", originalFilename, context, rp); |
|||
} |
|||
|
|||
/** |
|||
* 获取日志接口 |
|||
* @param rp HttpServletResponse对象 |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@GetMapping(value = "/sse/getLog", produces = "text/event-stream;charset=UTF-8") |
|||
public void getLog(HttpServletResponse rp) throws Exception { |
|||
docAiService.getLog(rp); |
|||
} |
|||
|
|||
/** |
|||
* 上传文件接口 |
|||
* @param file 上传的文件 |
|||
* @param originalFilename 原始文件名 |
|||
* @return 上传结果 |
|||
* @throws IOException IO异常 |
|||
* @throws InterruptedException 中断异常 |
|||
*/ |
|||
@PostMapping(value = "/sse/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<String> uploadFile(@RequestPart(name = "fileInfo") MultipartFile file, @RequestPart(name = "originalFilename") String originalFilename) throws IOException, InterruptedException { |
|||
return docAiService.uploadFile(file, originalFilename); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,159 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.DocumentTaskResultsVo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTaskResultVO; |
|||
import org.dromara.productManagement.domain.bo.DocumentTaskResultsBo; |
|||
import org.dromara.productManagement.service.IDocumentTaskResultsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 文档任务结果 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-10-23 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/DocumentTaskResults") |
|||
public class DocumentTaskResultsController extends BaseController { |
|||
|
|||
private final IDocumentTaskResultsService documentTaskResultsService; |
|||
|
|||
/** |
|||
* 查询文档任务结果列表 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:list")
|
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTaskResultsVo> list(DocumentTaskResultsBo bo, PageQuery pageQuery) { |
|||
return documentTaskResultsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文档任务结果列表 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:export")
|
|||
@Log(title = "文档任务结果", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DocumentTaskResultsBo bo, HttpServletResponse response) { |
|||
List<DocumentTaskResultsVo> list = documentTaskResultsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文档任务结果", DocumentTaskResultsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文档任务结果详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:query")
|
|||
@GetMapping("/{id}") |
|||
public R<DocumentTaskResultsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(documentTaskResultsService.queryById(id)); |
|||
} |
|||
/** |
|||
* 根据任务id获取文档任务结果详细信息 |
|||
* |
|||
* @param id 任务id |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:query")
|
|||
@GetMapping("/task/{id}") |
|||
public R<DocumentTaskResultsVo> getInfobyTaskId(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(documentTaskResultsService.queryByTaskId(id)); |
|||
} |
|||
|
|||
/** |
|||
* 根据任务ID获取详细的文档任务结果 |
|||
* |
|||
* @param taskId 任务ID |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:query")
|
|||
@GetMapping("/taskDetail/{taskId}") |
|||
public R<List<DocumentTaskResultVO>> getDetailResultsByTaskId(@NotNull(message = "任务ID不能为空") |
|||
@PathVariable String taskId) { |
|||
return R.ok(documentTaskResultsService.getDetailResultsByTaskId(taskId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文档任务结果 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:add")
|
|||
@Log(title = "文档任务结果", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DocumentTaskResultsBo bo) { |
|||
return toAjax(documentTaskResultsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文档任务结果 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:edit")
|
|||
@Log(title = "文档任务结果", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DocumentTaskResultsBo bo) { |
|||
return toAjax(documentTaskResultsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文档任务结果 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:remove")
|
|||
@Log(title = "文档任务结果", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(documentTaskResultsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
|
|||
/** |
|||
* 更新文档任务结果项的状态(已读/采纳) |
|||
* |
|||
* @param id 结果项ID |
|||
* @param field 字段名(isRead/isAdopted) |
|||
* @param value 值(0/1) |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:edit")
|
|||
@Log(title = "更新文档任务结果项状态", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/updateResultItemStatus/{id}/{field}/{value}") |
|||
public R<Void> updateResultItemStatus( |
|||
@NotEmpty(message = "ID不能为空") @PathVariable("id") String id, |
|||
@NotEmpty(message = "字段名不能为空") @PathVariable("field") String field, |
|||
@NotEmpty(message = "值不能为空") @PathVariable("value") String value) { |
|||
return toAjax(documentTaskResultsService.updateResultItemStatus(id, field, value)); |
|||
} |
|||
|
|||
/** |
|||
* 下载文档任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:DocumentTaskResults:download")
|
|||
@Log(title = "文档任务", businessType = BusinessType.EXPORT) |
|||
@GetMapping("/downloadResult/{ids}") |
|||
public void download(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids,HttpServletResponse response) { |
|||
documentTaskResultsService.downloadResult(ids,response); |
|||
} |
|||
} |
@ -0,0 +1,126 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.DocumentTaskGroup; |
|||
import org.dromara.system.domain.vo.SysOssUploadVo; |
|||
import org.dromara.system.domain.vo.SysOssVo; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.springframework.http.MediaType; |
|||
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.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|||
import org.dromara.productManagement.service.IDocumentTasksService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 文档任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-10-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/DocumentTasks") |
|||
public class DocumentTasksController extends BaseController { |
|||
|
|||
private final IDocumentTasksService documentTasksService; |
|||
|
|||
|
|||
/** |
|||
* 查询文档任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTaskGroup> list(DocumentTasksBo bo, PageQuery pageQuery) { |
|||
return documentTasksService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文档任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:export") |
|||
@Log(title = "文档任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DocumentTasksBo bo, HttpServletResponse response) { |
|||
List<DocumentTasksVo> list = documentTasksService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文档任务", DocumentTasksVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文档任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(documentTasksService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文档任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:add") |
|||
@Log(title = "文档任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DocumentTasksBo bo) throws IOException, InterruptedException { |
|||
return toAjax(documentTasksService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文档任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:edit") |
|||
@Log(title = "文档任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DocumentTasksBo bo) { |
|||
return toAjax(documentTasksService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文档任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasks:remove") |
|||
@Log(title = "文档任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(documentTasksService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
@PutMapping("/stopTask/{id}") |
|||
public R<Void> stop(@NotNull(message = "主键不能为空") @PathVariable Long id) { |
|||
return toAjax(documentTasksService.stopTask(id)); |
|||
} |
|||
@PostMapping(value = "/back/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<SysOssUploadVo> uploadFile(@RequestPart(name = "file") MultipartFile file) throws IOException, InterruptedException { |
|||
SysOssVo oss = documentTasksService.uploadFile(file); |
|||
SysOssUploadVo uploadVo = new SysOssUploadVo(); |
|||
uploadVo.setUrl(oss.getUrl()); |
|||
uploadVo.setFileName(oss.getOriginalName()); |
|||
uploadVo.setOssId(oss.getOssId().toString()); |
|||
return R.ok(uploadVo); |
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
package org.dromara.productManagement.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.common.satoken.utils.LoginHelper; |
|||
import org.dromara.system.domain.vo.SysUserVo; |
|||
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.productManagement.domain.vo.DocumentTasksPermissionsVo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksPermissionsBo; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 文档任务权限 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-11-08 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/DocumentTasksPermissions") |
|||
public class DocumentTasksPermissionsController extends BaseController { |
|||
|
|||
private final IDocumentTasksPermissionsService documentTasksPermissionsService; |
|||
|
|||
/** |
|||
* 查询文档任务权限列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksPermissionsVo> list(DocumentTasksPermissionsBo bo, PageQuery pageQuery) { |
|||
return documentTasksPermissionsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文档任务权限列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:export") |
|||
@Log(title = "文档任务权限", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DocumentTasksPermissionsBo bo, HttpServletResponse response) { |
|||
List<DocumentTasksPermissionsVo> list = documentTasksPermissionsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文档任务权限", DocumentTasksPermissionsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文档任务权限详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksPermissionsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(documentTasksPermissionsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文档任务权限 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:add") |
|||
@Log(title = "文档任务权限", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DocumentTasksPermissionsBo bo) { |
|||
return toAjax(documentTasksPermissionsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文档任务权限 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:edit") |
|||
@Log(title = "文档任务权限", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DocumentTasksPermissionsBo bo) { |
|||
return toAjax(documentTasksPermissionsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文档任务权限 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissions:remove") |
|||
@Log(title = "文档任务权限", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(documentTasksPermissionsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
/** |
|||
* 获取所有用户信息 |
|||
*/ |
|||
@GetMapping("/getUsersAll") |
|||
public R<List<SysUserVo>> getUsersAll() { |
|||
List<SysUserVo> list = documentTasksPermissionsService.getUsersAll(); |
|||
return R.ok(list); |
|||
} |
|||
|
|||
/** |
|||
* 获取文档任务权限详细信息根据用户id |
|||
*/ |
|||
@GetMapping("/getTasksPermissionsByUserId") |
|||
public R<DocumentTasksPermissionsVo> getTasksPermissionsByUserId() { |
|||
Long userId = LoginHelper.getUserId(); |
|||
DocumentTasksPermissionsVo documentTasksPermissionsVo = documentTasksPermissionsService.getTasksPermissionsByUserId(userId); |
|||
return R.ok(documentTasksPermissionsVo); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.DocumentTasksPermissionsDetailVo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksPermissionsDetailBo; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsDetailService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 文档任务权限详情 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-11-11 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/DocumentTasksPermissionsDetail") |
|||
public class DocumentTasksPermissionsDetailController extends BaseController { |
|||
|
|||
private final IDocumentTasksPermissionsDetailService documentTasksPermissionsDetailService; |
|||
|
|||
/** |
|||
* 查询文档任务权限详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksPermissionsDetailVo> list(DocumentTasksPermissionsDetailBo bo, PageQuery pageQuery) { |
|||
return documentTasksPermissionsDetailService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文档任务权限详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:export") |
|||
@Log(title = "文档任务权限详情", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DocumentTasksPermissionsDetailBo bo, HttpServletResponse response) { |
|||
List<DocumentTasksPermissionsDetailVo> list = documentTasksPermissionsDetailService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文档任务权限详情", DocumentTasksPermissionsDetailVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文档任务权限详情详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksPermissionsDetailVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(documentTasksPermissionsDetailService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文档任务权限详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:add") |
|||
@Log(title = "文档任务权限详情", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DocumentTasksPermissionsDetailBo bo) { |
|||
return toAjax(documentTasksPermissionsDetailService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文档任务权限详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:edit") |
|||
@Log(title = "文档任务权限详情", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DocumentTasksPermissionsDetailBo bo) { |
|||
return toAjax(documentTasksPermissionsDetailService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文档任务权限详情 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:DocumentTasksPermissionsDetail:remove") |
|||
@Log(title = "文档任务权限详情", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(documentTasksPermissionsDetailService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.dromara.common.excel.core.ExcelResult; |
|||
import org.springframework.http.MediaType; |
|||
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.productManagement.domain.vo.FileReadInfoVo; |
|||
import org.dromara.productManagement.domain.bo.FileReadInfoBo; |
|||
import org.dromara.productManagement.service.IFileReadInfoService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 文件处理信息表 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-09-20 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/fileReadInfo") |
|||
public class FileReadInfoController extends BaseController { |
|||
|
|||
private final IFileReadInfoService fileReadInfoService; |
|||
|
|||
/** |
|||
* 查询文件处理信息表列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<FileReadInfoVo> list(FileReadInfoBo bo, PageQuery pageQuery) { |
|||
return fileReadInfoService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文件处理信息表列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:export") |
|||
@Log(title = "文件处理信息表", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(FileReadInfoBo bo, HttpServletResponse response) { |
|||
List<FileReadInfoVo> list = fileReadInfoService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文件处理信息表", FileReadInfoVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文件处理信息表详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:query") |
|||
@GetMapping("/{id}") |
|||
public R<FileReadInfoVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(fileReadInfoService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文件处理信息表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:add") |
|||
@Log(title = "文件处理信息表", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody FileReadInfoBo bo) { |
|||
return toAjax(fileReadInfoService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文件处理信息表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:edit") |
|||
@Log(title = "文件处理信息表", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody FileReadInfoBo bo) { |
|||
return toAjax(fileReadInfoService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文件处理信息表 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:fileReadInfo:remove") |
|||
@Log(title = "文件处理信息表", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(fileReadInfoService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
/** |
|||
* 导入数据 |
|||
* |
|||
* @param file 导入文件 |
|||
* @param updateSupport 是否更新已存在数据 |
|||
*/ |
|||
@Log(title = "文件处理信息表", businessType = BusinessType.IMPORT) |
|||
@SaCheckPermission("productManagement:fileReadInfo:import") |
|||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Void> importData(@RequestPart("file") MultipartFile file,@RequestPart("content") String context) throws Exception { |
|||
if (ObjectUtil.isNull(file)) { |
|||
return R.fail("上传文件不能为空"); |
|||
} |
|||
fileReadInfoService.importData(file,context); |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,106 @@ |
|||
package org.dromara.productManagement.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.common.encrypt.annotation.ApiEncrypt; |
|||
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.productManagement.domain.vo.ModelPromptsVo; |
|||
import org.dromara.productManagement.domain.bo.ModelPromptsBo; |
|||
import org.dromara.productManagement.service.IModelPromptsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 模型提示词 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-05 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/ModelPrompts") |
|||
public class ModelPromptsController extends BaseController { |
|||
|
|||
private final IModelPromptsService modelPromptsService; |
|||
|
|||
/** |
|||
* 查询模型提示词列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ModelPromptsVo> list(ModelPromptsBo bo, PageQuery pageQuery) { |
|||
return modelPromptsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出模型提示词列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:export") |
|||
@Log(title = "模型提示词", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ModelPromptsBo bo, HttpServletResponse response) { |
|||
List<ModelPromptsVo> list = modelPromptsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "模型提示词", ModelPromptsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取模型提示词详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:query") |
|||
@GetMapping("/{id}") |
|||
public R<ModelPromptsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(modelPromptsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增模型提示词 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:add") |
|||
@Log(title = "模型提示词", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ModelPromptsBo bo) { |
|||
return toAjax(modelPromptsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改模型提示词 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:edit") |
|||
@Log(title = "模型提示词", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ModelPromptsBo bo) { |
|||
return toAjax(modelPromptsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除模型提示词 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPrompts:remove") |
|||
@Log(title = "模型提示词", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(modelPromptsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
package org.dromara.productManagement.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.common.encrypt.annotation.ApiEncrypt; |
|||
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.productManagement.domain.vo.ModelPromptsHistoryVo; |
|||
import org.dromara.productManagement.domain.bo.ModelPromptsHistoryBo; |
|||
import org.dromara.productManagement.service.IModelPromptsHistoryService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 模型提示词历史记录 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-05 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/ModelPromptsHistory") |
|||
public class ModelPromptsHistoryController extends BaseController { |
|||
|
|||
private final IModelPromptsHistoryService modelPromptsHistoryService; |
|||
|
|||
/** |
|||
* 查询模型提示词历史记录列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ModelPromptsHistoryVo> list(ModelPromptsHistoryBo bo, PageQuery pageQuery) { |
|||
return modelPromptsHistoryService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出模型提示词历史记录列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:export") |
|||
@Log(title = "模型提示词历史记录", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ModelPromptsHistoryBo bo, HttpServletResponse response) { |
|||
List<ModelPromptsHistoryVo> list = modelPromptsHistoryService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "模型提示词历史记录", ModelPromptsHistoryVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取模型提示词历史记录详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:query") |
|||
@GetMapping("/{id}") |
|||
public R<ModelPromptsHistoryVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(modelPromptsHistoryService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增模型提示词历史记录 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:add") |
|||
@Log(title = "模型提示词历史记录", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ModelPromptsHistoryBo bo) { |
|||
return toAjax(modelPromptsHistoryService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改模型提示词历史记录 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:edit") |
|||
@Log(title = "模型提示词历史记录", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ModelPromptsHistoryBo bo) { |
|||
return toAjax(modelPromptsHistoryService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除模型提示词历史记录 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:remove") |
|||
@Log(title = "模型提示词历史记录", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(modelPromptsHistoryService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
/** |
|||
* 修改模型提示词历史记录 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelPromptsHistory:restore") |
|||
@Log(title = "模型提示词历史记录", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PostMapping("/restore/{id}") |
|||
public R<Void> restore(@Validated(EditGroup.class) @PathVariable Long id) { |
|||
return toAjax(modelPromptsHistoryService.restoreByid(id)); |
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
package org.dromara.productManagement.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.common.satoken.utils.LoginHelper; |
|||
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.productManagement.domain.vo.ModelUserPromptssettingVo; |
|||
import org.dromara.productManagement.domain.bo.ModelUserPromptssettingBo; |
|||
import org.dromara.productManagement.service.IModelUserPromptssettingService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 模型提示词用户配置 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-06 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/ModelUserPromptssetting") |
|||
public class ModelUserPromptssettingController extends BaseController { |
|||
|
|||
private final IModelUserPromptssettingService modelUserPromptssettingService; |
|||
|
|||
/** |
|||
* 查询模型提示词用户配置列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ModelUserPromptssettingVo> list(ModelUserPromptssettingBo bo, PageQuery pageQuery) { |
|||
return modelUserPromptssettingService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出模型提示词用户配置列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:export") |
|||
@Log(title = "模型提示词用户配置", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ModelUserPromptssettingBo bo, HttpServletResponse response) { |
|||
List<ModelUserPromptssettingVo> list = modelUserPromptssettingService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "模型提示词用户配置", ModelUserPromptssettingVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取模型提示词用户配置详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:query") |
|||
@GetMapping("/{id}") |
|||
public R<ModelUserPromptssettingVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(modelUserPromptssettingService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增模型提示词用户配置 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:add") |
|||
@Log(title = "模型提示词用户配置", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ModelUserPromptssettingBo bo) { |
|||
return toAjax(modelUserPromptssettingService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改模型提示词用户配置 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:edit") |
|||
@Log(title = "模型提示词用户配置", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ModelUserPromptssettingBo bo) { |
|||
return toAjax(modelUserPromptssettingService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除模型提示词用户配置 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:ModelUserPromptssetting:remove") |
|||
@Log(title = "模型提示词用户配置", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(modelUserPromptssettingService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
/** |
|||
* 根据用户id获取模型提示词用户配置详细信息 |
|||
* |
|||
*/ |
|||
// @SaCheckPermission("productManagement:ModelUserPromptssetting:query")
|
|||
@GetMapping("/getInfoByuserId") |
|||
public R<ModelUserPromptssettingVo> getInfoByuserId( String taskType) { |
|||
Long userId = LoginHelper.getUserId(); |
|||
return R.ok(modelUserPromptssettingService.queryByuserId(userId, taskType)); |
|||
} |
|||
} |
@ -0,0 +1,140 @@ |
|||
package org.dromara.productManagement.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.productManagement.domain.bo.PmgCompanyProductModelDetailsBo; |
|||
import org.dromara.productManagement.domain.bo.ProductModelViewBo; |
|||
import org.dromara.productManagement.domain.vo.PmgCompanyProductModelDetailsVo; |
|||
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.productManagement.domain.vo.PmgCompanyProductModelVo; |
|||
import org.dromara.productManagement.domain.bo.PmgCompanyProductModelBo; |
|||
import org.dromara.productManagement.service.IPmgCompanyProductModelService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 公司产品模型 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProductModel") |
|||
public class PmgCompanyProductModelController extends BaseController { |
|||
|
|||
private final IPmgCompanyProductModelService pmgCompanyProductModelService; |
|||
/** |
|||
* 新增个人产品模型及其详情 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SaCheckPermission("productManagement:companyProductModel:add") |
|||
@Log(title = "个人产品新增模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
public R<String> addModel(@Validated @RequestBody ProductModelViewBo<PmgCompanyProductModelDetailsBo> bo) { |
|||
String id = pmgCompanyProductModelService.addModel(bo); |
|||
return R.ok("新增成功",id); |
|||
} |
|||
/** |
|||
* 修改个人产品模型及其详情 |
|||
*/ |
|||
@PutMapping("/editModel") |
|||
@SaCheckPermission("productManagement:companyProductModel:edit") |
|||
@Log(title = "个人产品修改模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
public R<String> editModel(@Validated @RequestBody ProductModelViewBo<PmgCompanyProductModelDetailsBo> bo) { |
|||
String id = pmgCompanyProductModelService.editModel(bo); |
|||
return R.ok("修改成功",id); |
|||
} |
|||
/** |
|||
* 根据id查询个人产品模型详情 |
|||
* @param id 个人产品模型表id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SaCheckPermission("productManagement:companyProductModel:query") |
|||
public R<List<PmgCompanyProductModelDetailsVo>> getModelDetails(@PathVariable("id") String id) { |
|||
List<PmgCompanyProductModelDetailsVo> detailsList=pmgCompanyProductModelService.getModelDetails(id); |
|||
return R.ok(detailsList); |
|||
} |
|||
/** |
|||
* 查询公司产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgCompanyProductModelVo> list(PmgCompanyProductModelBo bo, PageQuery pageQuery) { |
|||
return pmgCompanyProductModelService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:export") |
|||
@Log(title = "公司产品模型", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgCompanyProductModelBo bo, HttpServletResponse response) { |
|||
List<PmgCompanyProductModelVo> list = pmgCompanyProductModelService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "公司产品模型", PmgCompanyProductModelVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取公司产品模型详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgCompanyProductModelVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgCompanyProductModelService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:add") |
|||
@Log(title = "公司产品模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgCompanyProductModelBo bo) { |
|||
return toAjax(pmgCompanyProductModelService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改公司产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:edit") |
|||
@Log(title = "公司产品模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgCompanyProductModelBo bo) { |
|||
return toAjax(pmgCompanyProductModelService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品模型 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModel:remove") |
|||
@Log(title = "公司产品模型", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgCompanyProductModelService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.PmgCompanyProductModelDetailsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgCompanyProductModelDetailsBo; |
|||
import org.dromara.productManagement.service.IPmgCompanyProductModelDetailsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 公司产品模型详情表 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProductModelDetails") |
|||
public class PmgCompanyProductModelDetailsController extends BaseController { |
|||
|
|||
private final IPmgCompanyProductModelDetailsService pmgCompanyProductModelDetailsService; |
|||
|
|||
/** |
|||
* 查询公司产品模型详情表列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgCompanyProductModelDetailsVo> list(PmgCompanyProductModelDetailsBo bo, PageQuery pageQuery) { |
|||
return pmgCompanyProductModelDetailsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品模型详情表列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:export") |
|||
@Log(title = "公司产品模型详情表", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgCompanyProductModelDetailsBo bo, HttpServletResponse response) { |
|||
List<PmgCompanyProductModelDetailsVo> list = pmgCompanyProductModelDetailsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "公司产品模型详情表", PmgCompanyProductModelDetailsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取公司产品模型详情表详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgCompanyProductModelDetailsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgCompanyProductModelDetailsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品模型详情表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:add") |
|||
@Log(title = "公司产品模型详情表", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgCompanyProductModelDetailsBo bo) { |
|||
return toAjax(pmgCompanyProductModelDetailsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改公司产品模型详情表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:edit") |
|||
@Log(title = "公司产品模型详情表", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgCompanyProductModelDetailsBo bo) { |
|||
return toAjax(pmgCompanyProductModelDetailsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品模型详情表 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProductModelDetails:remove") |
|||
@Log(title = "公司产品模型详情表", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgCompanyProductModelDetailsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.PmgCompanyProductsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgCompanyProductsBo; |
|||
import org.dromara.productManagement.service.IPmgCompanyProductsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 公司产品管理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProducts") |
|||
public class PmgCompanyProductsController extends BaseController { |
|||
|
|||
private final IPmgCompanyProductsService pmgCompanyProductsService; |
|||
|
|||
/** |
|||
* 查询公司产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgCompanyProductsVo> list(PmgCompanyProductsBo bo, PageQuery pageQuery) { |
|||
return pmgCompanyProductsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:export") |
|||
@Log(title = "公司产品管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgCompanyProductsBo bo, HttpServletResponse response) { |
|||
List<PmgCompanyProductsVo> list = pmgCompanyProductsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "公司产品管理", PmgCompanyProductsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取公司产品管理详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgCompanyProductsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgCompanyProductsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:add") |
|||
@Log(title = "公司产品管理", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgCompanyProductsBo bo) { |
|||
return toAjax(pmgCompanyProductsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改公司产品管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:edit") |
|||
@Log(title = "公司产品管理", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgCompanyProductsBo bo) { |
|||
return toAjax(pmgCompanyProductsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品管理 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:companyProducts:remove") |
|||
@Log(title = "公司产品管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgCompanyProductsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,141 @@ |
|||
package org.dromara.productManagement.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.productManagement.domain.bo.PmgPersonProductModelDetailsBo; |
|||
import org.dromara.productManagement.domain.bo.ProductModelViewBo; |
|||
import org.dromara.productManagement.domain.vo.PmgPersonProductModelDetailsVo; |
|||
import org.springframework.http.ResponseEntity; |
|||
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.productManagement.domain.vo.PmgPersonProductModelVo; |
|||
import org.dromara.productManagement.domain.bo.PmgPersonProductModelBo; |
|||
import org.dromara.productManagement.service.IPmgPersonProductModelService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 个人产品模型 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/personProductModel") |
|||
public class PmgPersonProductModelController extends BaseController { |
|||
|
|||
private final IPmgPersonProductModelService pmgPersonProductModelService; |
|||
/** |
|||
* 新增个人产品模型及其详情 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SaCheckPermission("productManagement:personProductModel:add") |
|||
@Log(title = "个人产品新增模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
public R<String> addModel(@Validated @RequestBody ProductModelViewBo<PmgPersonProductModelDetailsBo> bo) { |
|||
String id = pmgPersonProductModelService.addModel(bo); |
|||
return R.ok("新增成功",id); |
|||
} |
|||
/** |
|||
* 修改个人产品模型及其详情 |
|||
*/ |
|||
@PutMapping("/editModel") |
|||
@SaCheckPermission("productManagement:personProductModel:edit") |
|||
@Log(title = "个人产品修改模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
public R<String> editModel(@Validated @RequestBody ProductModelViewBo<PmgPersonProductModelDetailsBo> bo) { |
|||
String id = pmgPersonProductModelService.editModel(bo); |
|||
return R.ok("修改成功",id); |
|||
} |
|||
/** |
|||
* 根据id查询个人产品模型详情 |
|||
* @param id 个人产品模型表id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SaCheckPermission("productManagement:personProductModel:query") |
|||
public R<List<PmgPersonProductModelDetailsVo>> getModelDetails(@PathVariable("id") String id) { |
|||
List<PmgPersonProductModelDetailsVo> detailsList=pmgPersonProductModelService.getModelDetails(id); |
|||
return R.ok(detailsList); |
|||
} |
|||
/** |
|||
* 查询个人产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgPersonProductModelVo> list(PmgPersonProductModelBo bo, PageQuery pageQuery) { |
|||
return pmgPersonProductModelService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:export") |
|||
@Log(title = "个人产品模型", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgPersonProductModelBo bo, HttpServletResponse response) { |
|||
List<PmgPersonProductModelVo> list = pmgPersonProductModelService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "个人产品模型", PmgPersonProductModelVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取个人产品模型详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgPersonProductModelVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgPersonProductModelService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:add") |
|||
@Log(title = "个人产品模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgPersonProductModelBo bo) { |
|||
return toAjax(pmgPersonProductModelService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改个人产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:edit") |
|||
@Log(title = "个人产品模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgPersonProductModelBo bo) { |
|||
return toAjax(pmgPersonProductModelService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品模型 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModel:remove") |
|||
@Log(title = "个人产品模型", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgPersonProductModelService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.PmgPersonProductModelDetailsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgPersonProductModelDetailsBo; |
|||
import org.dromara.productManagement.service.IPmgPersonProductModelDetailsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 个人产品模型详情 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/personProductModelDetails") |
|||
public class PmgPersonProductModelDetailsController extends BaseController { |
|||
|
|||
private final IPmgPersonProductModelDetailsService pmgPersonProductModelDetailsService; |
|||
|
|||
/** |
|||
* 查询个人产品模型详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgPersonProductModelDetailsVo> list(PmgPersonProductModelDetailsBo bo, PageQuery pageQuery) { |
|||
return pmgPersonProductModelDetailsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品模型详情列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:export") |
|||
@Log(title = "个人产品模型详情", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgPersonProductModelDetailsBo bo, HttpServletResponse response) { |
|||
List<PmgPersonProductModelDetailsVo> list = pmgPersonProductModelDetailsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "个人产品模型详情", PmgPersonProductModelDetailsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取个人产品模型详情详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgPersonProductModelDetailsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgPersonProductModelDetailsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品模型详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:add") |
|||
@Log(title = "个人产品模型详情", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgPersonProductModelDetailsBo bo) { |
|||
return toAjax(pmgPersonProductModelDetailsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改个人产品模型详情 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:edit") |
|||
@Log(title = "个人产品模型详情", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgPersonProductModelDetailsBo bo) { |
|||
return toAjax(pmgPersonProductModelDetailsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品模型详情 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProductModelDetails:remove") |
|||
@Log(title = "个人产品模型详情", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgPersonProductModelDetailsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
package org.dromara.productManagement.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.springframework.http.MediaType; |
|||
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.productManagement.domain.vo.PmgPersonProductsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgPersonProductsBo; |
|||
import org.dromara.productManagement.service.IPmgPersonProductsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 个人产品管理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/personProducts") |
|||
public class PmgPersonProductsController extends BaseController { |
|||
|
|||
private final IPmgPersonProductsService pmgPersonProductsService; |
|||
/** |
|||
* 导入数据 |
|||
* |
|||
* @param file 导入文件 |
|||
* @param updateSupport 是否更新已存在数据 |
|||
*/ |
|||
@Log(title = "个人产品管理", businessType = BusinessType.IMPORT) |
|||
@SaCheckPermission("productManagement:personProducts:import") |
|||
@PostMapping(value = "/personProductsImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception { |
|||
pmgPersonProductsService.personProductsImportData(file, updateSupport); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 查询个人产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgPersonProductsVo> list(PmgPersonProductsBo bo, PageQuery pageQuery) { |
|||
return pmgPersonProductsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:export") |
|||
@Log(title = "个人产品管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgPersonProductsBo bo, HttpServletResponse response) { |
|||
List<PmgPersonProductsVo> list = pmgPersonProductsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "个人产品管理", PmgPersonProductsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取个人产品管理详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgPersonProductsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgPersonProductsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:add") |
|||
@Log(title = "个人产品管理", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgPersonProductsBo bo) { |
|||
return toAjax(pmgPersonProductsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改个人产品管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:edit") |
|||
@Log(title = "个人产品管理", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgPersonProductsBo bo) { |
|||
return toAjax(pmgPersonProductsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品管理 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:personProducts:remove") |
|||
@Log(title = "个人产品管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgPersonProductsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.PmgSupplierInformationVo; |
|||
import org.dromara.productManagement.domain.bo.PmgSupplierInformationBo; |
|||
import org.dromara.productManagement.service.IPmgSupplierInformationService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 供应商信息管理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierInformation") |
|||
public class PmgSupplierInformationController extends BaseController { |
|||
|
|||
private final IPmgSupplierInformationService pmgSupplierInformationService; |
|||
|
|||
/** |
|||
* 查询供应商信息管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgSupplierInformationVo> list(PmgSupplierInformationBo bo, PageQuery pageQuery) { |
|||
return pmgSupplierInformationService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商信息管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:export") |
|||
@Log(title = "供应商信息管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgSupplierInformationBo bo, HttpServletResponse response) { |
|||
List<PmgSupplierInformationVo> list = pmgSupplierInformationService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "供应商信息管理", PmgSupplierInformationVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取供应商信息管理详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgSupplierInformationVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgSupplierInformationService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商信息管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:add") |
|||
@Log(title = "供应商信息管理", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgSupplierInformationBo bo) { |
|||
return toAjax(pmgSupplierInformationService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改供应商信息管理 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:edit") |
|||
@Log(title = "供应商信息管理", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgSupplierInformationBo bo) { |
|||
return toAjax(pmgSupplierInformationService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商信息管理 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierInformation:remove") |
|||
@Log(title = "供应商信息管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgSupplierInformationService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,140 @@ |
|||
package org.dromara.productManagement.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.productManagement.domain.bo.PmgSupplierProductModelDetailsBo; |
|||
import org.dromara.productManagement.domain.bo.ProductModelViewBo; |
|||
import org.dromara.productManagement.domain.vo.PmgSupplierProductModelDetailsVo; |
|||
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.productManagement.domain.vo.PmgSupplierProductModelVo; |
|||
import org.dromara.productManagement.domain.bo.PmgSupplierProductModelBo; |
|||
import org.dromara.productManagement.service.IPmgSupplierProductModelService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 供应商产品模型 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProductModel") |
|||
public class PmgSupplierProductModelController extends BaseController { |
|||
|
|||
private final IPmgSupplierProductModelService pmgSupplierProductModelService; |
|||
/** |
|||
* 新增供应商产品模型及其详情 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SaCheckPermission("productManagement:supplierProductModel:add") |
|||
@Log(title = "个人产品新增模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
public R<String> addModel(@Validated @RequestBody ProductModelViewBo<PmgSupplierProductModelDetailsBo> bo) { |
|||
String id = pmgSupplierProductModelService.addModel(bo); |
|||
return R.ok("新增成功",id); |
|||
} |
|||
/** |
|||
* 修改供应商产品模型及其详情 |
|||
*/ |
|||
@PutMapping("/editModel") |
|||
@SaCheckPermission("productManagement:supplierProductModel:edit") |
|||
@Log(title = "个人产品修改模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
public R<String> editModel(@Validated @RequestBody ProductModelViewBo<PmgSupplierProductModelDetailsBo> bo) { |
|||
String id = pmgSupplierProductModelService.editModel(bo); |
|||
return R.ok("修改成功",id); |
|||
} |
|||
/** |
|||
* 根据id查询供应商产品模型详情 |
|||
* @param id 个人产品模型表id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SaCheckPermission("productManagement:supplierProductModel:query") |
|||
public R<List<PmgSupplierProductModelDetailsVo>> getModelDetails(@PathVariable("id") String id) { |
|||
List<PmgSupplierProductModelDetailsVo> detailsList=pmgSupplierProductModelService.getModelDetails(id); |
|||
return R.ok(detailsList); |
|||
} |
|||
/** |
|||
* 查询供应商产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgSupplierProductModelVo> list(PmgSupplierProductModelBo bo, PageQuery pageQuery) { |
|||
return pmgSupplierProductModelService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品模型列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:export") |
|||
@Log(title = "供应商产品模型", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgSupplierProductModelBo bo, HttpServletResponse response) { |
|||
List<PmgSupplierProductModelVo> list = pmgSupplierProductModelService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "供应商产品模型", PmgSupplierProductModelVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取供应商产品模型详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgSupplierProductModelVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgSupplierProductModelService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:add") |
|||
@Log(title = "供应商产品模型", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgSupplierProductModelBo bo) { |
|||
return toAjax(pmgSupplierProductModelService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改供应商产品模型 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:edit") |
|||
@Log(title = "供应商产品模型", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgSupplierProductModelBo bo) { |
|||
return toAjax(pmgSupplierProductModelService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品模型 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModel:remove") |
|||
@Log(title = "供应商产品模型", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgSupplierProductModelService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.productManagement.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.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.productManagement.domain.vo.PmgSupplierProductModelDetailsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgSupplierProductModelDetailsBo; |
|||
import org.dromara.productManagement.service.IPmgSupplierProductModelDetailsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 供应商产品模型详细 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProductModelDetails") |
|||
public class PmgSupplierProductModelDetailsController extends BaseController { |
|||
|
|||
private final IPmgSupplierProductModelDetailsService pmgSupplierProductModelDetailsService; |
|||
|
|||
/** |
|||
* 查询供应商产品模型详细列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgSupplierProductModelDetailsVo> list(PmgSupplierProductModelDetailsBo bo, PageQuery pageQuery) { |
|||
return pmgSupplierProductModelDetailsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品模型详细列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:export") |
|||
@Log(title = "供应商产品模型详细", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgSupplierProductModelDetailsBo bo, HttpServletResponse response) { |
|||
List<PmgSupplierProductModelDetailsVo> list = pmgSupplierProductModelDetailsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "供应商产品模型详细", PmgSupplierProductModelDetailsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取供应商产品模型详细详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgSupplierProductModelDetailsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgSupplierProductModelDetailsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品模型详细 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:add") |
|||
@Log(title = "供应商产品模型详细", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgSupplierProductModelDetailsBo bo) { |
|||
return toAjax(pmgSupplierProductModelDetailsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改供应商产品模型详细 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:edit") |
|||
@Log(title = "供应商产品模型详细", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgSupplierProductModelDetailsBo bo) { |
|||
return toAjax(pmgSupplierProductModelDetailsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品模型详细 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProductModelDetails:remove") |
|||
@Log(title = "供应商产品模型详细", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgSupplierProductModelDetailsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package org.dromara.productManagement.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.common.encrypt.annotation.ApiEncrypt; |
|||
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.productManagement.domain.vo.PmgSupplierProductsVo; |
|||
import org.dromara.productManagement.domain.bo.PmgSupplierProductsBo; |
|||
import org.dromara.productManagement.service.IPmgSupplierProductsService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 供应商产品管理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProducts") |
|||
public class PmgSupplierProductsController extends BaseController { |
|||
|
|||
private final IPmgSupplierProductsService pmgSupplierProductsService; |
|||
|
|||
/** |
|||
* 查询供应商产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:supplierProducts:list") |
|||
@ApiEncrypt(response = true) |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PmgSupplierProductsVo> list(PmgSupplierProductsBo bo, PageQuery pageQuery) { |
|||
return pmgSupplierProductsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品管理列表 |
|||
*/ |
|||
@SaCheckPermission("supplierProducts:supplierProducts:export") |
|||
@Log(title = "供应商产品管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PmgSupplierProductsBo bo, HttpServletResponse response) { |
|||
List<PmgSupplierProductsVo> list = pmgSupplierProductsService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "供应商产品管理", PmgSupplierProductsVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取供应商产品管理详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("supplierProducts:supplierProducts:query") |
|||
@GetMapping("/{id}") |
|||
public R<PmgSupplierProductsVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(pmgSupplierProductsService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品管理 |
|||
*/ |
|||
@SaCheckPermission("supplierProducts:supplierProducts:add") |
|||
@Log(title = "供应商产品管理", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PmgSupplierProductsBo bo) { |
|||
return toAjax(pmgSupplierProductsService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改供应商产品管理 |
|||
*/ |
|||
@SaCheckPermission("supplierProducts:supplierProducts:edit") |
|||
@Log(title = "供应商产品管理", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PmgSupplierProductsBo bo) { |
|||
return toAjax(pmgSupplierProductsService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品管理 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("supplierProducts:supplierProducts:remove") |
|||
@Log(title = "供应商产品管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(pmgSupplierProductsService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,253 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.util.concurrent.TimeUnit; |
|||
import cn.hutool.core.io.FileUtil; |
|||
|
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import lombok.RequiredArgsConstructor; |
|||
import okhttp3.*; |
|||
import okhttp3.RequestBody; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.common.sse.dto.ChatGlmDto; |
|||
import org.dromara.common.sse.listener.SSEListener; |
|||
import org.dromara.common.sse.utils.ExecuteSSEUtil; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.core.domain.R; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
|
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 供应商信息管理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/docAi1") |
|||
public class Qwen72bController extends BaseController { |
|||
@Value("${chat.filePath}") |
|||
private String chatFilePath; |
|||
@Value("${chat.chatUrl}") |
|||
private String chatUrl; |
|||
|
|||
private final OkHttpClient client = new OkHttpClient.Builder() |
|||
.connectTimeout(300, TimeUnit.SECONDS)//连接超时(单位:秒)
|
|||
.callTimeout(1200, TimeUnit.SECONDS)//整个流程耗费的超时时间(单位:秒)--很少人使用
|
|||
.pingInterval(50, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒)
|
|||
.readTimeout(600, TimeUnit.SECONDS)//读取超时(单位:秒)
|
|||
.writeTimeout(600, TimeUnit.SECONDS)//写入超时(单位:秒)
|
|||
.build(); |
|||
|
|||
//对多个请求进行异步处理,并返回CompletableFuture对象,最后通过thenAccept()方法处理结果。
|
|||
|
|||
@PostMapping(value = "/sse-invoke", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void sse(@RequestPart(name = "originalFilename") String originalFilename, @RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
// String token = ApiTokenUtil.generateClientToken(API_KEY);
|
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/stream?context="+context, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@PostMapping(value = "/sse/checkPlaceName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void checkPlaceName( |
|||
@RequestPart(name = "originalFilename") String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
|
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
//http://183.136.156.2:50000/see/checkPlaceName?filename="+fileName
|
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/checkPlaceName?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@PostMapping(value = "/sse/checkRepeatText", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void checkRepeatText( |
|||
@RequestPart(name = "originalFilename") String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/checkRepeatText?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@PostMapping(value = "/sse/checkCompanyName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void checkCompanyName( |
|||
@RequestPart(name = "originalFilename") String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/checkCompanyName?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
|
|||
} |
|||
@PostMapping(value = "/sse/checkDocumentError", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void checkDocumentError( |
|||
@RequestPart(name = "originalFilename") String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/checkDocumentErrorWeb?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@PostMapping(value = "/sse/checkTitleName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void checkTitleName( |
|||
@RequestPart(name = "originalFilename") String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/checkTitleName?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@PostMapping(value = "/sse/documentEvaluate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = "text/event-stream;charset=UTF-8") |
|||
public void documentEvaluate( |
|||
@RequestPart(name = "originalFilename",required = false) String originalFilename, |
|||
@RequestPart("content") String context, HttpServletResponse rp) throws Exception { |
|||
String fileName="uploads/"+originalFilename; |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/xysse/documentEvaluate?filename="+fileName+"&userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
@GetMapping(value = "/sse/getLog",produces = "text/event-stream;charset=UTF-8") |
|||
public void getlog(HttpServletResponse rp) throws Exception { |
|||
Long userId = LoginHelper.getUserId(); |
|||
ChatGlmDto chatGlmDto = new ChatGlmDto(); |
|||
SSEListener sseListener = new SSEListener(chatGlmDto, rp); |
|||
ExecuteSSEUtil.executeSSE(chatUrl+"/sse/getLog?userId="+userId, sseListener, JSON.toJSONString(chatGlmDto)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 上传文件与文件转换 |
|||
* @param file 上传的文件 |
|||
* @param uuid 文件唯一标识 |
|||
* @return 上传成功返回文件路径,失败返回失败原因 |
|||
* @throws IOException |
|||
* @throws InterruptedException |
|||
*/ |
|||
@PostMapping(value = "/sse/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<String> uploadFileby(@RequestPart(name = "fileInfo") MultipartFile file,@RequestPart(name = "originalFilename") String originalFilename) throws IOException, InterruptedException { |
|||
String destDir = chatFilePath; |
|||
if (originalFilename == null) { |
|||
throw new IllegalArgumentException("文件名不能为空"); |
|||
} |
|||
// 获取文件的后缀
|
|||
String suffix = FileUtil.getSuffix(originalFilename); |
|||
|
|||
// 构建目标文件路径
|
|||
String destPath = destDir + File.separator + originalFilename; |
|||
|
|||
// 创建目标文件
|
|||
File destFile = new File(destPath); |
|||
FileUtil.writeFromStream(file.getInputStream(), destFile); |
|||
//不是docx文件需要转换
|
|||
if (!originalFilename.endsWith(".docx")) { |
|||
// ProcessBuilder builder = new ProcessBuilder("unoconv","-o" ,destDir,"-f", "docx", );
|
|||
ProcessBuilder builder = new ProcessBuilder("libreoffice", "--headless", "--convert-to", "docx",destFile.getAbsolutePath(), "--outdir", destDir); |
|||
|
|||
Process process = builder.start(); |
|||
|
|||
int complated = process.waitFor(); |
|||
if (complated!=0) { |
|||
// 如果返回值不是0,说明转换失败
|
|||
process.destroyForcibly(); |
|||
String failMsg = suffix+"转docx失败,请检查文件是否正确~"; |
|||
return R.fail(failMsg,failMsg); |
|||
}else{ |
|||
//文档转换成果
|
|||
process.destroyForcibly(); |
|||
destPath=destPath.substring(0,destPath.lastIndexOf("."))+".docx"; |
|||
} |
|||
} |
|||
|
|||
if(!sendRequest(chatUrl+"/sse/upload", destPath)){ |
|||
return R.fail("文件上传失败","文件上传失败"); |
|||
} |
|||
return R.ok("ok","uploads/"+originalFilename); |
|||
} |
|||
@PostMapping(value = "/xysse/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<String> uploadFileby1(@RequestPart(name = "fileInfo") MultipartFile file,@RequestPart(name = "originalFilename") String originalFilename) throws IOException, InterruptedException { |
|||
String destDir = chatFilePath; |
|||
if (originalFilename == null) { |
|||
throw new IllegalArgumentException("文件名不能为空"); |
|||
} |
|||
// 获取文件的后缀
|
|||
String suffix = FileUtil.getSuffix(originalFilename); |
|||
|
|||
// 构建目标文件路径
|
|||
String destPath = destDir + File.separator + originalFilename; |
|||
|
|||
// 创建目标文件
|
|||
File destFile = new File(destPath); |
|||
FileUtil.writeFromStream(file.getInputStream(), destFile); |
|||
//不是docx文件需要转换
|
|||
if (!originalFilename.endsWith(".docx")) { |
|||
ProcessBuilder builder = new ProcessBuilder("unoconv","-o" ,destDir,"-f", "docx", destFile.getAbsolutePath()); |
|||
|
|||
Process process = builder.start(); |
|||
|
|||
int complated = process.waitFor(); |
|||
if (complated!=0) { |
|||
// 如果返回值不是0,说明转换失败
|
|||
process.destroyForcibly(); |
|||
String failMsg = suffix+"转docx失败,请检查文件是否正确~"; |
|||
return R.fail(failMsg,failMsg); |
|||
}else{ |
|||
//文档转换成果
|
|||
process.destroyForcibly(); |
|||
destPath=destPath.substring(0,destPath.lastIndexOf("."))+".docx"; |
|||
} |
|||
} |
|||
|
|||
if(!sendRequest(chatUrl+"/xysse/upload", destPath)){ |
|||
return R.fail("文件上传失败","文件上传失败"); |
|||
} |
|||
return R.ok("ok","uploads/"+originalFilename); |
|||
} |
|||
|
|||
/** |
|||
* 发送文件到flask服务器 |
|||
* @param url |
|||
* @param filePath |
|||
* @return |
|||
*/ |
|||
public boolean sendRequest(String url,String filePath) { |
|||
// 替换为你要上传的文件路径
|
|||
File file = new File(filePath); |
|||
|
|||
RequestBody requestBody = new MultipartBody.Builder() |
|||
.setType(MultipartBody.FORM) |
|||
.addFormDataPart("file", file.getName(), |
|||
RequestBody.create(okhttp3.MediaType.parse(MediaType.APPLICATION_OCTET_STREAM_VALUE), file)) |
|||
.build(); |
|||
|
|||
Request request = new Request.Builder() |
|||
.url(url) // 替换为你的Flask服务器地址
|
|||
.post(requestBody) |
|||
.build(); |
|||
|
|||
try (Response response = client.newCall(request).execute()) { |
|||
if (!response.isSuccessful()) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return false; |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.vo.DocumentTasksVo; |
|||
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.productManagement.domain.vo.SchemEvaluationVo; |
|||
import org.dromara.productManagement.domain.bo.SchemEvaluationBo; |
|||
import org.dromara.productManagement.service.ISchemEvaluationService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 方案评价任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/SchemEvaluation") |
|||
public class SchemEvaluationController extends BaseController { |
|||
|
|||
private final ISchemEvaluationService schemEvaluationService; |
|||
|
|||
/** |
|||
* 查询方案评价任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksVo> list(SchemEvaluationBo bo, PageQuery pageQuery) { |
|||
return schemEvaluationService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出方案评价任务列表 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:SchemEvaluation:export")
|
|||
// @Log(title = "方案评价任务", businessType = BusinessType.EXPORT)
|
|||
// @PostMapping("/export")
|
|||
// public void export(SchemEvaluationBo bo, HttpServletResponse response) {
|
|||
// List<DocumentTasksVo> list = schemEvaluationService.queryList(bo);
|
|||
// ExcelUtil.exportExcel(list, "方案评价任务", SchemEvaluationVo.class, response);
|
|||
// }
|
|||
|
|||
/** |
|||
* 获取方案评价任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(schemEvaluationService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增方案评价任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:add") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchemEvaluationBo bo) throws IOException, InterruptedException { |
|||
return toAjax(schemEvaluationService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改方案评价任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:edit") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchemEvaluationBo bo) { |
|||
return toAjax(schemEvaluationService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除方案评价任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:remove") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(schemEvaluationService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,112 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
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.productManagement.domain.vo.SjjDocumentTasksVo; |
|||
import org.dromara.productManagement.domain.bo.SjjDocumentTasksBo; |
|||
import org.dromara.productManagement.service.ISjjDocumentTasksService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 审计局标书任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-04-13 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/SjjDocumentTasks") |
|||
public class SjjDocumentTasksController extends BaseController { |
|||
|
|||
private final ISjjDocumentTasksService sjjDocumentTasksService; |
|||
|
|||
/** |
|||
* 查询审计局标书任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SjjDocumentTasksVo> list(SjjDocumentTasksBo bo, PageQuery pageQuery) { |
|||
return sjjDocumentTasksService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出审计局标书任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:export") |
|||
@Log(title = "审计局标书任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SjjDocumentTasksBo bo, HttpServletResponse response) { |
|||
List<SjjDocumentTasksVo> list = sjjDocumentTasksService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "审计局标书任务", SjjDocumentTasksVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取审计局标书任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:query") |
|||
@GetMapping("/{id}") |
|||
public R<SjjDocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(sjjDocumentTasksService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增审计局标书任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:add") |
|||
@Log(title = "审计局标书任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SjjDocumentTasksBo bo) throws IOException { |
|||
return toAjax(sjjDocumentTasksService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改审计局标书任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:edit") |
|||
@Log(title = "审计局标书任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SjjDocumentTasksBo bo) { |
|||
return toAjax(sjjDocumentTasksService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除审计局标书任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SjjDocumentTasks:remove") |
|||
@Log(title = "审计局标书任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(sjjDocumentTasksService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
@DeleteMapping("/ossRemoveById/{ids}") |
|||
public R<Void> ossRemoveById(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
|
|||
return toAjax(sjjDocumentTasksService.ossRemoveById(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.vo.DocumentTasksVo; |
|||
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.productManagement.domain.vo.TenderTaskVo; |
|||
import org.dromara.productManagement.domain.bo.TenderTaskBo; |
|||
import org.dromara.productManagement.service.ITenderTaskService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 招标审核任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/TenderTask") |
|||
public class TenderTaskController extends BaseController { |
|||
|
|||
private final ITenderTaskService tenderTaskService; |
|||
|
|||
/** |
|||
* 查询招标审核任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksVo> list(TenderTaskBo bo, PageQuery pageQuery) { |
|||
return tenderTaskService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出招标审核任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:export") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(TenderTaskBo bo, HttpServletResponse response) { |
|||
// List<DocumentTasksVo> list = tenderTaskService.queryList(bo);
|
|||
// ExcelUtil.exportExcel(list, "招标审核任务", TenderTaskVo.class, response);
|
|||
} |
|||
|
|||
/** |
|||
* 获取招标审核任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(tenderTaskService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增招标审核任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:add") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TenderTaskBo bo) throws IOException, InterruptedException { |
|||
return toAjax(tenderTaskService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改招标审核任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:edit") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TenderTaskBo bo) { |
|||
return toAjax(tenderTaskService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除招标审核任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:remove") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(tenderTaskService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,108 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.math.BigDecimal; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 造价编制详情对象 cmg_cost_item_detail |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-29 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("cmg_cost_item_detail") |
|||
public class CmgCostItemDetail extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 造价表id |
|||
*/ |
|||
private String costTableId; |
|||
|
|||
/** |
|||
* 父类id |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 费用类型 |
|||
*/ |
|||
private String costType; |
|||
|
|||
/** |
|||
* 建设内容 |
|||
*/ |
|||
private String constructContent; |
|||
|
|||
/** |
|||
* 费用名称 |
|||
*/ |
|||
private String costName; |
|||
|
|||
/** |
|||
* 费用描述 |
|||
*/ |
|||
private String costDescribe; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
private String unit; |
|||
|
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Long quantity; |
|||
|
|||
/** |
|||
* 单价 |
|||
*/ |
|||
private BigDecimal unitPrice; |
|||
|
|||
/** |
|||
* 总价 |
|||
*/ |
|||
private BigDecimal totalPrice; |
|||
|
|||
/** |
|||
* 是否明细 |
|||
*/ |
|||
private String isDetail; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private String orderNo; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
// @TableLogic
|
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 造价编制信息对象 cmg_cost_table |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-29 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("cmg_cost_table") |
|||
public class CmgCostTable extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
private String projectName; |
|||
|
|||
/** |
|||
* 造价日期 |
|||
*/ |
|||
private Date costDate; |
|||
|
|||
/** |
|||
* 总投资 |
|||
*/ |
|||
private BigDecimal totalInvestment; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
// @TableLogic
|
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
对象 contractual_task_supplement |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("contractual_task_supplement") |
|||
public class ContractualTaskSupplement extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务id |
|||
*/ |
|||
private Long documentTasksId; |
|||
|
|||
/** |
|||
* 合同角色 |
|||
*/ |
|||
private String contractPartyRole; |
|||
|
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
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; |
|||
|
|||
/** |
|||
* 合同任务对象 contractual_tasks |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("contractual_tasks") |
|||
public class ContractualTasks extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 合同任务名称 |
|||
*/ |
|||
private String taskName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String documentName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* 预计完成时间 |
|||
*/ |
|||
private Date estimatedCompletionTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String progressStatus; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 列队任务id |
|||
*/ |
|||
private String taskId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,129 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
// 文档评价结果类
|
|||
@Data |
|||
class DocumentEvaluationResult { |
|||
@JsonProperty("evaluationResultSummary") |
|||
private EvaluationSummary evaluationSummary; // 评价汇总
|
|||
|
|||
@JsonProperty("evaluationDetails") |
|||
private List<EvaluationDetail> evaluationDetails; // 评价详情列表
|
|||
|
|||
// 评价汇总内部类
|
|||
@Data |
|||
public static class EvaluationSummary { |
|||
@JsonProperty("evaluationRegistration") |
|||
private String evaluationRegistration; // 评价登记
|
|||
|
|||
@JsonProperty("evaluationScore") |
|||
private String evaluationScore; // 评价得分
|
|||
} |
|||
|
|||
// 评价详情内部类
|
|||
@Data |
|||
public static class EvaluationDetail { |
|||
@JsonProperty("functionClarity") |
|||
private EvaluationCriteria functionClarity; // 功能清晰性
|
|||
|
|||
@JsonProperty("functionCompleteness") |
|||
private EvaluationCriteria functionCompleteness; // 功能完整性
|
|||
|
|||
@JsonProperty("functionTestability") |
|||
private EvaluationCriteria functionTestability; // 功能可测试性
|
|||
|
|||
@JsonProperty("functionDetail") |
|||
private EvaluationCriteria functionDetail; // 功能详细性
|
|||
|
|||
@JsonProperty("originalText") |
|||
private String originalText; // 原文
|
|||
|
|||
@JsonProperty("polishedText") |
|||
private String polishedText; // 润色完善
|
|||
} |
|||
|
|||
// 评价标准内部类
|
|||
@Data |
|||
public static class EvaluationCriteria { |
|||
@JsonProperty("level") |
|||
private String level; // 级别
|
|||
|
|||
@JsonProperty("score") |
|||
private String score; // 分值
|
|||
|
|||
@JsonProperty("evaluationDescription") |
|||
private String evaluationDescription; // 评价说明
|
|||
} |
|||
} |
|||
/** |
|||
* json格式 |
|||
* { |
|||
* "evaluationResultSummary": { |
|||
* "evaluationRegistration": "2023-001", |
|||
* "evaluationScore": "85" |
|||
* }, |
|||
* "evaluationDetails": [ |
|||
* { |
|||
* "functionClarity": { |
|||
* "level": "Excellent", |
|||
* "score": "90", |
|||
* "evaluationDescription": "The function description is clear and precise." |
|||
* }, |
|||
* "functionCompleteness": { |
|||
* "level": "Good", |
|||
* "score": "80", |
|||
* "evaluationDescription": "The functionality is mostly complete, missing some details." |
|||
* }, |
|||
* "functionTestability": { |
|||
* "level": "Good", |
|||
* "score": "85", |
|||
* "evaluationDescription": "The function is easy to test, but documentation is insufficient." |
|||
* }, |
|||
* "functionDetail": { |
|||
* "level": "Excellent", |
|||
* "score": "95", |
|||
* "evaluationDescription": "The details of the function are accurate and comprehensive." |
|||
* }, |
|||
* "originalText": "Original text content.", |
|||
* "polishedText": "Polished text content." |
|||
* }, |
|||
* { |
|||
* "functionClarity": { |
|||
* "level": "Average", |
|||
* "score": "70", |
|||
* "evaluationDescription": "The function description is not clear enough." |
|||
* }, |
|||
* "functionCompleteness": { |
|||
* "level": "Satisfactory", |
|||
* "score": "75", |
|||
* "evaluationDescription": "Some functionalities are missing." |
|||
* }, |
|||
* "functionTestability": { |
|||
* "level": "Average", |
|||
* "score": "70", |
|||
* "evaluationDescription": "Testing is not convenient enough." |
|||
* }, |
|||
* "functionDetail": { |
|||
* "level": "Good", |
|||
* "score": "80", |
|||
* "evaluationDescription": "Function details are relatively complete." |
|||
* }, |
|||
* "originalText": "Second original text content.", |
|||
* "polishedText": "Second polished text content." |
|||
* } |
|||
* ] |
|||
* } |
|||
* // 创建ObjectMapper实例
|
|||
* ObjectMapper objectMapper = new ObjectMapper(); |
|||
* try { |
|||
* // 将JSON字符串映射到Java对象
|
|||
* DocumentEvaluationResult documentEvaluationResult = objectMapper.readValue(jsonString, DocumentEvaluationResult.class); |
|||
* System.out.println(documentEvaluationResult); |
|||
* } catch (IOException e) { |
|||
* e.printStackTrace(); |
|||
* } |
|||
*/ |
@ -0,0 +1,29 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableLogic; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.baomidou.mybatisplus.annotation.Version; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_task_categories") |
|||
public class DocumentTaskCategory extends TenantEntity { |
|||
|
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
private String documentTaskId; |
|||
|
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 删除标志 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class DocumentTaskChild { |
|||
private Long id; |
|||
private String taskName; |
|||
private String taskType; |
|||
private String taskId; |
|||
private Long ossId; |
|||
private Date estimatedCompletionTime; |
|||
private String progressStatus; |
|||
private Long version; |
|||
private Date createTime; |
|||
private Date updateTime; |
|||
// 添加任务持续时间字段
|
|||
private String taskDuration; |
|||
private String createUser; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class DocumentTaskGroup { |
|||
private String id; |
|||
private String documentName; |
|||
private Long createBy; |
|||
private String taskIndustry; |
|||
private String taskRegion; |
|||
private Date createTime; |
|||
private String createUser; |
|||
private String progress; |
|||
private List<DocumentTaskChild> childrenTasks; |
|||
} |
@ -0,0 +1,48 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableLogic; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.baomidou.mybatisplus.annotation.Version; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_task_result_details") |
|||
public class DocumentTaskResultDetail extends TenantEntity { |
|||
|
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
private String categoryId; |
|||
private String issueName; // 问题点名称
|
|||
|
|||
private String originalText; // 原文
|
|||
|
|||
private String comparedText; // 比对原文
|
|||
|
|||
private String modifiedContent; // 修改后的内容
|
|||
|
|||
private String modificationDisplay; // 展示修改情况
|
|||
|
|||
private String existingIssues; // 存在的问题
|
|||
|
|||
private String reviewBasis; // 审查依据
|
|||
|
|||
private String isRead; // 是否已读
|
|||
|
|||
private String isAdopted; // 是否采纳
|
|||
|
|||
/** |
|||
* 删除标志 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 文档任务结果对象 document_task_results |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-10-23 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_task_results") |
|||
public class DocumentTaskResults extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 任务id |
|||
*/ |
|||
private Long documentTaskId; |
|||
|
|||
/** |
|||
* 任务结果 |
|||
*/ |
|||
private String result; |
|||
/** |
|||
* 任务结果json |
|||
*/ |
|||
private String resultJson; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,83 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
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; |
|||
|
|||
/** |
|||
* 文档任务对象 document_tasks |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-10-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_tasks") |
|||
public class DocumentTasks extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
/** |
|||
* 后台任务id |
|||
*/ |
|||
private String taskId; |
|||
|
|||
/** |
|||
* 文档名称 |
|||
*/ |
|||
private String documentName; |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* 预计时间 |
|||
*/ |
|||
private Date estimatedCompletionTime; |
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
private String progressStatus; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 文档任务权限对象 document_tasks_permissions |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-11-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_tasks_permissions") |
|||
public class DocumentTasksPermissions extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
private Long roleId; |
|||
|
|||
/** |
|||
* 每日文档数 |
|||
*/ |
|||
private Long dailyDocumentCount; |
|||
|
|||
/** |
|||
* 优先级 |
|||
*/ |
|||
private Long priority; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
|
|||
private String taskType; |
|||
|
|||
/** |
|||
* 删除标志 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 文档任务权限详情对象 document_tasks_permissions_detail |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-11-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_tasks_permissions_detail") |
|||
public class DocumentTasksPermissionsDetail extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 剩余文档数 |
|||
*/ |
|||
private Long remainingDocumentCount; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
|
|||
private String taskType; |
|||
|
|||
/** |
|||
* 删除标志 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 文件处理信息表对象 file_read_info |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-09-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("file_read_info") |
|||
public class FileReadInfo extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 文件名称 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 文件状态,1是已读 |
|||
*/ |
|||
private String fileStatus; |
|||
|
|||
/** |
|||
* 文件读取模式 |
|||
*/ |
|||
private String fileReadMode; |
|||
|
|||
/** |
|||
* 反馈 |
|||
*/ |
|||
private String feedback; |
|||
|
|||
|
|||
} |
@ -0,0 +1,109 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.encrypt.annotation.EncryptField; |
|||
import org.dromara.common.encrypt.enumd.AlgorithmType; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 用于存储模型提示词对象 model_prompts |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("model_prompts") |
|||
public class ModelPrompts extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务角色描述 |
|||
*/ |
|||
private String taskRoleDesc; |
|||
|
|||
/** |
|||
* 模型任务名称 |
|||
*/ |
|||
@EncryptField(algorithm = AlgorithmType.SM4, password = "c7746c89a780c27eda14a2f9b3097c8f") |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
|
|||
private String taskType; |
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 任务背景 |
|||
*/ |
|||
private String context; |
|||
|
|||
/** |
|||
* 任务描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 任务流程 |
|||
*/ |
|||
private String workflow; |
|||
|
|||
/** |
|||
* 输出说明 |
|||
*/ |
|||
private String outputDesc; |
|||
|
|||
/** |
|||
* 注意事项 |
|||
*/ |
|||
private String cautions; |
|||
|
|||
/** |
|||
* 模型版本 |
|||
*/ |
|||
private String modelVersion; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String note; |
|||
|
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Version |
|||
private String version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,109 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 模型提示词历史记录对象 model_prompts_history |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("model_prompts_history") |
|||
public class ModelPromptsHistory extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 提示词id |
|||
*/ |
|||
private Long promptId; |
|||
|
|||
/** |
|||
* 任务角色描述 |
|||
*/ |
|||
private String taskRoleDesc; |
|||
|
|||
/** |
|||
* 模型任务名称 |
|||
*/ |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 任务背景 |
|||
*/ |
|||
private String context; |
|||
|
|||
/** |
|||
* 任务描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 任务流程 |
|||
*/ |
|||
private String workflow; |
|||
|
|||
/** |
|||
* 输出说明 |
|||
*/ |
|||
private String outputDesc; |
|||
|
|||
/** |
|||
* 注意事项 |
|||
*/ |
|||
private String cautions; |
|||
|
|||
/** |
|||
* 模型版本 |
|||
*/ |
|||
private String modelVersion; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String note; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Version |
|||
private String version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 模型提示词用户配置对象 model_user_promptssetting |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("model_user_promptssetting") |
|||
public class ModelUserPromptssetting extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 任务类型(名称) |
|||
*/ |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Version |
|||
private String version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 公司产品模型对象 pmg_company_product_model |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_company_product_model") |
|||
public class PmgCompanyProductModel extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 公司产品指标描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
private String productModelTemplateId; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 公司产品模型详情表对象 pmg_company_product_model_details |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_company_product_model_details") |
|||
public class PmgCompanyProductModelDetails extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,118 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.math.BigDecimal; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 公司产品管理对象 pmg_company_products |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_company_products") |
|||
public class PmgCompanyProducts extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
private String supplierProductsId; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 公司产品规格 |
|||
*/ |
|||
private String productSpecifications; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private String image; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
private String brand; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
private String unit; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
private BigDecimal exTaxPrice; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
private Long taxrate; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
private String modelId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 个人产品模型对象 pmg_person_product_model |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_person_product_model") |
|||
public class PmgPersonProductModel extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
private String productModelTemplateId; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 个人产品模型详情对象 pmg_person_product_model_details |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-07-01 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_person_product_model_details") |
|||
public class PmgPersonProductModelDetails extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
|
|||
} |
@ -0,0 +1,119 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.math.BigDecimal; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 个人产品管理对象 pmg_person_products |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-06-28 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("pmg_person_products") |
|||
public class PmgPersonProducts extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
private String productSpecifications; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
private String supplierProductsId; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private String image; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
private String brand; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
private String unit; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
private BigDecimal exTaxPrice; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
private Long taxrate; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
private String modelId; |
|||
|
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue