|
@@ -1549,7 +1549,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
FormData dataFd=tec.formDataMap.get(codeList.get(0));
|
|
|
String designStr=codeList.get(1);
|
|
|
FormData designFd=tec.formDataMap.get(designStr);
|
|
|
- String devStr=StringUtils.isEmpty(formula.getDev())?formula.getDev():fd.getEAllowDeviation();
|
|
|
+ String devStr=StringUtils.isNotEmpty(formula.getDev())?formula.getDev():fd.getEAllowDeviation();
|
|
|
if(StringUtils.isEmpty(devStr)){
|
|
|
/*数据库找不到的情况就读取Excel*/
|
|
|
if(tec.wkbMap.isEmpty()){
|
|
@@ -1602,17 +1602,23 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
devStr="±100000";
|
|
|
}
|
|
|
/*设计值可以是数值类型,或空(等效0)*/
|
|
|
- if(dataFd!=null&&designFd!=null){
|
|
|
- if(dataFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isNotEmpty)&&(designFd.getValues().size()>1||designFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isEmpty))){
|
|
|
- /*多少个设计值暂时默认全部合格,满足绝大部分结果*/
|
|
|
- data=dataFd.getValues().stream().map(ElementData::getValue).filter(StringUtils::isNotEmpty).count();
|
|
|
- }else{
|
|
|
- List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),designFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),devStr,1 );
|
|
|
- data=result.get(1);
|
|
|
+ if(dataFd!=null){
|
|
|
+ List<Object> values= dataFd.getRawValue();
|
|
|
+ boolean nonNumeric=values.stream().filter(StringUtils::isNotEmpty).anyMatch(e->!StringUtils.isNumber(e));
|
|
|
+ if(nonNumeric){
|
|
|
+ data=values.stream().filter(StringUtils::isNotEmpty).count();
|
|
|
+ }else if(designFd!=null){
|
|
|
+ if(dataFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isNotEmpty)&&(designFd.getValues().size()>1||designFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isEmpty))){
|
|
|
+ /*多少个设计值暂时默认全部合格,满足绝大部分结果*/
|
|
|
+ data=dataFd.getValues().stream().map(ElementData::getValue).filter(StringUtils::isNotEmpty).count();
|
|
|
+ }else{
|
|
|
+ List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),designFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),devStr,1 );
|
|
|
+ data=result.get(1);
|
|
|
+ }
|
|
|
+ }else if(BaseUtils.isNumber(designStr)) {
|
|
|
+ List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()), 0, devStr, 1);
|
|
|
+ data = result.get(1);
|
|
|
}
|
|
|
- }else if(dataFd!=null&& BaseUtils.isNumber(designStr)){
|
|
|
- List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),0,devStr,1 );
|
|
|
- data=result.get(1);
|
|
|
}
|
|
|
}
|
|
|
f = f.replace(m.group(),putDataWithKey(BaseUtils.isNumber(data)?Double.parseDouble(data.toString()):data));
|