|
|
@@ -1,10 +1,12 @@
|
|
|
package com.fs.xiaoshouyi.service;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.fs.xiaoshouyi.client.XiaoShouYiHttpClient;
|
|
|
import com.fs.xiaoshouyi.config.XiaoShouYiProperties;
|
|
|
+import com.fs.xiaoshouyi.domain.XsyAccount;
|
|
|
import com.fs.xiaoshouyi.dto.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -42,19 +44,24 @@ public class XiaoShouYiMaterialService {
|
|
|
private final XiaoShouYiHttpClient httpClient;
|
|
|
private final XiaoShouYiProperties properties;
|
|
|
private final XsyAccountResolver xsyAccountResolver;
|
|
|
+ private final XsyAccountService xsyAccountService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 自动选账号:生成素材追踪链接
|
|
|
*/
|
|
|
public GenerateLinkResponse generateMaterialTrackLink(Long companyUserId,
|
|
|
- List<Long> materialIdList,
|
|
|
- Long sendUserId) {
|
|
|
+ List<Long> materialIdList) {
|
|
|
Long accountId = resolveAccountId(companyUserId);
|
|
|
+ XsyAccount xsyAccount = xsyAccountService.selectById(accountId);
|
|
|
+ if (ObjectUtil.isEmpty(xsyAccount)){
|
|
|
+ throw new RuntimeException("销售易账号不存在,accountId=" + accountId);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
Map<String, Object> body = new HashMap<String, Object>();
|
|
|
body.put("materialIdList", materialIdList);
|
|
|
- body.put("sendUserId", sendUserId);
|
|
|
+ body.put("sendUserId", xsyAccount.getSendUserId());
|
|
|
|
|
|
return executeWithRetry(
|
|
|
accountId,
|