|
@@ -123,7 +123,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
CurrentNode one=this.tec.getCurrentNode();
|
|
|
Long id =one.getId();
|
|
|
Long primaryKeyId=one.getPkId();
|
|
|
-// tec.constantMap=tec.getConstantMap();
|
|
|
tec.formDataList=list;
|
|
|
tec.constantMap.put("contractId",contractId);
|
|
|
keyWord(tec.constantMap);
|
|
@@ -193,19 +192,37 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
public FormulaDataBlock findFdb(){
|
|
|
- AppWbsTreeContractVO one =tec.getTableAll().get(0);
|
|
|
- List<String> ancestor=new ArrayList<>(Arrays.asList(one.getAncestors().split(",")));
|
|
|
- Collections.reverse(ancestor);
|
|
|
- FormulaDataBlock fdb= this.formulaDataBlockService.queryOption(Long.parseLong(one.getContractId()),Long.parseLong(ancestor.get(1)),0);
|
|
|
+ /*查找第一个包含分项评定子节点的父节点*/
|
|
|
+ Long ancestor=findFirstParentId();
|
|
|
+ FormulaDataBlock fdb= this.formulaDataBlockService.queryOption(tec.getContractId(),ancestor,0);
|
|
|
if(fdb==null){
|
|
|
fdb=new FormulaDataBlock();
|
|
|
fdb.setContractId(tec.getContractId());
|
|
|
- fdb.setSwId(Long.parseLong(ancestor.get(1)));
|
|
|
+ fdb.setSwId(ancestor);
|
|
|
fdb.setType(0);
|
|
|
fdb.setVal("[]");
|
|
|
}
|
|
|
return fdb;
|
|
|
}
|
|
|
+
|
|
|
+ public Long findFirstParentId(){
|
|
|
+ int max=10;
|
|
|
+ int loop=0;
|
|
|
+ Long parentId= tec.getCurrentNode().getParentId();
|
|
|
+ while (loop<max&&StringUtils.isNotEquals(0,parentId)){
|
|
|
+ List<WbsTreeContract> list= this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId,tec.getContractId()).eq(WbsTreeContract::getParentId,parentId));
|
|
|
+ if(list.stream().anyMatch(e->StringUtils.isEquals(2,e.getMajorDataType()))){
|
|
|
+ loop=10;
|
|
|
+ }else{
|
|
|
+ /*往上一层找*/
|
|
|
+ WbsTreeContract next= this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId,tec.getContractId()).eq(WbsTreeContract::getId,parentId));
|
|
|
+ parentId=next.getParentId();
|
|
|
+ }
|
|
|
+ loop++;
|
|
|
+ }
|
|
|
+ return parentId;
|
|
|
+ }
|
|
|
+
|
|
|
public void assessmentForm(){
|
|
|
if(tec.getTableAll().stream().anyMatch(e->StringUtils.isEquals(e.getTableType(),5))){
|
|
|
/*评定节点*/
|
|
@@ -217,11 +234,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
String eName=e.getEName();
|
|
|
if(eName.contains("实测")&&!eName.contains("平均")&&!eName.contains("率")&&!eName.contains("判")){
|
|
|
String point =FormulaUtils.parseItemName(eName);
|
|
|
+ /*评定匹配检验单的元素用相似匹配*/
|
|
|
Measurement measurement = itemsMap.computeIfAbsent(point,k->new Measurement(point));
|
|
|
measurement.setValue(e);
|
|
|
}
|
|
|
});
|
|
|
if(itemsMap.size()>0){
|
|
|
+ /*表内用同行匹配*/
|
|
|
tec.getFormDataMap().values().stream()
|
|
|
.filter(v -> v.getEName().contains("率") || v.getEName().contains("判"))
|
|
|
.forEach(v -> {
|