Commit 7aea0602 authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents f3afdc1c 310468b7
...@@ -183,12 +183,11 @@ public class CitReportServiceImpl extends BaseService { ...@@ -183,12 +183,11 @@ public class CitReportServiceImpl extends BaseService {
@Override @Override
public void run() { public void run() {
try { try {
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
// TODO 进行数据校验 // TODO 进行数据校验
DataValidation(periodParam, projectId, genJob); DataValidation(periodParam, projectId, genJob);
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam, PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
templates.stream().map(Template::getId).collect(Collectors.toList())); templates.stream().map(Template::getId).collect(Collectors.toList()));
......
...@@ -361,6 +361,9 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -361,6 +361,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
Row row = temp.getRow(j); Row row = temp.getRow(j);
for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){ for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if (cell == null) {
continue;//todo cell == null 如何处理
}
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
if(!cell.getCellStyle().getLocked() && "${KeyIn}".equalsIgnoreCase(cell.getStringCellValue())){ if(!cell.getCellStyle().getLocked() && "${KeyIn}".equalsIgnoreCase(cell.getStringCellValue())){
cell.setCellValue(""); cell.setCellValue("");
......
...@@ -174,7 +174,7 @@ public class FormulaAgent { ...@@ -174,7 +174,7 @@ public class FormulaAgent {
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) throws Exception { public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) throws Exception {
String sql = "select " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue; String sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period)); String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod()); String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1)); String per = insertZero((formulaContext.getPeriod() - 1));
...@@ -183,13 +183,13 @@ public class FormulaAgent { ...@@ -183,13 +183,13 @@ public class FormulaAgent {
sql += " and tms_period = " + Integer.parseInt(year + _period); sql += " and tms_period = " + Integer.parseInt(year + _period);
} else if (period == -99) { } else if (period == -99) {
sql += " and tms_period between " + Integer.parseInt(year+"01") + " and " + Integer.parseInt(year + per); sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + per);
} else if (period == 99) { } else if (period == 99) {
sql += " and tms_period between " + Integer.parseInt(year+"01") + " and " + Integer.parseInt(year + _period); sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + _period);
} else { } else {
if (period > 0) if (period > 0)
throw new Exception("参数不正确"); throw new Exception("参数不正确");
sql += " and tms_period between " + Integer.parseInt(year + _p )+ " and " + Integer.parseInt(year + per); sql += " and tms_period between " + Integer.parseInt(year + _p) + " and " + Integer.parseInt(year + per);
} }
} }
if (bool) if (bool)
...@@ -218,16 +218,28 @@ public class FormulaAgent { ...@@ -218,16 +218,28 @@ public class FormulaAgent {
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, "2018", formulaContext); formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, "2018", formulaContext);
} }
public double getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) { public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
List<Map<String, Object>> stringObjectMap = jdbcTemplate.queryForList(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext)); Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
double rev = 0.00; /* for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) { if (i == 1) {
if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
rev = 0.00;
}else{
rev = Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)))); rev = Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
}
} else { } else {
if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
rev= rev+ 0.00;
}else{
rev = rev + Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)))); rev = rev + Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
} }
} }
return rev; }
*/
if(stringObjectMap.get(getField) != null ){
return new BigDecimal(stringObjectMap.get(getField).toString());
}
return new BigDecimal(0);
} }
} }
...@@ -513,7 +513,7 @@ public class ReportGeneratorImpl { ...@@ -513,7 +513,7 @@ public class ReportGeneratorImpl {
new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext) new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext), , new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new SUM2(formulaContext), new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new SUM2(formulaContext),
new SUM(formulaContext), new RSUMIF(formulaContext), new TABLESUMIF(formulaContext)}; new RSUMIF(formulaContext), new TABLESUMIF(formulaContext), new SUM(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls); UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs); UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack); workbook.addToolPack(udfToolpack);
......
...@@ -56,7 +56,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction { ...@@ -56,7 +56,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
String filterValue =resolverString(args, ec, 3); String filterValue =resolverString(args, ec, 3);
period = resolverInteger(args, ec, 4);//会计期间 period = resolverInteger(args, ec, 4);//会计期间
year = resolverString(args, ec, 5);//会计年度 year = resolverString(args, ec, 5);//会计年度
new NumberEval(agent.getTableDataByName(tableName, getField,filter,filterValue, period, year, formulaContext)); new NumberEval(agent.getTableDataByName(tableName, getField,filter,filterValue, period, year, formulaContext).doubleValue());
} catch (EvaluationException e) { } catch (EvaluationException e) {
e.printStackTrace(); e.printStackTrace();
return new NumberEval(0.00); return new NumberEval(0.00);
......
...@@ -642,7 +642,9 @@ debugger; ...@@ -642,7 +642,9 @@ debugger;
} }
var getInitTaskStatus = function(){ var getInitTaskStatus = function(){
debugger;
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) { citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) {
debugger;
if(result.data && result.status == 200){ if(result.data && result.status == 200){
updateTasksStatus(result.data); updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){ if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
......
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