Commit 47d198cb authored by wujiang's avatar wujiang

添加报表下载接口

parent 3c9738c6
This diff is collapsed.
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
<factorypath> <factorypath>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\commons-io-2.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\mailapi-1.5.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\smtp-1.5.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-rdbms/1.1.20/tyboot-core-rdbms-1.1.20.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-rdbms/1.1.20/tyboot-core-rdbms-1.1.20.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/HikariCP/3.4.5/HikariCP-3.4.5.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/HikariCP/3.4.5/HikariCP-3.4.5.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/2.3.11.RELEASE/spring-boot-starter-logging-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/2.3.11.RELEASE/spring-boot-starter-logging-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/>
......
...@@ -6,8 +6,8 @@ package com.yeejoin.equipmanage.common.enums; ...@@ -6,8 +6,8 @@ package com.yeejoin.equipmanage.common.enums;
* *
*/ */
public enum WordTemplateTypeEum { public enum WordTemplateTypeEum {
resume("简历","jianli.ftl"); resume("简历","jianli.ftl"),
firePatrolReport("消防巡查报表","FirePatrolReport.ftl");
private String label; private String label;
private String templateFile; private String templateFile;
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
<factorypath> <factorypath>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\commons-io-2.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\mailapi-1.5.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="EXTJAR" id="F:\git\amos-boot-biz_plan6\amos-boot-module\amos-boot-module-api\amos-boot-module-avic-api\lib\smtp-1.5.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/cxf/cxf-spring-boot-starter-jaxws/3.2.6/cxf-spring-boot-starter-jaxws-3.2.6.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/apache/cxf/cxf-spring-boot-starter-jaxws/3.2.6/cxf-spring-boot-starter-jaxws-3.2.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter/2.3.11.RELEASE/spring-boot-starter-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter/2.3.11.RELEASE/spring-boot-starter-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot/2.3.11.RELEASE/spring-boot-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot/2.3.11.RELEASE/spring-boot-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/>
......
...@@ -86,7 +86,7 @@ public class FileFransferServiceImpl implements FileFransferService { ...@@ -86,7 +86,7 @@ public class FileFransferServiceImpl implements FileFransferService {
String template = eMailSenderService.getEmailTemplate(); String template = eMailSenderService.getEmailTemplate();
File file = new File(String.format("%s%s%s%s", baseDir,path.replace(":", ""), File.separator, fileName)); File file = new File(String.format("%s%s%s%s", baseDir,path.replace(":", ""), File.separator, fileName));
Multipart mp = new MimeMultipart(); Multipart mp = new MimeMultipart();
eMailSenderService.send(userCode, userCode, template, mp); //eMailSenderService.send(userCode, userCode, template, mp);
} }
@Override @Override
......
package com.yeejoin.equipmanage.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.equipmanage.service.IFirePatrolReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
/**
* @author wj
* @date 2022-04-28
*/
@RestController
@Api(tags = "消防巡查报表Api")
@RequestMapping(value = "/fire-patrol-report")
@Slf4j
public class FirePatrolReportController {
@Autowired
IFirePatrolReportService iFirePatrolReportService;
@ApiOperation(value = "下载报表", notes = "下载报表")
@GetMapping(value = "/download")
@TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
public void download(HttpServletRequest request, HttpServletResponse response,
@ApiParam(value = "换流站编码", required = true) @RequestParam String code,
@ApiParam(value = "开始日期", required = true) @RequestParam @DateTimeFormat(pattern="yyyy-MM-dd")Date startDate,
@ApiParam(value = "结束日期", required = true) @RequestParam @DateTimeFormat(pattern="yyyy-MM-dd")Date endDate) {
iFirePatrolReportService.download(request, response, code, startDate, endDate);
}
}
package com.yeejoin.equipmanage.service;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface IFirePatrolReportService {
void download(HttpServletRequest request, HttpServletResponse response,String code,Date startDate,Date endDate);
}
package com.yeejoin.equipmanage.service.impl;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Service;
import com.yeejoin.equipmanage.common.enums.WordTemplateTypeEum;
import com.yeejoin.equipmanage.common.exception.CommonException;
import com.yeejoin.equipmanage.common.utils.WordTemplateUtils;
import com.yeejoin.equipmanage.service.IFirePatrolReportService;
@Service
public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
@Override
public void download(HttpServletRequest request, HttpServletResponse response, String code, Date startDate,
Date endDate) {
WordTemplateUtils instance = WordTemplateUtils.getInstance();
Map<String,String> map = new HashMap<String,String>();
try {
instance.exportMillCertificateWord(request, response, map, null,
WordTemplateTypeEum.firePatrolReport.getTemplateFile());
} catch (IOException e) {
throw new CommonException(0, "下载装备巡查报表失败");
}
}
}
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
This diff is collapsed.
This diff is collapsed.
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.6.60:3306/xiy_amos_satety_business?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai spring.datasource.url = jdbc:mysql://39.98.246.31/dl_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root_123 spring.datasource.password=Yeejoin@2020
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3 spring.datasource.hikari.minimum-idle= 3
...@@ -17,7 +17,7 @@ spring.datasource.hikari.connection-test-query= SELECT 1 ...@@ -17,7 +17,7 @@ spring.datasource.hikari.connection-test-query= SELECT 1
fileserver_domain=http://39.98.45.134:9000/ fileserver_domain=http://39.98.45.134:9000/
#eureka.instance.ip-address= 172.16.3.135 #eureka.instance.ip-address= 172.16.3.135
eureka.instance.hostname= 172.16.3.97 eureka.instance.hostname= 39.98.246.31
eureka.instance.prefer-ip-address = true eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
...@@ -33,7 +33,7 @@ security.appKeyApp=studio_normalapp_3056965 ...@@ -33,7 +33,7 @@ security.appKeyApp=studio_normalapp_3056965
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.3.35 spring.redis.host=39.98.246.31
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200 spring.redis.lettuce.pool.max-active=200
...@@ -45,10 +45,10 @@ spring.redis.expire.time=300 ...@@ -45,10 +45,10 @@ spring.redis.expire.time=300
## emqx ## emqx
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.3.35:2883 emqx.broker=tcp://39.98.246.31:1883
emqx.user-name=super emqx.user-name=admin
emqx.password=a123456 emqx.password=public
mqtt.scene.host=mqtt://172.16.3.35:8083/mqtt mqtt.scene.host=mqtt://39.98.246.31:8083/mqtt
mqtt.client.product.id=mqtt mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000 spring.mqtt.completionTimeout=3000
......
spring.application.name=AMOS-EQUIPMANAGE spring.application.name=AMOS-EQUIPMANAGE-WJ
server.servlet.context-path=/equip server.servlet.context-path=/equip
server.port=8100 server.port=8100
#server.servlet.context-path=/case #server.servlet.context-path=/case
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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