yumeng %!s(int64=5) %!d(string=hai) anos
pai
achega
9b92b49980

+ 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) {
                                                     HttpServletRequest req) {
         Result<IPage<KuaiShouGroup>> result = new Result<IPage<KuaiShouGroup>>();
         Result<IPage<KuaiShouGroup>> result = new Result<IPage<KuaiShouGroup>>();
         QueryWrapper<KuaiShouGroup> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouGroup, req.getParameterMap());
         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);
         Page<KuaiShouGroup> page = new Page<KuaiShouGroup>(pageNo, pageSize);
         IPage<KuaiShouGroup> pageList = kuaiShouGroupService.page(page, queryWrapper);
         IPage<KuaiShouGroup> pageList = kuaiShouGroupService.page(page, queryWrapper);
         result.setSuccess(true);
         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 creativeCreateTime;
 
 
     private Date creativeUpdateTime;
     private Date creativeUpdateTime;
+
+    private Long siteId;
+
+    private String programmedCreativeMaterial;
+
+
+    private String photoIds;
 }
 }

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

@@ -158,6 +158,7 @@ public class KuaiShouGroup {
     private String appIconUrl;
     private String appIconUrl;
 
 
 
 
+    private Long convertId; // 转化目标
     private String groupCreateTime;
     private String groupCreateTime;
     private String groupUpdateTime;
     private String groupUpdateTime;
 
 

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

@@ -30,6 +30,7 @@
         url,
         url,
         app_id,
         app_id,
         app_icon_url,
         app_icon_url,
+        convert_id,
         group_create_time,
         group_create_time,
         group_update_time,
         group_update_time,
         create_time,
         create_time,
@@ -64,6 +65,7 @@
             #{getGroup.url},
             #{getGroup.url},
             #{getGroup.appId},
             #{getGroup.appId},
             #{getGroup.appIconUrl},
             #{getGroup.appIconUrl},
+            #{getGroup.convertId},
             #{getGroup.groupCreateTime},
             #{getGroup.groupCreateTime},
             #{getGroup.groupUpdateTime},
             #{getGroup.groupUpdateTime},
             #{getGroup.createTime},
             #{getGroup.createTime},

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

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