|
|
|
|
@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import io.swagger.models.auth.In; |
|
|
|
|
import lombok.NoArgsConstructor; |
|
|
|
|
import org.apache.commons.lang3.RandomUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
@ -377,8 +378,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId()); |
|
|
|
|
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId()); |
|
|
|
|
// 检测项目名称
|
|
|
|
|
reportMainBody.put("name" + i, examineItem.getName()); |
|
|
|
|
|
|
|
|
|
if ("2".equals(examineWay.getInputMode()) || "6".equals(examineWay.getInputMode())) { |
|
|
|
|
reportMainBody.put("name" + i, examineWay.getName()); |
|
|
|
|
} else { |
|
|
|
|
reportMainBody.put("name" + i, examineItem.getName()); |
|
|
|
|
} |
|
|
|
|
// 判断是哪种检测
|
|
|
|
|
// String inputMode = examineItem.getInputMode();
|
|
|
|
|
|
|
|
|
|
@ -416,8 +420,66 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
List<PCR2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), PCR2Excel.class); |
|
|
|
|
System.out.println("list: " + list); |
|
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
|
for (PCR2Excel excel : list) { |
|
|
|
|
System.out.println("excel: " + excel); |
|
|
|
|
if (examineResult.getConformityType() != null && examineResult.getConformityType() > 1) { |
|
|
|
|
for (int j = 0; j < list.size() - 2; j++) { |
|
|
|
|
String originalNum = ""; |
|
|
|
|
PCR2Excel pcr2Excel = list.get(j); |
|
|
|
|
String[] split = pcr2Excel.getExperieNum().split("-"); |
|
|
|
|
int startIndex; |
|
|
|
|
if (split.length == 3) { |
|
|
|
|
startIndex = Integer.parseInt(split[split.length - 1]); |
|
|
|
|
} else { |
|
|
|
|
startIndex = Integer.parseInt(split[split.length - 2]); |
|
|
|
|
} |
|
|
|
|
int endIndex = Integer.parseInt(split[split.length - 1]); |
|
|
|
|
for (int e = startIndex; e <= endIndex; e++) { |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
wrapper1.eq(Simple::getExperieNum, split[0] + "-" + split[1] + "-" + e); |
|
|
|
|
Simple simple = simpleService.getOne(wrapper1); |
|
|
|
|
if (simple != null) { |
|
|
|
|
if (e == endIndex) { |
|
|
|
|
originalNum += simple.getOriginalNum(); |
|
|
|
|
} else { |
|
|
|
|
originalNum += simple.getOriginalNum() + ","; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
resultVo.setOriginalNum(originalNum); |
|
|
|
|
resultVo.setNum(pcr2Excel.getExperieNum()); |
|
|
|
|
resultVo.setIndex(i); |
|
|
|
|
resultVo.setValue(pcr2Excel.getCtValue()); |
|
|
|
|
resultVo.setResult(pcr2Excel.getResult()); |
|
|
|
|
resultList.add(resultVo); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
for (PCR2Excel excel : list) { |
|
|
|
|
System.out.println("excel: " + excel); |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum()); |
|
|
|
|
Simple simple = simpleService.getOne(wrapper1); |
|
|
|
|
if (simple != null) { |
|
|
|
|
resultVo.setOriginalNum(simple.getOriginalNum()); |
|
|
|
|
resultVo.setNum(simple.getExperieNum()); |
|
|
|
|
resultVo.setIndex(i); |
|
|
|
|
resultVo.setValue(excel.getCtValue()); |
|
|
|
|
resultVo.setResult(excel.getResult()); |
|
|
|
|
resultVo.setRecessiveNum(simple.getRecessiveNum()); |
|
|
|
|
resultList.add(resultVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// XN检测
|
|
|
|
|
else if ("5".equals(examineWay.getInputMode())) { |
|
|
|
|
List<XN2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class); |
|
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
|
for (XN2Excel excel : list) { |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
@ -425,21 +487,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
Simple simple = simpleService.getOne(wrapper1); |
|
|
|
|
if (simple != null) { |
|
|
|
|
resultVo.setOriginalNum(simple.getOriginalNum()); |
|
|
|
|
resultVo.setRecessiveNum(simple.getRecessiveNum()); |
|
|
|
|
resultVo.setNum(simple.getExperieNum()); |
|
|
|
|
resultVo.setIndex(i); |
|
|
|
|
resultVo.setValue(excel.getCtValue()); |
|
|
|
|
resultVo.setResult(excel.getResult()); |
|
|
|
|
resultVo.setRecessiveNum(simple.getRecessiveNum()); |
|
|
|
|
resultList.add(resultVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// XN检测
|
|
|
|
|
else if ("5".equals(examineWay.getInputMode())) { |
|
|
|
|
List<XN2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class); |
|
|
|
|
else if ("8".equals(examineWay.getInputMode())) { |
|
|
|
|
List<BiochemicalIdentificationExcel> list = JSON.parseArray(examineResult.getExamineDataArr(), BiochemicalIdentificationExcel.class); |
|
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
|
for (XN2Excel excel : list) { |
|
|
|
|
for (BiochemicalIdentificationExcel excel : list) { |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
@ -450,7 +512,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
resultVo.setRecessiveNum(simple.getRecessiveNum()); |
|
|
|
|
resultVo.setNum(simple.getExperieNum()); |
|
|
|
|
resultVo.setIndex(i); |
|
|
|
|
resultVo.setValue(excel.getCtValue()); |
|
|
|
|
resultVo.setValue(excel.getValue()); |
|
|
|
|
resultVo.setResult(excel.getResult()); |
|
|
|
|
resultList.add(resultVo); |
|
|
|
|
} |
|
|
|
|
@ -572,6 +634,30 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 牛结核
|
|
|
|
|
else if (examineResult.getReagentId().contains("1570297053211455490") || examineResult.getReagentId().contains("1631222146321997826")) { |
|
|
|
|
list = list.stream().distinct().collect(Collectors.collectingAndThen |
|
|
|
|
(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing |
|
|
|
|
(ExamineDataArrVO::getNum))), ArrayList::new)); |
|
|
|
|
|
|
|
|
|
for (ExamineDataArrVO excel : list) { |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
wrapper1.eq(Simple::getExperieNum, excel.getNum()); |
|
|
|
|
Simple simple = simpleService.getOne(wrapper1); |
|
|
|
|
if (simple != null) { |
|
|
|
|
resultVo.setOriginalNum(simple.getOriginalNum()); |
|
|
|
|
resultVo.setRecessiveNum(simple.getRecessiveNum()); |
|
|
|
|
resultVo.setNum(simple.getExperieNum()); |
|
|
|
|
resultVo.setIndex(i); |
|
|
|
|
resultVo.setValue(excel.getValue()); |
|
|
|
|
resultVo.setResult(excel.getResult()); |
|
|
|
|
resultList.add(resultVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
reportMainBody.put("list", resultList); |
|
|
|
|
} |
|
|
|
|
// 普通
|
|
|
|
|
else { |
|
|
|
|
// 判断是满版吗
|
|
|
|
|
@ -718,6 +804,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
row.put("value" + index, value); |
|
|
|
|
row.put("result" + index, result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= examineCount; i++) { |
|
|
|
|
if (row.get("value" + examineCount) == null) { |
|
|
|
|
row.put("value" + examineCount, "/"); |
|
|
|
|
} |
|
|
|
|
if (row.get("result" + examineCount) == null) { |
|
|
|
|
row.put("result" + examineCount, "/"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 将每一行加入到模板循环列表
|
|
|
|
|
tempResultList.add(row); |
|
|
|
|
|
|
|
|
|
@ -971,7 +1066,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
instrumentName += instrument.getName() + "" + instrument.getCode() + ","; |
|
|
|
|
} |
|
|
|
|
result1.put("code", instrumentName.replace(",", "\r\n")); |
|
|
|
|
result1.put("experieDate", format3.format(taskBlueprint.getCreateTime())); |
|
|
|
|
|
|
|
|
|
// 按照完成时间降序排列
|
|
|
|
|
List<Examine> examines = examineList.stream().sorted(Comparator.comparing(Examine::getFinishTime).reversed()).collect(Collectors.toList()); |
|
|
|
|
result1.put("experieDate", format3.format(examines.get(0).getFinishTime())); |
|
|
|
|
|
|
|
|
|
result1.put("remark", entrust.getRemark()); |
|
|
|
|
result1.put("resultList1", ItemAndAllList); |
|
|
|
|
// 图片路劲
|
|
|
|
|
@ -1080,20 +1179,76 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
ExamineResult examineResult = examineResultService.getOne(wrapper); |
|
|
|
|
// json原始数据
|
|
|
|
|
List<ExamineResultVo> list = JSON.parseArray(examineResult.getExamineDataArr(), ExamineResultVo.class); |
|
|
|
|
|
|
|
|
|
if (examineResult.getReagentId().contains("1570297053211455490") || examineResult.getReagentId().contains("1631222146321997826")) { |
|
|
|
|
list = list.stream().distinct().collect(Collectors.collectingAndThen |
|
|
|
|
(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing |
|
|
|
|
(ExamineResultVo::getNum))), ArrayList::new)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int i = 0; |
|
|
|
|
if (examineResult.getConformityType() != null && examineResult.getConformityType() > 1) { |
|
|
|
|
i = examine.getSimpleCount() % examineResult.getConformityType(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int yangNum = 0; |
|
|
|
|
int yinNum = 0; |
|
|
|
|
int keyiNum = 0; |
|
|
|
|
for (ExamineResultVo vo : list) { |
|
|
|
|
if (vo.getResult() != null && !"".equals(vo.getResult())) { |
|
|
|
|
if (vo.getResult().contains("阳性")) { |
|
|
|
|
yangNum++; |
|
|
|
|
} else if ("阴性".equals(vo.getResult())) { |
|
|
|
|
yinNum++; |
|
|
|
|
} else if ("可疑".equals(vo.getResult())) { |
|
|
|
|
keyiNum++; |
|
|
|
|
// for (ExamineResultVo vo : list) {
|
|
|
|
|
// if (StringUtils.isNotBlank(vo.getResult())) {
|
|
|
|
|
// if (examineResult.getConformityType() != null && examineResult.getConformityType() > 1) {
|
|
|
|
|
// if (vo.getResult().contains("阳性")) {
|
|
|
|
|
// yangNum += examineResult.getConformityType();
|
|
|
|
|
// } else if ("阴性".equals(vo.getResult())) {
|
|
|
|
|
// yinNum += examineResult.getConformityType();
|
|
|
|
|
// } else if ("可疑".equals(vo.getResult())) {
|
|
|
|
|
// keyiNum += examineResult.getConformityType();
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (vo.getResult().contains("阳性")) {
|
|
|
|
|
// yangNum++;
|
|
|
|
|
// } else if ("阴性".equals(vo.getResult())) {
|
|
|
|
|
// yinNum++;
|
|
|
|
|
// } else if ("可疑".equals(vo.getResult())) {
|
|
|
|
|
// keyiNum++;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < list.size(); j++) { |
|
|
|
|
ExamineResultVo vo = list.get(j); |
|
|
|
|
if (StringUtils.isNotBlank(vo.getResult())) { |
|
|
|
|
if (examineResult.getConformityType() != null && examineResult.getConformityType() > 1) { |
|
|
|
|
if (i > 0 && j == list.size() - 3) { |
|
|
|
|
if (vo.getResult().contains("阳性")) { |
|
|
|
|
yangNum += i; |
|
|
|
|
} else if ("阴性".equals(vo.getResult())) { |
|
|
|
|
yinNum += i; |
|
|
|
|
} else if ("可疑".equals(vo.getResult())) { |
|
|
|
|
keyiNum += i; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (vo.getResult().contains("阳性")) { |
|
|
|
|
yangNum += examineResult.getConformityType(); |
|
|
|
|
} else if ("阴性".equals(vo.getResult())) { |
|
|
|
|
yinNum += examineResult.getConformityType(); |
|
|
|
|
} else if ("可疑".equals(vo.getResult())) { |
|
|
|
|
keyiNum += examineResult.getConformityType(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (vo.getResult().contains("阳性")) { |
|
|
|
|
yangNum++; |
|
|
|
|
} else if ("阴性".equals(vo.getResult())) { |
|
|
|
|
yinNum++; |
|
|
|
|
} else if ("可疑".equals(vo.getResult())) { |
|
|
|
|
keyiNum++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String s = "共" + examine.getSimpleCount() + "份样品,"; |
|
|
|
|
if (yangNum == examine.getSimpleCount()) { |
|
|
|
|
s += "均为阳性"; |
|
|
|
|
@ -1167,6 +1322,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
regentName += reagent.getName() + "(生产批号:" + reagent.getBatchNo() + ")" + reagent.getManufacturer() + "\r\n"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// String batchNos = examineResult.getBatchNos();
|
|
|
|
|
// if (StringUtils.isNotBlank(batchNos)) {
|
|
|
|
|
// String[] batch = batchNos.split(",");
|
|
|
|
|
// for (int i = 0; i < batch.length; i++) {
|
|
|
|
|
// String[] split2 = batch[i].split("-");
|
|
|
|
|
// Reagent reagent = reagentService.getById(split2[0]);
|
|
|
|
|
// if (i == (batch.length - 1)) {
|
|
|
|
|
// regentName += reagent.getName() + "(生产批号:" + split2[1] + ")" + reagent.getManufacturer();
|
|
|
|
|
// } else {
|
|
|
|
|
// regentName += reagent.getName() + "(生产批号:" + split2[1] + ")" + reagent.getManufacturer() + "\r\n";
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
result.put("7", regentName); |
|
|
|
|
|
|
|
|
|
// Set<String> set = new HashSet();
|
|
|
|
|
@ -1700,6 +1870,119 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
result.put("list", resultList1); |
|
|
|
|
url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "XNreportPrint"); |
|
|
|
|
} |
|
|
|
|
// 生化鉴定
|
|
|
|
|
else if ("8".equals(examineWay.getInputMode())) { |
|
|
|
|
List<BiochemicalIdentificationExcel> list = JSON.parseArray(examineResult.getExamineDataArr(), BiochemicalIdentificationExcel.class); |
|
|
|
|
// 阴阳性数量
|
|
|
|
|
// long yin = list.stream().filter((XN2Excel e) -> "阴性".equals(e.getValue())).count();
|
|
|
|
|
// long yang = list.stream().filter((XN2Excel e) -> "阳性".equals(e.getValue())).count();
|
|
|
|
|
// XN2Excel xn2Excel1 = new XN2Excel();
|
|
|
|
|
// XN2Excel xn2Excel2 = new XN2Excel();
|
|
|
|
|
// xn2Excel1.setExperieNum("阴性数量");
|
|
|
|
|
// xn2Excel1.setCtValue(String.valueOf(yin));
|
|
|
|
|
// xn2Excel2.setExperieNum("阳性数量");
|
|
|
|
|
// xn2Excel2.setCtValue(String.valueOf(yang));
|
|
|
|
|
// list.add(xn2Excel1);
|
|
|
|
|
// list.add(xn2Excel2);
|
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
Map<String, List<BiochemicalIdentificationExcel>> resultMap = new HashMap<>(); |
|
|
|
|
int count = 0; |
|
|
|
|
List<BiochemicalIdentificationExcel> everyGroupData = new ArrayList<>(); |
|
|
|
|
for (int j = 0; j < list.size(); j++) { |
|
|
|
|
if (count == 60 || j == list.size() - 1) { |
|
|
|
|
int keyCount = (j / 60); |
|
|
|
|
if (j == list.size() - 1) { |
|
|
|
|
keyCount = keyCount + 1; |
|
|
|
|
everyGroupData.add(list.get(j)); |
|
|
|
|
} |
|
|
|
|
resultMap.put(keyCount + "", everyGroupData); |
|
|
|
|
everyGroupData = new ArrayList<>(); |
|
|
|
|
count = 0; |
|
|
|
|
} |
|
|
|
|
everyGroupData.add(list.get(j)); |
|
|
|
|
count++; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
for (int j = 1; j <= resultMap.size(); j++) { |
|
|
|
|
List<BiochemicalIdentificationExcel> arrVOList = resultMap.get(String.valueOf(j)); |
|
|
|
|
// 使用每一页的数据
|
|
|
|
|
if (arrVOList.size() % 2 == 0) { |
|
|
|
|
for (int i = 0; i < arrVOList.size() / 2; i++) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("num1", arrVOList.get(i).getExperieNum()); |
|
|
|
|
map.put("value1", arrVOList.get(i).getValue()); |
|
|
|
|
map.put("result1", arrVOList.get(i).getResult()); |
|
|
|
|
map.put("num2", arrVOList.get(arrVOList.size() / 2 + i).getExperieNum()); |
|
|
|
|
map.put("value2", arrVOList.get(arrVOList.size() / 2 + i).getValue()); |
|
|
|
|
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i).getResult()); |
|
|
|
|
resultList1.add(map); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
for (int i = 0; i < arrVOList.size() / 2 + 1; i++) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("num1", arrVOList.get(i).getExperieNum()); |
|
|
|
|
map.put("value1", arrVOList.get(i).getValue()); |
|
|
|
|
map.put("result1", arrVOList.get(i).getResult()); |
|
|
|
|
if (i < arrVOList.size() / 2) { |
|
|
|
|
map.put("num2", arrVOList.get(arrVOList.size() / 2 + i + 1).getExperieNum()); |
|
|
|
|
map.put("value2", arrVOList.get(arrVOList.size() / 2 + i + 1).getValue()); |
|
|
|
|
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i + 1).getResult()); |
|
|
|
|
} |
|
|
|
|
resultList1.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if (list.size() % 3 == 0) {
|
|
|
|
|
// for (int i = 0; i < list.size() / 3; i++) {
|
|
|
|
|
// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
// map.put("num1", list.get(i).getExperieNum());
|
|
|
|
|
// map.put("value1", list.get(i).getCtValue());
|
|
|
|
|
// map.put("result1", list.get(i).getValue());
|
|
|
|
|
// map.put("num2", list.get(list.size() / 3 + i).getExperieNum());
|
|
|
|
|
// map.put("value2", list.get(list.size() / 3 + i).getCtValue());
|
|
|
|
|
// map.put("result2", list.get(list.size() / 3 + i).getValue());
|
|
|
|
|
// map.put("num3", list.get(list.size() / 3 * 2 + i).getExperieNum());
|
|
|
|
|
// map.put("value3", list.get(list.size() / 3 * 2 + i).getCtValue());
|
|
|
|
|
// map.put("result3", list.get(list.size() / 3 * 2 + i).getValue());
|
|
|
|
|
// resultList1.add(map);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// for (int i = 0; i < list.size() / 3 + 1; i++) {
|
|
|
|
|
// if (list.size() % 3 == 1) {
|
|
|
|
|
// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
// map.put("num1", list.get(i).getExperieNum());
|
|
|
|
|
// map.put("value1", list.get(i).getCtValue());
|
|
|
|
|
// map.put("result1", list.get(i).getValue());
|
|
|
|
|
// if (i < list.size() / 3) {
|
|
|
|
|
// map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum());
|
|
|
|
|
// map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue());
|
|
|
|
|
// map.put("result2", list.get(list.size() / 3 + i + 1).getValue());
|
|
|
|
|
// map.put("num3", list.get(list.size() / 3 * 2 + i + 1).getExperieNum());
|
|
|
|
|
// map.put("value3", list.get(list.size() / 3 * 2 + i + 1).getCtValue());
|
|
|
|
|
// map.put("result3", list.get(list.size() / 3 * 2 + i + 1).getValue());
|
|
|
|
|
// }
|
|
|
|
|
// resultList1.add(map);
|
|
|
|
|
// } else if (list.size() % 3 == 2) {
|
|
|
|
|
// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
// map.put("num1", list.get(i).getExperieNum());
|
|
|
|
|
// map.put("value1", list.get(i).getCtValue());
|
|
|
|
|
// map.put("result1", list.get(i).getValue());
|
|
|
|
|
// map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum());
|
|
|
|
|
// map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue());
|
|
|
|
|
// map.put("result2", list.get(list.size() / 3 + i + 1).getValue());
|
|
|
|
|
// if (i < list.size() / 3) {
|
|
|
|
|
// map.put("num3", list.get(list.size() / 3 * 2 + i + 2).getExperieNum());
|
|
|
|
|
// map.put("value3", list.get(list.size() / 3 * 2 + i + 2).getCtValue());
|
|
|
|
|
// map.put("result3", list.get(list.size() / 3 * 2 + i + 2).getValue());
|
|
|
|
|
// }
|
|
|
|
|
// resultList1.add(map);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
result.put("list", resultList1); |
|
|
|
|
url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "SHJDreportPrint"); |
|
|
|
|
} |
|
|
|
|
// 普通和口蹄疫检测
|
|
|
|
|
else { |
|
|
|
|
DecimalFormat df = new DecimalFormat("#0.000"); |
|
|
|
|
@ -2569,6 +2852,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
|| "1570297916894146562".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570667729797705730".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570671477110534145".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1659464963116519426".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1589877000410296322".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1582988982068027393".equals(examineResult.getReagentId())) { |
|
|
|
|
result.put("18", "S/P"); |
|
|
|
|
@ -2579,11 +2863,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} else if ("1570283733628678145".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1533624738296389636".equals(examineResult.getReagentId())) { |
|
|
|
|
result.put("18", "阻断率"); |
|
|
|
|
} else if ("1665968083879366657".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1665964229817307138".equals(examineResult.getReagentId())) { |
|
|
|
|
result.put("18", "抑制率"); |
|
|
|
|
} else if ("1570295395605737473".equals(examineResult.getReagentId())) { |
|
|
|
|
result.put("18", "KQ"); |
|
|
|
|
} else if ("1570296117147660290".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570295846749270017".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570664922961080322".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1656852607882579970".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570666622551781378".equals(examineResult.getReagentId()) |
|
|
|
|
|| "1570667398619656194".equals(examineResult.getReagentId())) { |
|
|
|
|
result.put("18", "S/N"); |
|
|
|
|
@ -3147,26 +3435,35 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
* @param resultList3 |
|
|
|
|
*/ |
|
|
|
|
private List<Map<String, Object>> getCondition(List<ExamineDataArrVO> list, int i, DecimalFormat df, String s, String startNum, String endNum, String reagentId, List<Map<String, Object>> resultList3) { |
|
|
|
|
// 阴性对照OD值
|
|
|
|
|
double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); |
|
|
|
|
double a2 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); |
|
|
|
|
// 阳性对照OD值
|
|
|
|
|
double b1 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); |
|
|
|
|
double b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); |
|
|
|
|
|
|
|
|
|
double a1 = 0.00; |
|
|
|
|
double a2 = 0.00; |
|
|
|
|
double b1 = 0.00; |
|
|
|
|
double b2 = 0.00; |
|
|
|
|
double c1 = 0.00; |
|
|
|
|
double c2 = 0.00; |
|
|
|
|
if (StringUtils.isNotBlank(list.get((i * 96) + 4).getOriginResult())) { |
|
|
|
|
c1 = Double.parseDouble(list.get((i * 96) + 4).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(list.get((i * 96) + 5).getOriginResult())) { |
|
|
|
|
c2 = Double.parseDouble(list.get((i * 96) + 5).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
String format = ""; |
|
|
|
|
String format1 = ""; |
|
|
|
|
|
|
|
|
|
if (!"1570297053211455490".equals(reagentId)) { |
|
|
|
|
// 阴性对照OD值
|
|
|
|
|
a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); |
|
|
|
|
a2 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); |
|
|
|
|
// 阳性对照OD值
|
|
|
|
|
b1 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); |
|
|
|
|
b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); |
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(list.get((i * 96) + 4).getOriginResult())) { |
|
|
|
|
c1 = Double.parseDouble(list.get((i * 96) + 4).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(list.get((i * 96) + 5).getOriginResult())) { |
|
|
|
|
c2 = Double.parseDouble(list.get((i * 96) + 5).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 阴性对照平均OD值
|
|
|
|
|
String format = df.format((a1 + a2) / 2); |
|
|
|
|
// 阳性对照平均OD值
|
|
|
|
|
String format1 = df.format((b1 + b2) / 2); |
|
|
|
|
// 阴性对照平均OD值
|
|
|
|
|
format = df.format((a1 + a2) / 2); |
|
|
|
|
// 阳性对照平均OD值
|
|
|
|
|
format1 = df.format((b1 + b2) / 2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, Object> map1 = new HashMap<>(); |
|
|
|
|
Map<String, Object> map2 = new HashMap<>(); |
|
|
|
|
@ -3198,6 +3495,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map2.put("2", "阳性对照OD平均值"); |
|
|
|
|
map2.put("3", format1); |
|
|
|
|
} |
|
|
|
|
// 猪繁殖与呼吸综合征病毒抗体检测试剂盒(爱德士IDEXX)
|
|
|
|
|
else if ("1659464963116519426".equals(reagentId)) { |
|
|
|
|
map1.put("2", "阴性对照OD平均值"); |
|
|
|
|
map1.put("3", format); |
|
|
|
|
map2.put("2", "阳性对照OD平均值"); |
|
|
|
|
map2.put("3", format1); |
|
|
|
|
} |
|
|
|
|
// 禽白血病病毒ELISA抗原检测试剂盒(哈尔滨国生生物科技股份有限公司)
|
|
|
|
|
else if ("1589877000410296322".equals(reagentId)) { |
|
|
|
|
map1.put("2", "阴性对照OD值"); |
|
|
|
|
@ -3307,6 +3611,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map2.put("2", "阴性对照平均OD值-阳性对照平均OD值"); |
|
|
|
|
map2.put("3", Double.parseDouble(format) - Double.parseDouble(format1)); |
|
|
|
|
} |
|
|
|
|
// 羊小反刍兽疫病毒 ELISA抗体检测试剂盒---真瑞生物
|
|
|
|
|
else if ("1656852607882579970".equals(reagentId)) { |
|
|
|
|
map1.put("2", "阳性对照OD平均值"); |
|
|
|
|
map1.put("3", format1); |
|
|
|
|
map2.put("2", "阴性对照平均OD值-阳性对照平均OD值"); |
|
|
|
|
map2.put("3", Double.parseDouble(format) - Double.parseDouble(format1)); |
|
|
|
|
} |
|
|
|
|
// 牛布鲁氏菌竞争ELISA抗体检测试剂盒(羊)---洛阳莱普生信息科技有限公司
|
|
|
|
|
else if ("1570666622551781378".equals(reagentId)) { |
|
|
|
|
map1.put("2", "阳性对照OD平均值"); |
|
|
|
|
@ -3328,8 +3639,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map3.put("5", "成立"); |
|
|
|
|
resultList3.add(map3); |
|
|
|
|
} |
|
|
|
|
// 牛结核病γ-干扰素ELISA检测试剂盒---武汉科前生物股份有限公司
|
|
|
|
|
else if ("1570297053211455490".equals(reagentId) || "1631222146321997826".equals(reagentId)) { |
|
|
|
|
// 牛结核病γ-干扰素ELISA检测试剂盒---广州悦洋生物技术有限公司
|
|
|
|
|
else if ("1631222146321997826".equals(reagentId)) { |
|
|
|
|
double yin1 = Double.parseDouble(list.get((i * 96)).getOriginResult()); |
|
|
|
|
double yin2 = Double.parseDouble(list.get((i * 96) + 8).getOriginResult()); |
|
|
|
|
double yin3 = Double.parseDouble(list.get((i * 96) + 16).getOriginResult()); |
|
|
|
|
@ -3341,6 +3652,35 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map2.put("2", "阳性对照的平均值"); |
|
|
|
|
map2.put("3", df.format((yang1 + yang2 + yang3) / 3)); |
|
|
|
|
} |
|
|
|
|
// 牛结核病γ-干扰素ELISA检测试剂盒---武汉科前生物股份有限公司
|
|
|
|
|
else if ("1570297053211455490".equals(reagentId)) { |
|
|
|
|
double yin1 = Double.parseDouble(list.get((i * 96) + 78).getOriginResult()); |
|
|
|
|
double yin2 = Double.parseDouble(list.get((i * 96) + 86).getOriginResult()); |
|
|
|
|
double yang1 = Double.parseDouble(list.get((i * 96) + 79).getOriginResult()); |
|
|
|
|
double yang2 = Double.parseDouble(list.get((i * 96) + 87).getOriginResult()); |
|
|
|
|
map1.put("2", "阴性对照的平均值"); |
|
|
|
|
map1.put("3", df.format((yin1 + yin2) / 2)); |
|
|
|
|
map2.put("2", "阳性对照的平均值"); |
|
|
|
|
map2.put("3", df.format((yang1 + yang2) / 2)); |
|
|
|
|
} |
|
|
|
|
// 布鲁氏菌 CELISA 抗体检测试剂盒---青岛立见生物科技有限公司
|
|
|
|
|
else if ("1665968083879366657".equals(reagentId)) { |
|
|
|
|
double yin = (a1 + a2) / 2; |
|
|
|
|
double yang = (b1 + b2) / 2; |
|
|
|
|
map1.put("2", "阴性对照的平均值"); |
|
|
|
|
map1.put("3", df.format(yin)); |
|
|
|
|
map2.put("2", "阳性对照血清抑制率"); |
|
|
|
|
map2.put("3", df.format((yin - yang) / yin * 100) + "%"); |
|
|
|
|
} |
|
|
|
|
// 布鲁氏菌 CELISA 抗体检测试剂盒---科前生物
|
|
|
|
|
else if ("1665964229817307138".equals(reagentId)) { |
|
|
|
|
double yin = (a1 + a2) / 2; |
|
|
|
|
double yang = (b1 + b2) / 2; |
|
|
|
|
map1.put("2", "阴性对照的平均值"); |
|
|
|
|
map1.put("3", df.format(yin)); |
|
|
|
|
map2.put("2", "阳性对照抑制率"); |
|
|
|
|
map2.put("3", df.format((yin - yang) / yin * 100) + "%"); |
|
|
|
|
} |
|
|
|
|
map1.put("5", "成立"); |
|
|
|
|
map2.put("5", "成立"); |
|
|
|
|
resultList3.add(map1); |
|
|
|
|
@ -3712,12 +4052,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (examineList.size() < 6) { |
|
|
|
|
for (int i = 0; i < 6 - examineList.size(); i++) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("simpleName",""); |
|
|
|
|
map.put("simpleCount",""); |
|
|
|
|
map.put("experieNum",""); |
|
|
|
|
map.put("examineItemName",""); |
|
|
|
|
map.put("examineWayName",""); |
|
|
|
|
map.put("examineBasisName",""); |
|
|
|
|
map.put("simpleName", ""); |
|
|
|
|
map.put("simpleCount", ""); |
|
|
|
|
map.put("experieNum", ""); |
|
|
|
|
map.put("examineItemName", ""); |
|
|
|
|
map.put("examineWayName", ""); |
|
|
|
|
map.put("examineBasisName", ""); |
|
|
|
|
resultList.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -3808,11 +4148,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
|
|
|
|
|
String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "simpleHandlePrint"); |
|
|
|
|
XWPFDocument doc = null; |
|
|
|
|
// FileOutputStream fos = null;
|
|
|
|
|
FileOutputStream fos = null; |
|
|
|
|
try { |
|
|
|
|
doc = WordExportUtil.exportWord07(url, result); |
|
|
|
|
// fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表.docx");
|
|
|
|
|
// String filename = "测试.docx";
|
|
|
|
|
fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表.docx"); |
|
|
|
|
String filename = "测试.docx"; |
|
|
|
|
|
|
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
|
response.setHeader("content-disposition", "attachment;filename=12344.docx"); |
|
|
|
|
@ -3823,21 +4163,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} finally { |
|
|
|
|
// if (null != doc) {
|
|
|
|
|
//// doc.close();
|
|
|
|
|
// try {
|
|
|
|
|
// doc.write(fos);
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (null != fos) {
|
|
|
|
|
// try {
|
|
|
|
|
// fos.close();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (null != doc) { |
|
|
|
|
// doc.close();
|
|
|
|
|
try { |
|
|
|
|
doc.write(fos); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != fos) { |
|
|
|
|
try { |
|
|
|
|
fos.close(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != doc) { |
|
|
|
|
try { |
|
|
|
|
doc.close(); |
|
|
|
|
|