Skip to content

Commit

Permalink
3.2.12.S52
Browse files Browse the repository at this point in the history
测试:字符串转数字时,支持货币字符、千分位
  • Loading branch information
HY-ZhengWei committed May 19, 2022
1 parent 4b046bb commit 6c8fbc5
Show file tree
Hide file tree
Showing 11 changed files with 307 additions and 24 deletions.
181 changes: 181 additions & 0 deletions test/org/hy/common/report/junit/read01/DataInfo.java
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 added test/org/hy/common/report/junit/read01/Datas.xls
Binary file not shown.
Binary file not shown.
55 changes: 55 additions & 0 deletions test/org/hy/common/report/junit/read01/JU_Read01.java
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.
22 changes: 22 additions & 0 deletions test/org/hy/common/report/junit/read01/JU_Read01.xml
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>
39 changes: 32 additions & 7 deletions test/org/hy/common/report/junit/readHorizontal/Finance.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


/**
* 财务信息
* 财务信息
*
* @author ZhengWei(HY)
* @createDate 2017-05-08
Expand Down Expand Up @@ -39,6 +39,9 @@ public class Finance extends SerializableDef

/** yyyy-MM格式的时间 */
private Date time3;

/* 纳税(千分位) */
private Double tax;



Expand All @@ -54,7 +57,7 @@ public Double getIncome()
/**
* 设置:收益
*
* @param income
* @param income
*/
public void setIncome(Double income)
{
Expand All @@ -74,7 +77,7 @@ public Double getPay()
/**
* 设置:支出
*
* @param pay
* @param pay
*/
public void setPay(Double pay)
{
Expand All @@ -96,7 +99,7 @@ public String getRate()
/**
* 设置:流动比
*
* @param rate
* @param rate
*/
public void setRate(String rate)
{
Expand All @@ -118,7 +121,7 @@ public Date getTime()
/**
* 设置:时间
*
* @param time
* @param time
*/
public void setTime(Date time)
{
Expand All @@ -140,7 +143,7 @@ public Timestamp getTime2()
/**
* 设置:数据库时间
*
* @param time2
* @param time2
*/
public void setTime2(Timestamp time2)
{
Expand All @@ -162,11 +165,33 @@ public Date getTime3()
/**
* 设置:yyyy-MM格式的时间
*
* @param time3
* @param time3
*/
public void setTime3(Date time3)
{
this.time3 = time3;
}



/**
* 获取:纳税(千分位)
*/
public Double getTax()
{
return tax;
}



/**
* 设置:纳税(千分位)
*
* @param tax
*/
public void setTax(Double tax)
{
this.tax = tax;
}

}
Binary file not shown.
Loading

0 comments on commit 6c8fbc5

Please sign in to comment.