4 files modified
2 files added
| New file |
| | |
| | | package org.springblade.common.converter; |
| | | |
| | | 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; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class HealthcodeTypeConverter 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 type, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | if (type.equals("1")){ |
| | | return new CellData("绿色健康码"); |
| | | } |
| | | if (type.equals("2")){ |
| | | return new CellData("黄色健康码"); |
| | | } |
| | | if (type.equals("3")){ |
| | | return new CellData("红色健康码"); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.common.converter; |
| | | |
| | | 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; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class ParcelMarkConverter 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 type, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | if (type.equals("1")){ |
| | | return new CellData("违禁"); |
| | | } |
| | | if (type.equals("0")){ |
| | | return new CellData("非违禁"); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package org.springblade.common.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | |
| | | private String galarmPeople; |
| | | |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("性别(0:男,1:女)") |
| | | // @ColumnWidth(15) |
| | | // @ExcelProperty("性别(0:男,1:女)") |
| | | @ExcelIgnore |
| | | private String sex; |
| | | |
| | | |
| | |
| | | private String district; |
| | | |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("省份") |
| | | // @ColumnWidth(10) |
| | | // @ExcelProperty("省份") |
| | | @ExcelIgnore |
| | | private String province; |
| | | |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("地市") |
| | | // @ColumnWidth(10) |
| | | // @ExcelProperty("地市") |
| | | @ExcelIgnore |
| | | private String city; |
| | | |
| | | |
| | |
| | | private String wd; |
| | | |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("是否生成警单(0:否 1:是)") |
| | | // @ColumnWidth(10) |
| | | // @ExcelProperty("是否生成警单(0:否 1:是)") |
| | | @ExcelIgnore |
| | | private String jtype; |
| | | |
| | | @ColumnWidth(20) |
| | |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.springblade.common.converter.HealthcodeTypeConverter; |
| | | |
| | | |
| | | @Data |
| | |
| | | |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("类型(1:绿色 2:黄色 3:红色)") |
| | | @ExcelProperty(value = "类型",converter = HealthcodeTypeConverter.class) |
| | | private String type; |
| | | |
| | | |
| | |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.springblade.common.converter.ListToStringConverter; |
| | | import org.springblade.common.converter.ParcelMarkConverter; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | private String samplingTime; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("是否识别违禁, 1-违禁 0-非违禁") |
| | | @ExcelProperty(value = "是否识别违禁",converter = ParcelMarkConverter.class) |
| | | private String mechineMark; |
| | | |
| | | @ColumnWidth(50) |
| | |
| | | private String levName; |
| | | |
| | | @ColumnWidth(30) |
| | | @ExcelProperty(value = "违禁品坐标,list格式",converter = ListToStringConverter.class) |
| | | @ExcelProperty(value = "违禁品坐标",converter = ListToStringConverter.class) |
| | | private List<String> coords; |
| | | |
| | | @ColumnWidth(30) |