Browse Source

Merge remote-tracking branch 'origin/master'

syh 5 years ago
parent
commit
98403ff3f0

+ 54 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.controller;
 package org.jeecg.modules.ctop.controller;
 
 
+import cn.com.ctop.common.utils.Check;
 import cn.com.ctop.manage.modules.actor.entity.Actor;
 import cn.com.ctop.manage.modules.actor.entity.Actor;
 import cn.com.ctop.manage.modules.actor.entity.ActorComment;
 import cn.com.ctop.manage.modules.actor.entity.ActorComment;
 import cn.com.ctop.manage.modules.actor.entity.ActorPhoto;
 import cn.com.ctop.manage.modules.actor.entity.ActorPhoto;
@@ -11,6 +12,7 @@ import cn.com.ctop.manage.modules.actor.service.IActorVideoService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import constant.KuaishouInterfaceConstant;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.query.QueryGenerator;
@@ -18,9 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * @author jeecg-boot
  * @author jeecg-boot
@@ -183,6 +182,12 @@ public class ActorController {
     public Result<ActorVideo> addVideo(ActorVideo actorVideo) {
     public Result<ActorVideo> addVideo(ActorVideo actorVideo) {
         Result<ActorVideo> result = new Result<ActorVideo>();
         Result<ActorVideo> result = new Result<ActorVideo>();
         try {
         try {
+            String videoUrl = actorVideo.getVideoUrl();
+            if (!Check.isNull(videoUrl)) {
+                if (!videoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actorVideo.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + videoUrl);
+                }
+            }
             actorVideoService.save(actorVideo);
             actorVideoService.save(actorVideo);
             result.success("添加成功!");
             result.success("添加成功!");
         } catch (Exception e) {
         } catch (Exception e) {
@@ -196,6 +201,13 @@ public class ActorController {
     public Result<ActorPhoto> addPhoto(ActorPhoto actorPhoto) {
     public Result<ActorPhoto> addPhoto(ActorPhoto actorPhoto) {
         Result<ActorPhoto> result = new Result<ActorPhoto>();
         Result<ActorPhoto> result = new Result<ActorPhoto>();
         try {
         try {
+            String photoUrl = actorPhoto.getPhotoUrl();
+            if (!Check.isNull(photoUrl)) {
+                if (!photoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actorPhoto.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + photoUrl);
+                }
+            }
+
             actorPhotoService.save(actorPhoto);
             actorPhotoService.save(actorPhoto);
             result.success("添加成功!");
             result.success("添加成功!");
         } catch (Exception e) {
         } catch (Exception e) {
@@ -211,7 +223,6 @@ public class ActorController {
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
                                                         HttpServletRequest req) {
         Result<IPage<ActorVideo>> result = new Result<IPage<ActorVideo>>();
         Result<IPage<ActorVideo>> result = new Result<IPage<ActorVideo>>();
-
         QueryWrapper<ActorVideo> queryWrapper = QueryGenerator.initQueryWrapper(actorVideo, req.getParameterMap());
         QueryWrapper<ActorVideo> queryWrapper = QueryGenerator.initQueryWrapper(actorVideo, req.getParameterMap());
         Page<ActorVideo> page = new Page<ActorVideo>(pageNo, pageSize);
         Page<ActorVideo> page = new Page<ActorVideo>(pageNo, pageSize);
         IPage<ActorVideo> pageList = actorVideoService.page(page, queryWrapper);
         IPage<ActorVideo> pageList = actorVideoService.page(page, queryWrapper);
@@ -231,23 +242,38 @@ public class ActorController {
     public Result<Actor> add(@RequestBody Actor actor) {
     public Result<Actor> add(@RequestBody Actor actor) {
         Result<Actor> result = new Result<Actor>();
         Result<Actor> result = new Result<Actor>();
         try {
         try {
+            String coverUrl = actor.getCoverUrl();
+            if (!Check.isNull(coverUrl)) {
+                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
+                }
+            }
             actorService.save(actor);
             actorService.save(actor);
-//            if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
-//                for (String url : actor.getImageUrl()) {
-//                    ActorPhoto photo = new ActorPhoto();
-//                    photo.setActorId(actor.getId());
-//                    photo.setPhotoUrl("http:" + url);
-//                    actorPhotoService.save(photo);
-//                }
-//            }
-//            if (actor.getVideoUrl() != null && actor.getVideoUrl().size() > 0) {
-//                for (String url : actor.getVideoUrl()) {
-//                    ActorVideo video = new ActorVideo();
-//                    video.setActorId(actor.getId());
-//                    video.setVideoUrl("http:" + url);
-//                    actorVideoService.save(video);
-//                }
-//            }
+            if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
+                for (String url : actor.getImageUrl()) {
+                    ActorPhoto photo = new ActorPhoto();
+                    photo.setActorId(actor.getId());
+                    if (!Check.isNull(url)) {
+                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                            photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                        }
+                    }
+                    actorPhotoService.save(photo);
+                }
+            }
+            if (actor.getVideoUrl() != null && actor.getVideoUrl().size() > 0) {
+                for (String url : actor.getVideoUrl()) {
+                    ActorVideo video = new ActorVideo();
+                    video.setActorId(actor.getId());
+                    if (!Check.isNull(url)) {
+                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                            video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                        }
+                    }
+                    actorVideoService.save(video);
+                }
+            }
+
             result.success("添加成功!");
             result.success("添加成功!");
         } catch (Exception e) {
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             log.error(e.getMessage(), e);
@@ -270,6 +296,14 @@ public class ActorController {
         if (actorEntity == null) {
         if (actorEntity == null) {
             result.error500("未找到对应实体");
             result.error500("未找到对应实体");
         } else {
         } else {
+
+            String coverUrl = actor.getCoverUrl();
+            if (!Check.isNull(coverUrl)) {
+                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
+                }
+            }
+
             boolean ok = actorService.updateById(actor);
             boolean ok = actorService.updateById(actor);
 //            ActorPhoto actorPhoto = new ActorPhoto();
 //            ActorPhoto actorPhoto = new ActorPhoto();
 //            actorPhoto.setActorId(actor.getId());
 //            actorPhoto.setActorId(actor.getId());

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/controller/KuaiShouCampaignTemplateController.java

@@ -15,6 +15,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.kuaishou.entity.KuaiShouCampaignTemplate;
 import org.jeecg.modules.kuaishou.entity.KuaiShouCampaignTemplate;
+import org.jeecg.modules.kuaishou.mapper.KuaiShouCampaignTemplateMapper;
 import org.jeecg.modules.kuaishou.service.IKuaiShouCampaignTemplateService;
 import org.jeecg.modules.kuaishou.service.IKuaiShouCampaignTemplateService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -50,6 +51,9 @@ public class KuaiShouCampaignTemplateController {
     @Autowired
     @Autowired
     private IKuaiShouCampaignTemplateService kuaiShouCampaignTemplateService;
     private IKuaiShouCampaignTemplateService kuaiShouCampaignTemplateService;
 
 
+    @Autowired
+    private KuaiShouCampaignTemplateMapper campaignTemplateMapper;
+
 
 
     @PostMapping("/insert")
     @PostMapping("/insert")
     public Map<String, Object> campaignTemplateInsert(@RequestBody KuaiShouCampaignTemplate template, HttpServletRequest req) {
     public Map<String, Object> campaignTemplateInsert(@RequestBody KuaiShouCampaignTemplate template, HttpServletRequest req) {
@@ -60,6 +64,21 @@ public class KuaiShouCampaignTemplateController {
     /**
     /**
      * 分页列表查询
      * 分页列表查询
      *
      *
+     * @return
+     */
+    @AutoLog(value = "快手-创建广告计划模板-分页列表查询")
+    @ApiOperation(value = "快手-创建广告计划模板-分页列表查询", notes = "快手-创建广告计划模板-分页列表查询")
+    @GetMapping(value = "/getKuaiShouCampaignTemplate")
+    public KuaiShouCampaignTemplate getKuaiShouCampaignTemplate(Long id) {
+        return campaignTemplateMapper.selectById(id);
+
+
+    }
+
+
+    /**
+     * 分页列表查询
+     *
      * @param kuaiShouCampaignTemplate
      * @param kuaiShouCampaignTemplate
      * @param pageNo
      * @param pageNo
      * @param pageSize
      * @param pageSize

+ 4 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouGroupCreateLog.java

@@ -118,9 +118,6 @@ public class KuaiShouGroupCreateLog {
     private Integer unitType;
     private Integer unitType;
 
 
 
 
-
-
-
     /**
     /**
      * 投放结束时间
      * 投放结束时间
      */
      */
@@ -193,6 +190,10 @@ public class KuaiShouGroupCreateLog {
     private Integer createCount;
     private Integer createCount;
 
 
 
 
+    @TableField(exist = false)
+    private String redundancy;
+
+
     /**
     /**
      * 修改人
      * 修改人
      */
      */

+ 25 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouCreateServiceImpl.java

@@ -81,6 +81,9 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                 return returnMap;
                 return returnMap;
             }
             }
 
 
+            String redundancy = groupCreateTemplate.getRedundancy();
+            JSONObject redundancyJson = JSONObject.parseObject(redundancy);
+
             // 广告计划信息
             // 广告计划信息
             KuaiShouCampaignTemplate kuaiShouCampaignTemplate = campaignTemplateMapper.selectById(campaignTemplateId);
             KuaiShouCampaignTemplate kuaiShouCampaignTemplate = campaignTemplateMapper.selectById(campaignTemplateId);
             if (Check.isNull(kuaiShouCampaignTemplate)) {
             if (Check.isNull(kuaiShouCampaignTemplate)) {
@@ -119,11 +122,21 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                 if (type == 3) {
                 if (type == 3) {
                     groupJson.put("url_type", kuaiShouCampaignTemplate.getUrlType());
                     groupJson.put("url_type", kuaiShouCampaignTemplate.getUrlType());
                 }
                 }
-                groupJson.put("url", kuaiShouCampaignTemplate.getUrl());
+                if (!Check.isNull(redundancyJson.getString("redirectUrl"))) {
+                    groupJson.put("url", redundancyJson.getString("redirectUrl"));// 是否页面重新输入 转换链接
+                } else {
+                    groupJson.put("url", kuaiShouCampaignTemplate.getUrl());
+                }
             }
             }
             // app推广
             // app推广
             if (type == 2) {
             if (type == 2) {
-                KuaiShouCreateAppTemplate appTemplate = createAppTemplateMapper.selectById(kuaiShouCampaignTemplate.getAppId());
+                KuaiShouCreateAppTemplate appTemplate;
+                if (!Check.isNull(redundancyJson.getLong("appId"))) { // 是否重新选择应用进行创建
+                    appTemplate = createAppTemplateMapper.selectById(redundancyJson.getLong("appId"));
+                } else {
+                    appTemplate = createAppTemplateMapper.selectById(kuaiShouCampaignTemplate.getAppId());
+                }
+
                 if (Check.isNull(appTemplate)) {
                 if (Check.isNull(appTemplate)) {
                     log.error("快手上传视频未获取到本地app信息,appId:{}", kuaiShouCampaignTemplate.getAppId());
                     log.error("快手上传视频未获取到本地app信息,appId:{}", kuaiShouCampaignTemplate.getAppId());
                     throw new Exception("快手上传视频未获取到本地app信息");
                     throw new Exception("快手上传视频未获取到本地app信息");
@@ -206,8 +219,17 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
             }
             }
 
 
             JSONObject targetJson = new JSONObject();
             JSONObject targetJson = new JSONObject();
-            groupJson.put("target", targetJson);
+            Integer platformOs = redundancyJson.getInteger("platformOs");
+            if (!Check.isNull(platformOs)) {
+                targetJson.put("platform_os", platformOs);
+                if (platformOs == 1) {
+                    targetJson.put("android_osv", redundancyJson.getInteger("androidOsv"));
+                } else if (platformOs == 2) {
+                    targetJson.put("ios_osv", redundancyJson.getInteger("iosOsv"));
+                }
+            }
 
 
+            groupJson.put("target", targetJson);
             String unitName = groupCreateTemplate.getUnitName();
             String unitName = groupCreateTemplate.getUnitName();
             for (int i = 0; i < createCount; i++) {
             for (int i = 0; i < createCount; i++) {
                 String name;
                 String name;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouImageServiceImpl.java

@@ -62,7 +62,7 @@ public class KuaiShouImageServiceImpl extends ServiceImpl<KuaiShouImageMapper, K
                 image.setPositionType(requestJson.getString("positionType"));
                 image.setPositionType(requestJson.getString("positionType"));
                 image.setAccountId(accountId);
                 image.setAccountId(accountId);
                 String imageUrlStr;
                 String imageUrlStr;
-                if (!imageUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl)) {
+                if (!imageUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
                     imageUrlStr = KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl;
                     imageUrlStr = KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl;
                 } else {
                 } else {
                     imageUrlStr = imageUrl;
                     imageUrlStr = imageUrl;

+ 1 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/entity/Actor.java

@@ -23,6 +23,7 @@ public class Actor {
     private String name;
     private String name;
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     private Date birthday;
     private Date birthday;
+    private String coverUrl;
     @Dict(dicCode = "sex")
     @Dict(dicCode = "sex")
     private Integer sex;
     private Integer sex;
     private String speciality;
     private String speciality;

+ 1 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/entity/Yard.java

@@ -20,6 +20,7 @@ public class Yard {
     @TableId(type = IdType.AUTO)
     @TableId(type = IdType.AUTO)
     private Long id;
     private Long id;
     private String address;
     private String address;
+    private String coverUrl;
     private String buildingName;
     private String buildingName;
     private String contactName;
     private String contactName;
     private String contactMobile;
     private String contactMobile;