| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardTreeTemplateBindingVo> selectTemplateBindingsByStandardMethod(Integer standardMethodId) { |
| | | List<StandardTreeTemplateBindingVo> result = new ArrayList<>(); |
| | | if (standardMethodId == null) { |
| | | return result; |
| | | } |
| | | List<StandardTree> trees = this.list(Wrappers.<StandardTree>lambdaQuery() |
| | | .eq(StandardTree::getStandardMethodId, standardMethodId) |
| | | .isNull(StandardTree::getSampleType) |
| | | .isNull(StandardTree::getModel) |
| | | .isNotNull(StandardTree::getSample) |
| | | .orderByAsc(StandardTree::getId)); |
| | | Set<Integer> templateIds = new HashSet<>(); |
| | | for (StandardTree tree : trees) { |
| | | for (StandardTreeTemplateBindingVo binding : selectTemplateBindings(tree.getId())) { |
| | | if (templateIds.add(binding.getTemplateId())) { |
| | | result.add(binding); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveTemplateBindings(StandardTreeTemplateBindingDto dto) { |
| | | if (dto == null || dto.getStandardTreeId() == null) { |