diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailImgVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailImgVO.java new file mode 100644 index 0000000..c75df94 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailImgVO.java @@ -0,0 +1,22 @@ +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 lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "车辆维保记录VO类-图片实体类") +public class CarMaintenanceDetailImgVO extends CarMaintenanceDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailStrVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailStrVO.java new file mode 100644 index 0000000..c8f8e75 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailStrVO.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "车辆维保记录VO类-图片字符串类") +public class CarMaintenanceDetailStrVO extends CarMaintenanceDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java index 554bd7b..8d18ae4 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java @@ -1,12 +1,10 @@ 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 @@ -64,9 +62,6 @@ public class CarMaintenanceDetailVO { @ApiModelProperty("维保类型") private String maintenanceType; - @ApiModelProperty("图片列表") - private List images; - @ApiModelProperty("年份") private String year; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailImgVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailImgVO.java new file mode 100644 index 0000000..6310c23 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailImgVO.java @@ -0,0 +1,22 @@ +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 lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "车辆用车记录VO类-图片实体类") +public class CarUsedRecordDetailImgVO extends CarUsedRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailStrVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailStrVO.java new file mode 100644 index 0000000..2d5f620 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailStrVO.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "车辆用车记录VO类-图片字符串类") +public class CarUsedRecordDetailStrVO extends CarUsedRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java index 50564f4..5f496bd 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java @@ -1,13 +1,11 @@ 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.math.BigDecimal; import java.util.Date; -import java.util.List; /** * @author liwen @@ -65,9 +63,6 @@ public class CarUsedRecordDetailVO { @ApiModelProperty("确认时间") private Date confirmationTime; - @ApiModelProperty("图片列表") - private List images; - @ApiModelProperty("年份") private String year; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailImgVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailImgVO.java new file mode 100644 index 0000000..839ac6a --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailImgVO.java @@ -0,0 +1,22 @@ +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 lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "会议记录VO类-图片实体类") +public class ConferenceRecordDetailImgVO extends ConferenceRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailStrVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailStrVO.java new file mode 100644 index 0000000..2650b11 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailStrVO.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "会议记录VO类-图片实体类") +public class ConferenceRecordDetailStrVO extends ConferenceRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java index 6bfaadb..7abdf86 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java @@ -1,13 +1,9 @@ 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 * @date 2024-01-15 @@ -55,9 +51,6 @@ public class ConferenceRecordDetailVO { @ApiModelProperty("会议附件") private String filePath; - @ApiModelProperty("图片列表") - private List images; - @ApiModelProperty("年份") private String year; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailImgVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailImgVO.java index abb312d..bbd34fa 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailImgVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailImgVO.java @@ -4,12 +4,14 @@ import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.List; @Data -@ApiModel(value = "演练记录表VO类") -public class RehearsalRecordDetailImgVO extends RehearsalRecordDetailVO{ +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "演练记录表VO类-图片实体类") +public class RehearsalRecordDetailImgVO extends RehearsalRecordDetailVO { @ApiModelProperty("图片列表") private List images; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailStrVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailStrVO.java index 2a7c8bf..953a997 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailStrVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailStrVO.java @@ -3,12 +3,14 @@ package com.hnac.hzims.safeproduct.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.List; @Data -@ApiModel(value = "演练记录表VO类") -public class RehearsalRecordDetailStrVO extends RehearsalRecordDetailVO{ +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "演练记录表VO类-图片字符串类") +public class RehearsalRecordDetailStrVO extends RehearsalRecordDetailVO { @ApiModelProperty("图片列表") private List images; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailImgVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailImgVO.java new file mode 100644 index 0000000..6d5724a --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailImgVO.java @@ -0,0 +1,22 @@ +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 lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "培训记录表VO类-图片实体类") +public class TrainRecordDetailImgVO extends TrainRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailStrVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailStrVO.java new file mode 100644 index 0000000..a5a23f9 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailStrVO.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "培训记录表VO类-图片字符串类") +public class TrainRecordDetailStrVO extends TrainRecordDetailVO { + + @ApiModelProperty("图片列表") + private List images; +} 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 e8850de..2eb2148 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,13 +1,9 @@ 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 * @date 2024-01-15 @@ -55,9 +51,6 @@ public class TrainRecordDetailVO { @ApiModelProperty("培训附件") private String filePath; - @ApiModelProperty("图片列表") - private List images; - @ApiModelProperty("年份") private String year; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java index d88ca90..33d77e2 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java @@ -19,7 +19,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -41,7 +40,7 @@ import java.util.Map; @AllArgsConstructor @Business(module = Constants.APP_NAME, value = "车辆管理", ignore = false) @Api(value = "车辆管理", tags = "车辆管理接口") -public class CarController extends BladeController { +public class CarController { private final ICarService carService; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index 119188f..fcd7aac 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -17,7 +17,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -38,7 +37,7 @@ import java.util.Map; @RequestMapping("/conference") @Business(module = Constants.APP_NAME, value = "会议管理", ignore = false) @Api(value = "会议管理", tags = "会议管理接口") -public class ConferenceController extends BladeController { +public class ConferenceController { private final IConferencePlanService conferencePlanService; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 08d28ce..af81138 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -19,7 +19,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -40,7 +39,7 @@ import java.util.Map; @RequestMapping("/rehearsal") @Business(module = Constants.APP_NAME, value = "演练管理", ignore = false) @Api(value = "演练管理", tags = "演练管理接口") -public class RehearsalController extends BladeController { +public class RehearsalController { private final IRehearsalRecordService rehearsalRecordService; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index ef252f9..3c39c65 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -45,7 +44,7 @@ import java.util.Map; @RequestMapping("/train") @Business(module = Constants.APP_NAME, value = "培训管理", ignore = false) @Api(value = "培训管理", tags = "培训管理接口") -public class TrainController extends BladeController { +public class TrainController { private final ITrainPlanService trainPlanService; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java index 7f6531a..1e48db1 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java @@ -10,7 +10,6 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import javax.servlet.http.HttpServletResponse; -import java.util.List; import java.util.Map; /** 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 dec42a9..8da1751 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 @@ -17,11 +17,14 @@ import com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper; import com.hnac.hzims.safeproduct.mapper.CarMapper; import com.hnac.hzims.safeproduct.service.ICarMaintenanceService; import com.hnac.hzims.safeproduct.utils.BaseUtil; +import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailImgVO; +import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailStrVO; import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO; import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -123,20 +126,6 @@ public class CarMaintenanceServiceImpl extends ServiceImpl list = new ArrayList<>(); - if (StringUtils.isNotEmpty(carMaintenanceDetailVO.getImgPath())) { - String[] imgArr = carMaintenanceDetailVO.getImgPath().split(","); - for (String img : imgArr) { - ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + - BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); - list.add(imageEntity); - } - } else { - // 添加空的ImageEntity,防止数据填入时显示"{{" - list.add(new ImageEntity()); - } - carMaintenanceDetailVO.setImages(list); // 表头年月 String code = carMaintenanceDetailVO.getCode(); carMaintenanceDetailVO.setYear(code.substring(4, 8)); @@ -148,7 +137,28 @@ public class CarMaintenanceServiceImpl extends ServiceImpl params = BaseUtil.obj2Map(carMaintenanceDetailVO); + // 图片 + Map params; + if (StringUtils.isNotEmpty(carMaintenanceDetailVO.getImgPath())) { + List list = new ArrayList<>(); + CarMaintenanceDetailImgVO imgVO = new CarMaintenanceDetailImgVO(); + BeanUtils.copyProperties(carMaintenanceDetailVO, imgVO); + String[] imgArr = carMaintenanceDetailVO.getImgPath().split(","); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + imgVO.setImages(list); + params = BaseUtil.obj2Map(imgVO); + } else { + List list = new ArrayList<>(); + list.add(""); + CarMaintenanceDetailStrVO strVO = new CarMaintenanceDetailStrVO(); + BeanUtils.copyProperties(carMaintenanceDetailVO, strVO); + strVO.setImages(list); + params = BaseUtil.obj2Map(strVO); + } String templateFile = "template/车辆维保记录单" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/车辆维保记录单" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/车辆维保记录单" + SafeProductConstant.PDF_SUFFIX; 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 386e7c5..9c8de83 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 @@ -14,11 +14,14 @@ import com.hnac.hzims.safeproduct.enums.CarUsedRecordEnum; import com.hnac.hzims.safeproduct.mapper.CarUsedRecordMapper; import com.hnac.hzims.safeproduct.service.ICarUsedRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; +import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailImgVO; +import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailStrVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -117,25 +120,32 @@ public class CarUsedRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); + Map params; if (StringUtils.isNotEmpty(carUsedRecordDetailVO.getImgPath())) { + List list = new ArrayList<>(); + CarUsedRecordDetailImgVO imgVO = new CarUsedRecordDetailImgVO(); + BeanUtils.copyProperties(carUsedRecordDetailVO, imgVO); String[] imgArr = carUsedRecordDetailVO.getImgPath().split(","); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } + imgVO.setImages(list); + params = BaseUtil.obj2Map(imgVO); } else { - // 添加空的ImageEntity,防止数据填入时显示"{{" - list.add(new ImageEntity()); + List list = new ArrayList<>(); + list.add(""); + CarUsedRecordDetailStrVO strVO = new CarUsedRecordDetailStrVO(); + BeanUtils.copyProperties(carUsedRecordDetailVO, strVO); + strVO.setImages(list); + params = BaseUtil.obj2Map(strVO); } - carUsedRecordDetailVO.setImages(list); - // 表头年月 - String code = carUsedRecordDetailVO.getCode(); - carUsedRecordDetailVO.setYear(code.substring(4, 8)); - carUsedRecordDetailVO.setMonth(code.substring(8, 10)); - Map params = BaseUtil.obj2Map(carUsedRecordDetailVO); String templateFile = "template/用车记录单" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/用车记录单" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/用车记录单" + SafeProductConstant.PDF_SUFFIX; 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 b8b4ed6..205a5f5 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 @@ -17,9 +17,12 @@ import com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.TimeUtils; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailImgVO; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailStrVO; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; import com.hnac.hzims.safeproduct.vo.ConferenceRecordVO; import org.springblade.core.mp.support.Query; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -120,28 +123,33 @@ public class ConferenceRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); + Map params; if (StringUtils.isNotEmpty(conferenceRecordDetailVO.getImgPath())) { + List list = new ArrayList<>(); + ConferenceRecordDetailImgVO imgVO = new ConferenceRecordDetailImgVO(); + BeanUtils.copyProperties(conferenceRecordDetailVO, imgVO); String[] imgArr = conferenceRecordDetailVO.getImgPath().split(","); for (String img : imgArr) { ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); list.add(imageEntity); } + imgVO.setImages(list); + params = BaseUtil.obj2Map(imgVO); } else { - // 添加空的ImageEntity,防止数据填入时显示"{{" - list.add(new ImageEntity()); + List list = new ArrayList<>(); + list.add(""); + ConferenceRecordDetailStrVO strVO = new ConferenceRecordDetailStrVO(); + BeanUtils.copyProperties(conferenceRecordDetailVO, strVO); + strVO.setImages(list); + params = BaseUtil.obj2Map(strVO); } - conferenceRecordDetailVO.setImages(list); - Map params = BaseUtil.obj2Map(conferenceRecordDetailVO); String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/会议记录表" + SafeProductConstant.PDF_SUFFIX; BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath,"filePath", response); } - - /** * 查询会议记录表详情 */ 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 4d96ddd..5551eec 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 @@ -19,10 +19,13 @@ import com.hnac.hzims.safeproduct.service.ITestService; import com.hnac.hzims.safeproduct.service.ITrainRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.TimeUtils; +import com.hnac.hzims.safeproduct.vo.TrainRecordDetailImgVO; +import com.hnac.hzims.safeproduct.vo.TrainRecordDetailStrVO; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.utils.CollectionUtil; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -163,20 +166,32 @@ public class TrainRecordServiceImpl extends ServiceImpl - new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150) - ).collect(Collectors.toList())); - } else { - // 添加空的ImageEntity,防止数据填入时显示"{{" - trainRecordDetailVO.setImages(Collections.singletonList(new ImageEntity())); - } // 表头年月 String code = trainRecordDetailVO.getCode(); trainRecordDetailVO.setYear(code.substring(4, 8)); trainRecordDetailVO.setMonth(code.substring(8, 10)); - Map params = BaseUtil.obj2Map(trainRecordDetailVO); + // 图片 + Map params; + if (StringUtils.isNotEmpty(trainRecordDetailVO.getImgPath())) { + List list = new ArrayList<>(); + TrainRecordDetailImgVO imgVO = new TrainRecordDetailImgVO(); + BeanUtils.copyProperties(trainRecordDetailVO, imgVO); + String[] imgArr = trainRecordDetailVO.getImgPath().split(","); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + imgVO.setImages(list); + params = BaseUtil.obj2Map(imgVO); + } else { + List list = new ArrayList<>(); + list.add(""); + TrainRecordDetailStrVO strVO = new TrainRecordDetailStrVO(); + BeanUtils.copyProperties(trainRecordDetailVO, strVO); + strVO.setImages(list); + params = BaseUtil.obj2Map(strVO); + } String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/培训记录表" + SafeProductConstant.PDF_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/resources/template/卫生考核表(五周).docx b/hzims-service/safeproduct/src/main/resources/template/卫生考核表(五周).docx index 8129688..e217f44 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 a91c9f0..0043a37 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/卫生考核表(四周).docx and b/hzims-service/safeproduct/src/main/resources/template/卫生考核表(四周).docx differ