Browse Source

公式相关:合格率计算兼容

yangyj 1 year ago
parent
commit
a05c94c1f8

+ 1 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java

@@ -308,7 +308,7 @@ public class CustomFunction {
 	public static Object count(Object data) {
 		List<Object> list=obj2ListNe(data);
 		if(ListUtils.isNotEmpty(list)){
-			if(list.stream().anyMatch(e->StringUtils.handleNull(e).contains(":"))){
+			if(list.stream().anyMatch(e->!StringUtils.isNumber(e))){
 				return list.stream().filter(StringUtils::isNotEmpty).count();
 			}
 			return   list.stream().filter(StringUtils::isNumber).map(StringUtils::handleNull).mapToDouble(Double::parseDouble).count();

+ 0 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -791,12 +791,6 @@ public  List<ElementData> setScale(Integer scale,List<ElementData> data){
                 if(fd.getFormula()!=null&&!fd.empty()&&fd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isDouble)){
                     Formula f = fd.getFormula();
                     fd.setValues(setScale(f.getScale(),fd.getValues()));
-//                    Integer scale =f.getScale();
-//                    if(scale==null){
-//                        scale=2;
-//                    }
-//                    Integer finalScale = scale;
-//                    fd.setValues(fd.getValues().stream().peek(e->{if(StringUtils.isDouble(e.getValue())){e.setValue(StringUtils.number2String(e.getValue(),finalScale));}}).collect(Collectors.toList()));
                 }
             }
         }