Sfoglia il codice sorgente

Merge branch 'test' of http://git.tjyourong.com.cn/ctop/adsp-boot into test

jiequan.bi 4 anni fa
parent
commit
80c87f3cdc
48 ha cambiato i file con 1217 aggiunte e 235 eliminazioni
  1. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGui.java
  2. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 15 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  4. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  5. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java
  6. 62 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  7. 0 61
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/CutFrameJob.java
  8. 1 1
      jeecg-boot-module-system/src/main/resources/quartz.properties
  9. 3 5
      module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java
  10. 0 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/CtopOauthToken.java
  11. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java
  12. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/ICtopOauthTokenService.java
  13. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java
  14. 12 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  15. 24 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  16. 7 1
      module-common/src/main/java/cn/com/ctop/common/module/utils/CloudVideoProcessUtil.java
  17. 30 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyFlowsJob.java
  18. 31 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouTargetingTagsJob.java
  19. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  20. 250 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouTitleCollectionController.java
  21. 266 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouTrackUrlCollectionController.java
  22. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java
  23. 71 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouTitleCollection.java
  24. 77 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouTrackUrlCollection.java
  25. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouTitleCollectionMapper.java
  26. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouTrackUrlCollectionMapper.java
  27. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  28. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouTitleCollectionMapper.xml
  29. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouTrackUrlCollectionMapper.xml
  30. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java
  31. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouTitleCollectionService.java
  32. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouTrackUrlCollectionService.java
  33. 26 15
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java
  34. 117 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  35. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouTitleCollectionServiceImpl.java
  36. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouTrackUrlCollectionServiceImpl.java
  37. 3 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  38. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/KuaishouBidWarningServiceImpl.java
  39. 12 5
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceAudienceTemplateController.java
  40. 1 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java
  41. 20 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeController.java
  42. 3 26
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java
  43. 5 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java
  44. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceAdvertisePlanMapper.xml
  45. 12 6
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  46. 23 30
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceBidWarningServiceImpl.java
  47. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/BytedancePlanDailyReport.java
  48. 9 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGui.java

@@ -16,5 +16,6 @@ public class JeecgOneGui {
     public static void main(String[] args) {
         new CodeWindow().pack();
     }
-
 }
+
+

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -76,8 +76,6 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/appium/crawler/*", "anon");
 
         filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
-
-
         filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
 

+ 15 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.service.ISysRoleService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.StringUtils;
@@ -45,7 +46,8 @@ public class BindAccountLoginController {
     private UserAllocationMapper userAllocationMapper;
     @Autowired
     private ICreateInternalService createInternalService;
-
+    @Autowired
+    private ISysRoleService sysRoleService;
     /**
      * @param json
      * @return
@@ -123,9 +125,20 @@ public class BindAccountLoginController {
                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                          HttpServletRequest req) {
         Result<IPage<BindAccountLogin>> result = new Result<>();
+        String accountName = bindAccountLogin.getAccountName();
+        String loginType = bindAccountLogin.getLoginType();
+        bindAccountLogin.setAccountName(null);
+        bindAccountLogin.setLoginType(null);
         QueryWrapper<BindAccountLogin> queryWrapper = QueryGenerator.initQueryWrapper(bindAccountLogin, req.getParameterMap());
+        if(null!=accountName&&!"".equals(accountName.trim())){
+            queryWrapper.like("account_name",accountName);
+        }
+        if(null != loginType&&!"".equals(loginType.trim())&&!"none".equals(loginType)){
+            queryWrapper.eq("login_type",loginType);
+        }
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if (!Check.isNull(user)) {
+        String roleCode = sysRoleService.getRoleCodeByUserId(user.getId());
+        if(!roleCode.equals("admin")){
             queryWrapper.eq("user_id", user.getId());
         }
         queryWrapper.orderByDesc("id");

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java

@@ -107,7 +107,7 @@ public class ByteDanceTemplateController {
                                                               @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize, HttpServletRequest req) {
         Result<IPage<ByteDanceAdvertisePlan>> result = new Result<>();
         QueryWrapper<ByteDanceAdvertisePlan> queryWrapper = QueryGenerator.initQueryWrapper(plan, req.getParameterMap());
-        queryWrapper.eq("toutiao_id", plan.getToutiaoId()).orderByDesc("id");
+        queryWrapper.eq("account_id", plan.getAccountId()).orderByDesc("id");
         Page<ByteDanceAdvertisePlan> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceAdvertisePlan> pageList = planService.page(page, queryWrapper);
         result.setSuccess(true);

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java

@@ -116,13 +116,13 @@ public class MaterialImageInfoController {
     @AutoLog(value = "素材-分页列表查询")
     @ApiOperation(value = "素材-分页列表查询", notes = "素材-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<List<MaterialImageInfo>> queryPageList(String videoId) {
+    public Result<List<MaterialImageInfo>> queryPageList(String videoId,Integer status) {
         Result<List<MaterialImageInfo>> result = new Result<>();
-
         List<MaterialImageInfo> list = new ArrayList<>();
         if (!Check.isNull(videoId)) {
             QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("video_id", videoId);
+            queryWrapper.eq("status", status);
             list = MaterialImageInfoService.list(queryWrapper);
         }
 

+ 62 - 58
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -178,6 +178,8 @@ public class MaterialInfoController {
                                                      HttpServletRequest req) {
 
         Result<IPage<MaterialInfo>> result = new Result<>();
+        String materialName = materialInfo.getMaterialName();
+        materialInfo.setMaterialName(null);
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         Object createTime = materialInfo.getCreateTime();
         materialInfo.setCreateTime(null);
@@ -214,6 +216,10 @@ public class MaterialInfoController {
                 }
             }
         }
+        if (!Check.isNull(materialName)) {
+            queryWrapper.like("material_name", materialName);
+
+        }
         Page<MaterialInfo> page = new Page<>(pageNo, pageSize);
         IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
         List<MaterialInfo> materialInfoList = pageList.getRecords();
@@ -349,74 +355,72 @@ public class MaterialInfoController {
         Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
         if (materialInfoEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            String url = materialInfo.getUrl();
-            if (!Check.isNull(url)) {
-                if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
-                }
-                materialInfo.setUrl(url);
+            return result.error500("未找到对应实体");
+        }
+        String url = materialInfo.getUrl();
+        if (!Check.isNull(url)) {
+            if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
             }
+            materialInfo.setUrl(url);
+        }
 
-            //  修改素材库 相关联code
-            if (!Check.isNull(materialInfo.getCode())) {
-                String code = materialInfoEntity.getCode();
-                if (!Check.isNull(code)) {
-                    MaterialTag updateMaterialTag = new MaterialTag();
-                    updateMaterialTag.setMaterialId(materialInfo.getCode());
-                    QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
-                    tagQueryWrapper.eq("material_id", code);
-                    materialTagService.update(updateMaterialTag, tagQueryWrapper);
-                    MaterialParameter updateParameter = new MaterialParameter();
-                    updateParameter.setMaterialId(materialInfo.getCode());
-                    QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
-                    parameterQueryWrapper.eq("material_id", code);
-                    materialParameterService.update(updateParameter, parameterQueryWrapper);
-                    MaterialAscription updateMaterialAscription = new MaterialAscription();
-                    updateMaterialAscription.setMaterialId(materialInfo.getCode());
-                    QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
-                    ascriptionQueryWrapper.eq("material_id", code);
-                    materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
-                }
+        //  修改素材库 相关联code
+        if (!Check.isNull(materialInfo.getCode())) {
+            String code = materialInfoEntity.getCode();
+            if (!Check.isNull(code)) {
+                MaterialTag updateMaterialTag = new MaterialTag();
+                updateMaterialTag.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
+                tagQueryWrapper.eq("material_id", code);
+                materialTagService.update(updateMaterialTag, tagQueryWrapper);
+                MaterialParameter updateParameter = new MaterialParameter();
+                updateParameter.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
+                parameterQueryWrapper.eq("material_id", code);
+                materialParameterService.update(updateParameter, parameterQueryWrapper);
+                MaterialAscription updateMaterialAscription = new MaterialAscription();
+                updateMaterialAscription.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
+                ascriptionQueryWrapper.eq("material_id", code);
+                materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
             }
+        }
 
-            //  审核通过自动同步到到媒体后台
-           /* Long projectId = materialInfoEntity.getProjectId();
-            Project project = projectService.getById(projectId);
-            if (!Check.isNull(projectId)) {
-                if ("2".equals(project.getMediaId())) {
-                    if (!Check.isNull(materialInfo.getStatus())) {
-                        Integer status = materialInfo.getStatus();
-                        if (status == 1) {
-                            Thread thread = new Thread() {
-                                @Override
-                                public void run() {
-                                    log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
-                                    uploadService.upload(materialInfoEntity);
-                                }
-                            };
-                            thread.start();
-                        }
+        //  审核通过自动同步到到媒体后台
+       /* Long projectId = materialInfoEntity.getProjectId();
+        Project project = projectService.getById(projectId);
+        if (!Check.isNull(projectId)) {
+            if ("2".equals(project.getMediaId())) {
+                if (!Check.isNull(materialInfo.getStatus())) {
+                    Integer status = materialInfo.getStatus();
+                    if (status == 1) {
+                        Thread thread = new Thread() {
+                            @Override
+                            public void run() {
+                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
+                                uploadService.upload(materialInfoEntity);
+                            }
+                        };
+                        thread.start();
                     }
                 }
-
-            }*/
-
-            boolean ok = materialInfoService.updateById(materialInfo);
-            if (ok) {
-                result.success("修改成功!");
             }
 
