|
@@ -221,19 +221,21 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
@Override
|
|
@Override
|
|
public void formulaFillData(List<TableInfo> tableInfoList) {
|
|
public void formulaFillData(List<TableInfo> tableInfoList) {
|
|
StopWatch stopWatch = new StopWatch();
|
|
StopWatch stopWatch = new StopWatch();
|
|
- stopWatch.start("公式处理");
|
|
|
|
String ids =tableInfoList.stream().map(TableInfo::getPkeyId).collect(Collectors.joining(","));
|
|
String ids =tableInfoList.stream().map(TableInfo::getPkeyId).collect(Collectors.joining(","));
|
|
List<Map<String,Object>> list=this.jdbcTemplate.queryForList("SELECT a.p_key_id as nodeId,b.id as fieldId,b.e_key as field,c.init_table_name as tableName from m_wbs_tree_contract a LEFT JOIN m_wbs_form_element b on a.id=b.f_id left JOIN m_wbs_tree c on a.id=c.id where a.p_key_id in ("+ids+")");
|
|
List<Map<String,Object>> list=this.jdbcTemplate.queryForList("SELECT a.p_key_id as nodeId,b.id as fieldId,b.e_key as field,c.init_table_name as tableName from m_wbs_tree_contract a LEFT JOIN m_wbs_form_element b on a.id=b.f_id left JOIN m_wbs_tree c on a.id=c.id where a.p_key_id in ("+ids+")");
|
|
List<KeyMapper> keyMappers = JSON.parseArray(JSONArray.toJSONString(list), KeyMapper.class);
|
|
List<KeyMapper> keyMappers = JSON.parseArray(JSONArray.toJSONString(list), KeyMapper.class);
|
|
- List<Formula> formulas =this.formulaService.list(Wrappers.<Formula>lambdaQuery().in(Formula::getElementId,keyMappers.stream().map(KeyMapper::getFieldId).distinct().collect(Collectors.toList())));
|
|
|
|
- TableElementConverter tec= new TableElementConverter(tableInfoList,keyMappers,formulas);
|
|
|
|
- if(tec.isPresent()){
|
|
|
|
- tec.before();
|
|
|
|
- this.formulaService.execute(tec);
|
|
|
|
- tec.after();
|
|
|
|
|
|
+ if(Func.isNotEmpty(keyMappers)) {
|
|
|
|
+ stopWatch.start("公式处理");
|
|
|
|
+ List<Formula> formulas = this.formulaService.list(Wrappers.<Formula>lambdaQuery().in(Formula::getElementId, keyMappers.stream().map(KeyMapper::getFieldId).distinct().collect(Collectors.toList())));
|
|
|
|
+ TableElementConverter tec = new TableElementConverter(tableInfoList, keyMappers, formulas);
|
|
|
|
+ if (tec.isPresent()) {
|
|
|
|
+ tec.before();
|
|
|
|
+ this.formulaService.execute(tec);
|
|
|
|
+ tec.after();
|
|
|
|
+ }
|
|
|
|
+ stopWatch.stop();
|
|
|
|
+ StaticLog.info("{}", stopWatch);
|
|
}
|
|
}
|
|
- stopWatch.stop();
|
|
|
|
- StaticLog.info("{}",stopWatch);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|