|
|
@ -919,31 +919,31 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut |
|
|
|
List<String> brandList = v.stream().map(DistributionParcelListEntity::getBrandName).collect(Collectors.toList()); |
|
|
|
List<String> brandList = v.stream().map(DistributionParcelListEntity::getBrandName).collect(Collectors.toList()); |
|
|
|
if (brandList.size()>1){ |
|
|
|
if (brandList.size()>1){ |
|
|
|
//多个品牌
|
|
|
|
//多个品牌
|
|
|
|
throw new RuntimeException(k+"多个品牌"); |
|
|
|
throw new ServiceException(k+"多个品牌"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> mallList = v.stream().map(DistributionParcelListEntity::getMallName).collect(Collectors.toList()); |
|
|
|
List<String> mallList = v.stream().map(DistributionParcelListEntity::getMallName).collect(Collectors.toList()); |
|
|
|
if (mallList.size()>1){ |
|
|
|
if (mallList.size()>1){ |
|
|
|
//多个商场
|
|
|
|
//多个商场
|
|
|
|
throw new RuntimeException(k+"多个商场"); |
|
|
|
throw new ServiceException(k+"多个商场"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<Long> brandId = v.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList()); |
|
|
|
List<Long> brandId = v.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList()); |
|
|
|
if (brandId.size()>1){ |
|
|
|
if (brandId.size()>1){ |
|
|
|
//多个品牌
|
|
|
|
//多个品牌
|
|
|
|
throw new RuntimeException(k+"多个品牌"); |
|
|
|
throw new ServiceException(k+"多个品牌"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> materialName = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
List<String> materialName = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
if (materialName.size()>1){ |
|
|
|
if (materialName.size()>1){ |
|
|
|
throw new RuntimeException(k+"存在多个物料单位"); |
|
|
|
throw new ServiceException(k+"存在多个物料单位"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
if (materialUnit.size()>1){ |
|
|
|
if (materialUnit.size()>1){ |
|
|
|
//多个物料单位
|
|
|
|
//多个物料单位
|
|
|
|
throw new RuntimeException(k+"存在多个物料单位"); |
|
|
|
throw new ServiceException(k+"存在多个物料单位"); |
|
|
|
} |
|
|
|
} |
|
|
|
int num = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
int num = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
if (num <= 0) { |
|
|
|
if (num <= 0) { |
|
|
|
//无有效的在库数量
|
|
|
|
//无有效的在库数量
|
|
|
|
throw new RuntimeException("无有效的在库数量"); |
|
|
|
throw new ServiceException("无有效的在库数量"); |
|
|
|
} |
|
|
|
} |
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
//直接添加
|
|
|
|
//直接添加
|
|
|
|