-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
307 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
package org.hy.common.report.junit.read01; | ||
|
||
/** | ||
* @author zy | ||
* @version v1.0 | ||
* @description: | ||
* @createDate 2022/3/9 | ||
*/ | ||
public class DataInfo { | ||
private String a; | ||
private String b; | ||
private String c; | ||
private String d; | ||
private String e; | ||
private String f; | ||
private String g; | ||
private String h; | ||
private String i; | ||
private String j; | ||
private String k; | ||
private String l; | ||
private String m; | ||
private String n; | ||
private String o; | ||
private String p; | ||
private String q; | ||
private String r; | ||
private String s; | ||
|
||
public String getA() { | ||
return a; | ||
} | ||
|
||
public void setA(String a) { | ||
this.a = a; | ||
} | ||
|
||
public String getB() { | ||
return b; | ||
} | ||
|
||
public void setB(String b) { | ||
this.b = b; | ||
} | ||
|
||
public String getC() { | ||
return c; | ||
} | ||
|
||
public void setC(String c) { | ||
this.c = c; | ||
} | ||
|
||
public String getD() { | ||
return d; | ||
} | ||
|
||
public void setD(String d) { | ||
this.d = d; | ||
} | ||
|
||
public String getE() { | ||
return e; | ||
} | ||
|
||
public void setE(String e) { | ||
this.e = e; | ||
} | ||
|
||
public String getF() { | ||
return f; | ||
} | ||
|
||
public void setF(String f) { | ||
this.f = f; | ||
} | ||
|
||
public String getG() { | ||
return g; | ||
} | ||
|
||
public void setG(String g) { | ||
this.g = g; | ||
} | ||
|
||
public String getH() { | ||
return h; | ||
} | ||
|
||
public void setH(String h) { | ||
this.h = h; | ||
} | ||
|
||
public String getI() { | ||
return i; | ||
} | ||
|
||
public void setI(String i) { | ||
this.i = i; | ||
} | ||
|
||
public String getJ() { | ||
return j; | ||
} | ||
|
||
public void setJ(String j) { | ||
this.j = j; | ||
} | ||
|
||
public String getK() { | ||
return k; | ||
} | ||
|
||
public void setK(String k) { | ||
this.k = k; | ||
} | ||
|
||
public String getL() { | ||
return l; | ||
} | ||
|
||
public void setL(String l) { | ||
this.l = l; | ||
} | ||
|
||
public String getM() { | ||
return m; | ||
} | ||
|
||
public void setM(String m) { | ||
this.m = m; | ||
} | ||
|
||
public String getN() { | ||
return n; | ||
} | ||
|
||
public void setN(String n) { | ||
this.n = n; | ||
} | ||
|
||
public String getO() { | ||
return o; | ||
} | ||
|
||
public void setO(String o) { | ||
this.o = o; | ||
} | ||
|
||
public String getP() { | ||
return p; | ||
} | ||
|
||
public void setP(String p) { | ||
this.p = p; | ||
} | ||
|
||
public String getQ() { | ||
return q; | ||
} | ||
|
||
public void setQ(String q) { | ||
this.q = q; | ||
} | ||
|
||
public String getR() { | ||
return r; | ||
} | ||
|
||
public void setR(String r) { | ||
this.r = r; | ||
} | ||
|
||
public String getS() { | ||
return s; | ||
} | ||
|
||
public void setS(String s) { | ||
this.s = s; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.hy.common.report.junit.read01; | ||
|
||
import java.util.List; | ||
|
||
import org.hy.common.Help; | ||
import org.hy.common.report.ReportHelp; | ||
import org.hy.common.report.bean.RTemplate; | ||
import org.hy.common.xml.XJava; | ||
import org.hy.common.xml.annotation.XType; | ||
import org.hy.common.xml.annotation.Xjava; | ||
import org.junit.FixMethodOrder; | ||
import org.junit.Test; | ||
import org.junit.runners.MethodSorters; | ||
|
||
|
||
|
||
|
||
|
||
/** | ||
* 测试单元:Excel转为Java对象 | ||
* | ||
* @author ZhengWei(HY) | ||
* @createDate 2022-03-09 | ||
* @version v1.0 | ||
*/ | ||
@Xjava(value=XType.XML) | ||
@FixMethodOrder(MethodSorters.NAME_ASCENDING) | ||
public class JU_Read01 | ||
{ | ||
private static boolean $isInit = false; | ||
|
||
|
||
|
||
public JU_Read01() throws Exception | ||
{ | ||
if ( !$isInit ) | ||
{ | ||
$isInit = true; | ||
XJava.parserAnnotation(this.getClass().getName()); | ||
} | ||
} | ||
|
||
|
||
|
||
@SuppressWarnings("unchecked") | ||
@Test | ||
public void test_Read01() | ||
{ | ||
RTemplate v_RTemplate = (RTemplate)XJava.getObject("Report_Read01"); | ||
List<DataInfo> v_Datas = (List<DataInfo>)ReportHelp.toJava(v_RTemplate ,JU_Read01.class.getResource("Datas_9J04-1.xls").toString()); | ||
|
||
Help.print(v_Datas); | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<config> | ||
|
||
<import name="xconfig" class="java.util.ArrayList" /> | ||
<import name="template" class="org.hy.common.report.bean.RTemplate" /> | ||
|
||
|
||
|
||
<!-- 报表模板配置信息 --> | ||
<xconfig> | ||
|
||
<template id="Report_Read01"> | ||
<name>工艺基础数据导入</name> | ||
<sheetIndex>0</sheetIndex> | ||
<excelFileName>classpath:JU_Read01.xlsx</excelFileName> | ||
<dataBeginRow>2</dataBeginRow> | ||
<dataClass>org.hy.common.report.junit.read01.DataInfo</dataClass> | ||
</template> | ||
</xconfig> | ||
|
||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3.19 KB
(140%)
test/org/hy/common/report/junit/readVertical/JU_ReadVertical.xlsx
Binary file not shown.
Oops, something went wrong.