-            Integer status = materialInfo.getStatus();
-            // 如果状态为2 审核拒绝 给上传人发送消息
-            if (status == 2) {
-                Project project = projectService.getById(materialInfoEntity.getProjectId());
-                String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
-                sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
-            }
+        }*/
+
+        boolean ok = materialInfoService.updateById(materialInfo);
+        if (ok) {
+            result.success("修改成功!");
         }
 
+        Integer status = materialInfo.getStatus();
+        // 如果状态为2 审核拒绝 给上传人发送消息
+        if (status == 2) {
+            Project project = projectService.getById(materialInfoEntity.getProjectId());
+            String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
+            sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
+        }
         return result;
 
     }

+ 0 - 61
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/CutFrameJob.java

@@ -1,61 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.MaterialCutFrameTask;
-import cn.com.ctop.common.module.service.IMaterialCutFrameService;
-import cn.com.ctop.common.module.service.IMaterialCutFrameTaskService;
-import cn.com.ctop.common.module.utils.Check;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.Executors;
-
-import static org.jeecg.modules.ctop.job.KuaishouDailyGroupReportLoadJob.executorService;
-
-/**
- * 获取抽帧视频
- */
-@Slf4j
-public class CutFrameJob implements Job {
-    @Autowired
-    private IMaterialCutFrameService materialCutFrameService;
-    @Autowired
-    private IMaterialCutFrameTaskService taskService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-
-                log.info("开始抽帧定时任务");
-                QueryWrapper<MaterialCutFrameTask> taskQueryWrapper = new QueryWrapper<>();
-                taskQueryWrapper.eq("job_status", 0);
-                //taskQueryWrapper.eq("cloud_type", 2);
-                List<MaterialCutFrameTask> list = taskService.list(taskQueryWrapper);
-
-                if (Check.isNull(list)) {
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(5);
-                list.forEach(cutFrameTask -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            //获取广告计划信息数据
-                            materialCutFrameService.loadCutFrame(cutFrameTask.getJobId(), cutFrameTask.getVideoSignature());
-                            //materialCutFrameService.loadCosCutFrame(cutFrameTask.getJobId(), cutFrameTask.getVideoSignature());  //腾讯云任务状态查询以及图片下载
-                        }
-                    });
-                });
-            }
-        };
-        thread.start();
-
-
-    }
-}

+ 1 - 1
jeecg-boot-module-system/src/main/resources/quartz.properties

@@ -4,7 +4,7 @@ org.quartz.scheduler.batchTriggerAcquisitionMaxCount=50
 org.quartz.threadPool.threadPriority=5
 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
 org.quartz.jobStore.misfireThreshold=600000
-org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
+# org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
 
 ##打开集群模式
 #org.quartz.jobStore.isClustered = true

+ 3 - 5
module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -51,11 +52,8 @@ public class BindAccountLogin {
     @Excel(name = "平台账户id", width = 15)
     @ApiModelProperty(value = "平台账户id")
     private String accountId;
-    /**
-     * 广告id
-     */
-    @Excel(name = "用户Id", width = 15)
-    @ApiModelProperty(value = "用户id")
+
+    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
     private String userId;
     /**
      * 账号

+ 0 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/CtopOauthToken.java

@@ -87,7 +87,6 @@ public class CtopOauthToken {
     private Date refreshTokenExpiresIn;
 
 
-
     /**
      * 创建时间
      */

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

@@ -34,7 +34,7 @@ public enum MaterialEnum {
             }
         }
 
-        return 0;
+        return 1;
     }
 
 

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/ICtopOauthTokenService.java

@@ -33,4 +33,6 @@ public interface ICtopOauthTokenService extends IService<CtopOauthToken> {
     List<CtopOauthToken> getToutiaoTokenByCreateTime(String createTime);
 
     List<CtopOauthToken> getByProjectId(long projectId);
+
+    CtopOauthToken selectOneByMediaId(String platformTypeKuaishou);
 }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.io.IOException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 截屏
@@ -32,4 +31,5 @@ public interface IMaterialCutFrameService extends IService<MaterialCutFrame> {
 
     MaterialCutFrame getCutFrameByCode(String code);
 
+    boolean updateTencentCutFrame(String videoMD5);
 }

+ 12 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -60,6 +60,8 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         param.put("grant_type", "refresh_token");
         param.put("refresh_token", token.getRefreshToken());
         String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
