|
@@ -518,18 +518,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));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1483,7 +1483,27 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
//终止判断
|
|
|
List<ElementData> elementData = collect.get(value.getY());
|
|
|
- long count = elementData.stream().filter(e -> e.getValue().equals(split[8])).count();
|
|
|
+ long count = 0;
|
|
|
+ switch (split[7]) {
|
|
|
+ case "=":
|
|
|
+ count = elementData.stream().filter(e -> e.getValue().equals(split[8])).count();
|
|
|
+ break;
|
|
|
+ case ">":
|
|
|
+ count = elementData.stream().filter(e -> Integer.parseInt(e.getValue().toString()) > Integer.parseInt(split[8])).count();
|
|
|
+ break;
|
|
|
+ case "<":
|
|
|
+ count = elementData.stream().filter(e -> Integer.parseInt(e.getValue().toString()) < Integer.parseInt(split[8])).count();
|
|
|
+ break;
|
|
|
+ case ">=":
|
|
|
+ count = elementData.stream().filter(e -> Integer.parseInt(e.getValue().toString()) >= Integer.parseInt(split[8])).count();
|
|
|
+ break;
|
|
|
+ case "<=":
|
|
|
+ count = elementData.stream().filter(e -> Integer.parseInt(e.getValue().toString()) <= Integer.parseInt(split[8])).count();
|
|
|
+ break;
|
|
|
+ case "!=":
|
|
|
+ count = elementData.stream().filter(e -> !e.getValue().equals(split[8])).count();
|
|
|
+ break;
|
|
|
+ }
|
|
|
if (stop) {
|
|
|
value.setValue("");
|
|
|
if (attachData != null) {
|
|
@@ -5933,7 +5953,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
value = action[1];
|
|
|
break;
|
|
|
}
|
|
|
- Expression parse = Expression.parse(s.replaceAll("=","==") + "?1:0");
|
|
|
+ Expression parse = Expression.parse(s + "?1:0");
|
|
|
Object data = parse.calculate(currentMap);
|
|
|
if(Objects.equals("1",String.valueOf(data))){
|
|
|
key = action[0];
|
|
@@ -6057,9 +6077,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if(Objects.equals("≠",s1)){
|
|
|
s1 = "!=";
|
|
|
}
|
|
|
- if(Objects.equals("=",s1)){
|
|
|
- s1 = "==";
|
|
|
- }
|
|
|
if(Objects.equals("<",s1)){
|
|
|
s1 = "<";
|
|
|
}
|