|
@@ -74,13 +74,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
|
private final IWbsTreePrivateService wbsTreePrivateService;
|
|
|
private final IElementFormulaMappingService elementFormulaMappingService;
|
|
|
- private final IWbsTreeService wbsTreeService;
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
private final IFormulaOptionService formulaOptionService;
|
|
|
private final ITextdictInfoService textDictInfoService;
|
|
|
private final IFormulaDataBlockService formulaDataBlockService;
|
|
|
private final IExcelTabService excelTabService;
|
|
|
- private final IWbsInfoService wbsInfoService;
|
|
|
|
|
|
private TableElementConverter tec;
|
|
|
public final static String WP="WP";
|
|
@@ -101,8 +99,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
public final static String E="E";
|
|
|
/*公式参数*/
|
|
|
public final static String FMOT="OP";
|
|
|
- /**表单信息*/
|
|
|
- public final static String TEXT_INFO_MAP="textInfoMap";
|
|
|
|
|
|
|
|
|
|
|
@@ -157,9 +153,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
|
|
|
List<WbsTreeContract> nodes = wpService.tracing(one.getPkId());
|
|
|
- if (Func.isEmpty(nodes)) {
|
|
|
- this.tec.getLog().append("【WBS信息缺失】");
|
|
|
- }
|
|
|
+
|
|
|
tec.constantMap.put(CHAIN,nodes.stream().map(e->StringUtils.isNotEmpty(e.getFullName())?e.getFullName():e.getNodeName()).collect(Collectors.toList()));
|
|
|
/*节点参数*/
|
|
|
tec.constantMap.put(WP,getWpMap(one));
|
|
@@ -196,7 +190,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
missingFill(missingList);
|
|
|
if(Func.isNotEmpty(missingList)){
|
|
|
- tec.getLog().append("【没有能加载的跨节点数据:").append(missingList.stream().map(e->e.replaceAll("'","")).collect(Collectors.joining(","))).append("】");
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ missingList.stream().collect(Collectors.groupingBy(s->s.split(StringPool.COLON)[0])).forEach((k,v)->{
|
|
|
+ sb.append(k).append("(").append(v.stream().map(c->c.split(StringPool.COLON)[1]).collect(Collectors.joining(","))).append(")");
|
|
|
+ });
|
|
|
+ tec.getLog().put(FormulaLog.CROSS,sb.toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -464,7 +462,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
one.setEName(name);
|
|
|
return one;
|
|
|
}
|
|
|
- this.tec.getLog().append("【").append(name).append(code).append("定位信息不存在】");
|
|
|
+ this.tec.getLog().put(FormulaLog.POSITION,code+"("+name+")");
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
@@ -501,7 +499,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
logMap.put(p.getK(),p.getName());
|
|
|
}
|
|
|
}
|
|
|
- this.tec.getLog().append("【本节点参数情况:").append(result.entrySet().stream().map(p->logMap.get(p.getKey())+":"+p.getValue()).collect(Collectors.joining(";"))).append("】");
|
|
|
+ this.tec.getLog().put(FormulaLog.PARAM,result.entrySet().stream().map(p->logMap.get(p.getKey())+":"+p.getValue()).collect(Collectors.joining(";")));
|
|
|
/*元素动态绑定*/
|
|
|
Map<String,Formula> formulaIdMap = this.wpService.formulaKeyMap(total.stream().map(WbsParam::getK).collect(Collectors.toList()));
|
|
|
/**查找无绑定公式且单元格只有一个的当前表单元素*/
|
|
@@ -667,7 +665,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
formulaStrategyFactory.execute(fd,tec);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
- tec.getLog().append("【特殊公式:").append(fd.getEName()).append(fd.getFormula().getNumber()).append("执行异常】");
|
|
|
+ tec.getLog().put(FormulaLog.CALC,fd.getCode()+"("+fd.getEName()+"公式id"+fd.getFormula().getId()+")");
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
@@ -754,7 +752,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
});
|
|
|
if(ele.size()<relyList.size()){
|
|
|
- this.tec.getLog().append("【").append(fd.getEName()).append(fd.getFormula().getFormula().replaceAll("'", "")).append("不满足执行依赖】");
|
|
|
+ this.tec.getLog().put(FormulaLog.RELY,fd.getCode()+"@"+fd.getEName()+"@"+fd.getFormula().getFormula().replaceAll("'", ""));
|
|
|
}
|
|
|
if(fd.getCoordsList().size()>1&&f.split("[/+\\-*]").length>1){
|
|
|
LinkedHashMap<String,FormData> fdMap =new LinkedHashMap<>();
|
|
@@ -827,7 +825,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
write(fd,data);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
- tec.getLog().append("【").append(fd.getEName()).append("计算错误】 ");
|
|
|
+ e.printStackTrace();
|
|
|
+ tec.getLog().put(FormulaLog.CALC,fd.getEName()+"("+formula+")");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -861,7 +860,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
boolean pd=tec.getTableAll().stream().anyMatch(e->e.getTableType().equals(5));
|
|
|
WbsTreePrivate sub = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().and(e->e.eq(WbsTreePrivate::getNodeName, pd?"质量检验评定表(附表)":"质量检验表(附表)").or().eq(WbsTreePrivate::getFullName, pd?"质量检验评定表(附表)":"质量检验表(附表)")).eq(WbsTreePrivate::getProjectId, tec.getProjectId()).eq(WbsTreePrivate::getIsLinkTable,2));
|
|
|
if (sub == null) {
|
|
|
- this.tec.getLog().append("该项目没有挂有附表信息");
|
|
|
+ this.tec.getLog().put(FormulaLog.SUB_TAB,"该项目没有挂有附表信息");
|
|
|
} else {
|
|
|
this.wbsTreePrivateService.addWbsTreeContractInfo(this.tec.getCurrentNode().getPkId().toString(), sub.getPKeyId().toString(), tec.getContractId());
|
|
|
NodeTable one = this.tec.getTableAll().get(0);
|
|
@@ -978,7 +977,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- this.tec.getLog().append("【").append("附表异常").append("】");
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
@@ -1699,7 +1697,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
formula.setFormula(f);
|
|
|
}catch (Exception e){
|
|
|
- tec.getLog().append(e.getMessage());
|
|
|
+ tec.getLog().put(FormulaLog.OTHER,e.getMessage());
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
@@ -1707,7 +1705,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
|
|
|
public Map<String,Object> createCurrentMap(String el){
|
|
|
- Map<String,Object> currentMap= new HashMap<String,Object>(tec.constantMap);
|
|
|
+ Map<String,Object> currentMap= new HashMap<>(tec.constantMap);
|
|
|
List<FormData> fds= getFormDataByCode(String.join(",", getCodeByEl(el)));
|
|
|
if(Func.isNotEmpty(fds)){
|
|
|
Map<String,Object> Em= (Map<String, Object>) currentMap.computeIfAbsent(E, k->new HashMap<String,Object>());
|