店铺新增初始化基本数据

This commit is contained in:
张松
2025-03-25 09:38:41 +08:00
parent 42fa1356f4
commit f070871c8e
3 changed files with 21 additions and 0 deletions

View File

@@ -11,4 +11,9 @@ import com.czg.account.entity.PointsBasicSetting;
*/
public interface PointsBasicSettingService extends IService<PointsBasicSetting> {
/**
* 初始化∫配置信息
* @param id 店铺id
*/
void initInfo(Long id);
}

View File

@@ -15,4 +15,13 @@ import org.apache.dubbo.config.annotation.DubboService;
@DubboService
public class PointsBasicSettingServiceImpl extends ServiceImpl<PointsBasicSettingMapper, PointsBasicSetting> implements PointsBasicSettingService{
@Override
public void initInfo(Long id) {
PointsBasicSetting record = getById(id);
if (record == null) {
PointsBasicSetting pointsBasicSetting = new PointsBasicSetting();
pointsBasicSetting.setShopId(id);
save(pointsBasicSetting);
}
}
}

View File

@@ -61,6 +61,10 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
private RedisService redisService;
@Resource
private ShopPayTypeService shopPayTypeService;
@Resource
private FreeDineConfigService freeDineConfigService;
@Resource
private PointsBasicSettingService pointsBasicSettingService;
@DubboReference
private SysParamsService sysParamsService;
@@ -149,6 +153,9 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
// 增加支付方式
shopPayTypeService.addInfo(shopInfo.getId());
// 初始化积分霸王餐设置
freeDineConfigService.getConfig(shopInfo.getId());
pointsBasicSettingService.initInfo(shopInfo.getId());
return updateById(shopInfo);
}