Browse Source

转库存品BUG修复

dist.1.3.0
汤建军 5 months ago
parent
commit
30eaf5cfaa
  1. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

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

Loading…
Cancel
Save