Commit 2c4b4601 authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo3' into 'dev'

Dev neo3

See merge request root/atms!103
parents d66688cf 44e9ea72
...@@ -16,7 +16,6 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -16,7 +16,6 @@ public interface FormulaAdminMapper extends MyMapper {
" cell_template.ID AS cellTemplateID, " + " cell_template.ID AS cellTemplateID, " +
" template.ID AS reportTemplateID, " + " template.ID AS reportTemplateID, " +
" template.template_group_id AS reportTemplateGroupID, " + " template.template_group_id AS reportTemplateGroupID, " +
" cell_template_config.formula AS formula, " +
" cell_template.row_index AS rowIndex, " + " cell_template.row_index AS rowIndex, " +
" cell_template.column_index AS columnIndex, " + " cell_template.column_index AS columnIndex, " +
" template.Code AS reportCode, " + " template.Code AS reportCode, " +
...@@ -27,11 +26,8 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -27,11 +26,8 @@ public interface FormulaAdminMapper extends MyMapper {
" template " + " template " +
" JOIN " + " JOIN " +
" cell_template ON template.id = cell_template.report_template_id " + " cell_template ON template.id = cell_template.report_template_id " +
" JOIN " +
" cell_template_config ON cell_template.id = cell_template_config.cell_template_id " +
"WHERE " + "WHERE " +
" cell_template_config.data_source_type = 1 " + " template.template_group_id = #{groupId}")
" AND template.template_group_id = #{groupId}")
List<CellTemplatePerGroupDto> getCellTemplatePerGroupDto(@Param("groupId") Long groupId); List<CellTemplatePerGroupDto> getCellTemplatePerGroupDto(@Param("groupId") Long groupId);
......
...@@ -9,7 +9,6 @@ public class CellTemplatePerGroupDto { ...@@ -9,7 +9,6 @@ public class CellTemplatePerGroupDto {
private String cellTemplateID ; private String cellTemplateID ;
private String reportTemplateID ; private String reportTemplateID ;
private String reportTemplateGroupID ; private String reportTemplateGroupID ;
private String formula ;
private int rowIndex ; private int rowIndex ;
private int columnIndex ; private int columnIndex ;
private String reportCode ; private String reportCode ;
......
package pwc.taxtech.atms.vat.entity; package pwc.taxtech.atms.vat.entity;
import java.math.BigDecimal;
public class PCTEntity { public class PCTEntity {
Integer period; Integer period;
Long cellTemplateId; Long cellTemplateId;
BigDecimal data; String data;
public PCTEntity() { public PCTEntity() {
} }
...@@ -44,11 +42,11 @@ public class PCTEntity { ...@@ -44,11 +42,11 @@ public class PCTEntity {
this.cellTemplateId = cellTemplateId; this.cellTemplateId = cellTemplateId;
} }
public BigDecimal getData() { public String getData() {
return data; return data;
} }
public void setData(BigDecimal data) { public void setData(String data) {
this.data = data; this.data = data;
} }
} }
...@@ -363,7 +363,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -363,7 +363,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
data = EMPTY; data = EMPTY;
} }
if(StringUtils.isNotBlank(data)) { if (StringUtils.isNotBlank(data)) {
Pattern pattern = Pattern.compile("[0-9.]*"); Pattern pattern = Pattern.compile("[0-9.]*");
Matcher isNum = pattern.matcher(data); Matcher isNum = pattern.matcher(data);
if (isNum.matches()) { if (isNum.matches()) {
...@@ -371,8 +371,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -371,8 +371,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
} else { } else {
cellData.setData(data); cellData.setData(data);
} }
} } else {
else{
cellData.setData(data); cellData.setData(data);
} }
...@@ -585,7 +584,14 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -585,7 +584,14 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List<PCTEntity> pctResults = cellDataMapper.queryByPCTs(parameter); List<PCTEntity> pctResults = cellDataMapper.queryByPCTs(parameter);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>(); Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> { 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) -> { 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