diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java index a173e9ff..18177e59 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java @@ -745,7 +745,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { int maxVehicleTypes = 5; // 创建一个具有最大车辆类型数量的列的表格 XWPFTable table = doc.createTable(result.size() + 1, maxVehicleTypes); - + CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW(); + infoTableWidth.setType(STTblWidth.DXA); + infoTableWidth.setW(BigInteger.valueOf(UniversalEnum.NINE_THOUSAND_AND_SEVENTY_TWO.getNumber())); // 提取所有不同的车辆类型作为列标题 Set vehicleTypes = new HashSet<>(); vehicleTypes.add("货车"); @@ -842,7 +844,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { // 换行 createLineBreak(doc); -} +}else { + addDescription(doc, UniversalEnum.NO_DATA_AVAILABLE.getValue()); + } } /** @@ -1061,9 +1065,13 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { Calendar calendar = Calendar.getInstance(); calendar.setTime(startTime); // 设置当前时间为 startTime calendar.add(Calendar.YEAR, -1); // 减去一年 - Date oneYearAgoStart = calendar.getTime(); // 一年前的开始时间 - dcSdhsEventQuery.setStartTime(oneYearAgoStart); - Map lastYearData = accidentTimeAnalysis(dcSdhsEventQuery); + Date oneYearAgoStart = calendar.getTime(); // 一年前的开始时间‘ + DcSdhsEventQuery dcSdhsEventQuery1 = new DcSdhsEventQuery(); + dcSdhsEventQuery1.setStartTime(oneYearAgoStart); + dcSdhsEventQuery1.setType(dcSdhsEventQuery.getType()); + dcSdhsEventQuery1.setEndTime(dcSdhsEventQuery.getEndTime()); + Map lastYearData = accidentTimeAnalysis(dcSdhsEventQuery1); + String type = dcSdhsEventQuery.getType(); int rows = 0; String stingType = ""; @@ -1197,6 +1205,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { //换行 createLineBreak(doc); + }else { + addDescription(doc, UniversalEnum.NO_DATA_AVAILABLE.getValue()); } } @@ -1976,6 +1986,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { } //换行 createLineBreak(doc); + }else { + addDescription(doc, UniversalEnum.NO_DATA_AVAILABLE.getValue()); } } @@ -2086,7 +2098,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { } //换行 createLineBreak(doc); -} +}else { + addDescription(doc, UniversalEnum.NO_DATA_AVAILABLE.getValue()); + } } diff --git a/zc-business/src/main/resources/wordTemplate/accidentModelAnalysis.docx b/zc-business/src/main/resources/wordTemplate/accidentModelAnalysis.docx index 7948e800..56b7f70e 100644 Binary files a/zc-business/src/main/resources/wordTemplate/accidentModelAnalysis.docx and b/zc-business/src/main/resources/wordTemplate/accidentModelAnalysis.docx differ