+        System.err.println(JSONObject.parseObject(result));
+        XxlJobLogger.log("头条刷新token;accountId:{},返回信息:{}", token.getAccountId(), result);
         if(null == result||result.trim().equals("")||result.equalsIgnoreCase("null")){
             XxlJobLogger.log("头条刷新token失败;accountId:{},返回信息:{}", token.getAccountId(), result);
             resultMap.put("message", "token刷新失败");
@@ -81,7 +83,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
             updateRefreshToken.setRefreshTokenExpiresIn(addSecond(now, refreshTokenExpiresIn));
             updateRefreshToken.setAccessTokenExpiresIn(addSecond(now, expiresIn));
             QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("access_token", token);
+            queryWrapper.eq("access_token", token.getAccessToken());
             queryWrapper.eq("media_id", 1);
             int i = ctopOauthTokenMapper.update(updateRefreshToken, queryWrapper);
             if (i > 0) {
@@ -217,6 +219,15 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         return this.list(queryWrapper);
     }
 
+    @Override
+    public CtopOauthToken selectOneByMediaId(String platformTypeKuaishou) {
+        QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
+        tokenQueryWrapper.eq("media_id", platformTypeKuaishou);
+        tokenQueryWrapper.orderByDesc("create_time");
+        tokenQueryWrapper.last("limit 1");
+        return this.getOne(tokenQueryWrapper);
+    }
+
     private Date addSecond(Date date, int seconds) {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);

+ 24 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -344,7 +344,27 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
             this.save(coveCutFrame);
             LoadFileUtil.delFile(coverCutFramePath);
             // 请求从数据接口 获取其余14张截图
+            getCut(materialId, videoUrl, loadImage, 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+    }
+
+
+    private void getCut(String materialId, String videoUrl, String loadImage, Integer count) {
+        try {
             Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
+            if (count < 4) {
+                getCut(materialId, videoUrl, loadImage, count + 1);
+            } else {
+                return;
+            }
+
+            if (Check.isNullMap(coverMap)) {
+                return;
+            }
             for (int i = 0; i <= 13; i++) {
                 String url = (String) coverMap.get(String.valueOf(i));
                 if (!Check.isNull(url)) {
@@ -358,10 +378,13 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
                     this.save(cutFrame);
                     LoadFileUtil.delFile(cutFramePath);
                 }
-
             }
+
         } catch (Exception e) {
+            log.info("抽帧异常,code:{}", materialId);
             e.printStackTrace();
+            getCut(materialId, videoUrl, loadImage, count + 1);
+
         }
 
     }

+ 7 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/CloudVideoProcessUtil.java

@@ -141,6 +141,12 @@ public class CloudVideoProcessUtil {
         }
     }
 
+    public static void main(String[] args) {
+        String loadImage = "cutFrame/" + 12345 + "/${Number}.jpg";
+        Map<String, Object> stringObjectMap = videoCutFrameHandle("/video/2020-07-22/1595381635927-JX.美白丸混剪.mp4", loadImage);
+        System.err.println(stringObjectMap);
+    }
+
     /**
      * 数据万象发起视频抽帧处理请求
      */
