|
|
@@ -1665,8 +1665,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}else {
|
|
|
List<NodeTable> subTabList = tec.getTableAll().stream().filter(e -> e.getNodeName().contains("附表") && (e.getTableType() == 1 || e.getTableType() == 5)).collect(Collectors.toList());
|
|
|
if(!subTabList.isEmpty()){
|
|
|
- List<Long> removeIds=subTabList.stream().map(e->e.getPKeyId()).collect(Collectors.toList());
|
|
|
- this.wbsTreeContractMapper.deleteLogicByIds(removeIds);
|
|
|
+ String queryIds = subTabList.stream().map(e -> e.getPKeyId() + "").collect(Collectors.joining(","));
|
|
|
+ // 如果不是系统自动生成的附表,则不删除。
|
|
|
+ List<Long> ids = jdbcTemplate.query("SELECT a.p_key_id from m_wbs_tree_contract a LEFT JOIN m_wbs_tree_private b on b.p_key_id = a.is_type_private_pid " +
|
|
|
+ "where a.is_deleted = 0 and (b.p_key_id is null or (b.is_deleted = 0 and b.is_link_table = 2 and b.type = 10 )) and a.p_key_id in ( " + queryIds +")", new SingleColumnRowMapper<>(Long.class));
|
|
|
+ if (!ids.isEmpty()) {
|
|
|
+ this.wbsTreeContractMapper.deleteLogicByIds(ids);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|