|
@@ -241,37 +241,32 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
});
|
|
|
if(itemsMap.size()>0){
|
|
|
/*表内用同行匹配*/
|
|
|
- tec.getFormDataMap().values().stream()
|
|
|
- .filter(v -> v.getEName().contains("率") || v.getEName().contains("判"))
|
|
|
- .forEach(v -> {
|
|
|
- itemsMap.values().stream()
|
|
|
- .filter(i -> i.getPass() == null || i.getJudge() == null)
|
|
|
- .filter(i -> {
|
|
|
- FormData vf = i.getValue();
|
|
|
- return vf != null && vf.getTableName().equals(v.getTableName()) && !vf.getCode().equals(v.getCode())&&FormulaUtils.similarity(v.getEName(),vf.getEName())>0.75;
|
|
|
- }).max(Comparator.comparingDouble((Measurement i)->FormulaUtils.similarity(v.getEName(),i.getValue().getEName())))
|
|
|
- .ifPresent(i->{
|
|
|
- if (v.getEName().contains("率") && i.getPass() == null) {
|
|
|
- i.setPass(v);
|
|
|
- } else if (v.getEName().contains("判") && i.getJudge() == null) {
|
|
|
- i.setJudge(v);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
+ List<FormData> primary = tec.getFormDataMap().values().stream().filter(v -> v.getEName().contains("率") || v.getEName().contains("判")).collect(Collectors.toList());
|
|
|
+ itemsMap.values().forEach(i->{
|
|
|
+ FormData vf = i.getValue();
|
|
|
+ primary.stream().filter(p->vf.getMaxRow().equals(p.getMaxRow()) && vf.getTableName().equals(p.getTableName())).forEach(t->{
|
|
|
+ if (t.getEName().contains("率") ) {
|
|
|
+ i.setPass(t);
|
|
|
+ } else if (t.getEName().contains("判")) {
|
|
|
+ i.setJudge(t);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
AtomicBoolean update= new AtomicBoolean(false);
|
|
|
itemsMap.values().stream().filter(Measurement::isMatching).forEach(t->{
|
|
|
ElementBlock g=null;
|
|
|
FormData vfd=t.getValue();
|
|
|
if(vfd.executable()&&vfd.getFormula().getRelyList()!=null){
|
|
|
List<String> relyList = vfd.getFormula().getRelyList();
|
|
|
+ /*先从公式去匹配*/
|
|
|
Optional<ElementBlock> op= elementBlockList.stream().filter(e->relyList.contains(e.getCode())).findAny();
|
|
|
if(op.isPresent()){
|
|
|
g=op.get();
|
|
|
}
|
|
|
}
|
|
|
if(g==null){
|
|
|
- Optional<ElementBlock> op= elementBlockList.stream().filter(w->FormulaUtils.similarity(w.getEName(),t.getPoint())>0.6).reduce((a, b) -> Comparator.<Double>reverseOrder().compare(FormulaUtils.similarity(a.getEName(),t.getPoint()), FormulaUtils.similarity(b.getEName(),t.getPoint())) <= 0 ? a : b);
|
|
|
+ Optional<ElementBlock> op= elementBlockList.stream().filter(w->FormulaUtils.similarity(w.getEName(),t.getPoint())>0.6).max(Comparator.comparingDouble((ElementBlock b)->FormulaUtils.similarity(b.getEName(),t.getPoint())));
|
|
|
+ /*相似匹配*/
|
|
|
if(op.isPresent()){
|
|
|
g=op.get();
|
|
|
}
|
|
@@ -285,9 +280,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
int total=itemBlockList.stream().mapToInt(ItemBlock::getSubTotal).sum();
|
|
|
int passNum=itemBlockList.stream().mapToInt(ItemBlock::getSubPass).sum();
|
|
|
double passRate=100*(double)passNum/(double) total;
|
|
|
- FormulaUtils.write(t.getPass(),StringUtils.number2String(passRate,1),null);
|
|
|
+ FormulaUtils.write(t.getPass(),StringUtils.number2String(passRate,1),false);
|
|
|
if(passRate>=60){
|
|
|
- FormulaUtils.write(t.getJudge(),"合格",null);
|
|
|
+ FormulaUtils.write(t.getJudge(),"合格",false);
|
|
|
}
|
|
|
itemBlockList.sort(Comparator.comparingInt(a->ids.indexOf(a.getPkeyId())));
|
|
|
List<String> values=itemBlockList.stream().map(ItemBlock::getData).flatMap(v->v.stream().flatMap(Collection::stream)).map(Object::toString).collect(Collectors.toList());
|