小程序店铺信息获取相关

This commit is contained in:
张松 2025-02-27 14:39:48 +08:00
parent 2bca77252c
commit 2871e9f7ee
2 changed files with 7 additions and 1 deletions

View File

@ -1,11 +1,14 @@
package com.czg.account.dto.shopinfo;
import com.czg.account.entity.ShopExtend;
import com.czg.account.entity.ShopInfo;
import com.czg.account.entity.ShopTable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author Administrator
*/
@ -21,6 +24,7 @@ public class ShopInfoByCodeDTO {
* 店铺信息
*/
private ShopInfo shopInfo;
private Map<String, ShopExtend> shopExtendMap;
/**
* 台桌信息
*/

View File

@ -159,7 +159,9 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
}
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getShopId, shopInfo.getId()).eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()).one();
return new ShopInfoByCodeDTO(distance, shopInfo, shopTable, shopUser != null && shopUser.getIsVip() != null && shopUser.getIsVip() == 1);
List<ShopExtend> shopExtends = shopExtendService.listInfo(shopInfo.getId(), null);
Map<String, ShopExtend> shopExtendMap = shopExtends.stream().collect(Collectors.toMap(ShopExtend::getAutoKey, i -> i));
return new ShopInfoByCodeDTO(distance, shopInfo, shopExtendMap, shopTable, shopUser != null && shopUser.getIsVip() != null && shopUser.getIsVip() == 1);
}
@Override