diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java similarity index 96% rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java index bb7bd8e..86afcbe 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java @@ -12,7 +12,7 @@ import java.util.Date; */ @Data @ApiModel(value = "演练记录表VO类") -public class RehearsalDetailVO { +public class RehearsalRecordDetailVO { @ApiModelProperty("编码") private String code; 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 60c96c9..afb6c70 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 @@ -7,7 +7,7 @@ import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.service.IRehearsalPlanService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import io.swagger.annotations.Api; @@ -106,7 +106,7 @@ public class RehearsalController extends BladeController { @GetMapping("/rehearsalRecordDetail") @ApiOperation(value = "演练记录详情") @ApiOperationSupport(order = 9) - public R rehearsalRecordDetail(@RequestParam Long id) { + public R rehearsalRecordDetail(@RequestParam Long id) { return R.data(rehearsalRecordService.getRecordDetailVOById(id)); } @@ -153,7 +153,7 @@ public class RehearsalController extends BladeController { @GetMapping("/exportRecordDetailData") @ApiOperation(value = "演练记录表导出") @ApiOperationSupport(order = 14) - public void exportRecordDetailData(@RequestParam Long id, HttpServletResponse response) { - rehearsalRecordService.exportRecordDetailData(id, response); + public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) { + rehearsalRecordService.exportRehearsalRecordData(id, response); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java index 9cbd708..9a55888 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import org.apache.ibatis.annotations.Mapper; /** @@ -19,5 +19,5 @@ public interface RehearsalRecordMapper extends BaseMapper * @param id 演练记录id * @return 演练记录表VO类 */ - RehearsalDetailVO getRecordDetailVOById(Long id); + RehearsalRecordDetailVO getRecordDetailVOById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 4eb9ff8..eecddec 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -2,7 +2,7 @@ - SELECT t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.rehearsal_method, t2.commander, t2.subject, t1.people_name, t1.record, t1.img_path, t1.command, t1.file_path diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java index 8f5d5e2..83dec8b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import javax.servlet.http.HttpServletResponse; @@ -40,12 +40,12 @@ public interface IRehearsalRecordService extends IService * @param id 演练记录id * @param response 响应类 */ - void exportRecordDetailData(Long id, HttpServletResponse response); + void exportRehearsalRecordData(Long id, HttpServletResponse response); /** * 查询演练记录表详情 * @param id 演练记录id * @return 演练记录表VO类 */ - RehearsalDetailVO getRecordDetailVOById(Long id); + RehearsalRecordDetailVO getRecordDetailVOById(Long id); } 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 f6ece0d..68dbb45 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 @@ -8,12 +8,13 @@ import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; +import com.hnac.hzims.safeproduct.enums.RehearsalMethodEnum; import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -129,9 +130,18 @@ public class RehearsalRecordServiceImpl extends ServiceImpl params = BaseUtil.obj2Map(rehearsalDetailVO); + public void exportRehearsalRecordData(Long id, HttpServletResponse response) { + RehearsalRecordDetailVO rehearsalRecordDetailVO = this.getRecordDetailVOById(id); + // 演练方式字段 + String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod(); + if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc()); + } else if (rehearsalMethod.equals(RehearsalMethodEnum.ONLINE.getValue())) { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.ONLINE.getDesc()); + } else { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.OFFLINE.getDesc()); + } + Map params = BaseUtil.obj2Map(rehearsalRecordDetailVO); String templateFile = "template/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/演练记录表" + SafeProductConstant.PDF_SUFFIX; @@ -142,7 +152,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl