切换店铺统计 √
下单选择会员 √ 注册会员 √ 完善手机号 √ 会员流水信息同步 √
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否为管理端登录
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user