Bladeren bron

优化大于及小于比较操作中存在空字符串值比较的情况

master
jacky6024 7 jaren geleden
bovenliggende
commit
0e14c557e1
  1. 5
      ureport2-core/src/main/java/com/bstek/ureport/build/assertor/EqualsGreatThenAssertor.java
  2. 5
      ureport2-core/src/main/java/com/bstek/ureport/build/assertor/EqualsLessThenAssertor.java
  3. 5
      ureport2-core/src/main/java/com/bstek/ureport/build/assertor/GreatThenAssertor.java
  4. 5
      ureport2-core/src/main/java/com/bstek/ureport/build/assertor/LessThenAssertor.java
  5. 9
      ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java

5
ureport2-core/src/main/java/com/bstek/ureport/build/assertor/EqualsGreatThenAssertor.java

@ -17,6 +17,8 @@ package com.bstek.ureport.build.assertor;
import java.math.BigDecimal;
import org.apache.commons.lang.StringUtils;
import com.bstek.ureport.Utils;
/**
@ -29,6 +31,9 @@ public class EqualsGreatThenAssertor extends AbstractAssertor{
if(left==null || right==null){
return false;
}
if(StringUtils.isBlank(left.toString()) || StringUtils.isBlank(right.toString())){
return false;
}
BigDecimal leftObj=Utils.toBigDecimal(left);
right=buildObject(right);
BigDecimal rightObj=Utils.toBigDecimal(right);

5
ureport2-core/src/main/java/com/bstek/ureport/build/assertor/EqualsLessThenAssertor.java

@ -17,6 +17,8 @@ package com.bstek.ureport.build.assertor;
import java.math.BigDecimal;
import org.apache.commons.lang.StringUtils;
import com.bstek.ureport.Utils;
/**
@ -30,6 +32,9 @@ public class EqualsLessThenAssertor extends AbstractAssertor {
if(left==null || right==null){
return false;
}
if(StringUtils.isBlank(left.toString()) || StringUtils.isBlank(right.toString())){
return false;
}
BigDecimal leftObj=Utils.toBigDecimal(left);
right=buildObject(right);
BigDecimal rightObj=Utils.toBigDecimal(right);

5
ureport2-core/src/main/java/com/bstek/ureport/build/assertor/GreatThenAssertor.java

@ -17,6 +17,8 @@ package com.bstek.ureport.build.assertor;
import java.math.BigDecimal;
import org.apache.commons.lang.StringUtils;
import com.bstek.ureport.Utils;
/**
@ -30,6 +32,9 @@ public class GreatThenAssertor extends AbstractAssertor {
if(left==null || right==null){
return false;
}
if(StringUtils.isBlank(left.toString()) || StringUtils.isBlank(right.toString())){
return false;
}
BigDecimal leftObj=Utils.toBigDecimal(left);
right=buildObject(right);
BigDecimal rightObj=Utils.toBigDecimal(right);

5
ureport2-core/src/main/java/com/bstek/ureport/build/assertor/LessThenAssertor.java

@ -17,6 +17,8 @@ package com.bstek.ureport.build.assertor;
import java.math.BigDecimal;
import org.apache.commons.lang.StringUtils;
import com.bstek.ureport.Utils;
/**
@ -30,6 +32,9 @@ public class LessThenAssertor extends AbstractAssertor{
if(left==null || right==null){
return false;
}
if(StringUtils.isBlank(left.toString()) || StringUtils.isBlank(right.toString())){
return false;
}
BigDecimal leftObj=Utils.toBigDecimal(left);
right=buildObject(right);
BigDecimal rightObj=Utils.toBigDecimal(right);

9
ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java

@ -44,6 +44,7 @@ public class Chart {
sb.append("\"type\":\""+dataset.getType()+"\",");
sb.append("\"data\":"+dataset.buildDataJson(context, cell)+",");
sb.append("\"options\":{");
boolean withoption=false;
if(options!=null && options.size()>0){
for(int i=0;i<options.size();i++){
Option option=options.get(i);
@ -51,9 +52,14 @@ public class Chart {
sb.append(",");
}
sb.append(option.buildOptionJson());
withoption=true;
}
}
if(xaxes!=null || yaxes!=null){
if(withoption){
sb.append(",");
}
withoption=true;
sb.append("\"scales\":{");
if(xaxes!=null){
sb.append("\"xAxes\":[");
@ -75,6 +81,9 @@ public class Chart {
}
sb.append("}");
}else{
if(withoption){
sb.append(",");
}
if(hasYAxes(dataset)){
sb.append("\"scales\":{\"yAxes\":[{\"ticks\":{\"min\":0}}]}");
}

Laden…
Annuleren
Opslaan