切换店铺统计 √

下单选择会员 √
注册会员 √
完善手机号 √
会员流水信息同步 √
This commit is contained in:
Tankaikai
2025-04-11 11:45:04 +08:00
parent efb833e8f0
commit be61a9dfea
2 changed files with 20 additions and 3 deletions

View File

@@ -303,9 +303,13 @@ public class ProductController {
public CzgResult<Void> sync() {
long shopId = StpKit.USER.getShopId(0L);
long sysUserId = StpKit.USER.getLoginIdAsLong();
long headShopId = StpKit.USER.getVipHeadShopId();
if(shopId == headShopId){
throw new CzgException("不存在主店分店关系,无需同步");
boolean isEnableSync = StpKit.USER.isEnableSync(shopId);
long headShopId = StpKit.USER.getHeadShopId();
if (!isEnableSync) {
throw new CzgException("主店未开启商品资料同步功能");
}
if (shopId == headShopId) {
throw new CzgException("不存在主子店铺关系,无需同步商品信息");
}
ThreadUtil.execAsync(() -> {
shopSyncService.sync(headShopId, shopId, sysUserId);

View File

@@ -242,6 +242,19 @@ public class MyStpLogic {
return shopId;
}
/**
* 是否启用同步功能
* @param shopId 店铺id
* @return 主店id
*/
public boolean isEnableSync(Long shopId) {
Integer isEnableProdSync = DbChain.table("tb_shop_config").select("is_enable_prod_sync").where("id = ?", shopId).objAs(Integer.class);
if (isEnableProdSync == null) {
return false;
}
return isEnableProdSync == 1;
}
/**
* 校验是否为管理端登录
*/