资源推送微服务
parent
ff8f7822be
commit
1e382a6ea4
|
@ -24,13 +24,13 @@ private String id;
|
||||||
private String recommendId;
|
private String recommendId;
|
||||||
@Excel(name = "*题名")
|
@Excel(name = "*题名")
|
||||||
private String title;
|
private String title;
|
||||||
@Excel(name = "只用来查重,格式化题名")
|
//@Excel(name = "只用来查重,格式化题名")
|
||||||
private String titleFormat;
|
private String titleFormat;
|
||||||
@Excel(name = "题名译名")
|
@Excel(name = "题名译名")
|
||||||
private String otherTitle;
|
private String otherTitle;
|
||||||
@Excel(name = "分辑号 - 预留")
|
//@Excel(name = "分辑号 - 预留")
|
||||||
private String seriesNumber;
|
private String seriesNumber;
|
||||||
@Excel(name = "分辑名")
|
//@Excel(name = "分辑名")
|
||||||
private String seriesTitle;
|
private String seriesTitle;
|
||||||
@Excel(name = "PISSN")
|
@Excel(name = "PISSN")
|
||||||
private String pissn;
|
private String pissn;
|
||||||
|
@ -42,25 +42,25 @@ private String pisbn;
|
||||||
private String eisbn;
|
private String eisbn;
|
||||||
@Excel(name = "订购号")
|
@Excel(name = "订购号")
|
||||||
private String orderNumber;
|
private String orderNumber;
|
||||||
@Excel(name = "学科")
|
//@Excel(name = "学科")
|
||||||
private String subject;
|
private String subject;
|
||||||
@Excel(name = "出版社")
|
//@Excel(name = "出版社")
|
||||||
private String publisher;
|
private String publisher;
|
||||||
@Excel(name = "国别")
|
@Excel(name = "国家/地区")
|
||||||
private String country;
|
private String country;
|
||||||
@Excel(name = "出版年")
|
//@Excel(name = "出版年")
|
||||||
private String pubYear;
|
private String pubYear;
|
||||||
@Excel(name = "创刊年")
|
//@Excel(name = "创刊年")
|
||||||
private String foundedYear;
|
private String foundedYear;
|
||||||
@Excel(name = "语种")
|
@Excel(name = "语种")
|
||||||
private String language;
|
private String language;
|
||||||
@Excel(name = "出版频率")
|
//@Excel(name = "出版频率")
|
||||||
private String pubFeq;
|
private String pubFeq;
|
||||||
@Excel(name = "内容简介")
|
//@Excel(name = "内容简介")
|
||||||
private String Intro;
|
private String Intro;
|
||||||
@Excel(name = "分类号")
|
//@Excel(name = "分类号")
|
||||||
private String classiNumber;
|
private String classiNumber;
|
||||||
@Excel(name = "期刊URL地址")
|
//@Excel(name = "期刊URL地址")
|
||||||
private String url;
|
private String url;
|
||||||
private String carrier;
|
private String carrier;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class ExcelUtil<T>
|
||||||
// 定义一个map用于存放excel列的序号和field.
|
// 定义一个map用于存放excel列的序号和field.
|
||||||
Map<String, Integer> cellMap = new HashMap<String, Integer>();
|
Map<String, Integer> cellMap = new HashMap<String, Integer>();
|
||||||
// 获取表头
|
// 获取表头
|
||||||
Row heard = sheet.getRow(0);
|
Row heard = sheet.getRow(2);
|
||||||
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
|
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
|
||||||
Cell cell = heard.getCell(i);
|
Cell cell = heard.getCell(i);
|
||||||
if (cell != null) {
|
if (cell != null) {
|
||||||
|
@ -176,7 +176,8 @@ public class ExcelUtil<T>
|
||||||
// 设置类的私有字段属性可访问.
|
// 设置类的私有字段属性可访问.
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
Integer column = cellMap.get(attr.name());
|
Integer column = cellMap.get(attr.name());
|
||||||
if(column == null){
|
Integer column2 = cellMap.get("*"+attr.name());
|
||||||
|
if(column == null && column2 == null){
|
||||||
System.out.println("模板错误:Excel表头和项目里面设置的表头["+attr.name()+"]不一致,请检查!");
|
System.out.println("模板错误:Excel表头和项目里面设置的表头["+attr.name()+"]不一致,请检查!");
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -185,7 +186,7 @@ public class ExcelUtil<T>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i < rows; i++) {
|
for (int i = 3; i < rows; i++) {
|
||||||
// 从第2行开始取数据,默认第一行是表头.
|
// 从第2行开始取数据,默认第一行是表头.
|
||||||
Row row = sheet.getRow(i);
|
Row row = sheet.getRow(i);
|
||||||
T entity = null;
|
T entity = null;
|
||||||
|
|
Loading…
Reference in New Issue