| | |
| | | |
| | | //(4级)新增-->型号 |
| | | @Override |
| | | public void addSpecifications(SpecificationsDto specificationsDto) { |
| | | public String addSpecifications(SpecificationsDto specificationsDto) { |
| | | //校验添加该标准下的型号是否重复 |
| | | List<String> specificationsNameList = specificationsMapper.selectList(Wrappers.<Specifications>query().eq("standard_id", specificationsDto.getId())).stream().map(specifications -> { |
| | | String specificationsName = specifications.getName(); |
| | | return specificationsName; |
| | | }).collect(Collectors.toList()); |
| | | if (specificationsNameList.contains(specificationsDto.getSpecifications())){ |
| | | return "该标准下有该型号"; |
| | | } |
| | | /*新增型号表*/ |
| | | Specifications specifications = new Specifications(); |
| | | specifications.setStandardId(specificationsDto.getId()); |
| | |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "添加型号【"+ specificationsDto.getSpecifications() +"】成功!"; |
| | | } |
| | | |
| | | /** |