|
@@ -319,11 +319,11 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
});
|
|
|
|
|
|
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_formula b on a.id=b.element_id where a.id in("+elementIds+")",Long.class);
|
|
|
+ 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 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.node_id=(select parent_id from m_wbs_tree where id ="+id+")",Long.class);
|
|
|
+ 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);
|
|
|
});
|