Browse Source

高速运营快报

develop
lau572 9 months ago
parent
commit
2ad13ffab2
  1. 374
      zc-business/src/main/java/com/zc/business/controller/WordController.java
  2. BIN
      zc-business/src/main/resources/wordTemplate/chartTemplate.docx
  3. BIN
      zc-business/src/main/resources/wordTemplate/chartTemplate2.docx

374
zc-business/src/main/java/com/zc/business/controller/WordController.java

@ -2,12 +2,16 @@ package com.zc.business.controller;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.zc.business.domain.DcTollStationStatisticsData;
import com.zc.business.enums.TrafficDataPeriodTypeEnum;
import com.zc.business.enums.UniversalEnum;
import com.zc.business.mapper.DcTrafficIncidentsMapper;
import com.zc.business.service.IDcGantryStatisticsDataService;
import com.zc.business.service.IDcTollStationStatisticsDataService;
import com.zc.business.service.IDcTrafficStatisticsService;
import com.zc.business.utils.PoiUtil;
import com.zc.common.core.httpclient.exception.HttpException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.xssf.usermodel.XSSFSheet;
@ -20,9 +24,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -48,6 +54,10 @@ public class WordController {
@Autowired
private IDcTollStationStatisticsDataService dcTollStationStatisticsDataService;
@Autowired
private IDcTrafficStatisticsService dcTrafficStatisticsService;
@Autowired
private IDcGantryStatisticsDataService dcGantryStatisticsDataService;
@PostMapping("/trafficSituationReport")
@ -84,6 +94,10 @@ public class WordController {
trafficAccident(newDoc);
/** 出入口车流量 */
trafficFlow(newDoc);
/** 全路段实时车流量*/
realTimeTrafficFlow(newDoc);
/** 车流量时段分析*/
trafficPeriodAnalysis(newDoc);
@ -316,14 +330,12 @@ public class WordController {
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {UniversalEnum.CLOSE.getValue(),UniversalEnum.TRAFFIC_RESTRICTION.getValue(),UniversalEnum.INTERVAL_RELEASE.getValue()};
String[] singleBarSeriesNames = {UniversalEnum.CLOSE.getValue(),UniversalEnum.TRAFFIC_RESTRICTION.getValue()};
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < tollStationAnalysisList.size(); i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(tollStationAnalysisList.get(i).get("facilityName").toString());
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(tollStationAnalysisList.get(i).get("facilityClose").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(tollStationAnalysisList.get(i).get("facilityRestriction").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.THREE.getNumber()).setCellValue(Long.parseLong(tollStationAnalysisList.get(i).get("facilityInterval").toString()));
}
PoiUtil.wordExportChar(chart, UniversalEnum.TRAFFIC_CONTROL_SITUATION.getValue(), singleBarSeriesNames,sheet );
@ -349,7 +361,7 @@ public class WordController {
List<Map<String,Object>> trafficControlAnalysisList = dcTrafficIncidentsMapper.selectTrafficControlAnalysis(startDate,endDate);
if (trafficControlAnalysisList != null && trafficControlAnalysisList.size() > UniversalEnum.ZERO.getNumber()) {
XWPFTable table = doc.createTable(UniversalEnum.SEVEN.getNumber(), UniversalEnum.FOUR.getNumber());
XWPFTable table = doc.createTable(UniversalEnum.SEVEN.getNumber(), UniversalEnum.THREE.getNumber());
//列宽自动分割
CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidth.setType(STTblWidth.DXA);
@ -357,14 +369,12 @@ public class WordController {
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ONE.getNumber()), UniversalEnum.CLOSE.getValue());
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.TWO.getNumber()), UniversalEnum.TRAFFIC_RESTRICTION.getValue());
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.THREE.getNumber()), UniversalEnum.INTERVAL_RELEASE.getValue());
//excel
for (int i = UniversalEnum.ZERO.getNumber(); i < trafficControlAnalysisList.size(); i++){
setTableFonts(table.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), trafficControlAnalysisList.get(i).get("controlCauseName").toString());
setTableFonts(table.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()), trafficControlAnalysisList.get(i).get("facilityClose").toString());
setTableFonts(table.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()), trafficControlAnalysisList.get(i).get("facilityRestriction").toString());
setTableFonts(table.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.THREE.getNumber()), trafficControlAnalysisList.get(i).get("facilityInterval").toString());
}
try {
@ -380,13 +390,12 @@ public class WordController {
XSSFWorkbook workbook = chart.getWorkbook();
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {UniversalEnum.CLOSE.getValue(),UniversalEnum.TRAFFIC_RESTRICTION.getValue(),UniversalEnum.INTERVAL_RELEASE.getValue()};
String[] singleBarSeriesNames = {UniversalEnum.CLOSE.getValue(),UniversalEnum.TRAFFIC_RESTRICTION.getValue()};
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < trafficControlAnalysisList.size(); i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(trafficControlAnalysisList.get(i).get("controlCauseName").toString());
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(trafficControlAnalysisList.get(i).get("facilityClose").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(trafficControlAnalysisList.get(i).get("facilityRestriction").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.THREE.getNumber()).setCellValue(Long.parseLong(trafficControlAnalysisList.get(i).get("facilityInterval").toString()));
}
for (int i = sheet.getLastRowNum(); i > trafficControlAnalysisList.size();i--){
sheet.removeRow(sheet.getRow(i));
@ -631,6 +640,355 @@ public class WordController {
}
/**
* @Description 全路段实时车流量
*
* @author liuwenge
* @date 2024/3/28 9:14
* @param doc
* @return void
*/
public void realTimeTrafficFlow(XWPFDocument doc) throws IOException, HttpException {
Map<String,List<Map<String, Object>>> result = dcTrafficStatisticsService.realTimeTrafficFlowHour();
if (result != null) {
// 13菏泽 24济南
List<Map<String, Object>> thisYearJN = result.get("2");
List<Map<String, Object>> lastYearJN = result.get("4");
List<Map<String, Object>> thisYearHZ = result.get("1");
List<Map<String, Object>> lastYearHZ = result.get("3");
PoiUtil.createHeading2(doc, "全路段实时车流量-济南方向");
XWPFTable table = doc.createTable(15,3);
//列宽自动分割
CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidth.setType(STTblWidth.DXA);
infoTableWidth.setW(BigInteger.valueOf(UniversalEnum.NINE_THOUSAND_AND_SEVENTY_TWO.getNumber()));
//插入表头
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), "路段");
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ONE.getNumber()), "本期车流量");
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.TWO.getNumber()), "去年同期");
//excel
for (int i = UniversalEnum.ZERO.getNumber(); i < thisYearJN.size(); i++){
setTableFonts(table.getRow(i+1).getCell(0), thisYearJN.get(i).get("name").toString());
setTableFonts(table.getRow(i+1).getCell(1), thisYearJN.get(i).get("totalFlow").toString());
setTableFonts(table.getRow(i+1).getCell(2), lastYearJN.get(i).get("totalFlow").toString());
}
try {
// 复制Word模板
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(UniversalEnum.DRAWING_TEMPLATE_2.getValue());
XWPFDocument copiedTemplate = new XWPFDocument(inputStream);
//获取word中所有图表对象
List<XWPFChart> charts = copiedTemplate.getCharts();
XWPFChart chart = charts.get(UniversalEnum.ONE.getNumber());
XSSFWorkbook workbook = chart.getWorkbook();
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {"本期车流量","去年同期"};
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < thisYearJN.size(); i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(thisYearJN.get(i).get("name").toString());
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(thisYearJN.get(i).get("totalFlow").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(lastYearJN.get(i).get("totalFlow").toString()));
}
PoiUtil.wordExportChar(chart, "全路段实时车流量-济南方向", singleBarSeriesNames,sheet );
// 追加到同一个Word文档中
mergeChart(chart,doc);
// PoiUtil.mergeDoc(copiedTemplate, doc);
// 关闭复制的模板文档
copiedTemplate.close();
} catch (Exception e){
e.printStackTrace();
}
//换行
createLineBreak(doc);
PoiUtil.createHeading2(doc, "全路段实时车流量-菏泽方向");
XWPFTable tableHZ = doc.createTable(15,3);
//列宽自动分割
CTTblWidth infoTableWidthHZ = tableHZ.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidthHZ.setType(STTblWidth.DXA);
infoTableWidthHZ.setW(BigInteger.valueOf(UniversalEnum.NINE_THOUSAND_AND_SEVENTY_TWO.getNumber()));
//插入表头
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), "路段");
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ONE.getNumber()), "本期车流量");
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.TWO.getNumber()), "去年同期");
//excel
for (int i = UniversalEnum.ZERO.getNumber(); i < thisYearHZ.size(); i++){
setTableFonts(tableHZ.getRow(i+1).getCell(0), thisYearHZ.get(i).get("name").toString());
setTableFonts(tableHZ.getRow(i+1).getCell(1), thisYearHZ.get(i).get("totalFlow").toString());
setTableFonts(tableHZ.getRow(i+1).getCell(2), lastYearHZ.get(i).get("totalFlow").toString());
}
try {
// 复制Word模板
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(UniversalEnum.DRAWING_TEMPLATE_2.getValue());
XWPFDocument copiedTemplate = new XWPFDocument(inputStream);
//获取word中所有图表对象
List<XWPFChart> charts = copiedTemplate.getCharts();
XWPFChart chart = charts.get(UniversalEnum.ONE.getNumber());
XSSFWorkbook workbook = chart.getWorkbook();
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {"本期车流量","去年同期"};
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < thisYearJN.size(); i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(thisYearHZ.get(i).get("name").toString());
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(thisYearHZ.get(i).get("totalFlow").toString()));
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(lastYearHZ.get(i).get("totalFlow").toString()));
}
PoiUtil.wordExportChar(chart, "全路段实时车流量-菏泽方向", singleBarSeriesNames,sheet );
// 追加到同一个Word文档中
mergeChart(chart,doc);
// PoiUtil.mergeDoc(copiedTemplate, doc);
// 关闭复制的模板文档
copiedTemplate.close();
} catch (Exception e){
e.printStackTrace();
}
//换行
createLineBreak(doc);
}
}
/**
* @Description 车流量时段分析
*
* @author liuwenge
* @date 2024/3/28 9:14
* @param doc
* @return void
*/
public void trafficPeriodAnalysis(XWPFDocument doc) throws IOException, HttpException {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(UniversalEnum.TIME_FORMAT_YEARS_MONTH_DAY.getValue());
LocalDate currentDate = LocalDate.now();
String nowYear = currentDate.format(formatter);
//String nowYear =startDate;
// 获取一年前的日期
LocalDate oneYearAgo = currentDate.minusYears(UniversalEnum.ONE.getNumber());
String lastYear = oneYearAgo.format(formatter);
//济南方向-本期
List<Map<String, String>> thisYearJN = dcGantryStatisticsDataService.trafficPeriodAnalysis(nowYear,"3","4");
Map<String,List<Map<String, String>>> thisYearJNData = new HashMap<>();
if (thisYearJN != null && thisYearJN.size() > 0){
thisYearJNData = thisYearJN.stream().collect(Collectors.groupingBy(item -> item.get("statisticalHour")));
}
//济南方向-去年同期
List<Map<String, String>> lastYearJN = dcGantryStatisticsDataService.trafficPeriodAnalysis(lastYear,"3","4");
Map<String,List<Map<String, String>>> lastYearJNData = new HashMap<>();
if (lastYearJN != null && lastYearJN.size() > 0){
lastYearJNData = lastYearJN.stream().collect(Collectors.groupingBy(item -> item.get("statisticalHour")));
}
PoiUtil.createHeading2(doc, "车流量时段分析-济南方向");
XWPFTable table = doc.createTable(25,3);
//列宽自动分割
CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidth.setType(STTblWidth.DXA);
infoTableWidth.setW(BigInteger.valueOf(UniversalEnum.NINE_THOUSAND_AND_SEVENTY_TWO.getNumber()));
//插入表头
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), "时段");
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ONE.getNumber()), "本期车流量");
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.TWO.getNumber()), "去年同期");
//excel
for (int i = 0; i < 24; i++){
setTableFonts(table.getRow(i+1).getCell(0), i + "时-" + (i+1) + "时");
if (thisYearJNData != null && thisYearJNData.containsKey(String.valueOf(i))){
String trafficVolume = thisYearJNData.get(String.valueOf(i)).get(0).get("trafficVolume");
setTableFonts(table.getRow(i+1).getCell(1), trafficVolume);
} else {
setTableFonts(table.getRow(i+1).getCell(1), "0");
}
if (lastYearJNData != null && lastYearJNData.containsKey(String.valueOf(i))){
String trafficVolume = lastYearJNData.get(String.valueOf(i)).get(0).get("trafficVolume");
setTableFonts(table.getRow(i+1).getCell(2), trafficVolume);
} else {
setTableFonts(table.getRow(i+1).getCell(2), "0");
}
}
try {
// 复制Word模板
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(UniversalEnum.DRAWING_TEMPLATE_2.getValue());
XWPFDocument copiedTemplate = new XWPFDocument(inputStream);
//获取word中所有图表对象
List<XWPFChart> charts = copiedTemplate.getCharts();
XWPFChart chart = charts.get(UniversalEnum.TWO.getNumber());
XSSFWorkbook workbook = chart.getWorkbook();
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {"本期车流量","去年同期"};
//分类信息
for (int i = 0; i < 24; i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(i + "时-" + (i+1) + "时");
if (thisYearJNData != null && thisYearJNData.containsKey(String.valueOf(i))){
String trafficVolume = thisYearJNData.get(String.valueOf(i)).get(0).get("trafficVolume");
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(trafficVolume));
} else {
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(0);
}
if (lastYearJNData != null && lastYearJNData.containsKey(String.valueOf(i))){
String trafficVolume = lastYearJNData.get(String.valueOf(i)).get(0).get("trafficVolume");
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(trafficVolume));
} else {
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(0);
}
}
PoiUtil.wordExportChar(chart, "车流量时段分析-济南方向", singleBarSeriesNames,sheet );
// 追加到同一个Word文档中
mergeChart(chart,doc);
// PoiUtil.mergeDoc(copiedTemplate, doc);
// 关闭复制的模板文档
copiedTemplate.close();
} catch (Exception e){
e.printStackTrace();
}
//换行
createLineBreak(doc);
//菏泽方向-本期
List<Map<String, String>> thisYearHZ = dcGantryStatisticsDataService.trafficPeriodAnalysis(nowYear,"1","4");
Map<String,List<Map<String, String>>> thisYearHZData = new HashMap<>();
if (thisYearHZ != null && thisYearHZ.size() > 0){
thisYearHZData = thisYearHZ.stream().collect(Collectors.groupingBy(item -> item.get("statisticalHour")));
}
//菏泽方向-去年同期
List<Map<String, String>> lastYearHZ = dcGantryStatisticsDataService.trafficPeriodAnalysis(lastYear,"1","4");
Map<String,List<Map<String, String>>> lastYearHZData = new HashMap<>();
if (lastYearHZ != null && lastYearHZ.size() > 0){
lastYearHZData = lastYearHZ.stream().collect(Collectors.groupingBy(item -> item.get("statisticalHour")));
}
PoiUtil.createHeading2(doc, "车流量时段分析-菏泽方向");
XWPFTable tableHZ = doc.createTable(25,3);
//列宽自动分割
CTTblWidth infoTableWidthHZ = tableHZ.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidthHZ.setType(STTblWidth.DXA);
infoTableWidthHZ.setW(BigInteger.valueOf(UniversalEnum.NINE_THOUSAND_AND_SEVENTY_TWO.getNumber()));
//插入表头
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), "时段");
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.ONE.getNumber()), "本期车流量");
setTableFonts(tableHZ.getRow(UniversalEnum.ZERO.getNumber()).getCell(UniversalEnum.TWO.getNumber()), "去年同期");
//excel
for (int i = 0; i < 24; i++){
setTableFonts(tableHZ.getRow(i+1).getCell(0), i + "时-" + (i+1) + "时");
if (thisYearHZData != null && thisYearHZData.containsKey(String.valueOf(i))){
String trafficVolume = thisYearHZData.get(String.valueOf(i)).get(0).get("trafficVolume");
setTableFonts(tableHZ.getRow(i+1).getCell(1), trafficVolume);
} else {
setTableFonts(tableHZ.getRow(i+1).getCell(1), "0");
}
if (lastYearHZData != null && lastYearHZData.containsKey(String.valueOf(i))){
String trafficVolume = lastYearHZData.get(String.valueOf(i)).get(0).get("trafficVolume");
setTableFonts(tableHZ.getRow(i+1).getCell(2), trafficVolume);
} else {
setTableFonts(tableHZ.getRow(i+1).getCell(2), "0");
}
}
try {
// 复制Word模板
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(UniversalEnum.DRAWING_TEMPLATE_2.getValue());
XWPFDocument copiedTemplate = new XWPFDocument(inputStream);
//获取word中所有图表对象
List<XWPFChart> charts = copiedTemplate.getCharts();
XWPFChart chart = charts.get(UniversalEnum.TWO.getNumber());
XSSFWorkbook workbook = chart.getWorkbook();
XSSFSheet sheet = workbook.getSheetAt(UniversalEnum.ZERO.getNumber());
//系列信息
String[] singleBarSeriesNames = {"本期车流量","去年同期"};
//分类信息
for (int i = 0; i < 24; i++){
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()).setCellValue(i + "时-" + (i+1) + "时");
if (thisYearHZData != null && thisYearHZData.containsKey(String.valueOf(i))){
String trafficVolume = thisYearHZData.get(String.valueOf(i)).get(0).get("trafficVolume");
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(Long.parseLong(trafficVolume));
} else {
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ONE.getNumber()).setCellValue(0);
}
if (lastYearHZData != null && lastYearHZData.containsKey(String.valueOf(i))){
String trafficVolume = lastYearHZData.get(String.valueOf(i)).get(0).get("trafficVolume");
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(Long.parseLong(trafficVolume));
} else {
sheet.getRow(i+UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.TWO.getNumber()).setCellValue(0);
}
}
PoiUtil.wordExportChar(chart, "车流量时段分析-菏泽方向", singleBarSeriesNames,sheet );
// 追加到同一个Word文档中
mergeChart(chart,doc);
// PoiUtil.mergeDoc(copiedTemplate, doc);
// 关闭复制的模板文档
copiedTemplate.close();
} catch (Exception e){
e.printStackTrace();
}
//换行
createLineBreak(doc);
}
/**
* @Description 封闭原因统计

BIN
zc-business/src/main/resources/wordTemplate/chartTemplate.docx

Binary file not shown.

BIN
zc-business/src/main/resources/wordTemplate/chartTemplate2.docx

Binary file not shown.
Loading…
Cancel
Save