Commit 085162c5 authored by zhuangzhuang's avatar zhuangzhuang

1.修改仓库firefox下载失败问题;

2.修改mqtt判断是否重发的逻辑
3.运输历史数据下载加上网关的序列号
parent 99417b9c
......@@ -67,7 +67,13 @@ public class WarehouseExcel {
//设置列的格式
cell1.setCellStyle(rowStyle1);
//将标题添加到列中
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
if(request.getHeader("AccountLanguage").equals("en")){
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"Warehouse temperature and humidity historic data -"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
}else if (request.getHeader("AccountLanguage ").equals("jp")){
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"倉庫の温度および湿度の観測記録-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
}else{
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
}
}
//设置行高
row1.setHeight((short) (30 * 20));
......@@ -87,7 +93,7 @@ public class WarehouseExcel {
//设置列的格式
cell2.setCellStyle(rowStyle2);
//将标题添加到列中
cell2.setCellValue(i18n.getMessage(request,"year")+ ":2018");
cell2.setCellValue(i18n.getMessage(request,"year")+ ":2019" );
}
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 2));
for (int n = 3; n < 6; n++) {
......
......@@ -6,6 +6,14 @@ public class WarehouseTimeAndDataVo {
private String value;
public WarehouseTimeAndDataVo() {
}
public WarehouseTimeAndDataVo(String time, String value) {
this.time = time;
this.value = value;
}
public String getTime() {
return time;
}
......
package com.example.tdl.domain.vo;
public class WarehouseVo {
private String offset;
private String warehouseNo;
public String getOffset() {
return offset;
}
public void setOffset(String offset) {
this.offset = offset;
}
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
}
......@@ -390,7 +390,7 @@ public class AliyunOSSClientUtil {
putResult = ossClient.putObject(BACKET_NAME, FOLDER3+ fileName, is, metadata);
} else if(fileName.contains("CHN")){
putResult = ossClient.putObject(BACKET_NAME, FOLDER6+ fileName, is, metadata);
} else if(fileName.contains("仓库温湿度观测记录") || fileName.contains("Warehouse temperature and humidity historic data")|| fileName.contains("倉庫の温度および湿度の観測記録")){
} else if(fileName.contains("仓库温湿度观测记录") || fileName.contains("WarehouseData")|| fileName.contains("倉庫の温度および湿度の観測記録")){
putResult = ossClient.putObject(BACKET_NAME, FOLDER5+ fileName, is, metadata);
} else if(fileName.contains("报警日志数据")){
putResult = ossClient.putObject(BACKET_NAME, FOLDER7+ fileName, is, metadata);
......
......@@ -568,7 +568,7 @@ public class DataController {
@ApiImplicitParam(paramType = "header", name = "Account_token", value = "token", required = true, dataType = "String"),
@ApiImplicitParam(paramType = "header", name = "AccountLanguage", value = "language", required = true, dataType = "String"),
})
public String downLoadfForABB(@RequestBody TransportationNoVo transportationNo, HttpServletRequest request){
public String downLoadfForABB(@RequestBody TransportationNoVo transportationNo, HttpServletRequest request){
UserRedisVo user = gson.fromJson(tokenRedisService.get("TOKEN_" + request.getHeader("Account_token")), UserRedisVo.class);
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo.getTransportationNo(), user.getCompanyNo());
if (resultCircuitVo == null) {
......@@ -649,7 +649,11 @@ public class DataController {
}
QueryResult queryResult = influxDBTemplate.query(new Query(sqls, database));
File[] srcFiles = new File[devList.size()];
File zipFile = new File("./export/" +transportationNo.getTransportationNo()+i18n.getMessage(request,"data")+".zip");
File myPath = new File( "./export/" );
if ( !myPath.exists()){//若此目录不存在,则创建之
myPath.mkdir();
}
File zipFile = new File("./export/" +transportationNo.getTransportationNo()+"_"+gatewayVo.getgSN()+i18n.getMessage(request,"data")+".zip");
if (queryResult.getResults().get(0).getSeries().get(0) != null) {
for(int i = 0;i<devList.size();i++){
String address = "./export/";
......@@ -692,7 +696,7 @@ public class DataController {
}
zipFile.delete();
fb.setCode(1);
fb.setMessage("https://tdlcloud.oss-cn-shanghai.aliyuncs.com/circuit/"+transportationNo.getTransportationNo()+i18n.getMessage(request,"data")+".zip");
fb.setMessage("https://tdlcloud.oss-cn-shanghai.aliyuncs.com/circuit/"+transportationNo.getTransportationNo() + "_" +gatewayVo.getgSN() +i18n.getMessage(request,"data")+".zip");
return gson.toJson(fb);
} else {
fb.setCode(0);
......
......@@ -122,6 +122,10 @@ public class DownloadController {
continue;
}
String fileName =downloadForWarehouseVo.getWarehouseNo() + i18n.getMessage(request, "warehousedata")+"-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN();
File myPath = new File( "./export/" );
if ( !myPath.exists()){//若此目录不存在,则创建之
myPath.mkdir();
}
srcFiles[a] = new File("./export/"+fileName+".xls") ;
List<DownloadWarehouseVo> downloadWarehouseVos = getWarehouseData(queryResults,downloadForWarehouseVo.getOffset());
for (int i = 0; i < downloadWarehouseVos.size(); i++) {
......@@ -150,7 +154,7 @@ public class DownloadController {
e.printStackTrace();
logger.info(e.toString());
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"fileUpload"));
fb.setMessage(i18n.getMessage(request,"downloadfail"));
return gson.toJson(fb);
}
}
......
#spring.datasource.url=jdbc:mysql://47.97.184.225:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
#spring.datasource.url=jdbc:mysql://47.110.153.44:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.url=jdbc:mysql://172.16.1.13:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.url=jdbc:mysql://47.110.153.44:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
#spring.datasource.url=jdbc:mysql://172.16.1.13:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root
spring.datasource.password=37774020
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......@@ -41,7 +41,7 @@ logging.config=classpath:logback.xml
# Mqtt
tdl.mqtt.url = ssl://172.16.1.11
tdl.mqtt.url = ssl://172.16.1.24
tdl.mqtt.port = 8883
tdl.mqtt.username = ugen
tdl.mqtt.password = ugen
......@@ -58,8 +58,8 @@ tdl.mqtt.clientpwd =
spring.influxdb.username=admin
spring.influxdb.password=37774020
#spring.influxdb.url=http://47.97.184.225:8086
#spring.influxdb.url=http://47.110.153.44:8086
spring.influxdb.url=http://172.16.1.24:8086
spring.influxdb.url=http://47.110.153.44:8086
#spring.influxdb.url=http://172.16.1.24:8086
spring.influxdb.database=original
spring.influxdb.retentionPolicy = tdl_policy
spring.influxdb.connent-timeout=10
......
......@@ -276,8 +276,8 @@ wrongThemeColors=The format of the theme color is incorrect
comPictureDimension=Width*Height150*200
warePictureDimension=Width*Height150*120
truckPictureDimension=Width*Height90*60
data=Transport data
warehousedata=Warehouse temperature and humidity historic data
data=TransportData
warehousedata=WarehouseData
temMaxLimit=The upper temperature limit is 85\u2103
temMinLimit=The lower temperature limit is -25\u2103
humidityMaxLimit=The upper humidity limit is 100%
......@@ -379,4 +379,6 @@ SensorAssignment=Sensor Assignment
AlarmAnalysis=Alarm Analysis
AlarmAnalysisDetail=Alarm Analysis Detail
AlarmAnalysisQuery=Alarm Analysis Query
usedgateway=The gateway has been used.
\ No newline at end of file
usedgateway=The gateway has been used.
fileUpload=File upload failed
downloadfail=File download failed
\ No newline at end of file
......@@ -199,6 +199,9 @@ humidityMaxLimit=\u6E7F\u5EA6\u306E\u4E0A\u9650\u306F100\uFF05\u3092\u8D85\u3048
temMinLimit=\u4E0B\u9650\u6E29\u5EA6\u306F-25\u2103\u4EE5\u4E0B\u306B\u3067\u304D\u307E\u305B\u3093
temMaxLimit=\u4E0A\u9650\u6E29\u5EA6\u306F85\u2103\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
fileUpload=\u30D5\u30A1\u30A4\u30EB\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u304C\u5931\u6557\u3059\u308B
downloadfail=\u30D5\u30A1\u30A4\u30EB\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5931\u6557
DataOverview=Data Overview
TransportationState=Transportation State
WarehouseStatus=Warehouse Status
......@@ -220,3 +223,5 @@ RegionManagement=Region Management
VehicleManagement=Vehicle Management
GatewayManagement=Gateway Management
SensorManagement=Sensor Management
......@@ -412,4 +412,6 @@ AlarmAnalysis=\u62A5\u8B66\u5206\u6790
AlarmAnalysisQuery=\u62A5\u8B66\u5206\u6790\u67E5\u8BE2
AlarmAnalysisDetail=\u62A5\u8B66\u5206\u6790\u8BE6\u60C5
downloadfail = \u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25
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