parent
e935d5932c
commit
a04f3c69b3
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue