|
@@ -73,7 +73,7 @@ public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technol
|
|
|
for (TechnologyVo technologyVo : records) {
|
|
|
//处理适用产品列表
|
|
|
List<String> productNameList = new ArrayList<>();
|
|
|
- List<ApplicableProducts> applicableProductsList1 = applicableProductsMap.getOrDefault(technologyVo.getId(),new ArrayList<>());
|
|
|
+ List<ApplicableProducts> applicableProductsList1 = applicableProductsMap.getOrDefault(technologyVo.getId(), new ArrayList<>());
|
|
|
for (ApplicableProducts applicableProducts : applicableProductsList1) {
|
|
|
ProductInfo productInfo = productInfoMap.get(applicableProducts.getProductId());
|
|
|
if (ObjectUtil.isNotEmpty(productInfo)) {
|
|
@@ -127,7 +127,7 @@ public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technol
|
|
|
//获取适用产品信息
|
|
|
List<ApplicableProducts> list = applicableProductsService.list(q -> q.eq(ApplicableProducts::getTechnologyId, result.getId()));
|
|
|
List<Long> productList = list.stream().map(ApplicableProducts::getProductId).collect(Collectors.toList());
|
|
|
- if(ObjectUtil.isNotEmpty(productList)) {
|
|
|
+ if (ObjectUtil.isNotEmpty(productList)) {
|
|
|
List<ProductInfo> productInfos = productInfoService.listByIds(productList);
|
|
|
result.setApplicableProductsList(productInfos);
|
|
|
}
|
|
@@ -223,6 +223,9 @@ public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technol
|
|
|
Long technologyId = dto.getId();
|
|
|
Assert.notEmpty(technologyId, "工艺id不能为空");
|
|
|
List<ApplicableProducts> productList = dto.getProductList();
|
|
|
+ if (ObjectUtil.isEmpty(productList)) {
|
|
|
+ productList = new ArrayList<>();
|
|
|
+ }
|
|
|
productList.forEach(item -> item.setTechnologyId(technologyId));
|
|
|
applicableProductsService.editLinked(productList, ApplicableProducts::getTechnologyId, technologyId);
|
|
|
}
|