Commit 1c0d7ab7 authored by neo's avatar neo

[dev] set pct data bigDicimal 0 where get a invlalid value

parent d66688cf
package pwc.taxtech.atms.vat.entity;
import java.math.BigDecimal;
public class PCTEntity {
Integer period;
Long cellTemplateId;
BigDecimal data;
String data;
public PCTEntity() {
}
......@@ -44,11 +42,11 @@ public class PCTEntity {
this.cellTemplateId = cellTemplateId;
}
public BigDecimal getData() {
public String getData() {
return data;
}
public void setData(BigDecimal data) {
public void setData(String data) {
this.data = data;
}
}
......@@ -363,7 +363,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
data = EMPTY;
}
if(StringUtils.isNotBlank(data)) {
if (StringUtils.isNotBlank(data)) {
Pattern pattern = Pattern.compile("[0-9.]*");
Matcher isNum = pattern.matcher(data);
if (isNum.matches()) {
......@@ -371,8 +371,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
} else {
cellData.setData(data);
}
}
else{
} else {
cellData.setData(data);
}
......@@ -585,7 +584,14 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List<PCTEntity> pctResults = cellDataMapper.queryByPCTs(parameter);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> {
pctCache.put(m, m.getData());
BigDecimal data = null;
try {
data = new BigDecimal(m.getData());
} catch (NumberFormatException e) {
logger.warn("number format ecption for parameter {}", m);
data = BigDecimal.ZERO;
}
pctCache.put(m, data);
});
configMapToPCTs.forEach((k, v) -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment