From 92b99a680d279ffa75cc46cfda0eb762a3fac6a3 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 15:59:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=9F=B9=E8=AE=AD?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=87=E4=BB=B6=E5=AF=BC=E5=87=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/entity/TrainPlanEntity.java | 12 ++++++++++-- .../hzims/safeproduct/vo/TrainRecordDetailVO.java | 11 +++++++++++ .../safeproduct/service/impl/TestServiceImpl.java | 1 + .../service/impl/TrainPlanServiceImpl.java | 6 +++++- .../service/impl/TrainRecordServiceImpl.java | 21 ++++++++++++++++++++- .../main/resources/template/培训记录表.docx | Bin 11819 -> 11871 bytes 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java index 93db233..3f67a4d 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java @@ -35,13 +35,11 @@ public class TrainPlanEntity extends BaseEntity { @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划开始时间") - @ExcelProperty(value = "计划开始时间", index = 6) private Date scheduledStartTime; @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划结束时间") - @ExcelProperty(value = "计划结束时间", index = 7) private Date scheduledEndTime; @NotNull @@ -80,4 +78,14 @@ public class TrainPlanEntity extends BaseEntity { @ApiModelProperty("是否考试") @ExcelProperty(value = "是否考试", index = 5) private String hasTest; + + @TableField(exist = false) + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 6) + private String startTime; + + @TableField(exist = false) + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 7) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java index ecf6b78..e7a6dff 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class TrainRecordDetailVO { @ApiModelProperty("培训附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index eeaa00a..5573afa 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -87,6 +87,7 @@ public class TestServiceImpl extends ServiceImpl impleme /** * 删除关联考试记录 */ + @Transactional(rollbackFor = Exception.class) @Override public boolean removeRelativeTest(Long trainRecordId) { // 查询关联考试记录 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 9dc05c5..37aabc0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -194,7 +195,7 @@ public class TrainPlanServiceImpl extends ServiceImpl trainPlanList = getTrainPlanByUnitAndDate(unit, startTime, endTime); - // 处理字段信息 + // 数据处理 trainPlanList.forEach(train -> { // 培训状态 String status; @@ -209,6 +210,9 @@ public class TrainPlanServiceImpl extends ServiceImpl 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); + } + // 表头年月 + String code = trainRecordDetailVO.getCode(); + trainRecordDetailVO.setYear(code.substring(4, 8)); + trainRecordDetailVO.setMonth(code.substring(8, 10)); Map params = BaseUtil.obj2Map(trainRecordDetailVO); String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx index 9fd0baffd18eeb7cb7e623adcc4a9a12093c0a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