feat: 店铺信息返回霸王餐相关配置

This commit is contained in:
2024-11-05 17:15:39 +08:00
parent d4149c091b
commit 5ebdb1610c
2 changed files with 12 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ public class TbFreeDineConfig implements Serializable {
/** /**
* 是否启用 * 是否启用
*/ */
private Integer enable; private Integer enable = 0;
/** /**
* 充值多少倍免单 * 充值多少倍免单

View File

@@ -107,9 +107,11 @@ public class ProductService {
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired @Autowired
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
private final TbFreeDineConfigService freeDineConfigService;
public ProductService(ShopUtils shopUtils) { public ProductService(ShopUtils shopUtils, TbFreeDineConfigService freeDineConfigService) {
this.shopUtils = shopUtils; this.shopUtils = shopUtils;
this.freeDineConfigService = freeDineConfigService;
} }
private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO, String tableId, Object shopId) { private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO, String tableId, Object shopId) {
@@ -167,6 +169,12 @@ public class ProductService {
concurrentMap.put("storeInfo", shopInfo); concurrentMap.put("storeInfo", shopInfo);
concurrentMap.put("distance", distance); concurrentMap.put("distance", distance);
TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId != null ? shopId.toString() : tbShopTable.getShopId().toString()); TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId != null ? shopId.toString() : tbShopTable.getShopId().toString());
TbFreeDineConfig freeDineConfig = freeDineConfigService.getOne(new LambdaQueryWrapper<TbFreeDineConfig>()
.eq(TbFreeDineConfig::getShopId, shopId));
if (freeDineConfig == null) {
freeDineConfig = new TbFreeDineConfig();
}
concurrentMap.put("freeDingConfig", freeDineConfig);
try { try {
if (ObjectUtil.isEmpty(shopUser)) { if (ObjectUtil.isEmpty(shopUser)) {
TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId)); TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));