|
@@ -512,18 +512,18 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
FormulaUtils.write(t.getJudge(), "合格", false);
|
|
|
}
|
|
|
// itemBlockList.sort(Comparator.comparingInt(a -> ids.indexOf(a.getPkeyId())));
|
|
|
- List<String> values;
|
|
|
+ Set<String> values;
|
|
|
Predicate<String> predicate = s -> Pattern.matches("^[,]*$", s);
|
|
|
if (itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().flatMap(Collection::stream)).map(Func::toStr).anyMatch(CustomFunction::containsZH)) {
|
|
|
- values = itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().map(l -> l.stream().map(Func::toStr).collect(Collectors.joining(","))).filter(predicate.negate()).distinct().flatMap(s -> Arrays.stream(s.split(",")))).collect(Collectors.toList());
|
|
|
+ values = itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().map(l -> l.stream().map(Func::toStr).collect(Collectors.joining(","))).filter(predicate.negate()).distinct().flatMap(s -> Arrays.stream(s.split(",")))).collect(Collectors.toSet());
|
|
|
} else {
|
|
|
- values = itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().flatMap(Collection::stream)).map(Func::toStr).collect(Collectors.toList());
|
|
|
+ values = itemBlockList.stream().map(ItemBlock::getData).flatMap(v -> v.stream().flatMap(Collection::stream)).map(Func::toStr).collect(Collectors.toSet());
|
|
|
}
|
|
|
if (t.getPoint().contains("榀数")) {
|
|
|
if (values.size() > 0) {
|
|
|
double x = values.stream().mapToDouble(Double::parseDouble).sum() / 3.0;
|
|
|
if (x != 0) {
|
|
|
- values = Collections.singletonList(StringUtils.number2String(x, 0));
|
|
|
+ values = Collections.singleton(StringUtils.number2String(x, 0));
|
|
|
}
|
|
|
}
|
|
|
}
|