@@ -181,7 +187,7 @@ public class CloudVideoProcessUtil {
         Map JobsDetail = (Map) ((Map) mapResp.get("Response")).get("JobsDetail");
         if (JobsDetail.get("Code").equals("Success")) {
             Map jobStatusMap = null;
-            for (int i = 0; i < 10; i++) {
+            for (int i = 0; i < 30; i++) {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {

+ 30 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyFlowsJob.java

@@ -0,0 +1,30 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class KuaishouDailyFlowsJob {
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @XxlJob("kuaishouDailyFlowsJob")
+    public ReturnT<String> execute(String param) {
+        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
+        if (!Check.isNull(tokens)) {
+            for (CtopOauthToken ctopOauthToken : tokens) {
+                kuaishouInterfaceService.getDailyFlows(ctopOauthToken);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+}

+ 31 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouTargetingTagsJob.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaishouTargetingTagsJob {
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
+    /**
+     * 定时更新 快手 标签
+     * @throws JobExecutionException
+     */
+    @XxlJob("kuaishouTargetingTagsJob")
+    public ReturnT<String> execute(String params)throws Exception {
+        CtopOauthToken token = oauthTokenService.selectOneByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        kuaishouInterfaceService.getTargetingTags(token.getAccountId(), token.getAccessToken());
+        kuaishouInterfaceService.areaList(token.getAccessToken());
+        return ReturnT.SUCCESS;
+    }
+}

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

@@ -1133,6 +1133,7 @@ public class BatchController {
                 queryWrapper.between("stat_date", startDate, endDate);
             }
             queryWrapper.orderByDesc("stat_date");
+            queryWrapper.orderByDesc("photo_id");
             queryWrapper.groupBy("signature");
             Page<KuaiShouVideoGet> page = new Page<>(pageNo, pageSize);
             IPage<KuaiShouVideoGet> pageList = kuaiShouVideoGetService.page(page, queryWrapper);
@@ -1695,7 +1696,7 @@ public class BatchController {
             }
             JSONArray unitIds = requestJson.getJSONArray("unitIds");
             if (Check.isNull(unitIds)) {
-                throw new Exception("请选择需要修改的广告组");
+                throw new Exception("请选择需要复制的广告组");
             }
 
             Long copyToCampaignId = requestJson.getLong("copyToCampaignId");
@@ -1707,6 +1708,7 @@ public class BatchController {
                     continue;
                 }
                 kuaiShouGroupService.getGroupByUnitId(oauthToken.getAccessToken(), oauthToken.getAccountId(), unitId);
+                kuaiShouGroupService.getCreativeByUnit(oauthToken.getAccessToken(), oauthToken.getAccountId(), unitId);
                 QueryWrapper<KuaiShouGroup> queryWrapper = new QueryWrapper<>();
                 queryWrapper.eq("account_id", accountId);
                 queryWrapper.eq("unit_id", unitId);
@@ -1769,6 +1771,7 @@ public class BatchController {
 
             Long unitId = requestJson.getLong("unitId");
             kuaiShouGroupService.getGroupByUnitId(oauthToken.getAccessToken(), oauthToken.getAccountId(), unitId);
+            kuaiShouGroupService.getCreativeByUnit(oauthToken.getAccessToken(), oauthToken.getAccountId(), unitId);
             Long copyToCampaignId = requestJson.getLong("copyToCampaignId");
             JSONArray failArr = new JSONArray();
             Integer createCount = requestJson.getInteger("createCount");
@@ -1868,6 +1871,8 @@ public class BatchController {
             if (Check.isNull(oauthToken)) {
                 throw new Exception("未获取到账户信息");
             }
+            Long copyUnitId = requestJson.getLong("copyUnitId");
+            kuaiShouGroupService.getCreativeByUnit(oauthToken.getAccessToken(), oauthToken.getAccountId(), copyUnitId);
             JSONObject returnJson = new JSONObject();
             JSONObject groupJson = requestJson.getJSONObject("groupArr");
             requestJson.remove("groupArr");

+ 250 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouTitleCollectionController.java

@@ -0,0 +1,250 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTitleCollection;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouTitleCollectionService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 标题收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Slf4j
+@Api(tags = "标题收藏")
+@RestController
+@RequestMapping("/kuaishou/kuaiShouTitleCollection")
+public class KuaiShouTitleCollectionController {
+    @Autowired
+    private IKuaiShouTitleCollectionService kuaiShouTitleCollectionService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouTitleCollection
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "标题收藏-分页列表查询")
+    @ApiOperation(value = "标题收藏-分页列表查询", notes = "标题收藏-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouTitleCollection>> queryPageList(KuaiShouTitleCollection kuaiShouTitleCollection,
+                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                HttpServletRequest req) {
+        Result<IPage<KuaiShouTitleCollection>> result = new Result<>();
+        QueryWrapper<KuaiShouTitleCollection> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouTitleCollection, req.getParameterMap());
+        queryWrapper.orderByDesc("create_time");
+        Page<KuaiShouTitleCollection> page = new Page<KuaiShouTitleCollection>(pageNo, pageSize);
+        IPage<KuaiShouTitleCollection> pageList = kuaiShouTitleCollectionService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+        
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouTitleCollection
+     * @return
+     */
+    @AutoLog(value = "标题收藏-添加")
+    @ApiOperation(value = "标题收藏-添加", notes = "标题收藏-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouTitleCollection> add(@RequestBody KuaiShouTitleCollection kuaiShouTitleCollection) {
+        Result<KuaiShouTitleCollection> result = new Result<>();
+        try {
+            kuaiShouTitleCollectionService.save(kuaiShouTitleCollection);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouTitleCollection
+     * @return
+     */
+    @AutoLog(value = "标题收藏-编辑")
+    @ApiOperation(value = "标题收藏-编辑", notes = "标题收藏-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouTitleCollection> edit(@RequestBody KuaiShouTitleCollection kuaiShouTitleCollection) {
+        Result<KuaiShouTitleCollection> result = new Result<KuaiShouTitleCollection>();
+        KuaiShouTitleCollection kuaiShouTitleCollectionEntity = kuaiShouTitleCollectionService.getById(kuaiShouTitleCollection.getId());
+        if (kuaiShouTitleCollectionEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouTitleCollectionService.updateById(kuaiShouTitleCollection);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "标题收藏-通过id删除")
+    @ApiOperation(value = "标题收藏-通过id删除", notes = "标题收藏-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouTitleCollectionService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "标题收藏-批量删除")
+    @ApiOperation(value = "标题收藏-批量删除", notes = "标题收藏-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaiShouTitleCollection> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouTitleCollection> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouTitleCollectionService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "标题收藏-通过id查询")
+    @ApiOperation(value = "标题收藏-通过id查询", notes = "标题收藏-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouTitleCollection> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouTitleCollection> result = new Result<>();
+        KuaiShouTitleCollection kuaiShouTitleCollection = kuaiShouTitleCollectionService.getById(id);
+        if (kuaiShouTitleCollection == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouTitleCollection);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouTitleCollection> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouTitleCollection kuaiShouTitleCollection = JSON.parseObject(deString, KuaiShouTitleCollection.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouTitleCollection, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouTitleCollection> pageList = kuaiShouTitleCollectionService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "标题收藏列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouTitleCollection.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("标题收藏列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaiShouTitleCollection> listKuaiShouTitleCollections = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouTitleCollection.class, params);
+                kuaiShouTitleCollectionService.saveBatch(listKuaiShouTitleCollections);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouTitleCollections.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 266 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouTrackUrlCollectionController.java

@@ -0,0 +1,266 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTrackUrlCollection;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouTrackUrlCollectionService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 监测链接收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Slf4j
+@Api(tags = "监测链接收藏")
+@RestController
+@RequestMapping("/kuaishou/kuaiShouTrackUrlCollection")
+public class KuaiShouTrackUrlCollectionController {
+    @Autowired
+    private IKuaiShouTrackUrlCollectionService kuaiShouTrackUrlCollectionService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouTrackUrlCollection
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-分页列表查询")
+    @ApiOperation(value = "监测链接收藏-分页列表查询", notes = "监测链接收藏-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouTrackUrlCollection>> queryPageList(KuaiShouTrackUrlCollection kuaiShouTrackUrlCollection,
+                                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                   HttpServletRequest req) {
+        Result<IPage<KuaiShouTrackUrlCollection>> result = new Result<>();
+        QueryWrapper<KuaiShouTrackUrlCollection> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouTrackUrlCollection, req.getParameterMap());
+        Page<KuaiShouTrackUrlCollection> page = new Page<KuaiShouTrackUrlCollection>(pageNo, pageSize);
+        IPage<KuaiShouTrackUrlCollection> pageList = kuaiShouTrackUrlCollectionService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    @GetMapping(value = "/checkTrackName")
+    public Result<Boolean> checkTrackName(Long accountId, String trackName) {
+        Result<Boolean> result = new Result<>();
+        QueryWrapper<KuaiShouTrackUrlCollection> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("track_name", trackName);
+        List<KuaiShouTrackUrlCollection> list = kuaiShouTrackUrlCollectionService.list(queryWrapper);
+        if (Check.isNull(list)) {
+            result.setResult(true);
+        } else {
+            result.setResult(false);
+        }
+
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouTrackUrlCollection
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-添加")
+    @ApiOperation(value = "监测链接收藏-添加", notes = "监测链接收藏-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouTrackUrlCollection> add(@RequestBody KuaiShouTrackUrlCollection kuaiShouTrackUrlCollection) {
+        Result<KuaiShouTrackUrlCollection> result = new Result<>();
+        try {
+            kuaiShouTrackUrlCollectionService.save(kuaiShouTrackUrlCollection);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouTrackUrlCollection
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-编辑")
+    @ApiOperation(value = "监测链接收藏-编辑", notes = "监测链接收藏-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouTrackUrlCollection> edit(@RequestBody KuaiShouTrackUrlCollection kuaiShouTrackUrlCollection) {
+        Result<KuaiShouTrackUrlCollection> result = new Result<KuaiShouTrackUrlCollection>();
+        KuaiShouTrackUrlCollection kuaiShouTrackUrlCollectionEntity = kuaiShouTrackUrlCollectionService.getById(kuaiShouTrackUrlCollection.getId());
+        if (kuaiShouTrackUrlCollectionEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouTrackUrlCollectionService.updateById(kuaiShouTrackUrlCollection);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-通过id删除")
+    @ApiOperation(value = "监测链接收藏-通过id删除", notes = "监测链接收藏-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouTrackUrlCollectionService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-批量删除")
+    @ApiOperation(value = "监测链接收藏-批量删除", notes = "监测链接收藏-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaiShouTrackUrlCollection> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouTrackUrlCollection> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouTrackUrlCollectionService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "监测链接收藏-通过id查询")
+    @ApiOperation(value = "监测链接收藏-通过id查询", notes = "监测链接收藏-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouTrackUrlCollection> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouTrackUrlCollection> result = new Result<>();
+        KuaiShouTrackUrlCollection kuaiShouTrackUrlCollection = kuaiShouTrackUrlCollectionService.getById(id);
+        if (kuaiShouTrackUrlCollection == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouTrackUrlCollection);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouTrackUrlCollection> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouTrackUrlCollection kuaiShouTrackUrlCollection = JSON.parseObject(deString, KuaiShouTrackUrlCollection.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouTrackUrlCollection, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouTrackUrlCollection> pageList = kuaiShouTrackUrlCollectionService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "监测链接收藏列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouTrackUrlCollection.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("监测链接收藏列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaiShouTrackUrlCollection> listKuaiShouTrackUrlCollections = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouTrackUrlCollection.class, params);
+                kuaiShouTrackUrlCollectionService.saveBatch(listKuaiShouTrackUrlCollections);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouTrackUrlCollections.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

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

@@ -163,6 +163,9 @@ public class KuaiShouGroup {
     private String groupCreateTime;
     private String groupUpdateTime;
 
+    // 应用商店列表
+    private String appStore;
+
 
     /**
      * 创建时间

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

@@ -0,0 +1,71 @@
+package cn.com.ctop.kuaishou.modules.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 标题收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Data
+@TableName("ctop_kuaishou_title_collection")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_title_collection对象", description = "标题收藏")
+public class KuaiShouTitleCollection {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户
+     */
+    @Excel(name = "账户", width = 15)
+    @ApiModelProperty(value = "账户")
+    private Long accountId;
+    /**
+     * 用户id
+     */
+    @Excel(name = "用户id", width = 15)
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+    /**
+     * 标题
+     */
+    @Excel(name = "标题", width = 15)
+    @ApiModelProperty(value = "标题")
+    private String title;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

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

@@ -0,0 +1,77 @@
+package cn.com.ctop.kuaishou.modules.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 监测链接收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Data
+@TableName("ctop_kuaishou_track_url_collection")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_track_url_collection对象", description = "监测链接收藏")
+public class KuaiShouTrackUrlCollection {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户
+     */
+    @Excel(name = "账户", width = 15)
+    @ApiModelProperty(value = "账户")
+    private Long accountId;
+    /**
+     * 用户id
+     */
+    @Excel(name = "用户id", width = 15)
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+    /**
+     * 监测链接名称
+     */
+    @Excel(name = "监测链接名称", width = 15)
+    @ApiModelProperty(value = "监测链接名称")
+    private String trackName;
+    /**
+     * url
+     */
+    @Excel(name = "url", width = 15)
+    @ApiModelProperty(value = "url")
+    private String trackUrl;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouTitleCollectionMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTitleCollection;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 标题收藏
+ *
+ * @author: jeecg-boot
+ * @date: 2020-07-22
+ * @cersion: V1.0
+ */
+public interface KuaiShouTitleCollectionMapper extends BaseMapper<KuaiShouTitleCollection> {
+
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouTrackUrlCollectionMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTrackUrlCollection;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 监测链接收藏
+ *
+ * @author: jeecg-boot
+ * @date: 2020-07-22
+ * @cersion: V1.0
+ */
+public interface KuaiShouTrackUrlCollectionMapper extends BaseMapper<KuaiShouTrackUrlCollection> {
+
+}

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

@@ -32,6 +32,7 @@
         app_icon_url,
         convert_id,
         use_app_market,
+        app_store,
         group_create_time,
         group_update_time,
         create_time,
@@ -68,6 +69,7 @@
             #{getGroup.appIconUrl},
             #{getGroup.convertId},
             #{getGroup.useAppMarket},
+            #{getGroup.appStore,},
             #{getGroup.groupCreateTime},
             #{getGroup.groupUpdateTime},
             #{getGroup.createTime},

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouTitleCollectionMapper">
+
+</mapper>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTrackUrlCollection">
+
+</mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java

@@ -14,4 +14,6 @@ public interface IKuaiShouGroupService extends IService<KuaiShouGroup> {
     void getGroupList(String accessToken, Long accountId);
 
     void getGroupByUnitId(String accessToken, Long accountId, Long unitId);
+
+    void getCreativeByUnit(String accessToken, Long accountId, Long unitId);
 }

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouTitleCollectionService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTitleCollection;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 标题收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+public interface IKuaiShouTitleCollectionService extends IService<KuaiShouTitleCollection> {
+
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouTrackUrlCollectionService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTrackUrlCollection;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 监测链接收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+public interface IKuaiShouTrackUrlCollectionService extends IService<KuaiShouTrackUrlCollection> {
+
+}

+ 26 - 15
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java

@@ -5,8 +5,6 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.LoadFileUtil;
-import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.*;
 import cn.com.ctop.kuaishou.modules.batch.mapper.*;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
@@ -27,7 +25,6 @@ import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
@@ -201,6 +198,11 @@ public class BatchServiceImpl implements IBatchService {
             unitJson.put("use_app_market", requestJson.getInteger("useAppMarket"));
         }
 
+        // 应用商店列表
+        if (!Check.isNull(requestJson.getJSONArray("appStore"))) {
+            unitJson.put("app_store", requestJson.getJSONArray("appStore"));
+        }
+
         //投放开始时间
         if (!Check.isNull(requestJson.getString("beginTime"))) {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
@@ -494,6 +496,11 @@ public class BatchServiceImpl implements IBatchService {
                 unitJson.put("use_app_market", requestJson.getInteger("useAppMarket"));
             }
 
+            // 应用商店列表
+            if (!Check.isNull(requestJson.getJSONArray("appStore"))) {
+                unitJson.put("app_store", requestJson.getJSONArray("appStore"));
+            }
+
             //投放开始时间
             if (!Check.isNull(requestJson.getString("beginTime"))) {
                 String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
@@ -771,6 +778,12 @@ public class BatchServiceImpl implements IBatchService {
                 if (!Check.isNull(group.getUseAppMarket())) {
                     unitJson.put("use_app_market", group.getUseAppMarket());
                 }
+
+                // 应用商店列表
+                if (!Check.isNull(group.getAppStore())) {
+                    unitJson.put("app_store", JSONArray.parseArray(group.getAppStore()));
+                }
+
                 // 转化目标id
                 if (!Check.isNull(group.getConvertId())) {
                     unitJson.put("convert_id", group.getConvertId());
@@ -891,7 +904,7 @@ public class BatchServiceImpl implements IBatchService {
                     }
                     // APP行为-按APP名称
                     if (!Check.isNull(groupTarget.getAppIds())) {
-                        targetJson.put("app_ids", groupTarget.getAppIds());
+                        targetJson.put("app_ids", JSONArray.parseArray(groupTarget.getAppIds()));
                     }
                     // 人群包定向
                     if (!Check.isNull(groupTarget.getPopulation())) {
@@ -1042,7 +1055,7 @@ public class BatchServiceImpl implements IBatchService {
                 String image = creative.getImageToken();
                 String name = creative.getCreativeName();
                 creativeJson.put("action_bar_text", action_bar_text);
-                creativeJson.put("description", description);
+                creativeJson.put("description", description.trim());
                 creativeJson.put("image_token", image);
                 creativeJson.put("creative_name", name);
                 creativeJson.put("photo_id", photo_id);
@@ -1177,7 +1190,7 @@ public class BatchServiceImpl implements IBatchService {
                                 content += 1;
                                 String name = imageJson.getString("name") + content;
                                 creativeJson.put("action_bar_text", action_bar_text);
-                                creativeJson.put("description", description);
+                                creativeJson.put("description", description.trim());
                                 creativeJson.put("creative_name", name);
                                 creativeJson.put("photo_id", photo_id);
                                 creativeJson.put("click_track_url", click_track_url);
@@ -1379,6 +1392,12 @@ public class BatchServiceImpl implements IBatchService {
             if (!Check.isNull(requestJson.getInteger("useAppMarket"))) {
                 unitJson.put("use_app_market", requestJson.getInteger("useAppMarket"));
             }
+
+            // 应用商店列表
+            if (!Check.isNull(requestJson.getJSONArray("appStore"))) {
+                unitJson.put("app_store", requestJson.getJSONArray("appStore"));
+            }
+
             // 转化目标
             if (!Check.isNull(requestJson.getInteger("convertId"))) {
                 unitJson.put("convert_id", requestJson.getInteger("convertId"));
@@ -1545,7 +1564,7 @@ public class BatchServiceImpl implements IBatchService {
 
         // 广告语
         if (!Check.isNull(requestJson.get("description"))) {
-            creativeJson.put("description", requestJson.get("description"));
+            creativeJson.put("description", requestJson.getString("description").trim());
         }
         // 封面标题
         if (!Check.isNull(requestJson.get("stickerTitle"))) {
@@ -1598,14 +1617,6 @@ public class BatchServiceImpl implements IBatchService {
         }
         return null;
     }
-
-
-    public static void main(String[] args) throws IOException {
-        String localUrl = LoadFileUtil.downLoadFromUrl("https://ctop-media.oss-cn-beijing.aliyuncs.com/image/2020-04-29/uuuuu-1588129352054.jpg", PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-        String signature = LoadFileUtil.getMD5(localUrl);
-        System.err.println(signature);
-    }
-
 }
 
 

+ 117 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -10,6 +10,7 @@ import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupTargetMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouScheduleMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -44,6 +45,8 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
     @Autowired
     private KuaiShouGroupTargetMapper groupTargetMapper;
     private static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    @Autowired
+    private IKuaiShouCreativeService creativeService;
 
 
     /**
@@ -139,6 +142,119 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
     }
 
 
+    /**
+     * 根据组获取创意
+     *
+     * @param accessToken
+     * @param accountId
+     * @param unitId
+     */
+    @Override
+    public void getCreativeByUnit(String accessToken, Long accountId, Long unitId) {
+
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", " application/json");
+            headers.put("Access-Token", accessToken);
+            JSONObject param = new JSONObject();
+            param.put("advertiser_id", accountId);
+            param.put("page_size", 200);
+
+
+            param.put("unit_id", unitId);
+            String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            if (Check.isNull(resultJson)) {
+                log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
+                return;
+            }
+            Integer code = resultJson.getInteger("code");
+            String message = resultJson.getString("message");
+            if (null == code || code != 0) {
+                log.error("获取广告创意返回结果异常,advertiserId:{},message:{}", accountId, message);
+                return;
+            }
+            JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+            if (null == details || details.size() <= 0) {
+                return;
+            }
+            for (int i = 0; i < details.size(); i++) {
+                JSONObject detailJson = JSONObject.parseObject(details.get(i).toString());
+                if (!Check.isNull(detailJson)) {
+                    KuaiShouCreative creative = new KuaiShouCreative();
+                    creative.setId("" + accountId + detailJson.getLong("creative_id"));
+                    creative.setAccountId(accountId);
+                    creative.setCampaignId(detailJson.getLong("campaign_id"));
+                    creative.setUnitId(detailJson.getLong("unit_id"));
+                    creative.setCreativeId(detailJson.getLong("creative_id"));
+                    creative.setCreativeName(detailJson.getString("creative_name"));
+                    creative.setCreativeMaterialType(detailJson.getInteger("creative_material_type"));
+                    if (!Check.isNull(detailJson.getJSONArray("material_url"))) {
+                        creative.setMaterialUrl(detailJson.getJSONArray("material_url").toJSONString());
+                    }
+
+                    if (!Check.isNull(detailJson.getJSONArray("image_tokens"))) {
+                        creative.setImageTokens(detailJson.getJSONArray("image_tokens").toJSONString());
+                    }
+                    creative.setStatus(detailJson.getInteger("status"));
+                    creative.setPutStatus(detailJson.getInteger("put_status"));
+                    creative.setCreateChannel(detailJson.getInteger("create_channel"));
+                    creative.setReviewDetail(detailJson.getString("review_detail"));
+                    creative.setCoverUrl(detailJson.getString("cover_url"));
+                    creative.setImageToken(detailJson.getString("image_token"));
+                    creative.setCoverWidth(detailJson.getString("cover_width"));
+                    creative.setCoverHeight(detailJson.getString("cover_height"));
+                    creative.setOverlayBgUrl(detailJson.getString("overlay_bg_url"));
+                    creative.setOverlayBgImageToken(detailJson.getString("overlay_bg_image_token"));
+                    creative.setStickerTitle(detailJson.getString("sticker_title"));
+                    creative.setOverlayType(detailJson.getString("overlay_type"));
+                    creative.setClickTrackUrl(detailJson.getString("click_track_url"));
+                    creative.setImpressionUrl(detailJson.getString("impression_url"));
+                    creative.setAdPhotoPlayedT3sUrl(detailJson.getString("ad_photo_played_t3s_url"));
+                    creative.setCreativeCreateTime(detailJson.getDate("create_time"));
+                    creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
+                    creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                    JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
+                    if (!Check.isNull(displayInfoJson)) {
+                        creative.setDescription(displayInfoJson.getString("description"));
+                        creative.setActionBarText(displayInfoJson.getString("action_bar_text"));
+                    }
+                    creative.setCreateTime(new Date());
+                    creative.setUpdateTime(new Date());
+                    creative.setSiteId(detailJson.getLong("site_id"));
+                    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");
+                                        photoIds.add(String.valueOf(photo_id));
+                                    }
+                                }
+                                creative.setPhotoIds(photoIds.toJSONString());
+                            }
+                        }
+                    }
+                    creativeService.saveOrUpdate(creative);
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+
+
+    }
+
+
     private void addGroupV2(Long advertiserId, JSONArray details) {
         if (!Check.isNull(details)) {
             List<KuaiShouGroup> groups = new ArrayList<>();
@@ -181,6 +297,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     group.setGroupUpdateTime(detail.getString("update_time"));
                     group.setConvertId(detail.getLong("convert_id"));
                     group.setUseAppMarket(detail.getInteger("use_app_market"));
+                    group.setAppStore(detail.getJSONArray("app_store") + "");
                     group.setCreateTime(new Date());
                     group.setUpdateTime(new Date());
                     groups.add(group);

+ 19 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouTitleCollectionServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTitleCollection;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouTitleCollectionMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouTitleCollectionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 标题收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Service
+public class KuaiShouTitleCollectionServiceImpl extends ServiceImpl<KuaiShouTitleCollectionMapper, KuaiShouTitleCollection> implements IKuaiShouTitleCollectionService {
+
+}

+ 19 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouTrackUrlCollectionServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouTrackUrlCollection;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouTrackUrlCollectionMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouTrackUrlCollectionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 监测链接收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-07-22
+ */
+@Service
+public class KuaiShouTrackUrlCollectionServiceImpl extends ServiceImpl<KuaiShouTrackUrlCollectionMapper, KuaiShouTrackUrlCollection> implements IKuaiShouTrackUrlCollectionService {
+
+}

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

@@ -189,8 +189,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
-
-
     private void getVideoListByPage(CtopOauthToken token, String startDate, String endDate, int page) {
         try {
             log.info("获取视频数据,accountId:{}", token.getAccountId());
@@ -1255,6 +1253,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setGroupUpdateTime(detail.getString("update_time"));
                     group.setConvertId(detail.getLong("convert_id"));
                     group.setUseAppMarket(detail.getInteger("use_app_market"));
+                    group.setAppStore(detail.getJSONArray("app_store") + "");
                     group.setCreateTime(new Date());
                     group.setUpdateTime(new Date());
                     groups.add(group);
@@ -2984,10 +2983,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             param.put("advertiser_id", accountId);
             param.put("page_size", 200);
 
-            Map<String, Object> deleteMap = new HashMap<>();
+           /* Map<String, Object> deleteMap = new HashMap<>();
             deleteMap.put("account_id", accountId);
             deleteMap.put("campaign_id", campaignId);
-            creativeService.removeByMap(deleteMap);
+            creativeService.removeByMap(deleteMap);*/
             QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
             groupQueryWrapper.eq("account_id", accountId);
             groupQueryWrapper.eq("campaign_id", campaignId);

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/KuaishouBidWarningServiceImpl.java

@@ -61,6 +61,8 @@ public class KuaishouBidWarningServiceImpl implements IKuaishouBidWarningService
                         List<String> unitWarning = new ArrayList<>();
                         if ("2".equals(userAllocation.getMediaId())) {
                             unitWarning = groupMapper.selectWarningGroup(accountId, maxBid);
+                        }
+                        if (!Check.isNull(unitWarning)) {
                             sendMessage(project.getMediaId(), accountId, projectId, project.getProjectName(), userAllocation.getAuthName(), unitWarning, maxBid);
                         }
                     }

+ 12 - 5
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceAudienceTemplateController.java

@@ -1,21 +1,28 @@
 package cn.com.ctop.toutiao.modules.batch.controller;
 
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONObject;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
 
 @RestController
-@RequestMapping("ctop/audience/template")
+@RequestMapping("ctop/audience")
 public class BytedanceAudienceTemplateController {
-    @PostMapping("create")
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+    @PostMapping("/template/create")
     public Map<String,Object> createAudiencePackageTemplate(HttpServletRequest request, JSONObject data){
         Map<String,Object> result = new HashMap<>();
 
         return result;
     }
+
+    @GetMapping("list")
+    public Map<String,Object>getAudienceList(@RequestParam(value = "accountId",defaultValue = "")String accountId){
+        return advertiserDataService.advertiserCustomAudienceSelect(accountId);
+    }
 }

+ 1 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java

@@ -54,6 +54,7 @@ public class ByteDanceCampaignController {
                                                           HttpServletRequest req) {
         Result<IPage<ByteDanceCampaign>> result = new Result<>();
         String name = byteDanceCampaign.getName();
+        byteDanceCampaign.setName(null);
         QueryWrapper<ByteDanceCampaign> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCampaign, req.getParameterMap());
         if(null!=name&&!"".equalsIgnoreCase(name)){
             queryWrapper.like("name",name);

+ 20 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeController.java

@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 今日头条创意信息
@@ -47,11 +49,29 @@ public class ByteDanceCreativeController {
     public Result<IPage<ByteDanceCreative>> queryPageList(ByteDanceCreative byteDanceCreative,
                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          @RequestParam(name="startDate",defaultValue = "")String startDate,
+                                                          @RequestParam(name="endDate",defaultValue = "")String endDate,
                                                           HttpServletRequest req) {
         Result<IPage<ByteDanceCreative>> result = new Result<>();
+        String title = byteDanceCreative.getTitle();
+        byteDanceCreative.setTitle(null);
         QueryWrapper<ByteDanceCreative> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCreative, req.getParameterMap());
+        if(null!=startDate&&!startDate.trim().equals("")){
+            queryWrapper.ge("",startDate+" 00:00:00");
+        }
+        if(null!=endDate&&!endDate.trim().equals("")){
+            queryWrapper.le("",startDate+" 23:59:59");
+        }
+        if(null!=title&&!"".equals(title.trim())){
+            queryWrapper.like("title",title);
+        }
         Page<ByteDanceCreative> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceCreative> pageList = byteDanceCreativeService.page(page, queryWrapper);
+        List<ByteDanceCreative> records = pageList.getRecords();
+        if(null!=records&&!records.isEmpty()){
+            List<ByteDanceCreative> creatives = records.stream().map(creative-> creative.setCreateStatus(creative.getStatus().equalsIgnoreCase("CAMPAIGN_STATUS_ENABLE"))).collect(Collectors.toList());
+            pageList.setRecords(creatives);
+        }
         result.setSuccess(true);
         result.setResult(pageList);
         return result;

+ 3 - 26
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -33,29 +33,8 @@ public class ByteDanceAdvertisePlan {
     @TableId
     @ApiModelProperty(value = "头条平台广告计划id")
     private Long id;
-    /**
-     * 平台广告主id
-     */
-    @Excel(name = "平台广告主id", width = 15)
-    @ApiModelProperty(value = "平台广告主id")
-    private String advertiserId;
-    /**
-     * 头条广告主id
-     */
-    @Excel(name = "头条广告主id", width = 15)
-    @ApiModelProperty(value = "头条广告主id")
-    private Long toutiaoId;
-    /**
-     * 计划名称
-     */
-    @Excel(name = "计划名称", width = 15)
-    @ApiModelProperty(value = "计划名称")
+    private String accountId;
     private String name;
-    /**
-     * 广告组id
-     */
-    @Excel(name = "广告组id", width = 15)
-    @ApiModelProperty(value = "广告组id")
     private Long campaignId;
     /**
      * 上次修改时间戳(用于更新时提交,服务端判断是否基于最新信息修改)
@@ -239,7 +218,6 @@ public class ByteDanceAdvertisePlan {
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
         Long id = dataObject.getLong("id");
         this.id = id;
-        this.advertiserId = accountId;
         String name = dataObject.getString("name");
         if (null != name && !"".equals(name.trim())) {
             this.name = name;
@@ -275,7 +253,7 @@ public class ByteDanceAdvertisePlan {
         this.updateTime = new Date();
         Long advertiserId = dataObject.getLong("advertiser_id");
         if (null != advertiserId) {
-            this.toutiaoId = advertiserId;
+            this.accountId = advertiserId+"";
         }
         Long campaignId = dataObject.getLong("campaign_id");
         if (null != campaignId) {
@@ -410,7 +388,6 @@ public class ByteDanceAdvertisePlan {
 
     public ByteDanceAdvertisePlan(String advertiserId, Long adId, JSONObject params) {
         this.id = adId;
-        this.advertiserId = advertiserId;
         String name = params.getString("name");
         if (null != name && !"".equals(name.trim())) {
             this.name = name;
@@ -418,7 +395,7 @@ public class ByteDanceAdvertisePlan {
 
         Long toutiaoId = params.getLong("advertiser_id");
         if (null != toutiaoId) {
-            this.toutiaoId = toutiaoId;
+            this.accountId = toutiaoId+"";
         }
         Long campaignId = params.getLong("campaign_id");
         if (null != campaignId) {

+ 5 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java

@@ -2,6 +2,7 @@ package cn.com.ctop.toutiao.modules.material.entity;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -41,8 +42,7 @@ public class ByteDanceCreative {
     /**
      * 本平台广告主id
      */
-    @Excel(name = "本平台广告主id", width = 15)
-    @ApiModelProperty(value = "本平台广告主id")
+    @Dict(dicCode = "account_id",dictTable="ctop_user_allocation",dicText="auth_name")
     private String accountId;
     /**
      * 创意素材标题
@@ -59,8 +59,7 @@ public class ByteDanceCreative {
     /**
      * 创意素材状态
      */
-    @Excel(name = "创意素材状态", width = 15)
-    @ApiModelProperty(value = "创意素材状态")
+    @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "57b60cec65bbc7cd3d6da4fbda589594")
     private String status;
     /**
      * 创意素材创作状态
@@ -126,6 +125,8 @@ public class ByteDanceCreative {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+    @TableField(exist = false)
+    private Boolean createStatus;
 
     public ByteDanceCreative(){
 

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceAdvertisePlanMapper.xml

@@ -6,7 +6,7 @@
    SELECT
    name
    FROM ctop_bytedance_advertise_plan
-   WHERE advertiser_id = #{accountId}
+   WHERE account_id = #{accountId}
    and (cpa_bid &gt; #{maxBid} or bid &gt; #{maxBid})
    and toutiao_status = 'AD_STATUS_DELIVERY_OK'
     </select>
@@ -16,7 +16,7 @@
    SELECT
    name
    FROM ctop_bytedance_advertise_plan
-   WHERE advertiser_id = #{accountId}
+   WHERE account_id = #{accountId}
    and deep_cpabid &gt; #{maxCpaBid}
    and toutiao_status = 'AD_STATUS_DELIVERY_OK'
     </select>

+ 12 - 6
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -453,7 +453,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
     }
 
-
     /**
      * 查询人群包信息
      *
@@ -462,8 +461,15 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     @Override
     public Map<String, Object> advertiserCustomAudienceSelect(String accountId) {
         Map<String, Object> resultMap = new HashMap<>();
+        if(null == accountId||accountId.trim().equals("")){
+            ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
-
+        if(null==token){
+            ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_select");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
@@ -477,17 +483,17 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         String result = HttpUtils.httpGetRequest(url, headers, params);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Integer code = jsonObject.getInteger("code");
-
+        String message = jsonObject.getString("message");
         if (null == code || !code.equals(0)) {
-            log.info("获取人群包信息接口异常==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
+            log.info("获取人群包信息接口异常==》accountId:{},message:{}", accountId, message);
             resultMap.put("success", false);
-            resultMap.put("message", "获取人群包信息接口异常");
+            resultMap.put("message", message);
             resultMap.put("code", -1);
             return resultMap;
         }
         JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
         if (null == data || data.isEmpty()) {
-            log.info("人群包信息不存在==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
+            log.info("人群包信息不存在==》accountId:{},message:{}", accountId, message);
             resultMap.put("success", false);
             resultMap.put("message", "人群包信息不存在");
             resultMap.put("code", -1);

+ 23 - 30
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceBidWarningServiceImpl.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.entity.MailLog;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.MailLogMapper;
-import cn.com.ctop.common.module.service.ICorpFeishuUserService;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.BigDecimalUtil;
@@ -28,8 +27,6 @@ import java.util.List;
 @Slf4j
 public class BytedanceBidWarningServiceImpl implements IBytedanceBidWarningService {
     @Autowired
-    private ICorpFeishuUserService corpFeishuUserService;
-    @Autowired
     private IProjectService projectService;
     @Autowired
     private IUserAllocationService userAllocationService;
@@ -40,46 +37,42 @@ public class BytedanceBidWarningServiceImpl implements IBytedanceBidWarningServi
 
     @Override
     public void bidWarning() {
-        XxlJobLogger.log("---------头条出价预警定时任务开始----------");
+        XxlJobLogger.log("开始头条出价预警定时任务");
         long start = System.currentTimeMillis();
         try {
             List<Project> projects = projectService.list();
-            if (Check.isNull(projects)) {
-                XxlJobLogger.log("查询所属项目为空");
-                return ;
-            }
-            for (Project project : projects) {
-                if (Check.isNull(project)) {
-                    continue;
-                }
-                Long maxBid = project.getMaxBid();
-                Long projectId = project.getId();
-                List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
-                if (Check.isNull(userAllocations)) {
-                    continue;
-                }
-                for (UserAllocation userAllocation : userAllocations) {
-                    if (userAllocation.getAccountStatus() == 1) {
+            if (!Check.isNull(projects)) {
+                for (Project project : projects) {
+                    if (Check.isNull(project)) {
                         continue;
                     }
-                    Long accountId = userAllocation.getAccountId();
-                    List<String> unitWarning = new ArrayList<>();
-                    if ("1".equals(userAllocation.getMediaId())) {
-                        BigDecimal bid = new BigDecimal(maxBid);
-                        BigDecimal bigDecimal = BigDecimalUtil.divideBigDecimal(bid, new BigDecimal(1000));
-                        unitWarning = byteDanceAdvertisePlanService.selectWarningGroup(accountId, bigDecimal);
-                        if (!Check.isNull(unitWarning)) {
-                            sendMessage(project.getMediaId(), accountId, projectId, project.getProjectName(), userAllocation.getAuthName(), unitWarning, maxBid);
+                    Long maxBid = project.getMaxBid();
+                    Long projectId = project.getId();
+                    List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+                    if (!Check.isNull(userAllocations)) {
+                        for (UserAllocation userAllocation : userAllocations) {
+                            if (userAllocation.getAccountStatus() == 1) {
+                                continue;
+                            }
+                            Long accountId = userAllocation.getAccountId();
+                            List<String> unitWarning = new ArrayList<>();
+                            if ("1".equals(userAllocation.getMediaId())) {
+                                BigDecimal bid = new BigDecimal(maxBid);
+                                BigDecimal bigDecimal = BigDecimalUtil.divideBigDecimal(bid, new BigDecimal(1000));
+                                unitWarning = byteDanceAdvertisePlanService.selectWarningGroup(accountId, bigDecimal);
+                            }
+                            if (!Check.isNull(unitWarning)) {
+                                sendMessage(project.getMediaId(), accountId, projectId, project.getProjectName(), userAllocation.getAuthName(), unitWarning, maxBid);
+                            }
                         }
                     }
                 }
             }
+
             XxlJobLogger.log("头条出价预警定时任务执行完毕,共耗时:{} s", (System.currentTimeMillis() - start) / 1000);
         } catch (Exception e) {
             e.printStackTrace();
         }
-
-
     }
 
     private void sendMessage(String mediaId, Long accountId, Long projectId, String projectName, String authName, List<String> unitWarning, Long maxBid) {

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/BytedancePlanDailyReport.java

@@ -425,7 +425,7 @@ public class BytedancePlanDailyReport {
         if (null != playFeedBreak75) {
             this.play75FeedBreak = playFeedBreak75;
         }
-        Long nextDayOpen = data.getLong("next_day_open");
+        Long nextDayOpen = data.getLong("attribution_next_day_open_cnt");
         if (null != nextDayOpen) {
             this.nextDayOpen = nextDayOpen;
         }
@@ -509,7 +509,7 @@ public class BytedancePlanDailyReport {
         if (null != inAppPay) {
             this.inAppPay = inAppPay;
         }
-        BigDecimal nextDayOpenCost = data.getBigDecimal("next_day_open_cost");
+        BigDecimal nextDayOpenCost = data.getBigDecimal("attribution_next_day_open_cost");
         if (null != nextDayOpenCost) {
             this.nextDayOpenCost = nextDayOpenCost;
         }
@@ -525,7 +525,7 @@ public class BytedancePlanDailyReport {
         if (null != show) {
             this.showNum = show;
         }
-        BigDecimal nextDayOpenRate = data.getBigDecimal("next_day_open_rate");
+        BigDecimal nextDayOpenRate = data.getBigDecimal("attribution_next_day_open_rate");
         if (null != nextDayOpenRate) {
             this.nextDayOpenRate = nextDayOpenRate;
         }

+ 9 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -151,7 +151,9 @@ public class ReportServiceImpl implements IReportService {
         var config = new SerializeConfig();
         config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
         var jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
+
         JSONObject getObject = getAdStat(token, jsonObject);
+       // System.out.println(conditions.getStartDate()  + " "  + conditions.getEndDate() + " " + getObject.getString("request_id"));
         if (null == getObject) {
             log.error("广告计划报表数据获取异常=》account:{};message:{}", token.getAccountId(), "返回数据异常");
             return;
@@ -381,6 +383,13 @@ public class ReportServiceImpl implements IReportService {
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
+
+
+        JSONObject status = new JSONObject();
+        status.put("status","AD_STATUS_ALL");
+
+
+        conditions.put("filtering",status);
         conditions.put("group_by", groupBy);
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }