luojun 1 vuosi sitten
vanhempi
commit
661e4aad26

+ 56 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/CoreSafetyTaskExport.java

@@ -0,0 +1,56 @@
+package com.xunmei.core.safetyCheck.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ColumnWidth(15) //列宽,最大值为255
+@HeadRowHeight(16) //表头行高
+@ContentRowHeight(16) //数据行高
+public class CoreSafetyTaskExport {
+    @ApiModelProperty(value = "序号")
+    @TableField(exist = false)
+    @ExcelProperty(value = "序号", index = 0)
+    private Integer index;
+    @ApiModelProperty(value = "任务名称")
+    @ExcelProperty(value = "任务名称", index = 1)
+    private String title;
+    @ApiModelProperty(value = "检查主体")
+    @ExcelProperty(value = "检查主体", index = 2)
+    private String checkOrgName;
+    @ApiModelProperty(value = "受检机构")
+    @ExcelProperty(value = "受检机构", index = 3)
+    private String orgName;
+    @ApiModelProperty(value = "检查人员")
+    @ExcelProperty(value = "检查人员", index = 4)
+    private String submitName;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "开始日期")
+    @ExcelProperty(value = "开始日期", index = 5)
+    private Date planStartTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "截止日期")
+    @ExcelProperty(value = "截止日期", index = 6)
+    private Date planEndTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    @ExcelProperty(value = "创建时间", index = 7)
+    private Date createTime;
+    @ApiModelProperty(value = "检查组成员")
+    @ExcelProperty(value = "检查组成员", index = 8)
+    private String checkTeam;
+    @ApiModelProperty(value = "0待检查,1检查完成")
+    @ExcelProperty(value = "检查状态", index = 9,converter = SafeStatusConverter.class)
+    private String status;
+    @ApiModelProperty(value = "异常数目")
+    @ExcelProperty(value = "异常数目", index = 10)
+    private String exceptionCount;
+}

+ 39 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/SafeStatusConverter.java

@@ -0,0 +1,39 @@
+package com.xunmei.core.safetyCheck.vo;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+public class SafeStatusConverter implements Converter<String> {
+
+
+
+    @Override
+    public Class supportJavaTypeKey() {
+        return null;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return null;
+    }
+
+    @Override
+    public String convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        return null;
+    }
+
+    @Override
+    public CellData convertToExcelData(String status, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        if ("1".equals(status)) {
+            return new CellData("待检查");
+        } else if ("0".equals(status)) {
+            return new CellData("检查完成");
+        } else {
+            return new CellData("检查完成");
+        }
+
+    }
+}