diff --git a/adc-da-login/src/main/java/com/adc/da/login/config/ShiroFilterConfiguration.java b/adc-da-login/src/main/java/com/adc/da/login/config/ShiroFilterConfiguration.java
index 2b3493c..03f89b2 100644
--- a/adc-da-login/src/main/java/com/adc/da/login/config/ShiroFilterConfiguration.java
+++ b/adc-da-login/src/main/java/com/adc/da/login/config/ShiroFilterConfiguration.java
@@ -121,7 +121,7 @@ public class ShiroFilterConfiguration {
filterChainDefinitionMap.put(restPath + "/updatePassword", ANON);
filterChainDefinitionMap.put(restPath + "/user/supplierRegistry/*", ANON);
-// filterChainDefinitionMap.put(restPath + "/**", AUTHC);
+ filterChainDefinitionMap.put(restPath + "/**", AUTHC);
/* static 不需登录 */
filterChainDefinitionMap.put("/static/**", ANON);
@@ -130,6 +130,7 @@ public class ShiroFilterConfiguration {
filterChainDefinitionMap.put("/userfiles/**", ANON);
filterChainDefinitionMap.put(adminPath + LOGIN, AUTHC);
filterChainDefinitionMap.put(adminPath + "/logout", "logout");
+// filterChainDefinitionMap.put(restPath + "/**", "logout");
filterChainDefinitionMap.put("/swagger-ui.html", ANON);
/* 流程需要 */
filterChainDefinitionMap.put(restPath + "/service/model/**", ANON);
diff --git a/adc-da-login/src/main/java/com/adc/da/login/security/AdcFormAuthenticationFilter.java b/adc-da-login/src/main/java/com/adc/da/login/security/AdcFormAuthenticationFilter.java
index eb3a027..8e440b5 100644
--- a/adc-da-login/src/main/java/com/adc/da/login/security/AdcFormAuthenticationFilter.java
+++ b/adc-da-login/src/main/java/com/adc/da/login/security/AdcFormAuthenticationFilter.java
@@ -1,11 +1,8 @@
package com.adc.da.login.security;
-import com.adc.da.util.exception.AdcDaBaseException;
-import com.adc.da.util.http.ResponseMessage;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.ThreadContext;
-import org.apache.shiro.web.servlet.ShiroHttpServletResponse;
import org.apache.shiro.web.subject.WebSubject;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.stereotype.Service;
@@ -56,6 +53,7 @@ public class AdcFormAuthenticationFilter extends org.apache.shiro.web.filter.aut
return new UsernamePasswordToken(username, record.toCharArray(), rememberMe, host, captcha);
}
+ @Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
Subject subject = this.getSubject(request, response);
diff --git a/adc-da-main/src/main/java/com/adc/da/main/config/WebMvcConfig.java b/adc-da-main/src/main/java/com/adc/da/main/config/WebMvcConfig.java
index da045a1..968ab09 100644
--- a/adc-da-main/src/main/java/com/adc/da/main/config/WebMvcConfig.java
+++ b/adc-da-main/src/main/java/com/adc/da/main/config/WebMvcConfig.java
@@ -21,7 +21,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// /home/file/**为前端URL访问路径 后面 file:xxxx为本地磁盘映射
- registry.addResourceHandler(picPath+"**").addResourceLocations("file://"+uploadFile);
+ registry.addResourceHandler(picPath + "**").addResourceLocations("file:" + uploadFile);
}
}
diff --git a/adc-da-main/src/main/resources/application-dev.properties b/adc-da-main/src/main/resources/application-dev.properties
index 4231dbe..aa2e423 100644
--- a/adc-da-main/src/main/resources/application-dev.properties
+++ b/adc-da-main/src/main/resources/application-dev.properties
@@ -18,7 +18,7 @@
#spring.datasource.password = adc_forecast
-#kylin数据库 ds1
+#kylin\u6570\u636E\u5E93 ds1
#spring.datasource.kylin.name=PROJECT_MI
#spring.datasource.kylin.driverClassName=org.apache.kylin.jdbc.Driver
#spring.datasource.kylin.url=jdbc:kylin://10.64.23.8:7070/PROJECT_MI
@@ -28,32 +28,32 @@
#spring.datasource.kylin.maxWaitTime=10000
#spring.datasource.kylin.poolSize=10
#
-##mysql数据库 ds2
+##mysql\u6570\u636E\u5E93 ds2
#spring.datasource.mysql.driverClassName = com.mysql.jdbc.Driver
#spring.datasource.mysql.url = jdbc:mysql://192.168.144.80:3306/cadata?characterEncoding=utf-8&&zeroDateTimeBehavior=convertToNull
#spring.datasource.mysql.username = root
#spring.datasource.mysql.password = root
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
-spring.datasource.url = jdbc:mysql://121.36.69.172:3307/report-library?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+spring.datasource.url = jdbc:mysql://121.36.69.172:3307/report-library?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
spring.datasource.username = root
spring.datasource.password = hzwlsoft.com
-#后端端口
+#\u540E\u7AEF\u7AEF\u53E3
server.port=7060
-#验证码后台模式,默认为1:1为不开启,2为开启,3为输错 用户名或密码 ${maxLoginErrorCount} 次 才开启
+#\u9A8C\u8BC1\u7801\u540E\u53F0\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A1\uFF1A1\u4E3A\u4E0D\u5F00\u542F\uFF0C2\u4E3A\u5F00\u542F\uFF0C3\u4E3A\u8F93\u9519 \u7528\u6237\u540D\u6216\u5BC6\u7801 ${maxLoginErrorCount} \u6B21 \u624D\u5F00\u542F
verifyCodeMode=3
-#仅当验证码模式 ${verifyCodeMode} 为 3时生效,设置错误登录出现验证码的阈值,默认为3
+#\u4EC5\u5F53\u9A8C\u8BC1\u7801\u6A21\u5F0F ${verifyCodeMode} \u4E3A 3\u65F6\u751F\u6548\uFF0C\u8BBE\u7F6E\u9519\u8BEF\u767B\u5F55\u51FA\u73B0\u9A8C\u8BC1\u7801\u7684\u9608\u503C\uFF0C\u9ED8\u8BA4\u4E3A3
maxLoginErrorCount=3
-#密码Base64加密开关,true为开启,false为关闭
+#\u5BC6\u7801Base64\u52A0\u5BC6\u5F00\u5173,true\u4E3A\u5F00\u542F,false\u4E3A\u5173\u95ED
isPassEncrypted=true
#{
#"password": "YWJjMTIz",
#"username": "YWRtaW4x"
#}
-#swagger 显示api,1为只显示${restPath:/api}前缀的api,0为显示所有api,其他为不显示api
+#swagger \u663E\u793Aapi\uFF0C1\u4E3A\u53EA\u663E\u793A${restPath:/api}\u524D\u7F00\u7684api,0\u4E3A\u663E\u793A\u6240\u6709api\uFF0C\u5176\u4ED6\u4E3A\u4E0D\u663E\u793Aapi
swaggerLevel=0
@@ -61,12 +61,13 @@ swaggerLevel=0
#
#picPath=/EPR/file/home/pic/
-# 本地存储文件的磁盘地址
-uploadFile=D:\\work\\idea\\changan\\
-# 本地文件访问的url地址
+# \u672C\u5730\u5B58\u50A8\u6587\u4EF6\u7684\u78C1\u76D8\u5730\u5740
+#uploadFile=D:\\work\\idea\\changan\\
+#uploadFile=D:\\uploadfile\\tmp\\
+uploadFile=/data/DeploymentPackage/report_library/uploadfile/
+# \u672C\u5730\u6587\u4EF6\u8BBF\u95EE\u7684url\u5730\u5740
picPath=/api/home/pic/
-
serverIp=http://127.0.0.1:7060/
@@ -86,50 +87,52 @@ MAIL_POP_PORT=110
#MAIL_USERNAME=64459@Any3.com
#MAIL_PASSWORD=65316975Xiaoq
-IPANDPORT=http://localhost:7061/
+# \u4FEE\u6539\u6210\u540E\u7AEF\u670D\u52A1\u5668\u5730\u5740
+IPANDPORT=http://localhost:7060/
#redis
-#Redis服务器地址
-spring.redis.host=192.168.144.29
-#spring.redis.host=localhost
-## Redis服务器连接端口
+#Redis\u670D\u52A1\u5668\u5730\u5740
+spring.redis.host=10.10.10.44
+## Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
spring.redis.port=6379
-## Redis服务器连接密码(默认为空)
-spring.redis.password=123321
-## 连接超时时间(毫秒)
+## Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
+spring.redis.password=123456
+## \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout=200000ms
-## 连接池中的最大空闲连接,默认值是8。
+## \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u662F8\u3002
spring.redis.jedis.pool.max-idle=50
-##连接池中的最小空闲连接,默认值是0。
+##\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u662F0\u3002
spring.redis.jedis.pool.min-idle=10
-## 如果赋值为-1,则表示不限制;如果pool已经分配了maxActive个jedis实例,则此时pool的状态为exhausted(耗尽)。
+## \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
spring.redis.jedis.pool.max-active=2000
-## 等待可用连接的最大时间,单位毫秒,默认值为-1,表示永不超时。如果超过等待时间,则直接抛出JedisConnectionException
+## \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
spring.redis.jedis.pool.max-wait=2000ms
-spring.redis.database=6
+spring.redis.database=2
-# 上传方式:阿里云:alioss 华为云:hwobs
+# \u4E0A\u4F20\u65B9\u5F0F\uFF1A\u963F\u91CC\u4E91\uFF1Aalioss \u534E\u4E3A\u4E91\uFF1Ahwobs \u672C\u5730\uFF1Alocal
uploadType: hwobs
-# ======= 阿里OSS配置 =========
+# \u672C\u5730\u6587\u4EF6\u5B58\u50A8\u5730\u5740
+localFilePath=D:\\uploadfile\\
+
+# ======= \u963F\u91CCOSS\u914D\u7F6E =========
aliyun.OSS.endpoint=https://oss-cn-hangzhou.aliyuncs.com
aliyun.OSS.accessKeyId= LTAI5tBmUfVF6Z8R6sHTdTG7
aliyun.OSS.accessKeySecret= mY6UvWv20Tg2R46ORe6uV5gL6TQloC
aliyun.OSS.bucketName=qqxexamplebucket
-aliyun.OSS.fileMaxSize=10 #文件上传最大M数
+aliyun.OSS.fileMaxSize=10 #\u6587\u4EF6\u4E0A\u4F20\u6700\u5927M\u6570
-# ======= 华为OBS配置 =========
+# ======= \u534E\u4E3AOBS\u914D\u7F6E =========
huawei.OBS.endPoint=https://obs.cn-north-4.myhuaweicloud.com
huawei.OBS.accessKey=EEMAGYTHP9KKPF18TZCL
huawei.OBS.secretKey=3NmFNf1uX3EV1LbCEzgw6gDv0tZ6WAVwG37BGq1p
huawei.OBS.bucketName=gcpa
-huawei.OBS.fileMaxSize=10 #文件上传最大M数
+huawei.OBS.fileMaxSize=10 #\u6587\u4EF6\u4E0A\u4F20\u6700\u5927M\u6570
logging.level.com.adc: debug
# ==== IAM????
iam.url=https://iamuat.faw-vw.com/
iam.appkey=xxxx
-iam.appSecret=xxx
-
+iam.appSecret=xxx
\ No newline at end of file
diff --git a/adc-da-main/target/classes/application-dev.properties b/adc-da-main/target/classes/application-dev.properties
index 4231dbe..1d60734 100644
--- a/adc-da-main/target/classes/application-dev.properties
+++ b/adc-da-main/target/classes/application-dev.properties
@@ -18,7 +18,7 @@
#spring.datasource.password = adc_forecast
-#kylin数据库 ds1
+#kylin\u6570\u636E\u5E93 ds1
#spring.datasource.kylin.name=PROJECT_MI
#spring.datasource.kylin.driverClassName=org.apache.kylin.jdbc.Driver
#spring.datasource.kylin.url=jdbc:kylin://10.64.23.8:7070/PROJECT_MI
@@ -28,7 +28,7 @@
#spring.datasource.kylin.maxWaitTime=10000
#spring.datasource.kylin.poolSize=10
#
-##mysql数据库 ds2
+##mysql\u6570\u636E\u5E93 ds2
#spring.datasource.mysql.driverClassName = com.mysql.jdbc.Driver
#spring.datasource.mysql.url = jdbc:mysql://192.168.144.80:3306/cadata?characterEncoding=utf-8&&zeroDateTimeBehavior=convertToNull
#spring.datasource.mysql.username = root
@@ -39,21 +39,21 @@ spring.datasource.url = jdbc:mysql://121.36.69.172:3307/report-library?character
spring.datasource.username = root
spring.datasource.password = hzwlsoft.com
-#后端端口
+#\u540E\u7AEF\u7AEF\u53E3
server.port=7060
-#验证码后台模式,默认为1:1为不开启,2为开启,3为输错 用户名或密码 ${maxLoginErrorCount} 次 才开启
+#\u9A8C\u8BC1\u7801\u540E\u53F0\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A1\uFF1A1\u4E3A\u4E0D\u5F00\u542F\uFF0C2\u4E3A\u5F00\u542F\uFF0C3\u4E3A\u8F93\u9519 \u7528\u6237\u540D\u6216\u5BC6\u7801 ${maxLoginErrorCount} \u6B21 \u624D\u5F00\u542F
verifyCodeMode=3
-#仅当验证码模式 ${verifyCodeMode} 为 3时生效,设置错误登录出现验证码的阈值,默认为3
+#\u4EC5\u5F53\u9A8C\u8BC1\u7801\u6A21\u5F0F ${verifyCodeMode} \u4E3A 3\u65F6\u751F\u6548\uFF0C\u8BBE\u7F6E\u9519\u8BEF\u767B\u5F55\u51FA\u73B0\u9A8C\u8BC1\u7801\u7684\u9608\u503C\uFF0C\u9ED8\u8BA4\u4E3A3
maxLoginErrorCount=3
-#密码Base64加密开关,true为开启,false为关闭
+#\u5BC6\u7801Base64\u52A0\u5BC6\u5F00\u5173,true\u4E3A\u5F00\u542F,false\u4E3A\u5173\u95ED
isPassEncrypted=true
#{
#"password": "YWJjMTIz",
#"username": "YWRtaW4x"
#}
-#swagger 显示api,1为只显示${restPath:/api}前缀的api,0为显示所有api,其他为不显示api
+#swagger \u663E\u793Aapi\uFF0C1\u4E3A\u53EA\u663E\u793A${restPath:/api}\u524D\u7F00\u7684api,0\u4E3A\u663E\u793A\u6240\u6709api\uFF0C\u5176\u4ED6\u4E3A\u4E0D\u663E\u793Aapi
swaggerLevel=0
@@ -61,9 +61,14 @@ swaggerLevel=0
#
#picPath=/EPR/file/home/pic/
-# 本地存储文件的磁盘地址
-uploadFile=D:\\work\\idea\\changan\\
-# 本地文件访问的url地址
+# \u672C\u5730\u6587\u4EF6\u5B58\u50A8\u8DEF\u5F84\u65B9\u5F0F jar\u5305\u8DEF\u5F84\uFF1Ajar \u5DE5\u4F5C\u76EE\u5F55\uFF1Auserdir \u56FA\u5B9A\u76EE\u5F55\uFF1Asettled
+localSaveFileType=settled
+#localSaveFileType=userdir
+
+# \u672C\u5730\u5B58\u50A8\u6587\u4EF6\u7684\u78C1\u76D8\u5730\u5740
+#uploadFile=D:\\work\\idea\\changan\\
+uploadFile=/data/DeploymentPackage/report_library/uploadfile
+# \u672C\u5730\u6587\u4EF6\u8BBF\u95EE\u7684url\u5730\u5740
picPath=/api/home/pic/
@@ -89,42 +94,42 @@ MAIL_POP_PORT=110
IPANDPORT=http://localhost:7061/
#redis
-#Redis服务器地址
+#Redis\u670D\u52A1\u5668\u5730\u5740
spring.redis.host=192.168.144.29
#spring.redis.host=localhost
-## Redis服务器连接端口
+## Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
spring.redis.port=6379
-## Redis服务器连接密码(默认为空)
+## Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password=123321
-## 连接超时时间(毫秒)
+## \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout=200000ms
-## 连接池中的最大空闲连接,默认值是8。
+## \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u662F8\u3002
spring.redis.jedis.pool.max-idle=50
-##连接池中的最小空闲连接,默认值是0。
+##\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u662F0\u3002
spring.redis.jedis.pool.min-idle=10
-## 如果赋值为-1,则表示不限制;如果pool已经分配了maxActive个jedis实例,则此时pool的状态为exhausted(耗尽)。
+## \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
spring.redis.jedis.pool.max-active=2000
-## 等待可用连接的最大时间,单位毫秒,默认值为-1,表示永不超时。如果超过等待时间,则直接抛出JedisConnectionException
+## \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
spring.redis.jedis.pool.max-wait=2000ms
spring.redis.database=6
-# 上传方式:阿里云:alioss 华为云:hwobs
+# \u4E0A\u4F20\u65B9\u5F0F\uFF1A\u963F\u91CC\u4E91\uFF1Aalioss \u534E\u4E3A\u4E91\uFF1Ahwobs \u672C\u5730\uFF1Alocal
uploadType: hwobs
-# ======= 阿里OSS配置 =========
+# ======= \u963F\u91CCOSS\u914D\u7F6E =========
aliyun.OSS.endpoint=https://oss-cn-hangzhou.aliyuncs.com
aliyun.OSS.accessKeyId= LTAI5tBmUfVF6Z8R6sHTdTG7
aliyun.OSS.accessKeySecret= mY6UvWv20Tg2R46ORe6uV5gL6TQloC
aliyun.OSS.bucketName=qqxexamplebucket
-aliyun.OSS.fileMaxSize=10 #文件上传最大M数
+aliyun.OSS.fileMaxSize=10 #\u6587\u4EF6\u4E0A\u4F20\u6700\u5927M\u6570
-# ======= 华为OBS配置 =========
+# ======= \u534E\u4E3AOBS\u914D\u7F6E =========
huawei.OBS.endPoint=https://obs.cn-north-4.myhuaweicloud.com
huawei.OBS.accessKey=EEMAGYTHP9KKPF18TZCL
huawei.OBS.secretKey=3NmFNf1uX3EV1LbCEzgw6gDv0tZ6WAVwG37BGq1p
huawei.OBS.bucketName=gcpa
-huawei.OBS.fileMaxSize=10 #文件上传最大M数
+huawei.OBS.fileMaxSize=10 #\u6587\u4EF6\u4E0A\u4F20\u6700\u5927M\u6570
logging.level.com.adc: debug
diff --git a/adc-da-report/pom.xml b/adc-da-report/pom.xml
index acde4b8..e38e5bf 100644
--- a/adc-da-report/pom.xml
+++ b/adc-da-report/pom.xml
@@ -118,7 +118,6 @@
spring-boot-starter-data-redis
-
diff --git a/adc-da-report/src/main/java/com/adc/da/report/controller/PowerApplyController.java b/adc-da-report/src/main/java/com/adc/da/report/controller/PowerApplyController.java
index dc8edcd..6e71427 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/controller/PowerApplyController.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/controller/PowerApplyController.java
@@ -2,8 +2,10 @@ package com.adc.da.report.controller;
import com.adc.da.report.eo.PowerApply;
+import com.adc.da.report.service.IPowerApplyActService;
import com.adc.da.report.service.IPowerApplyService;
import com.adc.da.report.vo.DeleteParamRequestVO;
+import com.adc.da.report.vo.PowerApplyActPageVO;
import com.adc.da.report.vo.PowerApplyPageVO;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
@@ -32,6 +34,9 @@ public class PowerApplyController {
@Autowired
private IPowerApplyService powerApplyService;
+ @Autowired
+ private IPowerApplyActService iPowerApplyActService;
+
/**
* @param powerApplyPageVO
* @return com.adc.da.util.http.ResponseMessage
@@ -107,7 +112,7 @@ public class PowerApplyController {
* @date 2023-04-23
* @description 根据id或id数组进行删除
*/
- @DeleteMapping("/delete")
+ @PostMapping("/delete")
@ApiOperation(value = "单条/批量删除数据")
public ResponseMessage delete(@RequestBody DeleteParamRequestVO deleteParamRequestVO){
@@ -115,4 +120,20 @@ public class PowerApplyController {
powerApplyService.deleteById(deleteParamRequestVO);
return Result.success();
}
+
+ /**
+ * @param deleteParamRequestVO
+ * @return com.adc.da.util.http.ResponseMessage
+ * @author bu
+ * @date 2023-04-23
+ * @description 根据id或id数组进行删除
+ */
+ @PostMapping("/deleteAct")
+ @ApiOperation(value = "单条/批量删除数据")
+ public ResponseMessage deleteAct(@RequestBody PowerApplyActPageVO powerApplyActPageVO){
+
+ //单条/批量删除数据
+ iPowerApplyActService.deleteByListPower(powerApplyActPageVO);
+ return Result.success();
+ }
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java b/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java
index 0910740..2916ee5 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java
@@ -1,10 +1,12 @@
package com.adc.da.report.controller;
import com.adc.da.report.annotation.ReportLog;
+import com.adc.da.report.dao.mysql.ReportDao;
import com.adc.da.report.eo.FileEntity;
import com.adc.da.report.eo.ReportEntity;
import com.adc.da.report.service.IFileService;
import com.adc.da.report.service.IReportService;
+import com.adc.da.report.util.LocalFileUtil;
import com.adc.da.report.util.OSSClientUtil;
import com.adc.da.report.util.ObsBootUtil;
import com.adc.da.report.vo.ReportQueryVo;
@@ -26,6 +28,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
+import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -62,9 +65,14 @@ public class ReportManageConroller {
@Autowired
private ObsBootUtil obsBootUtil;
+ @Autowired
+ private LocalFileUtil localFileUtil;
+
@Value("${uploadType}")
private String uploadType;
+ @Autowired
+ private ReportDao reportDao;
/**
* 新增或编辑报告
@@ -74,28 +82,37 @@ public class ReportManageConroller {
@ApiOperation("新增或编辑报告")
@PostMapping("/add")
@ReportLog(description = "新增或编辑")
- public ResponseMessage add(@RequestBody ReportVo vo) {
+ public ResponseMessage add(@RequestBody ReportVo vo) throws IOException {
+ Map map = new HashMap<>();
ReportEntity entity = new ReportEntity();
BeanUtils.copyProperties(vo, entity);
+ /**
+ * 名称不能重复
+ */
+ long count = reportDao.selectByidAndName(entity);
+ if (count>0){
+ return Result.error("报告名称已存在");
+ }
String name = reportService.insert(entity, vo.getLabelList());
- Map map = new HashMap<>();
map.put("reportName", name);
return Result.success(map);
}
/**
- * 报告列表
+ * 报告管理列表
* @param vo
* @return
* @throws Exception
*/
- @ApiOperation("报告列表")
- @PostMapping("/list")
- public ResponseMessage list(@RequestBody ReportQueryVo vo) throws Exception {
- IPage list = reportService.list(vo);
+ @ApiOperation("报告管理列表")
+ @PostMapping("/reportManagerPage")
+ public ResponseMessage reportManagerPage(@RequestBody ReportQueryVo vo) throws Exception {
+ IPage list = reportService.reportManagerPage(vo);
return Result.success(list);
}
+
+
/**
* 报告列表
* @param vo
@@ -109,19 +126,6 @@ public class ReportManageConroller {
return Result.success(list);
}
- /**
- * 报告列表(带权限验证)
- * @param vo
- * @return
- * @throws Exception
- */
- @ApiOperation("报告列表(带权限)")
- @PostMapping("/list-auth")
- public ResponseMessage listWithAuth(@RequestBody ReportQueryVo vo) throws Exception {
- IPage list = reportService.list(vo);
- return Result.success(list);
- }
-
/**
* 删除报告
* @param ids id
@@ -174,7 +178,17 @@ public class ReportManageConroller {
stringRedisTemplate.boundValueOps("1121212").set("1212");
}
-
+ @ApiOperation("testPath")
+ @GetMapping("/testPath")
+ @Deprecated
+ public ResponseMessage testPath() throws URISyntaxException {
+ HashMap pathMap = new HashMap<>();
+ String jarPath = new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile().getPath();
+ String property = System.getProperty("user.dir");
+ pathMap.put("jarpath", jarPath);
+ pathMap.put("propertyPath", property);
+ return Result.success(pathMap);
+ }
/**
* 上传文件
@@ -209,10 +223,12 @@ public class ReportManageConroller {
try{
String result="";
// 上传方式:阿里云:alioss 华为云:hwobs
- if (uploadType.equals("hwobs")){
+ if ("hwobs".equals(uploadType)){
result = obsBootUtil.upload(file, fileName);
- }else if (uploadType.equals("alioss")){
+ }else if ("alioss".equals(uploadType)) {
result = ossClientUtil.uploadFile2OSS(file.getInputStream(),fileName);
+ }else if ("local".equals(uploadType)) {
+ localFileUtil.saveFile(file.getInputStream(), fileName);
}
resultMap.put("key", date + num);
resultMap.put("value", path + "//" + fileName);
@@ -324,10 +340,12 @@ public class ReportManageConroller {
response.setContentType("application/x-download");
// File file = new File(uploadFile, entity.getSavePath());
// 上传方式:阿里云:alioss 华为云:hwobs
- if (uploadType.equals("hwobs")){
+ if ("hwobs".equals(uploadType)){
obsBootUtil.downFile(entity.getSavePath(), response);
- }else if (uploadType.equals("alioss")){
+ }else if ("alioss".equals(uploadType)){
ossClientUtil.downloadFileFromOSS(entity.getSavePath(),response);
+ }else if ("local".equals(uploadType)){
+ localFileUtil.downFile(entity.getSavePath(), response);
}
} catch (Exception ex) {
@@ -348,4 +366,16 @@ public class ReportManageConroller {
return Result.success(reportVoIPage);
}
+ /**
+ * 判断报告是否在流程中
+ * @return
+ * @throws ParseException
+ */
+ @ApiOperation("判断报告是否在流程中")
+ @PostMapping("/isAct")
+ public ResponseMessage isAct(@RequestBody ReportQueryVo vo) throws Exception {
+ List act = reportService.isAct(vo);
+ return Result.success(act);
+ }
+
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/PowerApplyActDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/PowerApplyActDao.java
index dd79f6f..eda274f 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/PowerApplyActDao.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/PowerApplyActDao.java
@@ -47,4 +47,7 @@ public interface PowerApplyActDao extends BaseMapper {
List selectListBydataId(@Param("dataId")String dataId);
+ List selectListBydataIdNodel(@Param("dataId")String dataId);
+
+ int batchDel(@Param("ids") List ids);
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportContentDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportContentDao.java
new file mode 100644
index 0000000..5ff3602
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportContentDao.java
@@ -0,0 +1,18 @@
+package com.adc.da.report.dao.mysql;
+
+import com.adc.da.report.eo.ReportContentEntity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author ThinkBook
+* @description 针对表【ts_report_content】的数据库操作Mapper
+* @createDate 2023-04-27 11:48:22
+* @Entity com.adc.da.report.eo.ReportContentEntity
+*/
+public interface ReportContentDao extends BaseMapper {
+
+}
+
+
+
+
diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportDao.java
index 1d9fc2b..65b48c8 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportDao.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportDao.java
@@ -24,16 +24,39 @@ public interface ReportDao extends BaseMapper {
* @param idSet
* @return
*/
- IPage list(IPage page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set idSet);
+ IPage list(IPage page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set idSet);
/**
* 报告日期列表
+ *
* @param usid
* @return
*/
- List getReportDateList(@Param("usid")String usid);
+ List getReportDateList(@Param("usid") String usid);
IPage getAddReportPage(IPage page, @Param("pageVO") ReportQueryVo vo);
- IPage page(IPage page,@Param("pageVO") ReportQueryVo vo);
+ /**
+ * 报告列表
+ *
+ * @param page
+ * @param vo
+ * @param idSet
+ * @return
+ */
+ IPage page(IPage page, @Param("pageVO") ReportQueryVo vo, @Param("idSet") Set idSet);
+
+ /**
+ * 报告列表
+ *
+ * @param page
+ * @param vo
+ * @param idSet
+ * @return
+ */
+ IPage reportManagerPage(IPage page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set idSet);
+
+ List isAct(@Param("Vo") ReportQueryVo vo);
+
+ long selectByidAndName(@Param("Vo")ReportEntity entity);
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/eo/ReportContentEntity.java b/adc-da-report/src/main/java/com/adc/da/report/eo/ReportContentEntity.java
new file mode 100644
index 0000000..86feeb8
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/eo/ReportContentEntity.java
@@ -0,0 +1,46 @@
+package com.adc.da.report.eo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ *
+ * @author Caihaohan
+ * @TableName ts_report_content
+ */
+@TableName(value ="ts_report_content")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+public class ReportContentEntity implements Serializable {
+
+ /**
+ * 主键id
+ */
+ @TableId(value = "id",type = IdType.INPUT)
+ private String id;
+
+ /**
+ * 报告id
+ */
+ @TableField(value = "report_id")
+ private String reportId;
+
+ /**
+ * 文件内容
+ */
+ @TableField(value = "report_content")
+ private String reportContent;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyActService.java b/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyActService.java
index 5636464..855e458 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyActService.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyActService.java
@@ -1,7 +1,6 @@
package com.adc.da.report.service;
import com.adc.da.report.eo.PowerApplyAct;
-import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.PowerApplyActPageVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -48,11 +47,11 @@ public interface IPowerApplyActService {
/**
- * @param deleteParamVO
+ * @param powerApplyActPageVO
* @return void
* @author bu
* @date 2023-04-23
* @description 根据id或id数组进行删除
*/
- public void deleteById(DeleteParamRequestVO deleteParamVO);
+ public void deleteByListPower(PowerApplyActPageVO powerApplyActPageVO);
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyService.java b/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyService.java
index 1f146f8..0e273a0 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyService.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/IPowerApplyService.java
@@ -1,6 +1,7 @@
package com.adc.da.report.service;
import com.adc.da.report.eo.PowerApply;
+import com.adc.da.report.eo.PowerApplyAct;
import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.PowerApplyPageVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -55,4 +56,6 @@ public interface IPowerApplyService {
* @description 根据id或id数组进行删除
*/
public void deleteById(DeleteParamRequestVO deleteParamVO);
+
+ void saveBatch(List powerApplyActs);
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/IReportContentService.java b/adc-da-report/src/main/java/com/adc/da/report/service/IReportContentService.java
new file mode 100644
index 0000000..37ce02d
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/IReportContentService.java
@@ -0,0 +1,24 @@
+package com.adc.da.report.service;
+
+import com.adc.da.report.eo.ReportContentEntity;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+* @author ThinkBook
+* @description 针对表【ts_report_content】的数据库操作Service
+* @createDate 2023-04-27 11:48:22
+*/
+public interface IReportContentService extends IService {
+
+
+ /**
+ * 插入报告内容表
+ *
+ * @param reportId 报告id
+ * @param fileId 文件id
+ */
+ void insertReportContent(String reportId, String fileId) throws IOException;
+}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java b/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java
index 11da10c..b253118 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java
@@ -5,6 +5,7 @@ import com.adc.da.report.vo.ReportQueryVo;
import com.adc.da.report.vo.ReportVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.io.IOException;
import java.util.List;
/**
@@ -20,14 +21,7 @@ public interface IReportService {
* @param labelList
* @return 报告名称
*/
- String insert(ReportEntity entity, List labelList);
-
- /**
- * 报告列表展示
- * @param vo
- * @return
- */
- IPage list(ReportQueryVo vo) throws Exception;
+ String insert(ReportEntity entity, List labelList) throws IOException;
/**
* 删除报告
@@ -51,4 +45,8 @@ public interface IReportService {
IPage addReportPage(ReportQueryVo vo) throws Exception;
IPage page(ReportQueryVo vo);
+
+ IPage reportManagerPage(ReportQueryVo vo);
+
+ List isAct(ReportQueryVo vo);
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportContentServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportContentServiceImpl.java
new file mode 100644
index 0000000..d0a545e
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportContentServiceImpl.java
@@ -0,0 +1,82 @@
+package com.adc.da.report.service.impl;
+
+import com.adc.da.report.dao.mysql.FileDao;
+import com.adc.da.report.eo.FileEntity;
+import com.adc.da.report.util.FileContentUtil;
+import com.adc.da.report.util.LocalFileUtil;
+import com.adc.da.report.util.OSSClientUtil;
+import com.adc.da.report.util.ObsBootUtil;
+import com.adc.da.util.utils.FileUtil;
+import com.adc.da.util.utils.UUID;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.adc.da.report.eo.ReportContentEntity;
+import com.adc.da.report.service.IReportContentService;
+import com.adc.da.report.dao.mysql.ReportContentDao;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+* @author Caihaohan
+* @description 针对表【ts_report_content】的数据库操作Service实现
+* @createDate 2023-04-27 11:48:22
+*/
+@Service
+@Slf4j
+public class IReportContentServiceImpl extends ServiceImpl
+ implements IReportContentService {
+
+ @Value("${uploadFile}")
+ private String uploadFile;
+
+ @Value("${uploadType}")
+ private String uploadType;
+
+ @Resource
+ private OSSClientUtil ossClientUtil;
+
+ @Resource
+ private ObsBootUtil obsBootUtil;
+
+ @Resource
+ private LocalFileUtil localFileUtil;
+
+ @Resource
+ private FileDao fileDao;
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void insertReportContent(String reportId, String fileId) throws IOException {
+ //获取文件
+ FileEntity fileEntity = fileDao.selectById(fileId);
+ String path = uploadFile + fileEntity.getSavePath();
+ FileOutputStream outputStream = new FileOutputStream(path);
+ // 上传方式:阿里云:alioss 华为云:hwobs
+ if ("hwobs".equals(uploadType)) {
+ obsBootUtil.getFileFromOBS(fileEntity.getSavePath(), outputStream);
+ } else if ("alioss".equals(uploadType)) {
+ ossClientUtil.getFileFromOSS(fileEntity.getSavePath(), outputStream);
+ } else if ("local".equals(uploadType)) {
+ localFileUtil.getFileFromLocal(fileEntity.getSavePath(), outputStream);
+ }
+ File file = new File(path);
+ //解析出内容
+ String content = FileContentUtil.readFileContent(file);
+ //将内容存入
+ ReportContentEntity reportContentEntity = new ReportContentEntity(UUID.randomUUID10(), reportId, content);
+ save(reportContentEntity);
+ //将文件删除
+ FileUtil.deleteFile(path);
+ }
+}
+
+
+
+
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java
index 36a8088..1270449 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java
@@ -11,6 +11,7 @@ import com.adc.da.report.eo.FileEntity;
import com.adc.da.report.eo.ReportEntity;
import com.adc.da.report.eo.ReportLabelEntity;
import com.adc.da.report.eo.ReportUserEntity;
+import com.adc.da.report.service.IReportContentService;
import com.adc.da.report.service.IReportLabelService;
import com.adc.da.report.service.IReportService;
import com.adc.da.report.service.ITreeLabelService;
@@ -37,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -90,6 +92,12 @@ public class IReportServiceImpl extends ServiceImpl
@Autowired
private RoleEODao roleEODao;
+ @Resource
+ private IReportContentService iReportContentService;
+
+ @Autowired
+ private LocalFileUtil localFileUtil;
+
/**
* 新增或编辑报告
*
@@ -99,13 +107,13 @@ public class IReportServiceImpl extends ServiceImpl
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public String insert(ReportEntity entity, List labelList) {
+ public String insert(ReportEntity entity, List labelList) throws IOException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (StringUtils.isEmpty(entity.getId())) {
entity.setId(UUID.randomUUID10());
entity.setCreateDate(format.format(new Date()));
- entity.setCreateUserId(CommonUtils.getUserId());
+ entity.setCreateUserId(UserUtils.getUserId());
entity.setDelFlag("0");
entity.setUpdateDate(format.format(new Date()));
reportDao.insert(entity);
@@ -124,6 +132,9 @@ public class IReportServiceImpl extends ServiceImpl
reportLabelDao.insert(reportLabelEntity);
});
+ //插入报表内容表
+ iReportContentService.insertReportContent(entity.getId() ,entity.getFileId());
+
CommonUtils.threadPoolExecutor().execute(() -> {
//生成html
try {
@@ -185,85 +196,6 @@ public class IReportServiceImpl extends ServiceImpl
return entity.getName();
}
- /**
- * 报告列表
- *
- * @param vo
- * @return
- * @throws Exception
- */
- @Override
- public IPage list(ReportQueryVo vo) throws Exception {
-
- IPage page = new Page<>();
- page.setCurrent(vo.getPageNo());
- page.setSize(vo.getPageSize());
-
- //判断是不是管理员
- boolean admin = CommonUtils.isAdmin();
- if (admin) {
- vo.setUsid(null);
- } else {
- vo.setUsid(CommonUtils.getUserId());
- }
-
- //按照labelId筛选
- Set idSet = new HashSet<>();
- if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
- LambdaQueryWrapper reportLabelEntityWrapper = new LambdaQueryWrapper<>();
- reportLabelEntityWrapper.eq(ReportLabelEntity::getLabelId, vo.getLabelId().get(vo.getLabelId().size() - 1));
- List reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
- reportLabelEntities.forEach(reportLabelEntity -> {
- idSet.add(reportLabelEntity.getReportId());
- });
- }
- // TODO ES模糊查询
-
- IPage list = reportDao.list(page, vo, idSet);
-
-
- //获取所有报告的labelId
- list.getRecords().forEach((reportVo) -> {
- reportVo.setLabelList(findLabelList(reportVo.getId()));
- });
- list.getRecords().forEach(c -> {
- FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
- if (StringUtils.isEmpty(fileEntity.getFileType())) {
- c.setFileType(null);
- }
- //ppt文件
- else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
- ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
- c.setFileType("1");
- }
- //excel文件
- else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
- ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
- c.setFileType("2");
- }
- //pdf文件
- else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
- c.setFileType("3");
- }
- //word文件
- else {
- c.setFileType("4");
- }
-
- //文件大小
- c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
- ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
- c.setFileName(fileEntity.getFileName());
- List userIdList = reportUserDao.selectList(
- new QueryWrapper().eq("reportId", c.getId()))
- .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
- c.setReportUserIdList(userIdList);
- });
-
-
- return list;
- }
-
/**
* 找出报告的所有标签中最长的那条路径
*
@@ -283,6 +215,9 @@ public class IReportServiceImpl extends ServiceImpl
labelList = labelList.stream()
.sorted(Comparator.comparingInt(List::size).reversed())
.collect(Collectors.toList());
+ if (labelList.size() == 0){
+ return null;
+ }
return labelList.get(0);
}
@@ -391,11 +326,154 @@ public class IReportServiceImpl extends ServiceImpl
vo.setUsid(UserUtils.getUserId());
}
- IPage list = reportDao.page(page, vo);
+ //按照labelId筛选
+ Set idSet = new HashSet<>();
+ if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
+ LambdaQueryWrapper reportLabelEntityWrapper = new LambdaQueryWrapper<>();
+ reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
+ List reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
+ reportLabelEntities.forEach(reportLabelEntity -> {
+ idSet.add(reportLabelEntity.getReportId());
+ });
+ idSet.add("1");
+ }
+
+ IPage list = reportDao.page(page, vo,idSet);
+ //获取所有报告的labelId
+ list.getRecords().forEach((reportVo) -> {
+ reportVo.setLabelList(findLabelList(reportVo.getId()));
+ });
+ list.getRecords().forEach(c -> {
+ FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
+ if (StringUtils.isEmpty(fileEntity.getFileType())) {
+ c.setFileType(null);
+ }
+ //ppt文件
+ else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
+ ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("1");
+ }
+ //excel文件
+ else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
+ ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("2");
+ }
+ //pdf文件
+ else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("3");
+ }
+ //word文件
+ else {
+ c.setFileType("4");
+ }
+
+ //文件大小
+ c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
+ ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
+ c.setFileName(fileEntity.getFileName());
+ List userIdList = reportUserDao.selectList(
+ new QueryWrapper().eq("reportId", c.getId()))
+ .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
+ c.setReportUserIdList(userIdList);
+ });
return list;
}
+ @Override
+ public IPage reportManagerPage(ReportQueryVo vo) {
+ IPage page = new Page<>();
+ page.setCurrent(vo.getPageNo());
+ page.setSize(vo.getPageSize());
+ //判断是不是管理员
+ boolean admin = false;
+ List roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
+ for (RoleEO roleEO : roleEOList) {
+ if ("管理员".equals(roleEO.getName())){
+ admin= !admin;
+ }
+ }
+ if (admin) {
+ vo.setUsid(null);
+ } else {
+ vo.setUsid(UserUtils.getUserId());
+ }
+
+ //按照labelId筛选
+ Set idSet = new HashSet<>();
+ if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
+ LambdaQueryWrapper reportLabelEntityWrapper = new LambdaQueryWrapper<>();
+ reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
+ List reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
+ reportLabelEntities.forEach(reportLabelEntity -> {
+ idSet.add(reportLabelEntity.getReportId());
+ });
+ idSet.add("1");
+ }
+
+ IPage list = reportDao.reportManagerPage(page, vo, idSet);
+
+ //获取所有报告的labelId
+ list.getRecords().forEach((reportVo) -> {
+ reportVo.setLabelList(findLabelList(reportVo.getId()));
+ });
+ list.getRecords().forEach(c -> {
+ FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
+ if (StringUtils.isEmpty(fileEntity.getFileType())) {
+ c.setFileType(null);
+ }
+ //ppt文件
+ else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
+ ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("1");
+ }
+ //excel文件
+ else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
+ ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("2");
+ }
+ //pdf文件
+ else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
+ c.setFileType("3");
+ }
+ //word文件
+ else {
+ c.setFileType("4");
+ }
+
+ //文件大小
+ c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
+ ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
+ c.setFileName(fileEntity.getFileName());
+ List userIdList = reportUserDao.selectList(
+ new QueryWrapper().eq("reportId", c.getId()))
+ .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
+ c.setReportUserIdList(userIdList);
+ });
+ return list;
+ }
+
+ @Override
+ public List isAct(ReportQueryVo vo) {
+ boolean flag = false;
+ //判断是不是管理员
+ boolean admin = false;
+ List roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
+ for (RoleEO roleEO : roleEOList) {
+ if ("管理员".equals(roleEO.getName())){
+ admin= !admin;
+ }
+ }
+ if (admin) {
+ vo.setUsid(null);
+ } else {
+ vo.setUsid(UserUtils.getUserId());
+ }
+
+ List act = baseMapper.isAct(vo);
+ return act;
+ }
+
/**
* 创建htmlstring
*
@@ -408,44 +486,30 @@ public class IReportServiceImpl extends ServiceImpl
String path = uploadFile + fileEntity.getSavePath();
FileOutputStream outputStream = new FileOutputStream(path);
// 上传方式:阿里云:alioss 华为云:hwobs
- if (uploadType.equals("hwobs")) {
+ if ("hwobs".equals(uploadType)) {
obsBootUtil.getFileFromOBS(fileEntity.getSavePath(), outputStream);
- } else if (uploadType.equals("alioss")) {
+ } else if ("alioss".equals(uploadType)) {
ossClientUtil.getFileFromOSS(fileEntity.getSavePath(), outputStream);
+ } else if ("local".equals(uploadType)) {
+ localFileUtil.getFileFromLocal(fileEntity.getSavePath(), outputStream);
}
String html = null;
- switch (fileEntity.getFileType()) {
- //03excel
- case "xls":
- html = ExcelUtil.excel03Html(new FileInputStream(path));
- break;
- //07excel
- case "xlsx":
- html = ExcelUtil.excel07Html(new FileInputStream(path));
- break;
- //03word
- case "doc":
- html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
- break;
- //07word
- case "docx":
- html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
- break;
- //03ppt
- case "ppt":
- html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
- break;
- //07ppt
- case "pptx":
- html = PptUtil.doPpt2007toImage(new FileInputStream(path), uploadFile, ipAddress);
- break;
- //pdf
- case "pdf":
- html = PdfUtil.pdfStreamToPng(new FileInputStream(path), uploadFile, ipAddress);
- break;
- default:
- break;
+
+ if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = ExcelUtil.excel03Html(new FileInputStream(path));
+ } else if (ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = ExcelUtil.excel07Html(new FileInputStream(path));
+ } else if (ReportConstants.FILE_EXTENSIONS_DOC.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
+ } else if (ReportConstants.FILE_EXTENSIONS_DOCX.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
+ } else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
+ } else if (ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = PptUtil.doPpt2007toImage(new FileInputStream(path), uploadFile, ipAddress);
+ } else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
+ html = PdfUtil.pdfStreamToPng(new FileInputStream(path), uploadFile, ipAddress);
}
FileUtil.deleteFile(path);
return html;
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyActServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyActServiceImpl.java
index 99c5250..56ff25a 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyActServiceImpl.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyActServiceImpl.java
@@ -4,7 +4,6 @@ package com.adc.da.report.service.impl;
import com.adc.da.report.dao.mysql.PowerApplyActDao;
import com.adc.da.report.eo.PowerApplyAct;
import com.adc.da.report.service.IPowerApplyActService;
-import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.PowerApplyActPageVO;
import com.adc.da.util.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -12,9 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
-import org.springframework.util.ObjectUtils;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -81,32 +78,21 @@ public class IpowerApplyActServiceImpl extends ServiceImpl ids = new ArrayList<>();
-
- if (!ObjectUtils.isEmpty(deleteParamVO.getId())) {
- ids.add(deleteParamVO.getId());
- }
- if (!ObjectUtils.isEmpty(deleteParamVO.getIds())) {
- ids.addAll(deleteParamVO.getIds());
- }
- if (ObjectUtils.isEmpty(deleteParamVO)) {
- return;
- }
- LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
- wrapper.in(PowerApplyAct::getId,ids);
- PowerApplyAct powerApplyAct = new PowerApplyAct();
- powerApplyAct.setDelFlag(1);
- baseMapper.update(powerApplyAct,wrapper);
+ public void deleteByListPower(PowerApplyActPageVO powerApplyActPageVO) {
+ List powerApplyList = powerApplyActPageVO.getPowerApplyList();
+ for (PowerApplyAct powerApplyAct : powerApplyList) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(PowerApplyAct::getPrcId,powerApplyAct.getPrcId());
+ wrapper.eq(PowerApplyAct::getReportId,powerApplyAct.getReportId());
+ powerApplyAct.setDelFlag(1);
+ baseMapper.update(powerApplyAct,wrapper);
+ }
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyServiceImpl.java
index b5b1a52..9f038eb 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyServiceImpl.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IpowerApplyServiceImpl.java
@@ -1,8 +1,10 @@
package com.adc.da.report.service.impl;
+import com.adc.da.report.dao.mysql.PowerApplyActDao;
import com.adc.da.report.dao.mysql.PowerApplyDao;
import com.adc.da.report.eo.PowerApply;
+import com.adc.da.report.eo.PowerApplyAct;
import com.adc.da.report.service.IPowerApplyService;
import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.PowerApplyPageVO;
@@ -11,11 +13,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @author bu
@@ -27,6 +31,10 @@ import java.util.List;
@Service
public class IpowerApplyServiceImpl extends ServiceImpl implements IPowerApplyService {
+ @Autowired
+ private PowerApplyActDao powerApplyActDao;
+
+
/**
* @param powerApplyPageVO
* @return
@@ -109,5 +117,12 @@ public class IpowerApplyServiceImpl extends ServiceImpl powerApplyActs) {
+ baseMapper.saveBatch(powerApplyActs);
+ List ids = powerApplyActs.stream().map(a -> a.getId()).collect(Collectors.toList());
+ powerApplyActDao.batchDel(ids);
+ }
+
}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/util/LocalFileUtil.java b/adc-da-report/src/main/java/com/adc/da/report/util/LocalFileUtil.java
new file mode 100644
index 0000000..6204671
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/util/LocalFileUtil.java
@@ -0,0 +1,86 @@
+package com.adc.da.report.util;
+
+import com.adc.da.util.exception.AdcDaBaseException;
+import com.obs.services.exception.ObsException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+/**
+ * @author Caihaohan
+ */
+@Slf4j
+@Component
+public class LocalFileUtil {
+
+ @Value("${uploadFile}")
+ private String uploadFile;
+
+ @Value("${localFilePath}")
+ private String localFilePath;
+
+ public void saveFile(InputStream fileInputStream, String fileName) throws IOException {
+ String path = localFilePath + fileName;
+ FileOutputStream fileOutputStream = new FileOutputStream(path);
+ byte[] buffer = new byte[1024];
+ int length;
+ while ((length = fileInputStream.read(buffer)) > 0) {
+ fileOutputStream.write(buffer, 0, length);
+ }
+ fileInputStream.close();
+ fileOutputStream.close();
+ }
+
+ public void getFileFromLocal(String savePath, FileOutputStream outputStream) throws IOException {
+ // 创建源文件对象
+ File sourceFile = new File(localFilePath, savePath);
+
+ // 如果源文件不存在,则抛出异常
+ if (!sourceFile.exists()) {
+ throw new IOException("Source file does not exist.");
+ }
+
+ // 创建输入流
+ FileInputStream inputStream = new FileInputStream(sourceFile);
+
+ // 创建缓冲区
+ byte[] buffer = new byte[1024];
+ int bytesRead;
+
+ // 从输入流读取数据,并写入输出流
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
+ outputStream.write(buffer, 0, bytesRead);
+ }
+
+ // 关闭输入流和输出流
+ inputStream.close();
+ outputStream.close();
+ }
+
+ public void downFile(String savePath, HttpServletResponse response) throws IOException {
+ String filePath = uploadFile + savePath;
+
+ //复制到本地
+ FileOutputStream fileOutputStream = new FileOutputStream(filePath);
+ getFileFromLocal(savePath, fileOutputStream);
+
+ //将文件写到response中
+ try (InputStream objectContent = Files.newInputStream(Paths.get(filePath))) {
+ byte[] bt = new byte[1024 * 1024];
+ int len = 0;
+ while ((len = objectContent.read(bt)) != -1) {
+ response.getOutputStream().write(bt, 0, len);
+ }
+ } catch (ObsException | IOException oe) {
+ throw new AdcDaBaseException("获取本地文件失败");
+ } finally {
+ // 数据读取完成后,获取的流必须关闭,否则会造成连接泄漏,导致请求无连接可用,程序无法正常工作。
+ response.getOutputStream().close();
+ }
+ }
+}
\ No newline at end of file
diff --git a/adc-da-report/src/main/java/com/adc/da/report/util/PageUtils.java b/adc-da-report/src/main/java/com/adc/da/report/util/PageUtils.java
new file mode 100644
index 0000000..9c9f964
--- /dev/null
+++ b/adc-da-report/src/main/java/com/adc/da/report/util/PageUtils.java
@@ -0,0 +1,72 @@
+package com.adc.da.report.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 分页工具类
+ *
+ * @author 程序员小强
+ */
+public class PageUtils {
+
+ /**
+ * 默认第一页
+ */
+ private static final int PAGE = 1;
+
+ /**
+ * 默认一页10条
+ */
+ private static final int PAGE_SIZE = 10;
+
+
+ public static Integer getStartRow(Integer pageNo, Integer pageSize) {
+ if (null == pageNo) {
+ pageNo = PAGE;
+ }
+ if (null == pageSize) {
+ pageSize = PAGE_SIZE;
+ }
+
+ return pageSize * (pageNo - 1);
+ }
+
+ public static Integer getOffset(Integer pageSize) {
+ if (null == pageSize) {
+ pageSize = PAGE_SIZE;
+ }
+ return pageSize;
+ }
+
+ /**
+ * list分页
+ *
+ * @param list
+ * @param pageNo
+ * @param pageSize
+ */
+ public static List listPage(List list, Integer pageNo, Integer pageSize) {
+ if (null == list || list.isEmpty()) {
+ return list;
+ }
+ if (null == pageNo) {
+ pageNo = PAGE;
+ }
+ if (null == pageSize) {
+ pageSize = PAGE_SIZE;
+ }
+ int totalCount = list.size();
+ pageNo = pageNo - 1;
+ int fromIndex = pageNo * pageSize;
+ if (fromIndex > totalCount) {
+ return new ArrayList<>(0);
+ }
+ int toIndex = ((pageNo + 1) * pageSize);
+ if (toIndex > totalCount) {
+ toIndex = totalCount;
+ }
+ return list.subList(fromIndex, toIndex);
+ }
+
+}
diff --git a/adc-da-report/src/main/java/com/adc/da/report/util/PdfUtil.java b/adc-da-report/src/main/java/com/adc/da/report/util/PdfUtil.java
index 93b699a..9fb2c15 100644
--- a/adc-da-report/src/main/java/com/adc/da/report/util/PdfUtil.java
+++ b/adc-da-report/src/main/java/com/adc/da/report/util/PdfUtil.java
@@ -4,6 +4,8 @@ import com.adc.da.util.utils.UUID;
import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
@@ -14,28 +16,37 @@ import java.util.ArrayList;
import java.util.List;
@Slf4j
+@Component
public class PdfUtil {
- private PdfUtil(){
- throw new IllegalStateException("Utility class");
+ private static String uploadType;
+
+ @Value("${uploadType}")
+ public void setUploadType(String uploadType) {
+ PdfUtil.uploadType = uploadType;
+ }
+
+ private PdfUtil() {
+
}
/**
* 截取pdf成图片
+ *
* @param inputStream
* @param targetPath
* @param ipAddress
* @return
*/
- public static String pdfStreamToPng( InputStream inputStream,String targetPath,String ipAddress) {
+ public static String pdfStreamToPng(InputStream inputStream, String targetPath, String ipAddress) {
- try(PDDocument doc=PDDocument.load( inputStream)) {
+ try (PDDocument doc = PDDocument.load(inputStream)) {
PDFRenderer renderer = new PDFRenderer(doc);
- List list=new ArrayList<>();
+ List list = new ArrayList<>();
int pageCount = doc.getNumberOfPages();
BufferedImage image = null;
- log.info("开始时间"+System.currentTimeMillis());
+ log.info("开始时间" + System.currentTimeMillis());
String fileName = UUID.randomUUID10();
for (int i = 0; i < pageCount; i++) {
image = renderer.renderImage(i, 2.0f);
@@ -46,32 +57,31 @@ public class PdfUtil {
imOut = ImageIO.createImageOutputStream(bs);
ImageIO.write(image, "png", imOut);
- try(ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bs.toByteArray());){
- File ff=new File(targetPath+"/"+fileName);
- if(!ff.exists()){
+ try (ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bs.toByteArray());) {
+ File ff = new File(targetPath + "/" + fileName);
+ if (!ff.exists()) {
ff.mkdirs();
}
- File uploadFile = new File(targetPath+"/"+fileName+"/"+i+".png");
- try(FileOutputStream fops = new FileOutputStream(uploadFile);){
+ File uploadFile = new File(targetPath + "/" + fileName + "/" + i + ".png");
+ try (FileOutputStream fops = new FileOutputStream(uploadFile);) {
fops.write(readInputStream(byteInputStream));
- }
- catch (Exception e){
- log.error(e.getMessage(),e);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
}
- list.add(ipAddress+"api/home/pic"+"/"+fileName+"/"+i+".png");
- }
- catch (Exception e){
+ list.add(ipAddress + "api/home/pic" + "/" + fileName + "/" + i + ".png");
+
+ } catch (Exception e) {
}
}
- log.info("结束时间"+System.currentTimeMillis());
+ log.info("结束时间" + System.currentTimeMillis());
- String htmlByBase64 = createHtmlByImg(list);
+ String htmlByBase64 = createHtmlByImg(list);
return htmlByBase64;
} catch (Exception e) {
- log.error(e.getMessage(),e);
+ log.error(e.getMessage(), e);
return "";
}
}
@@ -88,15 +98,15 @@ public class PdfUtil {
buffer.append("\r\n");
- for(int i=0;i");
+ for (int i = 0; i < baseList.size(); i++) {
+ buffer.append("
");
}
buffer.append("