From 3a10a89ecc42bf0f893e0681b9fe4b23717204fd Mon Sep 17 00:00:00 2001 From: liuqingkun Date: Tue, 13 Jan 2026 16:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=9E=E9=AA=8C=E8=AF=95?= =?UTF-8?q?=E5=89=82=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(维伯鑫) 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(绿诗源) 猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(测易) 猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒 --- .gitignore | 2 + .../lims/service/IExamineReagentService.java | 75 ++- .../impl/ExamineReagentServiceImpl.java | 413 +++++++++++++ .../impl/ExamineResultServiceImpl.java | 546 +----------------- 4 files changed, 497 insertions(+), 539 deletions(-) diff --git a/.gitignore b/.gitignore index 9154f4c..c8747ac 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ hs_err_pid* replay_pid* +.idea +**/target diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineReagentService.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineReagentService.java index bc54684..0829c22 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineReagentService.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineReagentService.java @@ -34,11 +34,76 @@ public interface IExamineReagentService { // 2010597883512958981 猪瘟病毒ELISA抗体检测试剂盒--深圳市绿诗源生物技术有限公司 // 2010597883512958982 猪瘟病毒阻断ELISA抗体检测试剂盒--科前生物 --有相同的 // 2010597883512958983 猪瘟病毒间接ELISA抗体检测试剂盒--禾旭生物 --有相同的 - // 2010597883512958984 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(维伯鑫)--维伯鑫 - // 2010597883512958985 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(绿诗源)--深圳市绿诗源生物技术有限公司 - // 2010597883512958986 猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒--禾旭生物 --有相同的 - // 2010597883512958987 猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(测易)--测易生物 - // 2010597883512958988 猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒--洛阳莱普生信息科技有限公司 + + /** + * 数据库ID:2010597883512958984 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(维伯鑫) + * 生产厂家:维伯鑫 + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + void reagent2010597883512958984(int group, Map> groupExcelData, + Map>>> map1, + List> list); + + /** + * 数据库ID:2010597883512958985 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(绿诗源) + * 生产厂家:深圳市绿诗源生物技术有限公司 + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + void reagent2010597883512958985(int group, Map> groupExcelData, + Map>>> map1, + List> list); + + /** + * 数据库ID:2010597883512958986 + * 试剂名称:猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒 + * 生产厂家:禾旭生物 + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + void reagent2010597883512958986(int group, Map> groupExcelData, + Map>>> map1, + List> list); + + /** + * 数据库ID:2010597883512958987 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(测易) + * 生产厂家:测易生物 + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + void reagent2010597883512958987(int group, Map> groupExcelData, + Map>>> map1, + List> list); + + /** + * 数据库ID:2010597883512958988 + * 试剂名称:猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒 + * 生产厂家:洛阳莱普生信息科技有限公司 + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + void reagent2010597883512958988(int group, Map> groupExcelData, + Map>>> map1, + List> list); /** * 数据库ID:2010597883512958989 diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineReagentServiceImpl.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineReagentServiceImpl.java index 78b51a8..3839bc1 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineReagentServiceImpl.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineReagentServiceImpl.java @@ -38,6 +38,419 @@ public class ExamineReagentServiceImpl implements IExamineReagentService { return groupExcelData; } + /** + * 数据库ID:2010597883512958984 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(维伯鑫) + * 生产厂家:维伯鑫 + *

+ * 1. 成立条件: 阴性对照孔OD均值≤0.2: 阳性对照孔OD均值≥0.6: + * 2. 计算方法: S/P值=(样本OD值-阴性对照OD平均值)/(阳性对照OD平均值-阴性对照OD平均值) + * 3. 结果判定: S/P值≥0.5则判断为阳性; S/P值<0.5则判断为阴性; + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + @Override + public void reagent2010597883512958984(int group, Map> groupExcelData, Map>>> map1, List> list) { + for (int i = 0; i < group; i++) { + List>> mapList = new ArrayList<>(); + List excels = groupExcelData.get(i + 1 + ""); + double negativeVal1 = Double.parseDouble(excels.get(0).getCode1()); + double negativeVal2 = Double.parseDouble(excels.get(1).getCode1()); + double positiveVal1 = Double.parseDouble(excels.get(2).getCode1()); + double positiveVal2 = Double.parseDouble(excels.get(3).getCode1()); + // 阴性对照平均值 + double negativeAvg = (negativeVal1 + negativeVal2) / 2; + // 阳性对照平均值 + double positiveAvg = (positiveVal1 + positiveVal2) / 2; + + // 成立条件校验 + if (negativeAvg <= 0.2 && positiveAvg >= 0.6) { + throw new ServiceException("第" + (i + 1) + "板阴阳性对照OD值条件不成立,请修改后重新上传!"); + } + + for (int rowNum = 0; rowNum < excels.size(); rowNum++) { + // 行标头:前端渲染需要A、B、C.... + String a = String.valueOf((char) (rowNum + 65)); + + //取到一行记录 + ExamineExcel examineExcel = excels.get(rowNum); + int fieldsLength = examineExcel.getClass().getDeclaredFields().length - 1; + + Map> map2 = new HashMap<>(); + + String SP = "0.00"; + for (int colNum = 1; colNum <= fieldsLength; colNum++) { + String cellVal = getExamineCellData(examineExcel, colNum); + + Map mapResult = new HashMap<>(); + // colNum 是列,rowNum是行 ,我们定义index是一列列的定义 + int index = (colNum - 1) * 8 + rowNum + 1; + if (StringUtils.isNotBlank(cellVal)) { + if (rowNum > 5 || colNum > 1) { + if (positiveAvg != 0) { + SP = DECIMAL_FORMAT.format((Double.parseDouble(cellVal) - negativeAvg) / (positiveAvg - negativeAvg)); + } + mapResult.put("originResult", cellVal); + mapResult.put("value", SP); + mapResult.put("num", "1"); + if (Double.parseDouble(SP) < 0.5) { + mapResult.put("result", "阴性"); + } else { + mapResult.put("result", "阳性"); + } + } else { + mapResult.put("originResult", cellVal); + mapResult.put("num", ""); + } + } else { + mapResult.put("originResult", ""); + mapResult.put("num", ""); + } + mapResult.put("order", index + i * 96); + map2.put(a + colNum, mapResult); + list.add(mapResult); + } + mapList.add(map2); + } + + map1.put("g" + (i + 1), mapList); + } + } + + /** + * 数据库ID:2010597883512958985 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(绿诗源) + * 生产厂家:深圳市绿诗源生物技术有限公司 + *

+ * 1. 成立条件: 阳性对照孔的OD均值≥0.60,阴性对照孔的平均 OD 值<0.40 + * 2. 计算方法: S/P=(样本OD450/630值-NCx)/(PCx-NCx), NCx表示阴性对照孔平均OD450/630值(0.05以下的数值按0.05计算), PCx表示阳1性对照孔平均OD450/630值: + * 3. 结果判定: S/P值≥0.20时,判为阳性; S/P值<0.20时,判为阴性; + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + @Override + public void reagent2010597883512958985(int group, Map> groupExcelData, Map>>> map1, List> list) { + for (int i = 0; i < group; i++) { + List>> mapList = new ArrayList<>(); + List excels = groupExcelData.get(i + 1 + ""); + double negativeVal1 = Double.parseDouble(excels.get(0).getCode1()); + double negativeVal2 = Double.parseDouble(excels.get(1).getCode1()); + double positiveVal1 = Double.parseDouble(excels.get(2).getCode1()); + double positiveVal2 = Double.parseDouble(excels.get(3).getCode1()); + // 阴性对照平均值 + double negativeAvg = (negativeVal1 + negativeVal2) / 2; + // 阳性对照平均值 + double positiveAvg = (positiveVal1 + positiveVal2) / 2; + + // 成立条件校验 + if (negativeAvg < 0.3 && positiveAvg - negativeAvg >= 0.7) { + throw new ServiceException("第" + (i + 1) + "板阴阳性对照OD值条件不成立,请修改后重新上传!"); + } + + for (int rowNum = 0; rowNum < excels.size(); rowNum++) { + // 行标头:前端渲染需要A、B、C.... + String a = String.valueOf((char) (rowNum + 65)); + + //取到一行记录 + ExamineExcel examineExcel = excels.get(rowNum); + int fieldsLength = examineExcel.getClass().getDeclaredFields().length - 1; + + Map> map2 = new HashMap<>(); + + String SP = "0.00"; + for (int colNum = 1; colNum <= fieldsLength; colNum++) { + String cellVal = getExamineCellData(examineExcel, colNum); + + Map mapResult = new HashMap<>(); + // colNum 是列,rowNum是行 ,我们定义index是一列列的定义 + int index = (colNum - 1) * 8 + rowNum + 1; + if (StringUtils.isNotBlank(cellVal)) { + if (rowNum > 5 || colNum > 1) { + if (positiveAvg != 0) { + SP = DECIMAL_FORMAT.format((Double.parseDouble(cellVal) - negativeAvg) / (positiveAvg - negativeAvg)); + } + mapResult.put("originResult", cellVal); + mapResult.put("value", SP); + mapResult.put("num", "1"); + if (Double.parseDouble(SP) < 0.2) { + mapResult.put("result", "阴性"); + } else { + mapResult.put("result", "阳性"); + } + } else { + mapResult.put("originResult", cellVal); + mapResult.put("num", ""); + } + } else { + mapResult.put("originResult", ""); + mapResult.put("num", ""); + } + mapResult.put("order", index + i * 96); + map2.put(a + colNum, mapResult); + list.add(mapResult); + } + mapList.add(map2); + } + + map1.put("g" + (i + 1), mapList); + } + } + + /** + * 数据库ID:2010597883512958986 + * 试剂名称:猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒 + * 生产厂家:禾旭生物 + *

+ * 1. 成立条件: 阴性对照平均值(NCX)NCX=(NC1+NC2)/2 阳性对照平均值(PCX)PCX=(PC1+PC2)/2 成立条件标准:PCX-NCX≥0.7;NCX<0.3。 + * 2. 计算方法: S/P值=样品OD450/PCX + * 3. 结果判定: S/P值≥0.3,样品应判定为抗体阳性; S/P值<0.3,样品应判定为抗体阴性; + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + @Override + public void reagent2010597883512958986(int group, Map> groupExcelData, Map>>> map1, List> list) { + for (int i = 0; i < group; i++) { + List>> mapList = new ArrayList<>(); + List excels = groupExcelData.get(i + 1 + ""); + double negativeVal1 = Double.parseDouble(excels.get(0).getCode1()); + double negativeVal2 = Double.parseDouble(excels.get(1).getCode1()); + double positiveVal1 = Double.parseDouble(excels.get(2).getCode1()); + double positiveVal2 = Double.parseDouble(excels.get(3).getCode1()); + // 阴性对照平均值 + double negativeAvg = (negativeVal1 + negativeVal2) / 2; + // 阳性对照平均值 + double positiveAvg = (positiveVal1 + positiveVal2) / 2; + + // 成立条件校验 + if (negativeAvg < 0.3 && positiveAvg - negativeAvg >= 0.7) { + throw new ServiceException("第" + (i + 1) + "板阴阳性对照OD值条件不成立,请修改后重新上传!"); + } + + for (int rowNum = 0; rowNum < excels.size(); rowNum++) { + // 行标头:前端渲染需要A、B、C.... + String a = String.valueOf((char) (rowNum + 65)); + + //取到一行记录 + ExamineExcel examineExcel = excels.get(rowNum); + int fieldsLength = examineExcel.getClass().getDeclaredFields().length - 1; + + Map> map2 = new HashMap<>(); + + String SP = "0.00"; + for (int colNum = 1; colNum <= fieldsLength; colNum++) { + String cellVal = getExamineCellData(examineExcel, colNum); + + Map mapResult = new HashMap<>(); + // colNum 是列,rowNum是行 ,我们定义index是一列列的定义 + int index = (colNum - 1) * 8 + rowNum + 1; + if (StringUtils.isNotBlank(cellVal)) { + if (rowNum > 5 || colNum > 1) { + if (positiveAvg != 0) { + SP = DECIMAL_FORMAT.format((Double.parseDouble(cellVal)) / positiveAvg); + } + mapResult.put("originResult", cellVal); + mapResult.put("value", SP); + mapResult.put("num", "1"); + if (Double.parseDouble(SP) < 0.3) { + mapResult.put("result", "阴性"); + } else { + mapResult.put("result", "阳性"); + } + } else { + mapResult.put("originResult", cellVal); + mapResult.put("num", ""); + } + } else { + mapResult.put("originResult", ""); + mapResult.put("num", ""); + } + mapResult.put("order", index + i * 96); + map2.put(a + colNum, mapResult); + list.add(mapResult); + } + mapList.add(map2); + } + + map1.put("g" + (i + 1), mapList); + } + } + + /** + * 数据库ID:2010597883512958987 + * 试剂名称:猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(测易) + * 生产厂家:测易生物 + *

+ * 1. 成立条件: 阳性对照OD450nm平均值-阴性对照OD450mm平均值≥0.3; 阴性对照OD450mm平均值≤0.5; + * 2. 计算方法: S/P值=(待测样品OD450nm值-阴性对照OD450nm均值)/(阳性对照OD450nm均值-阴性对照OD450nm均值) + * 3. 结果判定: S/P值≥0.4,判为阳性; S/P值<0.3, 判为阴性; + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + @Override + public void reagent2010597883512958987(int group, Map> groupExcelData, Map>>> map1, List> list) { + for (int i = 0; i < group; i++) { + List>> mapList = new ArrayList<>(); + List excels = groupExcelData.get(i + 1 + ""); + double negativeVal1 = Double.parseDouble(excels.get(0).getCode1()); + double negativeVal2 = Double.parseDouble(excels.get(1).getCode1()); + double positiveVal1 = Double.parseDouble(excels.get(2).getCode1()); + double positiveVal2 = Double.parseDouble(excels.get(3).getCode1()); + // 阴性对照平均值 + double negativeAvg = (negativeVal1 + negativeVal2) / 2; + // 阳性对照平均值 + double positiveAvg = (positiveVal1 + positiveVal2) / 2; + + // 成立条件校验 + if (positiveAvg - negativeAvg >= 0.3 && negativeAvg <= 0.5) { + throw new ServiceException("第" + (i + 1) + "板阴阳性对照OD值条件不成立,请修改后重新上传!"); + } + + for (int rowNum = 0; rowNum < excels.size(); rowNum++) { + // 行标头:前端渲染需要A、B、C.... + String a = String.valueOf((char) (rowNum + 65)); + + //取到一行记录 + ExamineExcel examineExcel = excels.get(rowNum); + int fieldsLength = examineExcel.getClass().getDeclaredFields().length - 1; + + Map> map2 = new HashMap<>(); + + String SP = "0.00"; + for (int colNum = 1; colNum <= fieldsLength; colNum++) { + String cellVal = getExamineCellData(examineExcel, colNum); + + Map mapResult = new HashMap<>(); + // colNum 是列,rowNum是行 ,我们定义index是一列列的定义 + int index = (colNum - 1) * 8 + rowNum + 1; + if (StringUtils.isNotBlank(cellVal)) { + if (rowNum > 5 || colNum > 1) { + if (positiveAvg != 0) { + SP = DECIMAL_FORMAT.format((Double.parseDouble(cellVal) - negativeAvg) / (positiveAvg - negativeAvg)); + } + mapResult.put("originResult", cellVal); + mapResult.put("value", SP); + mapResult.put("num", "1"); + if (Double.parseDouble(SP) < 0.3) { + mapResult.put("result", "阴性"); + } else if (Double.parseDouble(SP) >= 0.4) { + mapResult.put("result", "阳性"); + } else { + mapResult.put("result", "可疑"); + } + } else { + mapResult.put("originResult", cellVal); + mapResult.put("num", ""); + } + } else { + mapResult.put("originResult", ""); + mapResult.put("num", ""); + } + mapResult.put("order", index + i * 96); + map2.put(a + colNum, mapResult); + list.add(mapResult); + } + mapList.add(map2); + } + + map1.put("g" + (i + 1), mapList); + } + } + + + /** + * 数据库ID:2010597883512958988 + * 试剂名称:猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒 + * 生产厂家:洛阳莱普生信息科技有限公司 + *

+ * 1. 成立条件: 阴性对照平均值(NCX)NCX=(NC1+NC2)/2 阳性对照平均值(PCX)PCX=(PC1+PC2)/2 成立条件标准:PCX-NCX≥0.5;NCX≤0.3。 + * 2. 计算方法: S/P值=(样品-NCX)/(PCX-NCX) + * 3. 结果判定: S/P值≥0.3,样品应判定为抗体阳性; S/P值<0.3,样品应判定为抗体阴性; + * + * @param group 填报实验结果的组数,每组9行,12列 + * @param groupExcelData + * @param map1 + * @param list + */ + @Override + public void reagent2010597883512958988(int group, Map> groupExcelData, Map>>> map1, List> list) { + for (int i = 0; i < group; i++) { + List>> mapList = new ArrayList<>(); + List excels = groupExcelData.get(i + 1 + ""); + double negativeVal1 = Double.parseDouble(excels.get(0).getCode1()); + double negativeVal2 = Double.parseDouble(excels.get(1).getCode1()); + double positiveVal1 = Double.parseDouble(excels.get(2).getCode1()); + double positiveVal2 = Double.parseDouble(excels.get(3).getCode1()); + // 阴性对照平均值 + double negativeAvg = (negativeVal1 + negativeVal2) / 2; + // 阳性对照平均值 + double positiveAvg = (positiveVal1 + positiveVal2) / 2; + + // 成立条件校验 + if (positiveAvg - negativeAvg >= 0.5 && negativeAvg <= 0.3) { + throw new ServiceException("第" + (i + 1) + "板阴阳性对照OD值条件不成立,请修改后重新上传!"); + } + + for (int rowNum = 0; rowNum < excels.size(); rowNum++) { + // 行标头:前端渲染需要A、B、C.... + String a = String.valueOf((char) (rowNum + 65)); + + //取到一行记录 + ExamineExcel examineExcel = excels.get(rowNum); + int fieldsLength = examineExcel.getClass().getDeclaredFields().length - 1; + + Map> map2 = new HashMap<>(); + + String SP = "0.00"; + for (int colNum = 1; colNum <= fieldsLength; colNum++) { + String cellVal = getExamineCellData(examineExcel, colNum); + + Map mapResult = new HashMap<>(); + // colNum 是列,rowNum是行 ,我们定义index是一列列的定义 + int index = (colNum - 1) * 8 + rowNum + 1; + if (StringUtils.isNotBlank(cellVal)) { + if (rowNum > 5 || colNum > 1) { + if (positiveAvg != 0) { + SP = DECIMAL_FORMAT.format((Double.parseDouble(cellVal) - negativeAvg) / (positiveAvg - negativeAvg)); + } + mapResult.put("originResult", cellVal); + mapResult.put("value", SP); + mapResult.put("num", "1"); + if (Double.parseDouble(SP) < 0.3) { + mapResult.put("result", "阴性"); + } else { + mapResult.put("result", "阳性"); + } + } else { + mapResult.put("originResult", cellVal); + mapResult.put("num", ""); + } + } else { + mapResult.put("originResult", ""); + mapResult.put("num", ""); + } + mapResult.put("order", index + i * 96); + map2.put(a + colNum, mapResult); + list.add(mapResult); + } + mapList.add(map2); + } + + map1.put("g" + (i + 1), mapList); + } + } + /** * 数据库ID:2010597883512958989 * 试剂名称:禽白血病病毒J亚群ELISA抗体检测试剂盒 diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java index fba3748..cb8029b 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java @@ -5604,13 +5604,22 @@ public class ExamineResultServiceImpl extends BaseServiceImpl list, Integer order) { -// String result; -// ExamineExcel examineExcel = (order % 8 - 1 >= 0) ? list.get(order % 8 - 1) : list.get(list.size() - 1); -// Integer re = order / 8 + 1; -// switch (re) { -// case 1: -// result = examineExcel.getCode1(); -// break; -// case 2: -// result = examineExcel.getCode2(); -// break; -// case 3: -// result = examineExcel.getCode3(); -// break; -// case 4: -// result = examineExcel.getCode4(); -// break; -// case 5: -// result = examineExcel.getCode5(); -// break; -// case 6: -// result = examineExcel.getCode6(); -// break; -// case 7: -// result = examineExcel.getCode7(); -// break; -// case 8: -// result = examineExcel.getCode8(); -// break; -// case 9: -// result = examineExcel.getCode9(); -// break; -// case 10: -// result = examineExcel.getCode10(); -// break; -// case 11: -// result = examineExcel.getCode11(); -// break; -// case 12: -// result = examineExcel.getCode12(); -// break; -// default: -// result = "0"; -// } -// return result; -// } -// -// private R>>>> ptExcelReview( -// MultipartFile file, -// String examineId, -// Map info, //变量对应的标版的孔位,一行行的逐渐递增 -// String reg //计算公式 -// ) { -// try { -// List read = ExcelUtil.read(file, ExamineExcel.class); -// Map> map = new HashMap<>(); -//// int index = 0; -// // 组数 -// int group = 0; -// // 除9是否有余数 -// int size = (read.size() + 1) % 9; -// -// if (size == 0) { -// group = (read.size() + 1) / 9; -// } else { -// group = (read.size() + 1) / 9 + 1; -// } -// -// //将读取到的excel按照每一版分组 -// for (int i = 0; i < group; i++) { -// List excels = new ArrayList<>(); -// for (int j = i * 8 + i; j < (i + 1) * 8 + i; j++) { -// ExamineExcel excel = read.get(j); -// excels.add(excel); -// } -// map.put((i + 1) + "", excels); -// } -// -// Examine examine = examineService.getById(examineId); -// String experieNum = examine.getExperieNum(); -// String[] split = experieNum.split(","); -// -// List> list = new ArrayList<>(); -// // 按照公式计算实验数据并返回 -// Map>>> map1 = new HashMap<>(); -// -// for (int i = 0; i < group; i++) { -// List>> mapList = new ArrayList<>(); -// List excels = map.get(i + 1 + ""); -// //解析info,确定参数x的值和其它相对不变的参数 -// Map params = new HashMap<>(); //存放解析出的参数 -// -// Integer xStart = 0; -// Integer xEnd = 0; -// //解析参数 -// Set strings = info.keySet(); -// String x = ""; -// for (String s : strings) { -// String para = info.get(s); -// if (para.split("-").length > 1) {//可变参数 -// String[] xs = para.split("-"); -// xStart = Integer.parseInt(xs[0]); -// xEnd = Integer.parseInt(xs[1]); -// x = s; -// } else {//相对固定的参数 -// Integer order = Integer.valueOf(para); -// params.put(s, StringUtil.isBlank(getCode(excels, order)) ? "0" : getCode(excels, order)); -// } -// } -// -// //按照列循环每一版的数据 -// for (int m = 0; m < excels.size(); m++) { -// String a = ""; -// if (m == 0) { -// a = "A"; -// } -// if (m == 1) { -// a = "B"; -// } -// if (m == 2) { -// a = "C"; -// } -// if (m == 3) { -// a = "D"; -// } -// if (m == 4) { -// a = "E"; -// } -// if (m == 5) { -// a = "F"; -// } -// if (m == 6) { -// a = "G"; -// } -// if (m == 7) { -// a = "H"; -// } -// ExamineExcel examineExcel = excels.get(m);//取到一行记录 -// int filedsLength = examineExcel.getClass().getDeclaredFields().length - 1; -// -// Map> map2 = new HashMap<>(); -// for (int n = 1; n <= filedsLength; n++) { -// System.out.println(n); -// String code; -// switch (n) { -// case 1: -// code = examineExcel.getCode1(); -// break; -// case 2: -// code = examineExcel.getCode2(); -// break; -// case 3: -// code = examineExcel.getCode3(); -// break; -// case 4: -// code = examineExcel.getCode4(); -// break; -// case 5: -// code = examineExcel.getCode5(); -// break; -// case 6: -// code = examineExcel.getCode6(); -// break; -// case 7: -// code = examineExcel.getCode7(); -// break; -// case 8: -// code = examineExcel.getCode8(); -// break; -// case 9: -// code = examineExcel.getCode9(); -// break; -// case 10: -// code = examineExcel.getCode10(); -// break; -// case 11: -// code = examineExcel.getCode11(); -// break; -// case 12: -// code = examineExcel.getCode12(); -// break; -// default: -// code = "0"; -// } -// Map mapResult = new HashMap<>(); -// int index = (n - 1) * 8 + m + 1; //n是列,m是行 ,我们定义index是一列列的定义 -// System.out.println("code的值==" + code + ",列n ==" + n + ",行m=" + m); -// System.out.println("-------------------"); -// if (org.apache.commons.lang3.StringUtils.isNotBlank(code)) { -// if (xStart <= index && index <= xEnd) { -// params.put(x, code); -// String value = FormulaTool.getResult(reg, params); -// mapResult.put("originResult", examineExcel.getCode1()); -// mapResult.put("value", "0E-10".equals(value) ? "0" : value); -// if (Double.parseDouble(value) >= 0.4) { -// mapResult.put("result", "阳性"); -// } else { -// mapResult.put("result", "阴性"); -// } -// } -// } else { -// if (xStart <= index && index <= xEnd) { -// mapResult.put("originResult", ""); -// mapResult.put("num", ""); -// } -// } -// mapResult.put("order", index + i * 96); -// map2.put(a + n, mapResult); -// list.add(mapResult); -// mapList.add(map2); -// } -// map1.put("g" + (i + 1), mapList); -// } -// } -// -// Collections.sort(list, new Comparator>() { -// @Override -// public int compare(Map o1, Map o2) { -// Integer id1 = (Integer) o1.get("order"); -// Integer id2 = (Integer) o2.get("order"); -// // 升序 -// return id1.compareTo(id2); -// } -// }); -// -// int numIndex = 0; -// for (Map stringObjectMap : list) { -// String num = (String) stringObjectMap.get("num"); -// if (num != null && !"".equals(num)) { -// num = split[numIndex]; -// stringObjectMap.put("num", num); -// numIndex++; -// } -// } -// -// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); -// wrapper.eq(ExamineResult::getExamineId, examineId); -// ExamineResult result = this.getOne(wrapper); -// if (result != null) { -// result.setOriginRecordData(JSON.toJSONString(map)); -// result.setOriginRecordResult(JSON.toJSONString(map1)); -// result.setExamineDataArr(JSON.toJSONString(list)); -// this.updateById(result); -// } else { -// ExamineResult examineResult = new ExamineResult(); -// examineResult.setExamineId(Long.valueOf(examineId)); -// examineResult.setOriginRecordData(JSON.toJSONString(map)); -// examineResult.setOriginRecordResult(JSON.toJSONString(map1)); -// examineResult.setExamineDataArr(JSON.toJSONString(list)); -// this.save(examineResult); -// } -// return R.data(map1); -// } catch (ArrayIndexOutOfBoundsException e) { -// throw new RuntimeException("分配样品数量与检测样品数量不一致!"); -// } catch (Exception e1) { -// throw new RuntimeException("算术异常,请检查实验数据!"); -// } -// } -// /** 普通Excel解析数据 review stop **/ -// -// /** -// * 常规Excel解析数据 -// */ -// private R>>>> ptExcel1( -// MultipartFile file, -// String examineId, -// String infoStr, //变量对应的标版的孔位,一行行的逐渐递增 -// String reg //计算公式 -// ) throws Exception { -// List read = ExcelUtil.read(file, ExamineExcel.class); -// Map> map = new HashMap<>(); -// // 组数 -// int group = 0; -// // 除9是否有余数 -// int size = (read.size() + 1) % 9; -// if (size == 0) { -// group = (read.size() + 1) / 9; -// } else { -// group = (read.size() + 1) / 9 + 1; -// } -// -// for (int i = 0; i < group; i++) { -// List excels = new ArrayList<>(); -// for (int j = i * 8 + i; j < (i + 1) * 8 + i; j++) { -// ExamineExcel excel = read.get(j); -// excels.add(excel); -// } -// map.put((i + 1) + "", excels); -// } -// -// Examine examine = examineService.getById(examineId); -// String experieNum = examine.getExperieNum(); -// String[] split = experieNum.split(","); -// -// List> list = new ArrayList<>(); -// // 按照公式计算实验数据并返回 -// Map>>> map1 = new HashMap<>(); -// -// for (int i = 0; i < group; i++) { -// List>> mapList = new ArrayList<>(); -// List excels = map.get(i + 1 + ""); -// -//// double code1 = Double.parseDouble(excels.get(0).getCode1()); -//// double code2 = Double.parseDouble(excels.get(1).getCode1()); -//// double code3 = Double.parseDouble(excels.get(2).getCode1()); -//// double code4 = Double.parseDouble(excels.get(3).getCode1()); -//// double v1 = (code1 + code2) / 2; -//// double v2 = (code3 + code4) / 2; -// //按照列循环每一版的数据 -// -// DecimalFormat df = new DecimalFormat("#0.000"); -// //解析info,确定参数x的值和其它相对不变的参数 -// Map params = new HashMap<>(); //存放解析出的参数 -// Integer xStart = 0; -// Integer xEnd = 0; -// //解析参数 -// -// Map info = JSON.parseObject(infoStr, new TypeReference>() { -// }); -// // 测试假数据 -//// reg = "(x-((x1+x2)/2))/(((x3+x4)/2)-(((x1+x2)/2)))"; -//// Map info = new HashMap<>(); -//// info.put("x1", "1"); -//// info.put("x2", "2"); -//// info.put("x3", "3"); -//// info.put("x4", "4"); -//// info.put("x", "7-96"); -// -// Set strings = info.keySet(); -// String x = ""; -// for (String s : strings) { -// String para = info.get(s); -// if (para.split("-").length > 1) {//可变参数 -// String[] xs = para.split("-"); -// xStart = Integer.parseInt(xs[0]); -// xEnd = Integer.parseInt(xs[1]); -// x = s; -// } else {//相对固定的参数 -// Integer order = Integer.valueOf(para); -// params.put(s, StringUtil.isBlank(getCode(excels, order)) ? "0" : getCode(excels, order)); -// } -// } -// -// for (int j = 0; j < excels.size(); j++) { -// // 行标头:前端渲染需要A、B、C.... -// String a = String.valueOf((char) (j + 65)); -// -// ExamineExcel examineExcel = excels.get(j);//取到一行记录 -// int filedsLength = examineExcel.getClass().getDeclaredFields().length - 1; -// -// Map> map2 = new HashMap<>(); -// for (int n = 1; n <= filedsLength; n++) { -// System.out.println(n); -// String code; -// switch (n) { -// case 1: -// code = examineExcel.getCode1(); -// break; -// case 2: -// code = examineExcel.getCode2(); -// break; -// case 3: -// code = examineExcel.getCode3(); -// break; -// case 4: -// code = examineExcel.getCode4(); -// break; -// case 5: -// code = examineExcel.getCode5(); -// break; -// case 6: -// code = examineExcel.getCode6(); -// break; -// case 7: -// code = examineExcel.getCode7(); -// break; -// case 8: -// code = examineExcel.getCode8(); -// break; -// case 9: -// code = examineExcel.getCode9(); -// break; -// case 10: -// code = examineExcel.getCode10(); -// break; -// case 11: -// code = examineExcel.getCode11(); -// break; -// case 12: -// code = examineExcel.getCode12(); -// break; -// default: -// code = "0"; -// } -// Map mapResult = new HashMap<>(); -// int index = (n - 1) * 8 + j + 1; //n是列,j是行 ,我们定义index是一列列的定义 -// System.out.println("code的值==" + code + ",列n ==" + n + ",行m=" + j); -// System.out.println("-------------------"); -// if (org.apache.commons.lang3.StringUtils.isNotBlank(code)) { -// if (xStart <= index && index <= xEnd) { -// params.put(x, code); -// String value = FormulaTool.getResult(reg, params); -// System.out.println(value); -// String format = df.format(Double.parseDouble(value)); -// mapResult.put("originResult", code); -// mapResult.put("value", "0E-10".equals(format) ? "0" : format); -// mapResult.put("num", "1"); -// if (Double.parseDouble(format) >= 0.4) { -// mapResult.put("result", "阳性"); -// } else { -// mapResult.put("result", "阴性"); -// } -// } -// } else { -// if (xStart <= index && index <= xEnd) { -// mapResult.put("originResult", ""); -// mapResult.put("num", ""); -// } -// } -// mapResult.put("order", index + i * 96); -// map2.put(a + n, mapResult); -// list.add(mapResult); -// } -// mapList.add(map2); -// } -// map1.put("g" + (i + 1), mapList); -// } -// -// Collections.sort(list, new Comparator>() { -// @Override -// public int compare(Map o1, Map o2) { -// Integer id1 = (Integer) o1.get("order"); -// Integer id2 = (Integer) o2.get("order"); -// // 升序 -// return id1.compareTo(id2); -// } -// }); -// -// int numIndex = 0; -// for (Map stringObjectMap : list) { -// String num = (String) stringObjectMap.get("num"); -// if (num != null && !"".equals(num)) { -// num = split[numIndex]; -// stringObjectMap.put("num", num); -// numIndex++; -// } -// } -// // 判断分配样品数量与检测样品数量是否一致 -// if (split.length != numIndex) { -// throw new Exception("分配样品数量与检测样品数量不一致!"); -// } -// -// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); -// wrapper.eq(ExamineResult::getExamineId, examineId); -// ExamineResult result = this.getOne(wrapper); -// if (result != null) { -// result.setOriginRecordData(JSON.toJSONString(map)); -// result.setOriginRecordResult(JSON.toJSONString(map1)); -// result.setExamineDataArr(JSON.toJSONString(list)); -// this.updateById(result); -// } else { -// ExamineResult examineResult = new ExamineResult(); -// examineResult.setExamineId(Long.valueOf(examineId)); -// examineResult.setOriginRecordData(JSON.toJSONString(map)); -// examineResult.setOriginRecordResult(JSON.toJSONString(map1)); -// examineResult.setExamineDataArr(JSON.toJSONString(list)); -// this.save(examineResult); -// } -// return R.data(map1); -// } -// -// -// /** -// * 计算常规检验的阴或阳性对照平均值 -// */ -// private double getConventionalAvg(String i, String j) { -// double v1 = Double.parseDouble(i); -// double v2 = Double.parseDouble(j); -// return (v1 + v2) / 2; -// } -// -// /** -// * 计算该组的 对照平均值 -// * 1.公式内容map的value值换成真实数据值 -// * 2.按照公式算对照平均值 -// */ -// private Double calcCurrGroupContrastAvg1(List excels, String infoStr, String reg) { -// Map params = new HashMap<>(); -// DecimalFormat df = new DecimalFormat("#0.000"); -// -// // 获取4个抗原对照值 -// List list1 = new ArrayList<>(); -// list1.add(Double.parseDouble(excels.get(4).getCode12())); -// list1.add(Double.parseDouble(excels.get(5).getCode12())); -// list1.add(Double.parseDouble(excels.get(6).getCode12())); -// list1.add(Double.parseDouble(excels.get(7).getCode12())); -// -// // 排序,取中间两个值 -// List list2 = list1.stream().sorted().collect(Collectors.toList()); -// List list3 = new ArrayList<>(); -// list3.add(list2.get(1)); -// list3.add(list2.get(2)); -// Map info = JSON.parseObject(infoStr, new TypeReference>() { -// }); -// List list = new ArrayList<>(info.keySet()); -// -// // 公示内容换成真实数据换成真实数据值 -// for (int i = 0; i < list.size(); i++) { -// params.put(list.get(i), list3.get(i)); -// } -// -// // 得出最终对照平均值并返回 -// String value = null; -// try { -// value = FormulaTool.getResult(reg, params); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// return Double.valueOf(df.format(Double.parseDouble(value))); -// } - /** - * 暂时不用代码结束 - */ - } \ No newline at end of file