diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java index f8da351..5a231da 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java @@ -121,16 +121,19 @@ public class CarMaintenanceServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(carMaintenanceDetailVO.getImgPath())) { String[] imgArr = carMaintenanceDetailVO.getImgPath().split(","); - List list = new ArrayList<>(); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } - carMaintenanceDetailVO.setImages(list); + } else { + // 添加空的ImageEntity,防止数据填入时显示"{{" + list.add(new ImageEntity()); } + carMaintenanceDetailVO.setImages(list); // 表头年月 String code = carMaintenanceDetailVO.getCode(); carMaintenanceDetailVO.setYear(code.substring(4, 8)); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java index 7f9f808..ff6c62b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java @@ -118,16 +118,19 @@ public class CarUsedRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(carUsedRecordDetailVO.getImgPath())) { String[] imgArr = carUsedRecordDetailVO.getImgPath().split(","); - List list = new ArrayList<>(); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } - carUsedRecordDetailVO.setImages(list); + } else { + // 添加空的ImageEntity,防止数据填入时显示"{{" + list.add(new ImageEntity()); } + carUsedRecordDetailVO.setImages(list); // 表头年月 String code = carUsedRecordDetailVO.getCode(); carUsedRecordDetailVO.setYear(code.substring(4, 8)); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index 0239acd..f97f5e7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -109,16 +109,19 @@ public class ConferenceRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(conferenceRecordDetailVO.getImgPath())) { String[] imgArr = conferenceRecordDetailVO.getImgPath().split(","); - List list = new ArrayList<>(); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } - conferenceRecordDetailVO.setImages(list); + } else { + // 添加空的ImageEntity,防止数据填入时显示"{{" + list.add(new ImageEntity()); } + conferenceRecordDetailVO.setImages(list); Map params = BaseUtil.obj2Map(conferenceRecordDetailVO); String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index e172ce0..4b94cd0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -140,16 +140,19 @@ public class RehearsalRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(rehearsalRecordDetailVO.getImgPath())) { String[] imgArr = rehearsalRecordDetailVO.getImgPath().split(","); - List list = new ArrayList<>(); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } - rehearsalRecordDetailVO.setImages(list); + } else { + // 添加空的ImageEntity,防止数据填入时显示"{{" + list.add(new ImageEntity()); } + rehearsalRecordDetailVO.setImages(list); // 表头年月 String code = rehearsalRecordDetailVO.getCode(); rehearsalRecordDetailVO.setYear(code.substring(4, 8)); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 8311679..a5dbbc8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -153,16 +153,19 @@ public class TrainRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(trainRecordDetailVO.getImgPath())) { String[] imgArr = trainRecordDetailVO.getImgPath().split(","); - List list = new ArrayList<>(); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } - trainRecordDetailVO.setImages(list); + } else { + // 添加空的ImageEntity,防止数据填入时显示"{{" + list.add(new ImageEntity()); } + trainRecordDetailVO.setImages(list); // 表头年月 String code = trainRecordDetailVO.getCode(); trainRecordDetailVO.setYear(code.substring(4, 8)); diff --git a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx index dd5789d..c83a99c 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx index 366f01b..775af46 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx and b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx index 9f421d7..97730ce 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx and b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx differ