切换店铺统计 √

下单选择会员 √
注册会员 √
完善手机号 √
会员流水信息同步 √
This commit is contained in:
Tankaikai 2025-04-10 18:02:37 +08:00
parent e935d5932c
commit a04f3c69b3
1 changed files with 21 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.account.service.ShopConfigService;
import com.czg.annotation.SaStaffCheckPermission;
import com.czg.config.RabbitPublisher;
import com.czg.exception.CzgException;
@ -48,6 +49,8 @@ public class ProductController {
private final RabbitPublisher rabbitPublisher;
@Resource
private ShopSyncService shopSyncService;
@Resource
private ShopConfigService shopConfigService;
/**
* 商品-分页
@ -291,6 +294,24 @@ public class ProductController {
return CzgResult.success(data);
}
/**
* 商品-报损
*/
@PostMapping("sync")
@OperationLog("商品-同步主店商品信息")
//@SaAdminCheckPermission("product:sync")
public CzgResult<Void> sync() {
long shopId = StpKit.USER.getShopId(0L);
long sysUserId = StpKit.USER.getLoginIdAsLong();
Long headShopId = StpKit.USER.getHeadShopId();
ThreadUtil.execAsync(() -> {
shopSyncService.sync(headShopId, shopId, sysUserId);
});
CzgResult<Void> ret = CzgResult.success();
ret.setMsg("操作成功,数据正在后台同步中...");
return ret;
}
private void asyncToBranchShop(Long id) {
long shopId = StpKit.USER.getShopId(0L);
long sysUserId = StpKit.USER.getLoginIdAsLong();