huangpingkang 1 год назад
Родитель
Сommit
b720c125fb

+ 1 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/ChannelMapper.java

@@ -26,4 +26,5 @@ public interface ChannelMapper {
     List<JSONObject> getDistributorKey();
     void insertChangduDistributorApp(Set<ChangDuAppDistributor> adds);
     void insertChangduDistributorConfig(Set<ChangDuAppDistributor> adds);
+    void insertChannelAccountInfo(Set<ChangDuAppDistributor> adds);
 }

+ 15 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/ChannelMapper.xml

@@ -149,4 +149,19 @@
             )
         </foreach>
     </insert>
+    <insert id="insertChannelAccountInfo">
+        insert ignore into deepthink.channel_account_info
+        (channel_account_id,channel_account_name,channel_app_id,channel_app_name,business_type,secret_key)
+        values
+        <foreach collection="collection" item="item" separator=",">
+            (
+            #{item.distributorId},
+            #{item.distributorName},
+            #{item.appId},
+            #{item.appName},
+            #{item.channelType},
+            #{item.apiKey}
+            )
+        </foreach>
+    </insert>
 </mapper>

+ 2 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/ChannelServiceImpl.java

@@ -127,6 +127,7 @@ public class ChannelServiceImpl implements IChannelService {
                                     ChangDuAppDistributor distributorConfig = JSONObject.parseObject(resultJson.toJSONString(), ChangDuAppDistributor.class);
                                     distributorConfig.setChangduAccountId(changduAccountId);
                                     distributorConfig.setChannelType(3);
+                                    distributorConfig.setApiKey(apiKey);
                                     log.info("番茄获取小程序绑定的渠道信息 {}", distributorConfig);
                                     adds.add(distributorConfig);
                                 }
@@ -143,6 +144,7 @@ public class ChannelServiceImpl implements IChannelService {
             if (!Check.isNull(adds)) {
                 channelMapper.insertChangduDistributorApp(adds);
                 channelMapper.insertChangduDistributorConfig(adds);
+                channelMapper.insertChannelAccountInfo(adds);
             }
         } catch (Exception e) {
             e.printStackTrace();