Explorar o código

销售易增加sendUserId

zyy hai 1 semana
pai
achega
feed0b29d3

+ 1 - 2
fs-admin/src/main/java/com/fs/xiaoshouyi/controller/XiaoShouYiController.java

@@ -72,8 +72,7 @@ public class XiaoShouYiController {
 
             GenerateLinkResponse response = materialService.generateMaterialTrackLink(
                                                                     companyUserId,
-                                                                    request.getMaterialIds(),
-                                                                    request.getSendUserId());
+                                                                    request.getMaterialIds());
 
             return response.isSuccess()
                     ? AjaxResult.success(response)

+ 1 - 2
fs-company/src/main/java/com/fs/xiaoshouyi/controller/XiaoShouYiController.java

@@ -72,8 +72,7 @@ public class XiaoShouYiController {
 
             GenerateLinkResponse response = materialService.generateMaterialTrackLink(
                                                                     companyUserId,
-                                                                    request.getMaterialIds(),
-                                                                    request.getSendUserId());
+                                                                    request.getMaterialIds());
 
             return response.isSuccess()
                     ? AjaxResult.success(response)

+ 1 - 1
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -2131,7 +2131,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                     materialIdList.add(materialWithUpload.getMaterialId());
 
                                     GenerateLinkResponse response =
-                                            xiaoShouYiMaterialService.generateMaterialTrackLink(Long.valueOf(companyUserId),materialIdList, 4256378833539950L);
+                                            xiaoShouYiMaterialService.generateMaterialTrackLink(Long.valueOf(companyUserId),materialIdList);
 
                                     if (response == null) {
                                         throw new RuntimeException("generateMaterialTrackLink返回为空");

+ 5 - 0
fs-service/src/main/java/com/fs/xiaoshouyi/domain/XsyAccount.java

@@ -73,4 +73,9 @@ public class XsyAccount {
 
     private Date createTime;
     private Date updateTime;
+
+    /**
+     * 销售易发送人id
+     */
+    private String sendUserId;
 }

+ 10 - 3
fs-service/src/main/java/com/fs/xiaoshouyi/service/XiaoShouYiMaterialService.java

@@ -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,

+ 4 - 2
fs-service/src/main/resources/mapper/xiaoshouyi/XsyAccountMapper.xml

@@ -93,7 +93,8 @@
             client_secret,
             redirect_uri,
             status,
-            create_time
+            create_time,
+            send_user_id
         ) values (
              #{id},
              #{accountName},
@@ -101,7 +102,8 @@
              #{clientSecret},
              #{redirectUri},
              #{status},
-             now()
+             now(),
+             #{sendUserId}
                  )
     </insert>