Commit 9f5dd064 authored by zhuangzhuang's avatar zhuangzhuang

修改仓库数据除英文状态外下载失败的问题

parent 6a8a5513
...@@ -66,14 +66,16 @@ public class WarehouseExcel { ...@@ -66,14 +66,16 @@ public class WarehouseExcel {
cell1 = row1.createCell(n); cell1 = row1.createCell(n);
//设置列的格式 //设置列的格式
cell1.setCellStyle(rowStyle1); cell1.setCellStyle(rowStyle1);
//将标题添加到列中
if(request.getHeader("AccountLanguage").equals("en")){ String language = request.getHeader("AccountLanguage");
if(language.equals("en")){
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"Warehouse temperature and humidity historic data -"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN())); cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"Warehouse temperature and humidity historic data -"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
}else if (request.getHeader("AccountLanguage ").equals("jp")){ }else if (language.equals("jp")){
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"倉庫の温度および湿度の観測記録-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN())); cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"倉庫の温度および湿度の観測記録-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
}else{ }else{
cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN())); cell1.setCellValue(new HSSFRichTextString(resultWarehouseNoAndTDLSNAndTimeVo.getWarehouseNo()+"仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN()));
} }
} }
//设置行高 //设置行高
row1.setHeight((short) (30 * 20)); row1.setHeight((short) (30 * 20));
...@@ -229,13 +231,13 @@ public class WarehouseExcel { ...@@ -229,13 +231,13 @@ public class WarehouseExcel {
row.setHeight((short) (26 * 20)); row.setHeight((short) (26 * 20));
} }
} }
sheet.setColumnWidth(0, 10 * 256); sheet.setColumnWidth(0, 15 * 256);
sheet.setColumnWidth(1, 10 * 256); sheet.setColumnWidth(1, 15 * 256);
sheet.setColumnWidth(2, 10 * 256); sheet.setColumnWidth(2, 15 * 256);
sheet.setColumnWidth(3, 35 * 256); sheet.setColumnWidth(3, 43 * 256);
sheet.setColumnWidth(4, 35 * 256); sheet.setColumnWidth(4, 43 * 256);
sheet.setColumnWidth(5, 35 * 256); sheet.setColumnWidth(5, 43 * 256);
sheet.setColumnWidth(6, 25* 256); sheet.setColumnWidth(6, 30* 256);
return workbook; return workbook;
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -656,7 +656,7 @@ public class DataController { ...@@ -656,7 +656,7 @@ public class DataController {
if ( !myPath.exists()){//若此目录不存在,则创建之 if ( !myPath.exists()){//若此目录不存在,则创建之
myPath.mkdir(); myPath.mkdir();
} }
File zipFile = new File("./export/" +transportationNo.getTransportationNo()+i18n.getMessage(request,"data")+".zip"); File zipFile = new File("./export/" +transportationNo.getTransportationNo()+"_"+gatewayVo.getgSN()+i18n.getMessage(request,"data")+".zip");
if (queryResult.getResults().get(0).getSeries().get(0) != null) { if (queryResult.getResults().get(0).getSeries().get(0) != null) {
for(int i = 0;i<devList.size();i++){ for(int i = 0;i<devList.size();i++){
String address = "./export/"; String address = "./export/";
...@@ -699,7 +699,7 @@ public class DataController { ...@@ -699,7 +699,7 @@ public class DataController {
} }
zipFile.delete(); zipFile.delete();
fb.setCode(1); 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); return gson.toJson(fb);
} else { } else {
fb.setCode(0); fb.setCode(0);
......
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