| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public List<ProductModel> selectModelList(ProductDto productDto) { |
| | | LambdaQueryWrapper<ProductModel> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ProductModel::getProductId, productDto.getId()); |
| | | queryWrapper.eq(productDto.getCreateUser() != null, ProductModel::getCreateUser, productDto.getCreateUser()); |
| | | queryWrapper.eq(productDto.getDeptId() != null, ProductModel::getDeptId, productDto.getDeptId()); |
| | | queryWrapper.in(productDto.getDeptIds() != null && productDto.getDeptIds().length > 0, ProductModel::getDeptId, Arrays.asList(productDto.getDeptIds())); |
| | | return productModelMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | |
| | | ProductModel item = productModelList.get(i); |
| | | int rowNum = i + 2; |
| | | |
| | | if (StringUtils.isEmpty(item.getProductCode())) { |
| | | return AjaxResult.error("第 " + rowNum + " 行导入失败: [产品编码] 不能为空"); |
| | | } |
| | | if (StringUtils.isEmpty(item.getModel())) { |
| | | return AjaxResult.error("第 " + rowNum + " 行导入失败: [规格型号] 不能为空"); |
| | | } |