فهرست منبع

Merge branch 'master' of http://39.106.184.70:3000/ctop/adsp-boot into test

yumeng 5 سال پیش
والد
کامیت
3528d45e50

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

@@ -129,12 +129,9 @@ public class MaterialImageInfoController {
     }
 
 
-
-
-
     @GetMapping(value = "/getImageList")
     public Result<List<MaterialImageInfo>> getImageList(MaterialImageInfo MaterialImageInfo,
-                                                         HttpServletRequest req) {
+                                                        HttpServletRequest req) {
         Result<List<MaterialImageInfo>> result = new Result<>();
         QueryWrapper<MaterialImageInfo> queryWrapper = QueryGenerator.initQueryWrapper(MaterialImageInfo, req.getParameterMap());
         List<MaterialImageInfo> list = MaterialImageInfoService.list(queryWrapper);
@@ -144,21 +141,30 @@ public class MaterialImageInfoController {
     }
 
 
-
     @GetMapping(value = "/getDetail")
     public Result<MaterialImageInfo> getDetail(String id) {
         Result<MaterialImageInfo> result = new Result<>();
         MaterialImageInfo materialImageInfo = MaterialImageInfoService.getById(id);
         if (!Check.isNull(materialImageInfo)) {
-            MaterialInfo materialmInfo = materialInfoService.getById(materialImageInfo.getVideoId());
-            if (!Check.isNull(materialmInfo)) {
-                materialImageInfo.setVideoUrl(materialmInfo.getUrl());
+            QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
+            materialInfoQueryWrapper.eq("code", materialImageInfo.getVideoId());
+            materialInfoQueryWrapper.orderByDesc("create_time");
+            materialInfoQueryWrapper.last("limit 1");
+            MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
+            if (!Check.isNull(materialInfo)) {
+                materialImageInfo.setVideoUrl(materialInfo.getUrl());
 
             }
+            if (!Check.isNull(materialImageInfo.getAuditorId())) {
+                String auditorName = materialInfoMapper.selectUserNameById(materialImageInfo.getAuditorId());
+                materialImageInfo.setAuditorName(auditorName);
 
-            String auditorName = materialInfoMapper.selectUserNameById(materialImageInfo.getAuditorId());
-            materialImageInfo.setAuditorName(auditorName);
+            }
 
+            if (!Check.isNull(materialImageInfo.getUserId())) {
+                String userName = materialInfoMapper.selectUserNameById(materialImageInfo.getUserId());
+                materialImageInfo.setUserName(userName);
+            }
         }
 
         result.setSuccess(true);

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

@@ -94,6 +94,17 @@ public class TestController {
     private IKuaishouInterfaceService kuaishouInterfaceService;
 
 
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
+
+    @GetMapping(value = "/getToken")
+    public String getToken(Long accountId, String refreshToken, Integer agentType) {
+        oauthTokenService.getKuaiShouRefreshToken(accountId, refreshToken, agentType);
+        return "Success";
+    }
+
+
     @GetMapping(value = "/updateCode")
     public String updateCode() {
 
@@ -101,7 +112,6 @@ public class TestController {
         for (MaterialInfo info : list) {
 
 
-
             QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
             imageInfoQueryWrapper.eq("video_id", String.valueOf(info.getId()));
             MaterialImageInfo updateMaterialImageInfo = new MaterialImageInfo();
@@ -129,8 +139,6 @@ public class TestController {
             parameterService.update(updateMaterialParameter, parameterQueryWrapper);
 
 
-
-
         }
         List<MaterialImageInfo> list1 = iMaterialImageInfoService.list();
         for (MaterialImageInfo imageInfo : list1) {

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

@@ -1,7 +1,6 @@
 package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 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;

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialImageInfo.java

@@ -136,4 +136,7 @@ public class MaterialImageInfo {
     @TableField(exist = false)
     private String auditorName;
 
+    @TableField(exist = false)
+    private String userName;
+
 }

+ 1 - 3
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialAscriptionMapper.xml

@@ -4,7 +4,7 @@
 
     <select id="selectByMaterialId" resultType="com.alibaba.fastjson.JSONObject">
 
-select
+    select
       (case
         when clip_id != ""
         then (select realname from sys_user where id = clip_id)
@@ -13,8 +13,6 @@ select
         ) clipName, -- 剪辑人姓名
 
         clip_id clipId,
-
-
         (case
         when shot_id != ""
         then (select realname from sys_user where id = shot_id)

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

@@ -73,7 +73,7 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
                     .append(KuaishouInterfaceConstant.AUTH_PATH)
                     .append("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_appid"))
                     .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
-                    .append("&scope=%5B%22ad_query%22%2C%22ad_manage%22%5D&")
+                    .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D")
                     .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));
         }
 

+ 4 - 7
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -257,24 +257,21 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             json.put("auditorName", "");
         }
 
-        List<String> tagList = materialTagMapper.selectByMaterialId(materialId);
+        List<String> tagList = materialTagMapper.selectByMaterialId(materialInfo.getCode());
         if (!Check.isNull(tagList)) {
             json.put("tag", tagList);
         }
         QueryWrapper<MaterialParameter> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("material_id", materialId);
+        queryWrapper.eq("material_id", materialInfo.getCode());
         queryWrapper.orderByDesc("create_time");
         queryWrapper.last("limit 1");
         MaterialParameter materialParameter = materialParameterMapper.selectOne(queryWrapper);
 
         if (!Check.isNull(materialParameter)) {
             json.put("parameter", materialParameter);
-        } else {
-            MaterialParameter materialParameter1 = new MaterialParameter();
-            materialParameter1.setMaterialId(materialId);
-            json.put("parameter", materialParameter1);
         }
-        JSONObject ascriptionJson = materialAscriptionMapper.selectByMaterialId(materialId);
+
+        JSONObject ascriptionJson = materialAscriptionMapper.selectByMaterialId(materialInfo.getCode());
         if (!Check.isNull(ascriptionJson)) {
             json.put("ascription", ascriptionJson);
         }

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

@@ -440,7 +440,7 @@ public class BatchController {
      * 获取人群包接口
      *
      * @param accountId
-     * @return
+     * @returnBatch
      */
     @GetMapping(value = "/getPopulationList")
     public Result<JSONArray> getAppList(Long accountId) {
@@ -1559,7 +1559,15 @@ public class BatchController {
                 if (Check.isNull(group)) {
                     continue;
                 }
-                String unitName = group.getUnitName();
+                String unitNameStr = group.getUnitName();
+                String unitName;
+
+                if (unitNameStr.contains("#")) {
+                    int lastIndexOf = unitNameStr.lastIndexOf("#");
+                    unitName = unitNameStr.substring(0, lastIndexOf);
+                } else {
+                    unitName = unitNameStr;
+                }
                 group.setUnitName(unitName + RandomUtil.verifyCode());
                 JSONObject unitJson = batchService.copyUnit(group, copyToCampaignId);
                 if (!Check.isNull(unitJson)) {

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

@@ -1,7 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.MaterialParameter;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.enums.MaterialEnum;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
@@ -22,7 +21,6 @@ import org.apache.http.ParseException;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.FileSystemResource;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -32,7 +30,6 @@ import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
-import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.Date;
@@ -739,7 +736,6 @@ public class BatchServiceImpl implements IBatchService {
         QueryWrapper<KuaiShouCreative> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("account_id", accountId);
         queryWrapper.eq("unit_id", copyUnitId);
-        queryWrapper.eq("status", 52);
         List<KuaiShouCreative> creativeList = creativeMapper.selectList(queryWrapper);
         if (!Check.isNull(creativeList)) {
             for (KuaiShouCreative creative : creativeList) {

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

@@ -263,6 +263,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         param.put("page", page);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
+        System.err.println(resultJson);
         Integer code = resultJson.getInteger("code");
         String message = resultJson.getString("message");
         if (null == code || code != 0) {