diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java index 77d943f..4ae12e5 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java @@ -1,5 +1,6 @@ package org.springblade.lims.service.impl; +import com.alibaba.nacos.common.utils.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.AllArgsConstructor; @@ -62,6 +63,11 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(Simple::getEntrustId, taskBlueprint.getEntrustId()); + wrapper1.orderByAsc(Simple::getSort); + List simples = simpleService.list(wrapper1); // 如果是追加检验计划提交 if (taskBlueprint.getIsContinue() != null && taskBlueprint.getIsContinue() == 1) { @@ -76,6 +82,7 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("dept_id", eTask.getDeptId()); + queryWrapper.eq("entrust_id", taskBlueprint.getEntrustId()); List examinesInDB = examineService.list(queryWrapper); // 要加的检验 @@ -87,16 +94,34 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.eq(Simple::getEntrustId, taskBlueprint.getEntrustId()); +// LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); +// wrapper1.eq(Simple::getEntrustId, taskBlueprint.getEntrustId()); // 加这个查询条件是因为防止一个委托单加了牛拭子、牛血清、牛组织导致在样品log表检测编号都一样的情况 - wrapper1.eq(Simple::getSimpleName, examine.getSimpleName()); - wrapper1.orderByAsc(Simple::getSort); - List simples = simpleService.list(wrapper1); +// wrapper1.eq(Simple::getSimpleName, examine.getSimpleName()); +// wrapper1.orderByAsc(Simple::getSort); +// List simples = simpleService.list(wrapper1); // 组装样品log表 SimpleDoExamineLog log = new SimpleDoExamineLog(); @@ -148,7 +173,7 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.eq(Simple::getEntrustId, taskBlueprint.getEntrustId()); - wrapper1.eq(Simple::getSimpleName, examine.getSimpleName()); - wrapper1.orderByAsc(Simple::getSort); - List simples = simpleService.list(wrapper1); +// LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); +// wrapper1.eq(Simple::getEntrustId, taskBlueprint.getEntrustId()); +// wrapper1.eq(Simple::getSimpleName, examine.getSimpleName()); +// wrapper1.orderByAsc(Simple::getSort); +// List simples = simpleService.list(wrapper1); SimpleDoExamineLog log = new SimpleDoExamineLog(); log.setExamineId(examine.getId()); @@ -237,7 +262,7 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl examines, Examine dbExamine) { + // 判断该集合不为空 + if (CollectionUtils.isNotEmpty(examines)) { + // 循环检测 + for (Examine examine : examines) { + // 判断传过来的检测对象是否在集合中包含 + if (examine.getId().equals(dbExamine.getId())) { + return true; + } + } + } + return false; + } }