检验下单选择样品的时候不用原本那个接口,去掉两层,直接从天线和无源器件开始选
| | |
| | | @ApiOperation(value = "获取标准树(检验下单)") |
| | | @GetMapping("/selectStandardTreeList2") |
| | | public Result selectStandardTreeList2() { |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | return Result.success(standardTreeService.selectStandardTreeList2()); |
| | | } |
| | | |
| | | @ValueClassify("标准库") |
| | |
| | | public interface StandardTreeService extends IService<StandardTree> { |
| | | |
| | | List<FactoryDto> selectStandardTreeList(); |
| | | List<SampleTypeDto> selectStandardTreeList2(); |
| | | |
| | | int addStandardTree(StandardTree standardTree); |
| | | |
| | |
| | | //按照电路试验--辐射试验--温湿度试验--环境试验进行排序 |
| | | // 定义自定义排序器 |
| | | Comparator<StandardProductList> testTypeComparator = (o1, o2) -> { |
| | | String[] order = {"电路试验", "辐射试验", "温湿度试验", "环境试验"}; |
| | | String[] order = {"电路试验", "辐射试验", "温湿度试验", "环境试验","功率试验"}; |
| | | int index1 = -1; |
| | | int index2 = -1; |
| | | // 找出两个对象 在自定义顺序数组中的位置 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SampleTypeDto> selectStandardTreeList2() { |
| | | List<SampleTypeDto> sampleTypeDtos= new ArrayList<>(); |
| | | List<FactoryDto> factoryDtos = standardTreeMapper.selectStandardTreeList(); |
| | | for (FactoryDto factoryDto : factoryDtos) { |
| | | for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { |
| | | for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) { |
| | | if (sampleTypeDto.getChildren().size() == 0) { |
| | | sampleTypeDto.setChildren(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue())); |
| | | } |
| | | sampleTypeDtos.add(sampleTypeDto); |
| | | } |
| | | } |
| | | } |
| | | return sampleTypeDtos; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardTree(StandardTree standardTree) { |
| | | StandardTree tree = standardTreeMapper.selectOne(Wrappers.<StandardTree>lambdaQuery() |