|
@@ -317,17 +317,17 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
elements.setEAllowDeviation(escapeChar);
|
|
elements.setEAllowDeviation(escapeChar);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
String elementIds = wbsFormElements.stream().map(WbsFormElement::getId).map(String::valueOf).collect(Collectors.joining(","));
|
|
String elementIds = wbsFormElements.stream().map(WbsFormElement::getId).map(String::valueOf).collect(Collectors.joining(","));
|
|
- List<Long> longs= this.jdbcTemplate.queryForList("select a.id from m_wbs_form_element a inner join m_element_formula_mapping b on a.id=b.element_id where a.id in("+elementIds+") and b.scope=1",Long.class);
|
|
|
|
- wbsFormElements.forEach(e->{
|
|
|
|
- e.setGlobalFormula(longs.contains(e.getId())?1:0);
|
|
|
|
- });
|
|
|
|
- List<Long> longs2= this.jdbcTemplate.queryForList("select c.element_id from m_wbs_tree a INNER JOIN m_wbs_tree b on a.parent_id=b.id INNER JOIN m_element_formula_mapping c on b.id=c.node_id where a.id="+id+" and c.scope=10 and c.element_id in("+elementIds+")",Long.class);
|
|
|
|
- wbsFormElements.forEach(e->{
|
|
|
|
- e.setIsSaveFormula(longs2.contains(e.getId())?1:0);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ if(Func.isNotEmpty(elementIds)) {
|
|
|
|
+ List<Long> longs = this.jdbcTemplate.queryForList("select a.id from m_wbs_form_element a inner join m_element_formula_mapping b on a.id=b.element_id where a.id in(" + elementIds + ") and b.scope=1", Long.class);
|
|
|
|
+ wbsFormElements.forEach(e -> {
|
|
|
|
+ e.setGlobalFormula(longs.contains(e.getId()) ? 1 : 0);
|
|
|
|
+ });
|
|
|
|
+ List<Long> longs2 = this.jdbcTemplate.queryForList("select c.element_id from m_wbs_tree a INNER JOIN m_wbs_tree b on a.parent_id=b.id INNER JOIN m_element_formula_mapping c on b.id=c.node_id where a.id=" + id + " and c.scope=10 and c.element_id in(" + elementIds + ")", Long.class);
|
|
|
|
+ wbsFormElements.forEach(e -> {
|
|
|
|
+ e.setIsSaveFormula(longs2.contains(e.getId()) ? 1 : 0);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
return wbsFormElements;
|
|
return wbsFormElements;
|
|
}
|
|
}
|
|
|
|
|