Commit 0da607bc authored by qinhu's avatar qinhu

Merge branch 'master' of D:\JavaProject\tianjin-cement with conflicts.

parent ba3488c5
......@@ -146,7 +146,6 @@
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.aspose/aspose-slides -->
<dependency>
<groupId>com.aspose</groupId> <!--自定义-->
......@@ -155,6 +154,13 @@
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${basedir}/lib/aspose-cells-8.5.2.jar</systemPath> <!--项目根目录下的lib文件夹下-->
</dependency>
<dependency>
<groupId>com.aspose</groupId> <!--自定义-->
<artifactId>words</artifactId> <!--自定义-->
<version>1.0</version> <!--自定义-->
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${basedir}/lib/words.jar</systemPath> <!--项目根目录下的lib文件夹下-->
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
......
......@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.TimeZone;
......
......@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import sun.misc.BASE64Encoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -63,11 +62,15 @@ public class EntityEnclosureController {
return BaseResponse.errorMsg("登录信息失效");
}
if (extName.contains(FileExt.EXCL.getName()) || extName.contains(FileExt.EXCLX.getName())) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
String pdfPath = FastDFSUtils.conventAndUploadExcel(file.getInputStream(), fileName);
map.put("pdfPath", pdfPath);
} else if (extName.contains(FileExt.DOC.getName()) || extName.contains(FileExt.DOCX.getName())) {
String pdfPath = FastDFSUtils.conventAndUploadWord(file.getInputStream(), fileName);
map.put("pdfPath", pdfPath);
} else {
map.put("pdfPath", filePath);
}
String picUrl = filePath;
map.put("fileUrl", picUrl);
map.put("fileName", fileName);
......@@ -135,7 +138,10 @@ public class EntityEnclosureController {
mapSub.put("fileName", fileName);
mapSub.put("extName", extName);
if (extName.contains(FileExt.EXCL.getName()) || extName.contains(FileExt.EXCLX.getName())) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
String pdfPath = FastDFSUtils.conventAndUploadExcel(file.getInputStream(), fileName);
mapSub.put("pdfPath", pdfPath);
} else if (extName.contains(FileExt.DOC.getName()) || extName.contains(FileExt.DOCX.getName())) {
String pdfPath = FastDFSUtils.conventAndUploadWord(file.getInputStream(), fileName);
mapSub.put("pdfPath", pdfPath);
} else {
mapSub.put("pdfPath", filePath);
......
......@@ -122,12 +122,12 @@ public class ReportController {
beanParams.put("printDate", rts.getPrintDate());
beanParams.put("year", DateUtil.year(DateUtil.date()));
beanParams.put("month",DateUtil.month(DateUtil.date()));
beanParams.put("day",DateUtil.today());
beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo())?"":rts.getReportNo());
beanParams.put("month", DateUtil.month(DateUtil.date()));
beanParams.put("day", DateUtil.today());
beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo()) ? "" : rts.getReportNo());
beanParams.put("firstMethodName",getFirstSet(rts.getMethodNames()));
beanParams.put("firstEquipment",getFirstSet(rts.getEquipmentNames()));
beanParams.put("firstMethodName", getFirstSet(rts.getMethodNames()));
beanParams.put("firstEquipment", getFirstSet(rts.getEquipmentNames()));
beanParams.put("methodNames", moveFirst(rts.getMethodNames()));
beanParams.put("equipmentNames", moveFirst(rts.getEquipmentNames()));
......@@ -166,7 +166,8 @@ public class ReportController {
qw.eq("entity_id", query.getId());
if (FileExt.EXCL.getName().equals(query.getExtName()) ||
FileExt.EXCLX.getName().equals(query.getExtName())) {
FileExt.EXCLX.getName().equals(query.getExtName()) ||
FileExt.PDF.getName().equals(query.getExtName())) {
EntityEnclosure one = iEntityEnclosureService.getOne(qw);
if (BeanUtil.isEmpty(one)) {
EntityEnclosure entityEnclosure = new EntityEnclosure();
......@@ -230,15 +231,15 @@ public class ReportController {
sixElement.setSo3(countResultMap.getOrDefault(SixElementKey.SO3.getKey(), "0"));
}
private String getFirstSet(Set<String> set){
private String getFirstSet(Set<String> set) {
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()){
if (iterator.hasNext()) {
return iterator.next();
}
return "";
}
private static Set<String> moveFirst(Set<String> set){
private static Set<String> moveFirst(Set<String> set) {
Set<String> newSet = new HashSet<>(set.size());
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) {
......
......@@ -2,8 +2,10 @@ package cn.wise.sc.cement.business.util.dfs;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileReader;
import com.aspose.cells.License;
import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;
import com.aspose.words.Document;
import org.apache.commons.io.FilenameUtils;
import org.csource.common.MyException;
import org.csource.common.NameValuePair;
......@@ -181,7 +183,31 @@ public class FastDFSUtils {
}
public static String conventAndUpload(InputStream inputStream, String filename) {
public static String conventAndUploadWord(InputStream inputStream, String filename) {
File outputFile = new File(filename + ".pdf");
String filePath = "";
try {
Document document = new Document(inputStream);
document.save(outputFile.getAbsolutePath(), com.aspose.words.SaveFormat.PDF);
FileReader fileReader = new FileReader(outputFile.getAbsolutePath());
filePath = uploadPic(fileReader.readBytes(), outputFile.getName(), outputFile.length());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除创建的输出文件
FileUtil.del(outputFile);
return filePath;
}
}
public static String conventAndUploadExcel(InputStream inputStream, String filename) {
// 验证License
getLicense();
File outputFile = new File(filename + ".pdf");
String filePath = "";
try {
......@@ -202,4 +228,13 @@ public class FastDFSUtils {
}
}
public static void getLicense() {
try {
InputStream is = FastDFSUtils.class.getClassLoader().getResourceAsStream("\\license.xml");
License aposeLic = new License();
aposeLic.setLicense(is);
} catch (Exception e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port=8888
fastdfs.http.anti_steal_token=no
fastdfs.http.secret_key=FastDFS1234567890
fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122
fastdfs.tracker_servers=192.168.110.85:22122
#fastdfs.tracker_servers=192.168.110.85:22122
<License>
<Data>
<Products>
<Product>Aspose.Total for Java</Product>
<Product>Aspose.Words for Java</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SubscriptionExpiry>20991231</SubscriptionExpiry>
<LicenseExpiry>20991231</LicenseExpiry>
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
</Data>
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
</License>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<contextName>logback-spring</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
<property name="logging.path" value="./../wise-came/logs"/>
<!-- <property name="logging.path" value="./../wise-came/logs"/>-->
<!--0. 日志格式和颜色渲染 -->
<!-- 彩色日志依赖的渲染类 -->
......
......@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port=8888
fastdfs.http.anti_steal_token=no
fastdfs.http.secret_key=FastDFS1234567890
fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122
fastdfs.tracker_servers=192.168.110.85:22122
#fastdfs.tracker_servers=192.168.110.85:22122
......@@ -8,7 +8,7 @@
<contextName>logback-spring</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
<property name="logging.path" value="./../wise-came/logs"/>
<!-- <property name="logging.path" value="./../wise-came/logs"/>-->
<!--0. 日志格式和颜色渲染 -->
<!-- 彩色日志依赖的渲染类 -->
......
#Created by Apache Maven 3.6.0
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=cement-business
#Created by Apache Maven 3.6.0
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=common-swagger
D:\idea_workspases\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\PackageInfo.java
D:\idea_workspases\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\SwaggerConfig.java
D:\JavaProject\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\SwaggerConfig.java
D:\JavaProject\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\PackageInfo.java
......@@ -42,23 +42,21 @@ mybatis-plus:
mapper-locations: classpath:/cn/wise/sc/cement/business/mapper/xml/*Mapper.xml
#天津
#weixin:
# corpId: ww348f91b2573c1867
# agentId: 1000002
# agentIdPC: 1000003
# agentSecret: gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o
# agentSecretPC: itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A
# backUrl: https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system
# systemUrl: <a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="ww348f91b2573c1867"&redirect_uri="https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">物化检测流程</a>,
#邦业
weixin:
corpId: ww348f91b2573c1867
agentId: 1000004
agentIdPC: 1000005
agentSecret: flISLojPiE1_ieO9bPgyZ4g_4O-Rr-FKzs7e7p3HEtA
agentSecretPC: ABagJNftdn1uOYsDLrhlCIM8jZdcTgEA9DyX6kn_-hY
backUrl: https%3a%2f%2flab.wisenergy.cn%2flab-bangye
systemUrl: <a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="ww348f91b2573c1867"&redirect_uri="https%3a%2f%2flab.wisenergy.cn%2flab-bangye"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">物化检测流程</a>,
agentId: 1000002
agentIdPC: 1000003
agentSecret: gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o
agentSecretPC: itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A
backUrl: https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system
systemUrl: <a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="ww348f91b2573c1867"&redirect_uri="https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">物化检测流程</a>,
#邦业
#weixin:
# corpId: ww348f91b2573c1867
# agentId: 1000004
# agentIdPC: 1000005
# agentSecret: flISLojPiE1_ieO9bPgyZ4g_4O-Rr-FKzs7e7p3HEtA
# agentSecretPC: ABagJNftdn1uOYsDLrhlCIM8jZdcTgEA9DyX6kn_-hY
# backUrl: https%3a%2f%2flab.wisenergy.cn%2flab-bangye
# systemUrl: <a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="ww348f91b2573c1867"&redirect_uri="https%3a%2f%2flab.wisenergy.cn%2flab-bangye"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">物化检测流程</a>,
......@@ -47,7 +47,7 @@ public class GeneratorApplication {
AutoGenerator mpg = new AutoGenerator();
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?useUnicode=true&useSSL=false&characterEncoding=utf8");
dsc.setUrl("jdbc:mysql://47.93.148.213:3306/sinoma_tcdri?useUnicode=true&useSSL=false&characterEncoding=utf8");
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("admin!@#123");
......
#Created by Apache Maven 3.6.0
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=mybatis-generator
D:\idea_workspases\tianjin-cement\mybatis-generator\src\main\java\cn\wise\sc\cement\mg\GeneratorApplication.java
D:\JavaProject\tianjin-cement\mybatis-generator\src\main\java\cn\wise\sc\cement\mg\GeneratorApplication.java
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment