Browse Source

fix: 修改导出演练记录表的数据内容

zhongwei
liwen 11 months ago
parent
commit
fc7eb24fda
  1. 5
      hzims-service-api/safeproduct-api/pom.xml
  2. 13
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java
  3. 17
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  4. 1
      hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

5
hzims-service-api/safeproduct-api/pom.xml

@ -15,6 +15,11 @@
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
</dependencies>
<packaging>jar</packaging>

13
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java

@ -1,5 +1,7 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -19,40 +21,48 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ExcelIgnoreUnannotated
@TableName("hzims_rehearsal_record")
@ApiModel(value = "演练记录实体类")
public class RehearsalRecordEntity extends BaseEntity {
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
@ExcelProperty(value = "编码", index = 0)
private String code;
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
@ExcelProperty(value = "单位", index = 1)
private String unit;
@NotNull
@Size(max = 50, message = "演练科目字段长度不能超过50")
@ApiModelProperty("演练科目")
@ExcelProperty(value = "演练科目", index = 2)
private String subject;
@NotNull
@ApiModelProperty("演练计划开始时间")
@ExcelProperty(value = "演练计划开始时间", index = 3)
private Date scheduledStartTime;
@NotNull
@ApiModelProperty("演练计划结束时间")
@ExcelProperty(value = "演练计划结束时间", index = 4)
private Date scheduledEndTime;
@NotNull
@Size(max = 255, message = "演练地点字段长度不能超过255")
@ApiModelProperty("演练地点")
@ExcelProperty(value = "演练地点", index = 5)
private String location;
@Min(value = 0, message = "参演人数不能小于0")
@Max(value = 1000, message = "参演人数字段长度超出限制范围")
@ApiModelProperty("参演人数")
@ExcelProperty(value = "参演人数", index = 6)
private Integer peopleNum;
@Size(max = 5000, message = "参演人员字段长度超出限制范围")
@ -65,9 +75,11 @@ public class RehearsalRecordEntity extends BaseEntity {
private String commander;
@ApiModelProperty("演练实际开始时间")
@ExcelProperty(value = "演练实际开始时间", index = 7)
private Date actualStartTime;
@ApiModelProperty("演练实际结束时间")
@ExcelProperty(value = "演练实际结束时间", index = 8)
private Date actualEndTime;
@Size(max = 250, message = "演练记录字段长度不能超过250")
@ -85,6 +97,7 @@ public class RehearsalRecordEntity extends BaseEntity {
@NotNull
@Size(max = 20, message = "演练状态字段长度不能超过20")
@ApiModelProperty("演练状态")
@ExcelProperty(value = "演练状态", index = 9)
private String rehearsalStatus;
@Size(max = 1000, message = "演练图片字段长度不能超过1000")

17
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -207,24 +207,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
.registerConverter(new LongStringConverter())
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25))
.build();
Set<String> excludeColumnFiledNames = new HashSet<>();
excludeColumnFiledNames.add("peopleName");
excludeColumnFiledNames.add("commander");
excludeColumnFiledNames.add("record");
excludeColumnFiledNames.add("comment");
excludeColumnFiledNames.add("rehearsalMethod");
excludeColumnFiledNames.add("imgPath");
excludeColumnFiledNames.add("filePath");
excludeColumnFiledNames.add("id");
excludeColumnFiledNames.add("createUser");
excludeColumnFiledNames.add("createDept");
excludeColumnFiledNames.add("createTime");
excludeColumnFiledNames.add("updateUser");
excludeColumnFiledNames.add("updateTime");
excludeColumnFiledNames.add("status");
excludeColumnFiledNames.add("isDeleted");
WriteSheet writeSheet = EasyExcel.writerSheet(1, "演练记录表").head(RehearsalRecordEntity.class)
.excludeColumnFiledNames(excludeColumnFiledNames)
.build();
excelWriter.write(rehearsalRecordList, writeSheet);
excelWriter.finish();

1
hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

@ -20,6 +20,7 @@ CREATE TABLE `hzims`.`hzims_rehearsal_record` (
`scheduled_end_time` datetime NOT NULL COMMENT '演练计划结束时间',
`location` varchar(255) NOT NULL COMMENT '演练地点',
`people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数',
`people_name` varchar(5000) DEFAULT '' COMMENT '参演人员',
`commander` varchar(10) NOT NULL COMMENT '总指挥',
`actual_start_time` datetime DEFAULT NULL COMMENT '演练实际开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '演练实际结束时间',

Loading…
Cancel
Save