浏览代码

Merge remote-tracking branch 'origin/test' into test

syh 5 年之前
父节点
当前提交
86754ce0d3

+ 28 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -867,4 +867,32 @@ public class TestController {
     }
 
 
+    @GetMapping(value = "/getAllGroupList")
+    public void getAllGroupList() {
+
+        try {
+
+            QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+            oauthTokenQueryWrapper.eq("media_id", 2);
+            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
+            if (!Check.isNull(ctopOauthTokens)) {
+                for (CtopOauthToken token : ctopOauthTokens) {
+                    executorService.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (!Check.isNull(token)) {
+                                log.info("获取组,账号id:{}", token.getAccountId());
+                                kuaishouInterfaceService.getGroupList(token, null, null);
+                            }
+                        }
+                    });
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
 }

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java

@@ -6,6 +6,7 @@ public enum MaterialEnum {
     VerticalVideoSmall(1, 720, 1280),
     VerticalVideo787Small(1, 787, 1280),
     VerticalVideo846Small(1, 846, 1536),
+    VerticalVideo1080mall(1, 1080, 2200),
     VerticalVideoBig(1, 1080, 1920),
     HorizontalVideoSmall(2, 1280, 720),
     HorizontalVideoBig(2, 1920, 1080);

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -340,7 +340,7 @@ public class BatchController {
                                                     HttpServletRequest req) {
         Result<IPage<KuaiShouGroup>> result = new Result<IPage<KuaiShouGroup>>();
         QueryWrapper<KuaiShouGroup> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouGroup, req.getParameterMap());
-        queryWrapper.orderByDesc("unit_id");
+        queryWrapper.orderByDesc("group_create_time");
         Page<KuaiShouGroup> page = new Page<KuaiShouGroup>(pageNo, pageSize);
         IPage<KuaiShouGroup> pageList = kuaiShouGroupService.page(page, queryWrapper);
         result.setSuccess(true);

+ 7 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java

@@ -212,4 +212,11 @@ public class KuaiShouCreative {
     private Date creativeCreateTime;
 
     private Date creativeUpdateTime;
+
+    private Long siteId;
+
+    private String programmedCreativeMaterial;
+
+
+    private String photoIds;
 }

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java

@@ -157,6 +157,12 @@ public class KuaiShouGroup {
     @ApiModelProperty(value = "APP图标存储地址")
     private String appIconUrl;
 
+
+    private Long convertId; // 转化目标
+    private String groupCreateTime;
+    private String groupUpdateTime;
+
+
     /**
      * 创建时间
      */

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml

@@ -30,6 +30,9 @@
         url,
         app_id,
         app_icon_url,
+        convert_id,
+        group_create_time,
+        group_update_time,
         create_time,
         update_time)
         values
@@ -62,6 +65,9 @@
             #{getGroup.url},
             #{getGroup.appId},
             #{getGroup.appIconUrl},
+            #{getGroup.convertId},
+            #{getGroup.groupCreateTime},
+            #{getGroup.groupUpdateTime},
             #{getGroup.createTime},
             #{getGroup.updateTime})
         </foreach>

+ 9 - 10
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1612,6 +1612,9 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUrl(detail.getString("url"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
+                    group.setGroupCreateTime(detail.getString("create_time"));
+                    group.setGroupUpdateTime(detail.getString("update_time"));
+                    group.setConvertId(detail.getLong("convert_id"));
                     group.setCreateTime(new Date());
                     group.setUpdateTime(new Date());
                     groups.add(group);
@@ -2012,30 +2015,25 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     }
                     creative.setCreateTime(new Date());
                     creative.setUpdateTime(new Date());
-
+                    creative.setPhotoId(detailJson.getString("photo_id"));
                     if (detailJson.getLong("photo_id") == 0) {
+                        JSONArray photoIds = new JSONArray();
                         JSONObject programmed_creative_material = detailJson.getJSONObject("programmed_creative_material");
                         if (!Check.isNull(programmed_creative_material)) {
+                            creative.setProgrammedCreativeMaterial(programmed_creative_material.toJSONString());
                             JSONArray materials = programmed_creative_material.getJSONArray("materials");
                             if (!Check.isNull(materials)) {
                                 for (int j = 0; j < materials.size(); j++) {
                                     JSONObject materialJson = materials.getJSONObject(j);
                                     if (!Check.isNull(materialJson)) {
                                         Long photo_id = materialJson.getLong("photo_id");
-                                        creative.setPhotoId(String.valueOf(photo_id));
-                                        creatives.add(creative);
+                                        photoIds.add(String.valueOf(photo_id));
                                     }
                                 }
+                                creative.setPhotoIds(photoIds.toJSONString());
                             }
                         }
-
-
-                    } else {
-                        creative.setPhotoId(detailJson.getString("photo_id"));
-                        creatives.add(creative);
                     }
-
-
                 }
             }
             creativeService.replaceBatch(creatives);
@@ -2123,6 +2121,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         try {
             String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
+            System.err.println(resultJson);
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {

+ 1 - 3
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/KuaiShouYiCheReportMapper.xml

@@ -446,8 +446,7 @@
             and t1.stat_date = #{statDate}
         </if>
         ) t2
-        WHERE t2.campaignName &gt;= 845
-        and t2.campaignName &lt;= 850;
+        WHERE t2.campaignName in(845,846,847,848,849,850,1071,1072)
 
     </select>
 
@@ -455,7 +454,6 @@
     <select id="getChannelSubcontractingReportByMap" parameterType="java.util.Map"
             resultType="com.alibaba.fastjson.JSONObject">
 
-
         SELECT
         '汇创' agent, -- 代理商
         (