|
|
@@ -0,0 +1,37 @@
|
|
|
+package com.chuanghai.h3c_reporting.conver;
|
|
|
+
|
|
|
+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;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author 浮生
|
|
|
+ * @Date 2023/3/22 14:38
|
|
|
+ * @PackageName:com.chuanghai.h3c_reporting.conver
|
|
|
+ * @ClassName: StatusConverter
|
|
|
+ * @Description: TODO 转换项目状态
|
|
|
+ * @Version 1.0
|
|
|
+ */
|
|
|
+public class StatusConverter implements Converter<Integer> {
|
|
|
+ @Override
|
|
|
+ public Class supportJavaTypeKey() {
|
|
|
+ return Integer.class;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CellDataTypeEnum supportExcelTypeKey() {
|
|
|
+ return CellDataTypeEnum.STRING;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
|
|
|
+ return cellData.getStringValue().equals("进行中") ? 1 : 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
|
|
|
+ return new CellData(value == 1 ? "进行中" : "已关闭");
|
|
|
+ }
|
|
|
+}
|