fix bug
This commit is contained in:
@ -67,7 +67,7 @@ public class PopupController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得弹窗")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('shop:popup:query')")
|
||||
@PreAuthorize("@ss.hasPermission('shop:popup:get')")
|
||||
public CommonResult<PopupRespVO> getPopup(@RequestParam("id") Long id) {
|
||||
PopupDO popup = popupService.getPopup(id);
|
||||
return success(PopupConvert.INSTANCE.convert(popup));
|
||||
@ -76,7 +76,7 @@ public class PopupController {
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得弹窗列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('shop:popup:query')")
|
||||
@PreAuthorize("@ss.hasPermission('shop:popup:list')")
|
||||
public CommonResult<List<PopupRespVO>> getPopupList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<PopupDO> list = popupService.getPopupList(ids);
|
||||
return success(PopupConvert.INSTANCE.convertList(list));
|
||||
|
@ -139,18 +139,20 @@ public class ShopAssistantServiceImpl implements ShopAssistantService {
|
||||
}
|
||||
|
||||
private void fillData(PageResult<ShopAssistantRespVO> resPage) {
|
||||
List<Long> userIds = resPage.getList().stream().map(ShopAssistantRespVO::getUserId).distinct().collect(Collectors.toList());
|
||||
List<Long> storeIds = resPage.getList().stream().map(ShopAssistantRespVO::getStoreId).distinct().collect(Collectors.toList());
|
||||
Map<Long, MemberUserDO> userMap = userService.getUserList(userIds).stream().collect(Collectors.toMap(MemberUserDO::getId, Function.identity()));
|
||||
Map<Long, ShopDO> storeMap = shopService.getShopList(storeIds).stream().collect(Collectors.toMap(ShopDO::getId, Function.identity()));
|
||||
if(resPage.getTotal() > 0){
|
||||
List<Long> userIds = resPage.getList().stream().map(ShopAssistantRespVO::getUserId).distinct().collect(Collectors.toList());
|
||||
List<Long> storeIds = resPage.getList().stream().map(ShopAssistantRespVO::getStoreId).distinct().collect(Collectors.toList());
|
||||
Map<Long, MemberUserDO> userMap = userService.getUserList(userIds).stream().collect(Collectors.toMap(MemberUserDO::getId, Function.identity()));
|
||||
Map<Long, ShopDO> storeMap = shopService.getShopList(storeIds).stream().collect(Collectors.toMap(ShopDO::getId, Function.identity()));
|
||||
|
||||
resPage.getList().forEach(item -> {
|
||||
MemberUserDO user = userMap.getOrDefault(item.getUserId(), new MemberUserDO());
|
||||
ShopDO shop = storeMap.getOrDefault(item.getStoreId(), new ShopDO());
|
||||
item.setAvatar(user.getAvatar());
|
||||
item.setNickname(user.getNickname());
|
||||
item.setStoreName(shop.getStoreName());
|
||||
});
|
||||
resPage.getList().forEach(item -> {
|
||||
MemberUserDO user = userMap.getOrDefault(item.getUserId(), new MemberUserDO());
|
||||
ShopDO shop = storeMap.getOrDefault(item.getStoreId(), new ShopDO());
|
||||
item.setAvatar(user.getAvatar());
|
||||
item.setNickname(user.getNickname());
|
||||
item.setStoreName(shop.getStoreName());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user