同步触发

This commit is contained in:
wangw 2025-04-10 11:04:54 +08:00
parent 46f6481552
commit f7ec556cd3
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package com.czg.service.account.service.impl;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.log.Log;
import com.czg.account.dto.ShopBranchDTO;
import com.czg.account.entity.ShopConfig;
import com.czg.account.entity.ShopInfo;
@ -22,6 +23,7 @@ import com.github.pagehelper.PageInfo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
@ -33,6 +35,7 @@ import java.util.List;
* @author tankaikai
* @since 2025-04-07 14:20
*/
@Slf4j
@Service
public class ShopBranchServiceImpl implements ShopBranchService {
@ -107,8 +110,10 @@ public class ShopBranchServiceImpl implements ShopBranchService {
branchConfig.setIsEnableVipSync(YesNoEnum.YES.value());
shopConfigMapper.update(branchConfig);
ThreadUtil.execAsync(() -> {
log.info("开始同步店铺id{}分店id{} 操作人Id:{}", shopId, branchShop.getId(), StpKit.USER.getLoginIdAsLong());
// 同步商品和耗材
shopSyncService.sync(shopId, branchShop.getId(), StpKit.USER.getLoginIdAsLong());
log.info("同步结束店铺id{}分店id{} 操作人Id:{}", shopId, branchShop.getId(), StpKit.USER.getLoginIdAsLong());
});
ThreadUtil.execAsync(() -> {
// 同步会员信息