Commit 248303be authored by 赵建伟's avatar 赵建伟

update codes

parent 363446af
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<workItem from="1587982524517" duration="5052000" /> <workItem from="1587982524517" duration="5052000" />
<workItem from="1588152481879" duration="139000" /> <workItem from="1588152481879" duration="139000" />
<workItem from="1588154352798" duration="195000" /> <workItem from="1588154352798" duration="195000" />
<workItem from="1588220085338" duration="4971000" /> <workItem from="1588220085338" duration="5045000" />
</task> </task>
<task id="LOCAL-00001" summary="add init codes."> <task id="LOCAL-00001" summary="add init codes.">
<created>1587723565207</created> <created>1587723565207</created>
......
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<workItem from="1584945647680" duration="4469000" /> <workItem from="1584945647680" duration="4469000" />
<workItem from="1588148891822" duration="2318000" /> <workItem from="1588148891822" duration="2318000" />
<workItem from="1588152718016" duration="1463000" /> <workItem from="1588152718016" duration="1463000" />
<workItem from="1588154601852" duration="17055000" /> <workItem from="1588154601852" duration="17671000" />
</task> </task>
<servers /> <servers />
</component> </component>
......
...@@ -27,7 +27,11 @@ public class BiReportServiceImpl implements BiReportService { ...@@ -27,7 +27,11 @@ public class BiReportServiceImpl implements BiReportService {
@Override @Override
public int genExcel(String name){ public int genExcel(String name){
ExcelGenDto resultDto = sparksqlService.getResultDto(name); ExcelGenDto resultDto = sparksqlService.getResultDto(name);
return excelService.genExcel(resultDto, "测试示例"); if(null == resultDto){
return -1;
}else{
return excelService.genExcel(resultDto, "测试示例");
}
} }
@Override @Override
......
...@@ -32,6 +32,7 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -32,6 +32,7 @@ public class SparksqlServiceImpl implements SparksqlService {
@Override @Override
public ExcelGenDto getResultDto(String name){ public ExcelGenDto getResultDto(String name){
ExcelGenDto excelGenDto = null;
List<String> sheetNameList = new ArrayList<String>(); List<String> sheetNameList = new ArrayList<String>();
List<List<String>> headersList = new ArrayList<List<String>>(); List<List<String>> headersList = new ArrayList<List<String>>();
List<List<List>> rowsList = new ArrayList<List<List>>(); List<List<List>> rowsList = new ArrayList<List<List>>();
...@@ -57,6 +58,7 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -57,6 +58,7 @@ public class SparksqlServiceImpl implements SparksqlService {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getMessage()); logger.error(e.getMessage());
continue;
} finally { } finally {
if (reader != null) { if (reader != null) {
try { try {
...@@ -64,6 +66,7 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -64,6 +66,7 @@ public class SparksqlServiceImpl implements SparksqlService {
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace(); e1.printStackTrace();
logger.error(e1.getMessage()); logger.error(e1.getMessage());
continue;
} }
} }
} }
...@@ -89,6 +92,7 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -89,6 +92,7 @@ public class SparksqlServiceImpl implements SparksqlService {
} }
}catch (Exception e){ }catch (Exception e){
logger.error(e.getMessage()); logger.error(e.getMessage());
return null;
} }
headersList.add(headers); headersList.add(headers);
rowsList.add(rows); rowsList.add(rows);
......
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