| | |
| | | List<Product> productList = productModel.stream().map(stringObjectMap -> { |
| | | Product product = new Product(); |
| | | product.setName(stringObjectMap.get("name").toString()); |
| | | product.setFather(stringObjectMap.get("father").toString()); |
| | | product.setUnit(stringObjectMap.get("unit").toString()); |
| | | if (ObjectUtils.isNotEmpty(stringObjectMap.get("father"))) { |
| | | product.setFather(stringObjectMap.get("father").toString()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(stringObjectMap.get("unit"))) { |
| | | product.setUnit(stringObjectMap.get("unit").toString()); |
| | | } |
| | | product.setSpecifications_id(specifications.getId()); |
| | | return product; |
| | | }).collect(Collectors.toList()); |