|
|
|
@ -916,12 +916,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
Map<String, List<DistributionParcelListEntity>> listMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getMaterialName)); |
|
|
|
|
listMap.forEach((k,v)->{ |
|
|
|
|
//校验品牌
|
|
|
|
|
List<String> brandList = v.stream().map(DistributionParcelListEntity::getBrandName).collect(Collectors.toList()); |
|
|
|
|
List<String> brandList = v.stream().map(DistributionParcelListEntity::getBrandName).distinct().collect(Collectors.toList()); |
|
|
|
|
if (brandList.size()>1){ |
|
|
|
|
//多个品牌
|
|
|
|
|
throw new ServiceException(k+"多个品牌"); |
|
|
|
|
} |
|
|
|
|
List<String> mallList = v.stream().map(DistributionParcelListEntity::getMallName).collect(Collectors.toList()); |
|
|
|
|
List<String> mallList = v.stream().map(DistributionParcelListEntity::getMallName).distinct().collect(Collectors.toList()); |
|
|
|
|
if (mallList.size()>1){ |
|
|
|
|
//多个商场
|
|
|
|
|
throw new ServiceException(k+"多个商场"); |
|
|
|
@ -931,11 +931,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
//多个品牌
|
|
|
|
|
throw new ServiceException(k+"多个品牌"); |
|
|
|
|
} |
|
|
|
|
List<String> materialName = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialName = v.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
|
if (materialName.size()>1){ |
|
|
|
|
throw new ServiceException(k+"存在多个物料单位"); |
|
|
|
|
} |
|
|
|
|
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialUnit = v.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
|
if (materialUnit.size()>1){ |
|
|
|
|
//多个物料单位
|
|
|
|
|
throw new ServiceException(k+"存在多个物料单位"); |
|
|
|
|