新增实验试剂配置

猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(维伯鑫)
猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(绿诗源)
猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒
猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒(测易)
猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒
pull/1/head
liuqingkun 3 months ago
parent 973f3f3373
commit 3a10a89ecc
  1. 2
      .gitignore
  2. 75
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineReagentService.java
  3. 413
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineReagentServiceImpl.java
  4. 546
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java

2
.gitignore vendored

@ -24,3 +24,5 @@
hs_err_pid*
replay_pid*
.idea
**/target

@ -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抗体检测试剂盒--洛阳莱普生信息科技有限公司
/**
* 数据库ID2010597883512958984
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒维伯鑫
* 生产厂家维伯鑫
*
* @param group 填报实验结果的组数每组9行12列
* @param groupExcelData
* @param map1
* @param list
*/
void reagent2010597883512958984(int group, Map<String, List<ExamineExcel>> groupExcelData,
Map<String, List<Map<String, Map<String, Object>>>> map1,
List<Map<String, Object>> list);
/**
* 数据库ID2010597883512958985
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒绿诗源
* 生产厂家深圳市绿诗源生物技术有限公司
*
* @param group 填报实验结果的组数每组9行12列
* @param groupExcelData
* @param map1
* @param list
*/
void reagent2010597883512958985(int group, Map<String, List<ExamineExcel>> groupExcelData,
Map<String, List<Map<String, Map<String, Object>>>> map1,
List<Map<String, Object>> list);
/**
* 数据库ID2010597883512958986
* 试剂名称猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒
* 生产厂家禾旭生物
*
* @param group 填报实验结果的组数每组9行12列
* @param groupExcelData
* @param map1
* @param list
*/
void reagent2010597883512958986(int group, Map<String, List<ExamineExcel>> groupExcelData,
Map<String, List<Map<String, Map<String, Object>>>> map1,
List<Map<String, Object>> list);
/**
* 数据库ID2010597883512958987
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒测易
* 生产厂家测易生物
*
* @param group 填报实验结果的组数每组9行12列
* @param groupExcelData
* @param map1
* @param list
*/
void reagent2010597883512958987(int group, Map<String, List<ExamineExcel>> groupExcelData,
Map<String, List<Map<String, Map<String, Object>>>> map1,
List<Map<String, Object>> list);
/**
* 数据库ID2010597883512958988
* 试剂名称猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒
* 生产厂家洛阳莱普生信息科技有限公司
*
* @param group 填报实验结果的组数每组9行12列
* @param groupExcelData
* @param map1
* @param list
*/
void reagent2010597883512958988(int group, Map<String, List<ExamineExcel>> groupExcelData,
Map<String, List<Map<String, Map<String, Object>>>> map1,
List<Map<String, Object>> list);
/**
* 数据库ID2010597883512958989

@ -38,6 +38,419 @@ public class ExamineReagentServiceImpl implements IExamineReagentService {
return groupExcelData;
}
/**
* 数据库ID2010597883512958984
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒维伯鑫
* 生产厂家维伯鑫
* <p>
* 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<String, List<ExamineExcel>> groupExcelData, Map<String, List<Map<String, Map<String, Object>>>> map1, List<Map<String, Object>> list) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> 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<String, Map<String, Object>> map2 = new HashMap<>();
String SP = "0.00";
for (int colNum = 1; colNum <= fieldsLength; colNum++) {
String cellVal = getExamineCellData(examineExcel, colNum);
Map<String, Object> 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);
}
}
/**
* 数据库ID2010597883512958985
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒绿诗源
* 生产厂家深圳市绿诗源生物技术有限公司
* <p>
* 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<String, List<ExamineExcel>> groupExcelData, Map<String, List<Map<String, Map<String, Object>>>> map1, List<Map<String, Object>> list) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> 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<String, Map<String, Object>> map2 = new HashMap<>();
String SP = "0.00";
for (int colNum = 1; colNum <= fieldsLength; colNum++) {
String cellVal = getExamineCellData(examineExcel, colNum);
Map<String, Object> 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);
}
}
/**
* 数据库ID2010597883512958986
* 试剂名称猪繁殖与呼吸综合征病毒间接ELISA抗体检测试剂盒
* 生产厂家禾旭生物
* <p>
* 1. 成立条件 阴性对照平均值(NCX)NCX=(NC1+NC2)/2 阳性对照平均值(PCX)PCX=(PC1+PC2)/2 成立条件标准:PCX-NCX0.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<String, List<ExamineExcel>> groupExcelData, Map<String, List<Map<String, Map<String, Object>>>> map1, List<Map<String, Object>> list) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> 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<String, Map<String, Object>> map2 = new HashMap<>();
String SP = "0.00";
for (int colNum = 1; colNum <= fieldsLength; colNum++) {
String cellVal = getExamineCellData(examineExcel, colNum);
Map<String, Object> 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);
}
}
/**
* 数据库ID2010597883512958987
* 试剂名称猪繁殖与呼吸综合征病毒ELISA抗体检测试剂盒测易
* 生产厂家测易生物
* <p>
* 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<String, List<ExamineExcel>> groupExcelData, Map<String, List<Map<String, Map<String, Object>>>> map1, List<Map<String, Object>> list) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> 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<String, Map<String, Object>> map2 = new HashMap<>();
String SP = "0.00";
for (int colNum = 1; colNum <= fieldsLength; colNum++) {
String cellVal = getExamineCellData(examineExcel, colNum);
Map<String, Object> 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);
}
}
/**
* 数据库ID2010597883512958988
* 试剂名称猪口蹄疫病毒O型VP1间接ELISA抗体检测试剂盒
* 生产厂家洛阳莱普生信息科技有限公司
* <p>
* 1. 成立条件: 阴性对照平均值(NCX)NCX=(NC1+NC2)/2 阳性对照平均值(PCX)PCX=(PC1+PC2)/2 成立条件标准:PCX-NCX0.5;NCX0.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<String, List<ExamineExcel>> groupExcelData, Map<String, List<Map<String, Map<String, Object>>>> map1, List<Map<String, Object>> list) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> 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<String, Map<String, Object>> map2 = new HashMap<>();
String SP = "0.00";
for (int colNum = 1; colNum <= fieldsLength; colNum++) {
String cellVal = getExamineCellData(examineExcel, colNum);
Map<String, Object> 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);
}
}
/**
* 数据库ID2010597883512958989
* 试剂名称禽白血病病毒J亚群ELISA抗体检测试剂盒

@ -5604,13 +5604,22 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
}
map1.put("g" + (i + 1), mapList);
}
} else if ("2010597883512958984".equals(reagentId)) {
examineReagentService.reagent2010597883512958984(group, groupExcelData, map1, list);
} else if ("2010597883512958985".equals(reagentId)) {
examineReagentService.reagent2010597883512958985(group, groupExcelData, map1, list);
} else if ("2010597883512958986".equals(reagentId)) {
examineReagentService.reagent2010597883512958986(group, groupExcelData, map1, list);
} else if ("2010597883512958987".equals(reagentId)) {
examineReagentService.reagent2010597883512958987(group, groupExcelData, map1, list);
} else if ("2010597883512958988".equals(reagentId)) {
examineReagentService.reagent2010597883512958988(group, groupExcelData, map1, list);
} else if ("2010597883512958989".equals(reagentId)) {
examineReagentService.reagent2010597883512958989(group, groupExcelData, map1, list);
} else if ("2010597883512958990".equals(reagentId)) {
examineReagentService.reagent2010597883512958990(group, groupExcelData, map1, list);
}
// 无该试剂公式提示
else {
} else {
// 无该试剂公式提示
throw new Exception("该试剂未维护公式计算,请联系相关开发人员!");
}
@ -5864,535 +5873,4 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
return cPosData;
}
/**
* 暂时不用代码开始
*/
// /**
// * 普通Excel解析数据 review start
// **/
// //获取单元格的值
// private String getCode(List<ExamineExcel> 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<Map<String, List<Map<String, Map<String, Object>>>>> ptExcelReview(
// MultipartFile file,
// String examineId,
// Map<String, String> info, //变量对应的标版的孔位,一行行的逐渐递增
// String reg //计算公式
// ) {
// try {
// List<ExamineExcel> read = ExcelUtil.read(file, ExamineExcel.class);
// Map<String, List<ExamineExcel>> 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<ExamineExcel> 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<Map<String, Object>> list = new ArrayList<>();
// // 按照公式计算实验数据并返回
// Map<String, List<Map<String, Map<String, Object>>>> map1 = new HashMap<>();
//
// for (int i = 0; i < group; i++) {
// List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
// List<ExamineExcel> excels = map.get(i + 1 + "");
// //解析info,确定参数x的值和其它相对不变的参数
// Map<String, Object> params = new HashMap<>(); //存放解析出的参数
//
// Integer xStart = 0;
// Integer xEnd = 0;
// //解析参数
// Set<String> 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<String, Map<String, Object>> 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<String, Object> 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<Map<String, Object>>() {
// @Override
// public int compare(Map<String, Object> o1, Map<String, Object> o2) {
// Integer id1 = (Integer) o1.get("order");
// Integer id2 = (Integer) o2.get("order");
// // 升序
// return id1.compareTo(id2);
// }
// });
//
// int numIndex = 0;
// for (Map<String, Object> stringObjectMap : list) {
// String num = (String) stringObjectMap.get("num");
// if (num != null && !"".equals(num)) {
// num = split[numIndex];
// stringObjectMap.put("num", num);
// numIndex++;
// }
// }
//
// LambdaQueryWrapper<ExamineResult> 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<Map<String, List<Map<String, Map<String, Object>>>>> ptExcel1(
// MultipartFile file,
// String examineId,
// String infoStr, //变量对应的标版的孔位,一行行的逐渐递增
// String reg //计算公式
// ) throws Exception {
// List<ExamineExcel> read = ExcelUtil.read(file, ExamineExcel.class);
// Map<String, List<ExamineExcel>> 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<ExamineExcel> 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<Map<String, Object>> list = new ArrayList<>();
// // 按照公式计算实验数据并返回
// Map<String, List<Map<String, Map<String, Object>>>> map1 = new HashMap<>();
//
// for (int i = 0; i < group; i++) {
// List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
// List<ExamineExcel> 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<String, Object> params = new HashMap<>(); //存放解析出的参数
// Integer xStart = 0;
// Integer xEnd = 0;
// //解析参数
//
// Map<String, String> info = JSON.parseObject(infoStr, new TypeReference<HashMap<String, String>>() {
// });
// // 测试假数据
//// reg = "(x-((x1+x2)/2))/(((x3+x4)/2)-(((x1+x2)/2)))";
//// Map<String, String> 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<String> 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<String, Map<String, Object>> 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<String, Object> 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<Map<String, Object>>() {
// @Override
// public int compare(Map<String, Object> o1, Map<String, Object> o2) {
// Integer id1 = (Integer) o1.get("order");
// Integer id2 = (Integer) o2.get("order");
// // 升序
// return id1.compareTo(id2);
// }
// });
//
// int numIndex = 0;
// for (Map<String, Object> 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<ExamineResult> 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<ExamineExcel> excels, String infoStr, String reg) {
// Map<String, Object> params = new HashMap<>();
// DecimalFormat df = new DecimalFormat("#0.000");
//
// // 获取4个抗原对照值
// List<Double> 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<Double> list2 = list1.stream().sorted().collect(Collectors.toList());
// List<Double> list3 = new ArrayList<>();
// list3.add(list2.get(1));
// list3.add(list2.get(2));
// Map<String, String> info = JSON.parseObject(infoStr, new TypeReference<HashMap<String, String>>() {
// });
// List<String> 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)));
// }
/**
* 暂时不用代码结束
*/
}
Loading…
Cancel
Save