From 6682b5f6b390194489b65fb76c36e2cc679e5f1e Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 10 Dec 2024 16:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=B1=BB=E4=BA=A4=E8=B0=83=E7=AB=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/controller/WordController.java | 2 +- .../service/impl/DcTrafficSurveyDataServiceImpl.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/WordController.java b/zc-business/src/main/java/com/zc/business/controller/WordController.java index 0786173d..9414fdac 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WordController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WordController.java @@ -690,7 +690,7 @@ public class WordController { PoiUtil.createHeading2(doc, "当天全路段实时车流量-济南方向"); - XWPFTable table = doc.createTable(15,3); + XWPFTable table = doc.createTable(17,3); //列宽自动分割 CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW(); infoTableWidth.setType(STTblWidth.DXA); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java index 04f5d768..21f95942 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java @@ -650,10 +650,14 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi ) )); if (dataList != null && dataList.size() > 0){ - JSONArray hezeLanesData = dataList.get("1"); - formatTrafficSurveyData(hezeData,hezeLanesData); - JSONArray jinanLanesData = dataList.get("3"); - formatTrafficSurveyData(jinanData,jinanLanesData); + if(dataList.containsKey("1")){ + JSONArray hezeLanesData = dataList.get("1"); + formatTrafficSurveyData(hezeData,hezeLanesData); + } + if (dataList.containsKey("3")){ + JSONArray jinanLanesData = dataList.get("3"); + formatTrafficSurveyData(jinanData,jinanLanesData); + } } Map dataItem = new HashMap<>();