|
|
|
@ -186,28 +186,28 @@ public class ExamineResultController extends BladeController { |
|
|
|
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>(); |
|
|
|
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>(); |
|
|
|
List<ExamineExcel> excels = map.get(i + 1 + ""); |
|
|
|
List<ExamineExcel> excels = map.get(i + 1 + ""); |
|
|
|
//解析info,确定参数x的值和其它相对不变的参数
|
|
|
|
//解析info,确定参数x的值和其它相对不变的参数
|
|
|
|
Map<String,Object> params = new HashMap<>(); //存放解析出的参数
|
|
|
|
Map<String, Object> params = new HashMap<>(); //存放解析出的参数
|
|
|
|
|
|
|
|
|
|
|
|
Integer xStart = 0; |
|
|
|
Integer xStart = 0; |
|
|
|
Integer xEnd = 0; |
|
|
|
Integer xEnd = 0; |
|
|
|
//解析参数
|
|
|
|
//解析参数
|
|
|
|
Set<String> strings = info.keySet(); |
|
|
|
Set<String> strings = info.keySet(); |
|
|
|
String x = ""; |
|
|
|
String x = ""; |
|
|
|
for(String s: strings){ |
|
|
|
for (String s : strings) { |
|
|
|
String para = info.get(s); |
|
|
|
String para = info.get(s); |
|
|
|
if (para.split("-").length > 1){//可变参数
|
|
|
|
if (para.split("-").length > 1) {//可变参数
|
|
|
|
String[] xs = para.split("-"); |
|
|
|
String[] xs = para.split("-"); |
|
|
|
xStart = Integer.parseInt(xs[0]); |
|
|
|
xStart = Integer.parseInt(xs[0]); |
|
|
|
xEnd = Integer.parseInt(xs[1]); |
|
|
|
xEnd = Integer.parseInt(xs[1]); |
|
|
|
x = s; |
|
|
|
x = s; |
|
|
|
}else{//相对固定的参数
|
|
|
|
} else {//相对固定的参数
|
|
|
|
Integer order = Integer.valueOf(para); |
|
|
|
Integer order = Integer.valueOf(para); |
|
|
|
params.put(s,StringUtil.isBlank(getCode(excels,order)) ? "0" : getCode(excels,order)); |
|
|
|
params.put(s, StringUtil.isBlank(getCode(excels, order)) ? "0" : getCode(excels, order)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//按照列循环每一版的数据
|
|
|
|
//按照列循环每一版的数据
|
|
|
|
for (int m = 0; m < excels.size(); m++){ |
|
|
|
for (int m = 0; m < excels.size(); m++) { |
|
|
|
String a = ""; |
|
|
|
String a = ""; |
|
|
|
if (m == 0) { |
|
|
|
if (m == 0) { |
|
|
|
a = "A"; |
|
|
|
a = "A"; |
|
|
|
@ -237,10 +237,10 @@ public class ExamineResultController extends BladeController { |
|
|
|
int filedsLength = examineExcel.getClass().getDeclaredFields().length - 1; |
|
|
|
int filedsLength = examineExcel.getClass().getDeclaredFields().length - 1; |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Map<String, Object>> map2 = new HashMap<>(); |
|
|
|
Map<String, Map<String, Object>> map2 = new HashMap<>(); |
|
|
|
for(int n = 1; n <= filedsLength; n++){ |
|
|
|
for (int n = 1; n <= filedsLength; n++) { |
|
|
|
System.out.println(n); |
|
|
|
System.out.println(n); |
|
|
|
String code; |
|
|
|
String code; |
|
|
|
switch (n){ |
|
|
|
switch (n) { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
code = examineExcel.getCode1(); |
|
|
|
code = examineExcel.getCode1(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -281,28 +281,28 @@ public class ExamineResultController extends BladeController { |
|
|
|
code = "0"; |
|
|
|
code = "0"; |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, Object> mapResult = new HashMap<>(); |
|
|
|
Map<String, Object> mapResult = new HashMap<>(); |
|
|
|
int index = (n -1) * 8 + m + 1; //n是列,m是行 ,我们定义index是一列列的定义
|
|
|
|
int index = (n - 1) * 8 + m + 1; //n是列,m是行 ,我们定义index是一列列的定义
|
|
|
|
System.out.println("code的值==" + code + ",列n ==" + n+",行m="+m); |
|
|
|
System.out.println("code的值==" + code + ",列n ==" + n + ",行m=" + m); |
|
|
|
System.out.println("-------------------"); |
|
|
|
System.out.println("-------------------"); |
|
|
|
if (StringUtil.isNoneBlank(code)){ |
|
|
|
if (StringUtil.isNoneBlank(code)) { |
|
|
|
if(xStart <= index && index <= xEnd){ |
|
|
|
if (xStart <= index && index <= xEnd) { |
|
|
|
params.put(x,code); |
|
|
|
params.put(x, code); |
|
|
|
String value = FormulaTool.getResult(reg, params); |
|
|
|
String value = FormulaTool.getResult(reg, params); |
|
|
|
mapResult.put("originResult", examineExcel.getCode1()); |
|
|
|
mapResult.put("originResult", examineExcel.getCode1()); |
|
|
|
mapResult.put("value", "0E-10".equals(value) ? "0": value); |
|
|
|
mapResult.put("value", "0E-10".equals(value) ? "0" : value); |
|
|
|
if (Double.parseDouble(value) >= 0.4) { |
|
|
|
if (Double.parseDouble(value) >= 0.4) { |
|
|
|
mapResult.put("result", "阳性"); |
|
|
|
mapResult.put("result", "阳性"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mapResult.put("result", "阴性"); |
|
|
|
mapResult.put("result", "阴性"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
if(xStart <= index && index <= xEnd){ |
|
|
|
if (xStart <= index && index <= xEnd) { |
|
|
|
mapResult.put("originResult", ""); |
|
|
|
mapResult.put("originResult", ""); |
|
|
|
mapResult.put("num", ""); |
|
|
|
mapResult.put("num", ""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
mapResult.put("order",index + i*96); |
|
|
|
mapResult.put("order", index + i * 96); |
|
|
|
map2.put(a + n, mapResult); |
|
|
|
map2.put(a + n, mapResult); |
|
|
|
list.add(mapResult); |
|
|
|
list.add(mapResult); |
|
|
|
mapList.add(map2); |
|
|
|
mapList.add(map2); |
|
|
|
@ -350,7 +350,7 @@ public class ExamineResultController extends BladeController { |
|
|
|
return R.data(map1); |
|
|
|
return R.data(map1); |
|
|
|
} catch (ArrayIndexOutOfBoundsException e) { |
|
|
|
} catch (ArrayIndexOutOfBoundsException e) { |
|
|
|
throw new RuntimeException("分配样品数量与检测样品数量不一致!"); |
|
|
|
throw new RuntimeException("分配样品数量与检测样品数量不一致!"); |
|
|
|
}catch(Exception e1){ |
|
|
|
} catch (Exception e1) { |
|
|
|
throw new RuntimeException("算术异常,请检查实验数据!"); |
|
|
|
throw new RuntimeException("算术异常,请检查实验数据!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|