|
@@ -287,9 +287,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if (g != null) {
|
|
|
List<ItemBlock> itemBlockList = g.getList();
|
|
|
int originSize = itemBlockList.size();
|
|
|
- /*过滤方法有问题*/
|
|
|
-// List<Long> ids = this.jdbcTemplate.queryForList("select b.p_key_id from m_wbs_tree_contract a join m_wbs_tree_contract b on (a.parent_id=b.parent_id and a.contract_id=b.contract_id) where a.p_key_id=" + tec.getCurrentNode().getPkId() + " and b.is_deleted=0 and b.node_type=6", Long.class);
|
|
|
-// itemBlockList.removeIf(ik -> !ids.contains(ik.getPkeyId()));
|
|
|
+ List<Long> ids =getNodeType46().stream().map(CurrentNode::getId).collect(Collectors.toList());
|
|
|
+ /*清除那些已经不存在的工序*/
|
|
|
+ itemBlockList.removeIf(ik -> !ids.contains(ik.getPkeyId()));
|
|
|
if (itemBlockList.size() > 0) {
|
|
|
int total = itemBlockList.stream().mapToInt(ItemBlock::getSubTotal).sum();
|
|
|
int passNum = itemBlockList.stream().mapToInt(ItemBlock::getSubPass).sum();
|
|
@@ -302,7 +302,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
List<String> values = itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().flatMap(Collection::stream)).map(Object::toString).collect(Collectors.toList());
|
|
|
int scale = StringUtils.getScale(values);
|
|
|
FormulaUtils.write(t.getValue(), values.stream().map(u -> StringUtils.number2String(u, scale)).collect(Collectors.toList()), true);
|
|
|
-
|
|
|
// if(t.getValue().getEName().contains("±")){
|
|
|
// /*存在偏差范围则获取的是偏差值:实测-设计*/
|
|
|
// FormulaUtils.write(t.getValue(),itemBlockList.stream().flatMap(b->{
|
|
@@ -339,7 +338,15 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ public List<CurrentNode> getNodeType46(){
|
|
|
+ if(tec.getCurrentNode().getDivisional().size()==0){
|
|
|
+ List<Map<String,Object>> listMaps=this.jdbcTemplate.queryForList("select b.p_Key_id pkId,b.id from m_wbs_tree_contract a join m_wbs_tree_contract b on (a.contract_id=b.contract_id and b.ancestors like CONCAT(a.ancestors,'%')) where a.p_key_id="+tec.getCurrentNode().getPkId()+" and b.is_deleted=0 and b.node_type=6 ORDER BY b.sort");
|
|
|
+ if(listMaps.size()>0){
|
|
|
+ tec.getCurrentNode().getDivisional().addAll(listMaps.stream().map(m->BeanUtil.toBean(m,CurrentNode.class)).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tec.getCurrentNode().getDivisional();
|
|
|
+ }
|
|
|
|
|
|
public void missingFill(List<String> missingList){
|
|
|
/*数据池里面没有任何元素匹配和当前依赖匹配*/
|
|
@@ -1080,17 +1087,17 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
eb.getList().remove(targetItem);
|
|
|
}
|
|
|
}
|
|
|
-// if(c.executable()){
|
|
|
-// /*主要是获取实测值,合格率,合格数量*/
|
|
|
-// List<String> relyCode = c.getFormula().getRelyList();
|
|
|
-// if(Func.isNotEmpty(relyCode)){
|
|
|
-// List<FormData> designList= tec.getFormDataMap().values().stream().filter(t->relyCode.contains(t.getCode())&&t.getEName().contains("设计")).collect(Collectors.toList());
|
|
|
-// if(designList.size()>0){
|
|
|
-// FormData design =designList.get(0);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ /* if(c.executable()){
|
|
|
+ *//*主要是获取实测值,合格率,合格数量*//*
|
|
|
+ List<String> relyCode = c.getFormula().getRelyList();
|
|
|
+ if(Func.isNotEmpty(relyCode)){
|
|
|
+ List<FormData> designList= tec.getFormDataMap().values().stream().filter(t->relyCode.contains(t.getCode())&&t.getEName().contains("设计")).collect(Collectors.toList());
|
|
|
+ if(designList.size()>0){
|
|
|
+ FormData design =designList.get(0);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
});
|
|
|
fdb.setVal(JSON.toJSONString(elementBlockList));
|
|
|
this.formulaDataBlockService.saveOrUpdate(fdb);
|