فهرست منبع

启用商品库拉取机器人

zhaotx 9 ماه پیش
والد
کامیت
6b6adc6af6

+ 4 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/config/FeishuRobotLinkConfig.java

@@ -75,9 +75,12 @@ public class FeishuRobotLinkConfig {
                                 public void run() {
                                     try {
                                         responseMessage(event, "商品库同步任务已启动");
-                                        feishuDocSyncService.syncBytedanceProductPlatform();
+                                        String res = feishuDocSyncService.syncBytedanceProductPlatform();
 //                                        feishuDocSyncService.syncBytedanceDysDistributeMovies();
 //                                        bytedanceProductUpdateService.runPlatform(platformId);
+                                        if (StringUtils.isNotEmpty(res)){
+                                            responseMessage(event, res);
+                                        }
                                         responseMessage(event, "商品库同步任务已完成,请登录巨量平台确认");
 //                                } catch (IOException e) {
 //                                    throw new RuntimeException(e);

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedanceProductUpdateMapper.xml

@@ -194,7 +194,7 @@
         </foreach>
     </insert>
     <insert id="batchInsertPlatform">
-        replace into deepthink.bytedance_product_main_advertiser
+        insert into deepthink.bytedance_product_main_advertiser
         (platform_id, advertiser_id, type, platform_type, platform_name, mini_instance_id,
          mi_appid, _status, social_credit_code, is_bytedance, is_wechat, is_dys, source)
         values

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/IFeishuDocSyncService.java

@@ -5,7 +5,7 @@ public interface IFeishuDocSyncService {
     /**
      * 同步巨量 IAA 商品库
      */
-    void syncBytedanceProductPlatform();
+    String syncBytedanceProductPlatform();
     /**
      * 同步巨量 端原生分销剧目
      */

+ 4 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/FeishuDocSyncServiceImpl.java

@@ -32,7 +32,7 @@ public class FeishuDocSyncServiceImpl implements IFeishuDocSyncService {
     @Autowired
     BytedanceProductDocProperties productDocProperties;
     @Override
-    public void syncBytedanceProductPlatform() {
+    public String syncBytedanceProductPlatform() {
         String readToken;
         try {
             //iaa
@@ -44,14 +44,14 @@ public class FeishuDocSyncServiceImpl implements IFeishuDocSyncService {
             List<String> all = bytedanceProductUpdateMapper.allPlatform();
             list.removeIf(a -> all.contains(a.getPlatformId()));
             if (!list.isEmpty()){
-                System.out.println("新增商品库:"+JSON.toJSONString(list));
                 bytedanceProductUpdateMapper.batchInsertPlatform(list);
+                return "新增商品库:"+JSON.toJSONString(list);
             }
         }catch (Exception e){
             log.error("获取飞书文档读权限token失败",e);
-            return;
+            return "商品库同步失败";
         }
-
+        return null;
 
     }