Browse Source

update: 演练管理

zhongwei
liwen 11 months ago
parent
commit
92ca5218dc
  1. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java
  2. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  3. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  4. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  5. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java
  6. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java

@ -12,7 +12,7 @@ import java.util.Date;
*/ */
@Data @Data
@ApiModel(value = "演练记录表VO类") @ApiModel(value = "演练记录表VO类")
public class RehearsalDetailVO { public class RehearsalRecordDetailVO {
@ApiModelProperty("编码") @ApiModelProperty("编码")
private String code; private String code;

8
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.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.service.IRehearsalPlanService; import com.hnac.hzims.safeproduct.service.IRehearsalPlanService;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; 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.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -106,7 +106,7 @@ public class RehearsalController extends BladeController {
@GetMapping("/rehearsalRecordDetail") @GetMapping("/rehearsalRecordDetail")
@ApiOperation(value = "演练记录详情") @ApiOperation(value = "演练记录详情")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
public R<RehearsalDetailVO> rehearsalRecordDetail(@RequestParam Long id) { public R<RehearsalRecordDetailVO> rehearsalRecordDetail(@RequestParam Long id) {
return R.data(rehearsalRecordService.getRecordDetailVOById(id)); return R.data(rehearsalRecordService.getRecordDetailVOById(id));
} }
@ -153,7 +153,7 @@ public class RehearsalController extends BladeController {
@GetMapping("/exportRecordDetailData") @GetMapping("/exportRecordDetailData")
@ApiOperation(value = "演练记录表导出") @ApiOperation(value = "演练记录表导出")
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
public void exportRecordDetailData(@RequestParam Long id, HttpServletResponse response) { public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) {
rehearsalRecordService.exportRecordDetailData(id, response); rehearsalRecordService.exportRehearsalRecordData(id, response);
} }
} }

4
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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; 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; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -19,5 +19,5 @@ public interface RehearsalRecordMapper extends BaseMapper<RehearsalRecordEntity>
* @param id 演练记录id * @param id 演练记录id
* @return 演练记录表VO类 * @return 演练记录表VO类
*/ */
RehearsalDetailVO getRecordDetailVOById(Long id); RehearsalRecordDetailVO getRecordDetailVOById(Long id);
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper"> <mapper namespace="com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper">
<select id="getRecordDetailVOById" resultType="com.hnac.hzims.safeproduct.vo.RehearsalDetailVO"> <select id="getRecordDetailVOById" resultType="com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO">
SELECT SELECT
t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.rehearsal_method, t2.commander, 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 t2.subject, t1.people_name, t1.record, t1.img_path, t1.command, t1.file_path

6
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.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; 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; import javax.servlet.http.HttpServletResponse;
@ -40,12 +40,12 @@ public interface IRehearsalRecordService extends IService<RehearsalRecordEntity>
* @param id 演练记录id * @param id 演练记录id
* @param response 响应类 * @param response 响应类
*/ */
void exportRecordDetailData(Long id, HttpServletResponse response); void exportRehearsalRecordData(Long id, HttpServletResponse response);
/** /**
* 查询演练记录表详情 * 查询演练记录表详情
* @param id 演练记录id * @param id 演练记录id
* @return 演练记录表VO类 * @return 演练记录表VO类
*/ */
RehearsalDetailVO getRecordDetailVOById(Long id); RehearsalRecordDetailVO getRecordDetailVOById(Long id);
} }

20
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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; 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.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper;
import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; 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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -129,9 +130,18 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
* 演练记录表导出 * 演练记录表导出
*/ */
@Override @Override
public void exportRecordDetailData(Long id, HttpServletResponse response) { public void exportRehearsalRecordData(Long id, HttpServletResponse response) {
RehearsalDetailVO rehearsalDetailVO = this.getRecordDetailVOById(id); RehearsalRecordDetailVO rehearsalRecordDetailVO = this.getRecordDetailVOById(id);
Map<String, Object> params = BaseUtil.obj2Map(rehearsalDetailVO); // 演练方式字段
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<String, Object> params = BaseUtil.obj2Map(rehearsalRecordDetailVO);
String templateFile = "template/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String templateFile = "template/演练记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/演练记录表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/演练记录表" + SafeProductConstant.PDF_SUFFIX; String pdfPath = savePath + "/演练记录表" + SafeProductConstant.PDF_SUFFIX;
@ -142,7 +152,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
* 查询演练记录表详情 * 查询演练记录表详情
*/ */
@Override @Override
public RehearsalDetailVO getRecordDetailVOById(Long id) { public RehearsalRecordDetailVO getRecordDetailVOById(Long id) {
return baseMapper.getRecordDetailVOById(id); return baseMapper.getRecordDetailVOById(id);
} }
} }

Loading…
Cancel
Save