| | |
| | | //(3级)新增-->标准,型号 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addStandard(StandardDto standardDto) { |
| | | public String addStandard(StandardDto standardDto) { |
| | | //校验添加该物料下的标准是否重复 |
| | | List<String> standNameList = standardMapper.selectList(Wrappers.<Standard>query().eq("material_id", standardDto.getId())).stream().map(standard -> { |
| | | String standardName = standard.getName(); |
| | | return standardName; |
| | | }).collect(Collectors.toList()); |
| | | if (standNameList.contains(standardDto.getStandard())){ |
| | | return "该产品下有该标准"; |
| | | } |
| | | /*新增标准表*/ |
| | | Standard standard = new Standard(); |
| | | standard.setMaterial_id(standardDto.getId()); |
| | |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "添加标准【"+ standardDto.getStandard() +"】成功!"; |
| | | } |
| | | } |
| | | |