去除autopoi,引入easypoi
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel(description = "onl_auth_data", value = "onl_auth_data对象")
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel(description = "onl_auth_page", value = "onl_auth_page对象")
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
+7
-8
@@ -40,11 +40,11 @@ import com.jero.generater.modules.online.config.util.DbTableUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -660,8 +660,6 @@ public class OnlCgformApiController {
|
||||
Entry<String, MultipartFile> var20 = var53.next();
|
||||
MultipartFile var21 = var20.getValue();
|
||||
ImportParams var22 = new ImportParams();
|
||||
var22.setImageList(var12);
|
||||
var22.setDataHanlder(new CgFormExcelHandler(var10, this.upLoadPath, this.uploadType));
|
||||
List<Map<String, Object>> var23 = ExcelImportUtil.importExcel(var21.getInputStream(), Map.class, var22);
|
||||
if (var23 != null) {
|
||||
Object var24 = "";
|
||||
@@ -899,7 +897,8 @@ public class OnlCgformApiController {
|
||||
if ("image".equals(var1.get(var4).getFieldShowType())) {
|
||||
var6.setType(2);
|
||||
var6.setExportImageType(3);
|
||||
var6.setImageBasePath(this.upLoadPath);
|
||||
// TODO 处理图片路径的问题
|
||||
// var6.setImageBasePath(this.upLoadPath);
|
||||
var6.setHeight(50.0D);
|
||||
var6.setWidth(60.0D);
|
||||
} else {
|
||||
|
||||
+3
-19
@@ -5,11 +5,12 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
|
||||
import cn.afterturn.easypoi.util.PoiPublicUtil;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecgframework.poi.handler.impl.ExcelDataHandlerDefaultImpl;
|
||||
import org.jeecgframework.poi.util.PoiPublicUtil;
|
||||
|
||||
public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl {
|
||||
Map<String, OnlCgformField> a;
|
||||
@@ -38,23 +39,6 @@ public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl {
|
||||
return var2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapValue(Map<String, Object> map, String originKey, Object value) {
|
||||
String var4 = this.a(originKey);
|
||||
if (value instanceof Double) {
|
||||
map.put(var4, PoiPublicUtil.doubleToString((Double)value));
|
||||
} else if (value instanceof byte[]) {
|
||||
byte[] var5 = ((byte[])value);
|
||||
String var6 = CgformUtil.a(var5, this.c, this.d, this.e);
|
||||
if (var6 != null) {
|
||||
map.put(var4, var6);
|
||||
}
|
||||
} else {
|
||||
map.put(var4, value == null ? "" : value.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String a(String var1) {
|
||||
return this.a.containsKey(var1) ? "$mainTable$" + this.a.get(var1).getDbFieldName() : "$subTable$" + var1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.jero.generater.modules.online.config.util.DbTableUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
||||
+4
-16
@@ -24,9 +24,9 @@ import com.jero.generater.modules.online.cgreport.util.SqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -360,13 +360,12 @@ public class OnlCgreportAPI {
|
||||
var53 = var12.get(var52);
|
||||
((List)var53).add(var15);
|
||||
} else {
|
||||
ExcelExportEntity var23 = new ExcelExportEntity(var52, var52, true);
|
||||
ExcelExportEntity var23 = new ExcelExportEntity(var52, var52);
|
||||
var13.add(var23);
|
||||
((List)var53).add(var15);
|
||||
}
|
||||
|
||||
var12.put(var52, var53);
|
||||
var16.setColspan(true);
|
||||
}
|
||||
|
||||
var13.add(var16);
|
||||
@@ -382,8 +381,6 @@ public class OnlCgreportAPI {
|
||||
Entry<String, Object> var39 = var37.next();
|
||||
var42 = var39.getKey();
|
||||
List<String> var43 = (List)var39.getValue();
|
||||
|
||||
getVar48(var13, var42, var43);
|
||||
}
|
||||
|
||||
if (!var36.isEmpty()) {
|
||||
@@ -418,15 +415,6 @@ public class OnlCgreportAPI {
|
||||
}
|
||||
}
|
||||
|
||||
private void getVar48(ArrayList<ExcelExportEntity> var13, String var42, List<String> var43) {
|
||||
for (ExcelExportEntity o : var13) {
|
||||
ExcelExportEntity var48 = o;
|
||||
if (var42.equals(var48.getName()) && var48.isColspan()) {
|
||||
var48.setSubColumnList(var43);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getVar16(ExcelExportEntity var16, List<DictModel> var19) {
|
||||
if (var19 != null && !var19.isEmpty()) {
|
||||
ArrayList<String> var20 = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user