|
@@ -498,6 +498,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
return integer > 0;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Param [id 表, nodeId 工序, type 1:WBS 0:项目]
|
|
|
+ **/
|
|
|
@Override
|
|
|
public List<WbsFormElementVO> selectFormElements(String id, String nodeId, Integer type) {
|
|
|
List<WbsFormElementVO> wbsFormElements = wbsTreeMapper.selectFormElements(id);
|
|
@@ -517,7 +521,19 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
/*TYPE==1就是WBS级别*/
|
|
|
Integer scopeA = com.mixsmart.utils.StringUtils.isEquals(type, 1) ? FormulaBean.WBS_GLOBAL : FormulaBean.PRO_GLOBAL;
|
|
|
Integer scopeB = com.mixsmart.utils.StringUtils.isEquals(type, 1) ? FormulaBean.WBS_PART : FormulaBean.PRO_PART;
|
|
|
- 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=" + scopeA, Long.class);
|
|
|
+ String sqlTmp;
|
|
|
+ WbsTreePrivate treePrivate;
|
|
|
+ WbsTree wbsTree;
|
|
|
+ if (com.mixsmart.utils.StringUtils.isEquals(type, 1)){
|
|
|
+ wbsTree =this.wbsTreeMapper.selectById(nodeId);
|
|
|
+ sqlTmp="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.wbs_id="+wbsTree.getWbsId()+" and b.scope=" + scopeA;
|
|
|
+ }else if (com.mixsmart.utils.StringUtils.isEquals(type, 0)){
|
|
|
+ treePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodeId));
|
|
|
+ sqlTmp="select a.id from m_wbs_form_element a inner join m_element_formula_mapping b on a.id=b.element_id join m_wbs_tree_private c on c.parent_id=b.node_id where a.id in(" + elementIds + ") and c.project_id="+treePrivate.getProjectId()+" and b.scope=" + scopeA;
|
|
|
+ }else{
|
|
|
+ sqlTmp="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=" + scopeA;
|
|
|
+ }
|
|
|
+ List<Long> longs = this.jdbcTemplate.queryForList(sqlTmp, Long.class);
|
|
|
wbsFormElements.forEach(e -> {
|
|
|
e.setGlobalFormula(longs.contains(e.getId()) ? 1 : 0);
|
|
|
});
|
|
@@ -525,10 +541,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
if (com.mixsmart.utils.StringUtils.isEquals(type, 1)) {
|
|
|
sql = "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=" + scopeB + " and c.element_id in(" + elementIds + ")";
|
|
|
} else if (com.mixsmart.utils.StringUtils.isEquals(type, 0)) {
|
|
|
- WbsTreePrivate treePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, id));
|
|
|
- sql = "select c.element_id from m_wbs_tree_private 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.p_key_id=" + id + " and c.scope=" + scopeB + " and c.element_id in(" + elementIds + ") and c.project_id=" + treePrivate.getProjectId();
|
|
|
+ treePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, id));
|
|
|
+ sql = "select c.element_id from m_wbs_tree_private a INNER JOIN m_element_formula_mapping c on a.parent_id=c.node_id where a.p_key_id=" + id + " and c.scope=" + scopeB + " and c.element_id in(" + elementIds + ") and c.project_id=" + treePrivate.getProjectId();
|
|
|
} else if (com.mixsmart.utils.StringUtils.isEquals(type, 3)) {
|
|
|
- WbsTreePrivate treePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodeId));
|
|
|
+ treePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodeId));
|
|
|
sql = "select c.element_id from m_wbs_tree_private 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.p_key_id=" + id + " and c.scope=35 and c.element_id in(" + elementIds + ") and c.project_id=" + treePrivate.getProjectId();
|
|
|
} else {
|
|
|
sql = "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=35 and c.element_id in(" + elementIds + ")";
|