|
@@ -359,11 +359,13 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
|
|
|
if (ObjectUtil.isEmpty(excelBoList)) {
|
|
|
return excelBoList;
|
|
|
}
|
|
|
+
|
|
|
List<String> productCodes = excelBoList.stream().map(SubscribeDetailExcelBo::getProductCustomCode).collect(Collectors.toList());
|
|
|
if (ObjectUtil.isNotEmpty(productCodes)) {
|
|
|
List<String> notArr = new ArrayList<>();
|
|
|
//赋值产品信息
|
|
|
Map<String, ProductInfo> productInfoMap = productInfoService.mapKEntity(ProductInfo::getCustomCode, q -> q.in(ProductInfo::getCustomCode, productCodes));
|
|
|
+
|
|
|
for (SubscribeDetailExcelBo subscribeDetailExcelBo : excelBoList) {
|
|
|
ProductInfo productInfo = productInfoMap.get(subscribeDetailExcelBo.getProductCustomCode());
|
|
|
if (ObjectUtil.isEmpty(productInfo)) {
|
|
@@ -376,8 +378,9 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
|
|
|
subscribeDetailExcelBo.setProductSpec(productInfo.getSpec());
|
|
|
subscribeDetailExcelBo.setProductUnit(productInfo.getUnit());
|
|
|
}
|
|
|
- if (notArr.size() != 0) {
|
|
|
- throw new ServiceException("以下产品不存在:" + notArr.stream().collect(Collectors.joining(",")));
|
|
|
+
|
|
|
+ if (!notArr.isEmpty()) {
|
|
|
+ throw new ServiceException("以下产品不存在:" + String.join(",", notArr));
|
|
|
}
|
|
|
}
|
|
|
return excelBoList;
|