Commit 82589d5f by guojuxing

品牌添加共享标志

parent 92ec26dc
......@@ -53,6 +53,7 @@ public class StoreBrandController {
.collect(Collectors.toList());
Map<Integer, String> enterpriseMap = new HashMap<>();
Map<Integer, Integer> brandIdMap = new HashMap<>();
ServiceResponse<List<StoreBrandDTO>> brandResponse = storeBrandApiService.listAllStoreBrandInfoByIds(brandIdList);
if (brandResponse.isSuccess() && CollectionUtils.isNotEmpty(brandResponse.getResult())) {
......@@ -61,6 +62,9 @@ public class StoreBrandController {
.filter(e -> Objects.equals(e.getType(), 1))
.mapToInt(e -> e.getEnterpriseId()).boxed()
.collect(Collectors.toList());
brandIdMap = brandList.stream().filter(e -> Objects.equals(e.getType(), 1))
.collect(Collectors.toMap(e -> e.getStoreBrandId(), e -> e.getEnterpriseId()));
ServiceResponse<List<EnterpriseDTO>> enterpriseResponse = enterpriseApiService.listEnterpriseByIds(enterpriseIdList);
if (enterpriseResponse.isSuccess()) {
enterpriseMap = enterpriseResponse.getResult().stream().collect(Collectors.toMap(e -> e.getEnterpriseId(), e -> e.getEnterpriseName()));
......@@ -68,6 +72,7 @@ public class StoreBrandController {
}
Map<Integer, String> finalEnterpriseMap = enterpriseMap;
Map<Integer, Integer> finalBrandIdMap = brandIdMap;
voList = list.stream()
.map(e -> {
StoreWidgetInterfaceShareVO vo = new StoreWidgetInterfaceShareVO();
......@@ -75,7 +80,8 @@ public class StoreBrandController {
vo.setValue(e.getStoreBrandId().toString());
//共享类型
if (Objects.equals(e.getType(), 2)) {
vo.setEnterpriseName(finalEnterpriseMap.get(e.getEnterpriseId()));
Integer tempEnterpriseId = finalBrandIdMap.get(e.getStoreBrandId());
vo.setEnterpriseName(finalEnterpriseMap.get(tempEnterpriseId));
}
return vo;
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment