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

@@ -17,7 +17,7 @@ import lombok.Data;
@Data
public class TbFreeDineConfig implements Serializable {
/**
*
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
@@ -25,7 +25,7 @@ public class TbFreeDineConfig implements Serializable {
/**
* 是否启用
*/
private Integer enable;
private Integer enable = 0;
/**
* 充值多少倍免单
@@ -147,4 +147,4 @@ public class TbFreeDineConfig implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

View File

@@ -107,9 +107,11 @@ public class ProductService {
private RedisUtil redisUtil;
@Autowired
private StringRedisTemplate stringRedisTemplate;
private final TbFreeDineConfigService freeDineConfigService;
public ProductService(ShopUtils shopUtils) {
public ProductService(ShopUtils shopUtils, TbFreeDineConfigService freeDineConfigService) {
this.shopUtils = shopUtils;
this.freeDineConfigService = freeDineConfigService;
}
private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO, String tableId, Object shopId) {
@@ -167,6 +169,12 @@ public class ProductService {
concurrentMap.put("storeInfo", shopInfo);
concurrentMap.put("distance", distance);
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 {
if (ObjectUtil.isEmpty(shopUser)) {
TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));