Browse Source

修改内广效果

syh 5 years ago
parent
commit
6defa3185e
26 changed files with 418 additions and 175 deletions
  1. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java
  2. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdCoverController.java
  3. 11 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  4. 7 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceUserOrientationTemplateController.java
  5. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/GraphqlController.java
  6. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  7. 7 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceAdvertisePlan.java
  8. 82 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceUserOrientationTemplate.java
  9. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IByteDanceAdvertisePlanService.java
  10. 11 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IByteDanceAdvertiserDataService.java
  11. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IByteDanceUserOrientationTemplateService.java
  12. 17 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  13. 54 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  14. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceUserOrientationTemplateServiceImpl.java
  15. 46 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  16. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/sign/itext5/Extension.java
  17. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/AdConvertVo.java
  18. 26 25
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/mock/MockController.java
  19. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java
  20. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/UploadController.java
  21. 16 19
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/industry/controller/IndustryController.java
  22. 43 39
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/controller/ActuatorRedisController.java
  23. 6 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/vo/DefContants.java
  24. 17 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/web/TestWebController.java
  25. 30 0
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  26. 11 1
      module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils.java

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

@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 @RestController
 @RestController
 @Slf4j
 @Slf4j
 @RequestMapping("/ctop/actor")
 @RequestMapping("/ctop/actor")

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

@@ -21,6 +21,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 @RestController
 @RestController
 @RequestMapping("/ctop/adcover")
 @RequestMapping("/ctop/adcover")
 public class AdCoverController {
 public class AdCoverController {
@@ -83,6 +86,7 @@ public class AdCoverController {
         result.setSuccess(true);
         result.setSuccess(true);
         return result;
         return result;
     }
     }
+
     @ResponseBody
     @ResponseBody
     @RequestMapping(value="/feeds", method = RequestMethod.GET)
     @RequestMapping(value="/feeds", method = RequestMethod.GET)
     public Result<List<AppAd>> getVideoList(HttpServletRequest req){
     public Result<List<AppAd>> getVideoList(HttpServletRequest req){

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

@@ -174,7 +174,8 @@ public class ByteDanceTemplateController {
      * @return
      * @return
      */
      */
     @PostMapping("userorentation/insert")
     @PostMapping("userorentation/insert")
-    public Map<String, Object> userOrentationTemplateInsert(@RequestBody ByteDanceUserOrientationTemplate template, HttpServletRequest req) {
+    public Map<String, Object> userOrentationTemplateInsert(@RequestBody JSONObject template, HttpServletRequest req) {
+        System.out.println(template.toJSONString());
         return orientationTemplateService.insertTemplate(template);
         return orientationTemplateService.insertTemplate(template);
     }
     }
 
 
@@ -276,6 +277,15 @@ public class ByteDanceTemplateController {
         return planService.getAdConvertListByUrlId(accountId, urlId);
         return planService.getAdConvertListByUrlId(accountId, urlId);
     }
     }
 
 
+    /**
+     * @param bindAccountId 绑定账号id
+     * @param urlId         链接id
+     * @return 查询计划可用转化id
+     */
+    @GetMapping(value = "convert/list/url/ng")
+    public Map<String, Object> convertListByBindAccountId(Long bindAccountId, Long urlId) {
+        return planService.getAdConvertListByUrlIdAndBindId(bindAccountId, urlId);
+    }
 
 
     /**
     /**
      * @param req
      * @param req

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

@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
 import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
 import org.jeecg.modules.ctop.service.IByteDanceUserOrientationTemplateService;
 import org.jeecg.modules.ctop.service.IByteDanceUserOrientationTemplateService;
@@ -58,12 +60,14 @@ public class ByteDanceUserOrientationTemplateController {
      */
      */
     @AutoLog(value = "今日头条受众模板信息-分页列表查询")
     @AutoLog(value = "今日头条受众模板信息-分页列表查询")
     @ApiOperation(value = "今日头条受众模板信息-分页列表查询", notes = "今日头条受众模板信息-分页列表查询")
     @ApiOperation(value = "今日头条受众模板信息-分页列表查询", notes = "今日头条受众模板信息-分页列表查询")
-    @GetMapping(value = "/list")
+    @RequestMapping(value = "/list")
     public Result<IPage<ByteDanceUserOrientationTemplate>> queryPageList(ByteDanceUserOrientationTemplate byteDanceUserOrientationTemplate,
     public Result<IPage<ByteDanceUserOrientationTemplate>> queryPageList(ByteDanceUserOrientationTemplate byteDanceUserOrientationTemplate,
                                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                         @RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize,
                                                                          HttpServletRequest req) {
                                                                          HttpServletRequest req) {
-        Result<IPage<ByteDanceUserOrientationTemplate>> result = new Result<IPage<ByteDanceUserOrientationTemplate>>();
+        Result<IPage<ByteDanceUserOrientationTemplate>> result = new Result<>();
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        byteDanceUserOrientationTemplate.setUserId(user.getId());
         QueryWrapper<ByteDanceUserOrientationTemplate> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceUserOrientationTemplate, req.getParameterMap());
         QueryWrapper<ByteDanceUserOrientationTemplate> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceUserOrientationTemplate, req.getParameterMap());
         Page<ByteDanceUserOrientationTemplate> page = new Page<ByteDanceUserOrientationTemplate>(pageNo, pageSize);
         Page<ByteDanceUserOrientationTemplate> page = new Page<ByteDanceUserOrientationTemplate>(pageNo, pageSize);
         IPage<ByteDanceUserOrientationTemplate> pageList = byteDanceUserOrientationTemplateService.page(page, queryWrapper);
         IPage<ByteDanceUserOrientationTemplate> pageList = byteDanceUserOrientationTemplateService.page(page, queryWrapper);

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

@@ -17,6 +17,9 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 @Controller
 @Controller
 @RequestMapping("/graphql")
 @RequestMapping("/graphql")
 public class GraphqlController {
 public class GraphqlController {
@@ -24,6 +27,7 @@ public class GraphqlController {
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
     @Autowired
     @Autowired
     private IKuaishouVideoService kuaishouVideoService;
     private IKuaishouVideoService kuaishouVideoService;
+
     @RequestMapping("/video")
     @RequestMapping("/video")
     public void getVideoList(@RequestParam("uid") String uid){
     public void getVideoList(@RequestParam("uid") String uid){
         try {
         try {
@@ -32,6 +36,7 @@ public class GraphqlController {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
     }
     }
+
     @ResponseBody
     @ResponseBody
     @RequestMapping(value="/addkuaishouuser", method = RequestMethod.POST)
     @RequestMapping(value="/addkuaishouuser", method = RequestMethod.POST)
     public Result<Map<String,Object>> addKuaishouUser(@RequestBody JSONObject jsonObject){
     public Result<Map<String,Object>> addKuaishouUser(@RequestBody JSONObject jsonObject){
@@ -60,6 +65,7 @@ public class GraphqlController {
         result.setResult(resultMap);
         result.setResult(resultMap);
         return result;
         return result;
     }
     }
+
     @ResponseBody
     @ResponseBody
     @RequestMapping(value="/publicfeeds", method = RequestMethod.GET)
     @RequestMapping(value="/publicfeeds", method = RequestMethod.GET)
     public Result<IPage<KuaishouVideo>> getVideoList(@RequestParam("num") Integer num){
     public Result<IPage<KuaishouVideo>> getVideoList(@RequestParam("num") Integer num){

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

@@ -10,6 +10,9 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 @RestController
 @RestController
 @RequestMapping("/test")
 @RequestMapping("/test")
 public class TestController {
 public class TestController {

+ 7 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceAdvertisePlan.java

@@ -153,6 +153,9 @@ public class ByteDanceAdvertisePlan {
 	@Excel(name = "audience", width = 15)
 	@Excel(name = "audience", width = 15)
     @ApiModelProperty(value = "audience")
     @ApiModelProperty(value = "audience")
 	private Object audience;
 	private Object audience;
+    @Excel(name = "上次修改时间", width = 15)
+    @ApiModelProperty(value = "上次修改时间")
+    private String modifyTime;
 
 
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
 		Long id = dataObject.getLong("id");
 		Long id = dataObject.getLong("id");
@@ -176,7 +179,10 @@ public class ByteDanceAdvertisePlan {
         if (null != budgetMode && !"".equals(budgetMode.trim())) {
         if (null != budgetMode && !"".equals(budgetMode.trim())) {
             this.budgetMode = budgetMode;
             this.budgetMode = budgetMode;
 		}
 		}
-
+        String modifyTime = dataObject.getString("modify_time");
+        if (null != modifyTime && !"".equals(modifyTime.trim())) {
+            this.modifyTime = modifyTime;
+        }
         String openUrl = dataObject.getString("open_url");
         String openUrl = dataObject.getString("open_url");
         if (null != openUrl && !"".equals(openUrl.trim())) {
         if (null != openUrl && !"".equals(openUrl.trim())) {
             this.openUrl = openUrl;
             this.openUrl = openUrl;

+ 82 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceUserOrientationTemplate.java

@@ -1,5 +1,7 @@
 package org.jeecg.modules.ctop.entity;
 package org.jeecg.modules.ctop.entity;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -13,10 +15,10 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 import java.util.Date;
 import java.util.Date;
 
 
 /**
 /**
- * @Description: 今日头条受众模板信息
- * @Author: jeecg-boot
- * @Date: 2019-07-23
- * @Version: V1.0
+ * 今日头条受众模板信息
+ * @author jeecg-boot
+ * @date 2019-07-23
+ * @version V1.0
  */
  */
 @Data
 @Data
 @TableName("ctop_bytedance_user_orientation_template")
 @TableName("ctop_bytedance_user_orientation_template")
@@ -33,11 +35,11 @@ public class ByteDanceUserOrientationTemplate {
     private Long id;
     private Long id;
     /**
     /**
      * 平台广告主id
      * 平台广告主id
-     * advertiserId
+     * userId
      */
      */
-    @Excel(name = "平台广告主id")
-    @ApiModelProperty(value = "advertiser_id")
-    private String advertiserId;
+    @Excel(name = "用户id")
+    @ApiModelProperty(value = "user_id")
+    private String userId;
     /**
     /**
      * 模板名称
      * 模板名称
      */
      */
@@ -45,18 +47,6 @@ public class ByteDanceUserOrientationTemplate {
     @ApiModelProperty(value = "模板名称")
     @ApiModelProperty(value = "模板名称")
     private String name;
     private String name;
     /**
     /**
-     * 定向人群包列表
-     */
-    @Excel(name = "定向人群包列表", width = 15)
-    @ApiModelProperty(value = "定向人群包列表")
-    private String retargetingTagsInclude;
-    /**
-     * 排除人群包列表
-     */
-    @Excel(name = "排除人群包列表", width = 15)
-    @ApiModelProperty(value = "排除人群包列表")
-    private String retargetingTagsExclude;
-    /**
      * 受众性别
      * 受众性别
      */
      */
     @Excel(name = "受众性别", width = 15)
     @Excel(name = "受众性别", width = 15)
@@ -224,6 +214,14 @@ public class ByteDanceUserOrientationTemplate {
     @Excel(name = "排除流量包ID数组", width = 15)
     @Excel(name = "排除流量包ID数组", width = 15)
     @ApiModelProperty(value = "排除流量包ID数组")
     @ApiModelProperty(value = "排除流量包ID数组")
     private String excludeFlowPackage;
     private String excludeFlowPackage;
+
+    /**
+     * 智能放量
+     */
+    @Excel(name = "是否开启智能放量", width = 15)
+    @ApiModelProperty(value = "是否开启智能放量")
+    private String autoExtendEnabled;
+
     /**
     /**
      * status
      * status
      */
      */
@@ -243,4 +241,68 @@ public class ByteDanceUserOrientationTemplate {
 
 
     public ByteDanceUserOrientationTemplate() {
     public ByteDanceUserOrientationTemplate() {
     }
     }
+
+    public ByteDanceUserOrientationTemplate(String userId, JSONObject template) {
+        this.userId = userId;
+        String name = template.getString("name");
+        if (null != name && !name.equals("")) {
+            this.name = name;
+        } else {
+            this.name = "汇创思拓_" + System.currentTimeMillis() + "定向模板";
+        }
+
+        String gender = template.getString("genden");
+        if (null != gender && !gender.equals("")) {
+            this.gender = gender;
+        } else {
+            this.gender = "NONE";
+        }
+        JSONArray ageRange = template.getJSONArray("ageRange");
+        if (null != ageRange) {
+            this.age = ageRange.toJSONString();
+        }
+        String intrestType = template.getString("intrestType");
+        if (null != intrestType && !intrestType.equals("")) {
+            if ("NONE".equals(intrestType)) {
+                this.adTag = "[]";
+            } else if ("SYSTEM_TJ".equals(intrestType)) {
+                this.adTag = "[" + 0 + "]";
+            } else {
+                JSONArray categoryList = template.getJSONArray("intrestCategoryList");
+                JSONArray tags = new JSONArray();
+                if (null != categoryList && categoryList.size() > 0) {
+                    categoryList.forEach(category -> {
+                        JSONObject categoryObject = (JSONObject) category;
+                        Long id = categoryObject.getLong("id");
+                        tags.add(id);
+                    });
+                }
+                this.adTag = tags.toJSONString();
+            }
+        }
+        String platformType = template.getString("platformType");
+        if (null != platformType && !"".equals(platformType)) {
+            this.platform = platformType;
+        }
+        JSONArray netType = template.getJSONArray("netType");
+        if (null != netType) {
+            this.ac = netType.toJSONString();
+        }
+        String smartFl = template.getString("smartFl");
+        if (null != smartFl && !"".equals(smartFl)) {
+            this.autoExtendEnabled = smartFl;
+        }
+        String isArticleCategory = template.getString("isArticleCategory");
+        if (null != isArticleCategory && !"".equals(isArticleCategory)) {
+            if ("CATEGORY".equals(isArticleCategory)) {
+                this.articleCategory = template.getJSONArray("tags").toJSONString();
+            }
+        }
+        String isMobileBrand = template.getString("isArticleCategory");
+        if (null != isArticleCategory && !"".equals(isArticleCategory)) {
+            if ("CATEGORY".equals(isArticleCategory)) {
+                this.deviceBrand = template.getJSONArray("mobileType").toJSONString();
+            }
+        }
+    }
 }
 }

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IByteDanceAdvertisePlanService.java

@@ -19,4 +19,6 @@ public interface IByteDanceAdvertisePlanService extends IService<ByteDanceAdvert
     Map<String, Object> getAdConvertList(Long accountId, Long targetId);
     Map<String, Object> getAdConvertList(Long accountId, Long targetId);
 
 
     Map<String, Object> getAdConvertListByUrlId(Long accountId, Long urlId);
     Map<String, Object> getAdConvertListByUrlId(Long accountId, Long urlId);
+
+    Map<String, Object> getAdConvertListByUrlIdAndBindId(Long bindAccountId, Long urlId);
 }
 }

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

@@ -2,19 +2,23 @@ package org.jeecg.modules.ctop.service;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
 import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 public interface IByteDanceAdvertiserDataService {
 public interface IByteDanceAdvertiserDataService {
     Map<String, Object> getAdvertiserInfo(String accountId);
     Map<String, Object> getAdvertiserInfo(String accountId);
 
 
-    Map<String, Object> getAdvertiserPlan(String accountId,String ids);
+    Map<String, Object> getAdvertiserPlan(String accountId, String ids);
 
 
-    Map<String, Object> getAdvertiserCampaign(String accountId,String ids);
+    Map<String, Object> getAdvertiserCampaign(String accountId, String ids);
 
 
     Map<String, Object> getAdvertiserBudget(String accountId);
     Map<String, Object> getAdvertiserBudget(String accountId);
 
 
-    Map<String, Object> getAdvertiserCreative(String accountId,String ids);
+    Map<String, Object> getAdvertiserCreative(String accountId, String ids);
 
 
     Map<String, Object> getAdvertiserCreativeMaterial(String accountId, String creativeIds);
     Map<String, Object> getAdvertiserCreativeMaterial(String accountId, String creativeIds);
 
 
@@ -34,5 +38,9 @@ public interface IByteDanceAdvertiserDataService {
 
 
     Map<String, Object> advertiserAdUpdate(String accountId, Long adId, ByteDanceUserOrientationTemplate template);
     Map<String, Object> advertiserAdUpdate(String accountId, Long adId, ByteDanceUserOrientationTemplate template);
 
 
+    JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template);
+
+    JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId);
+
     JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template);
     JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template);
 }
 }

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IByteDanceUserOrientationTemplateService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.service;
 package org.jeecg.modules.ctop.service;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.ctop.entity.ByteDanceBudgetTemplate;
 import org.jeecg.modules.ctop.entity.ByteDanceBudgetTemplate;
@@ -18,7 +19,7 @@ import java.util.Map;
  */
  */
 public interface IByteDanceUserOrientationTemplateService extends IService<ByteDanceUserOrientationTemplate> {
 public interface IByteDanceUserOrientationTemplateService extends IService<ByteDanceUserOrientationTemplate> {
 
 
-    Map<String, Object> insertTemplate(ByteDanceUserOrientationTemplate template);
+    Map<String, Object> insertTemplate(JSONObject template);
 
 
     Result<IPage<ByteDanceUserOrientationTemplate>> getList(ByteDanceUserOrientationTemplate template, Integer pageNo, Integer pageSize, HttpServletRequest req);
     Result<IPage<ByteDanceUserOrientationTemplate>> getList(ByteDanceUserOrientationTemplate template, Integer pageNo, Integer pageSize, HttpServletRequest req);
 }
 }

+ 17 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -5,10 +5,8 @@ import cn.com.ctop.common.utils.PropertiesUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.modules.ctop.entity.ByteDanceAdvertisePlan;
-import org.jeecg.modules.ctop.entity.BytedanceDeliveryTargetTemplate;
-import org.jeecg.modules.ctop.entity.BytedanceUrlInfo;
-import org.jeecg.modules.ctop.entity.CtopOauthToken;
+import org.jeecg.modules.ctop.entity.*;
+import org.jeecg.modules.ctop.mapper.BindAccountLoginMapper;
 import org.jeecg.modules.ctop.mapper.ByteDanceAdvertisePlanMapper;
 import org.jeecg.modules.ctop.mapper.ByteDanceAdvertisePlanMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceDeliveryTargetTemplateMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceDeliveryTargetTemplateMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceUrlInfoMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceUrlInfoMapper;
@@ -78,7 +76,19 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return getAdConvertByUrlInfo(token, urlInfo);
         return getAdConvertByUrlInfo(token, urlInfo);
     }
     }
 
 
+    @Autowired
+    private BindAccountLoginMapper bindAccountLoginMapper;
+
+    @Override
+    public Map<String, Object> getAdConvertListByUrlIdAndBindId(Long bindAccountId, Long urlId) {
+        BindAccountLogin accountLogin = bindAccountLoginMapper.selectById(bindAccountId);
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountLogin.getAccountId());
+        BytedanceUrlInfo urlInfo = urlInfoMapper.selectById(urlId);
+        return getAdConvertByUrlInfo(token, urlInfo);
+    }
+
     private Map<String, Object> getAdConvertByUrlInfo(CtopOauthToken token, BytedanceUrlInfo urlInfo) {
     private Map<String, Object> getAdConvertByUrlInfo(CtopOauthToken token, BytedanceUrlInfo urlInfo) {
+
         final Long advertiserId = token.getAccountId();
         final Long advertiserId = token.getAccountId();
         // 请求地址
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/ad_convert/select/";
         String url = "https://ad.toutiao.com/open_api/2/tools/ad_convert/select/";
@@ -93,6 +103,9 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         if ("android".equals(urlInfo.getType())) {
         if ("android".equals(urlInfo.getType())) {
             params.put("package_name", urlInfo.getPackageName());
             params.put("package_name", urlInfo.getPackageName());
         }
         }
+        if ("IOS".equals(urlInfo.getType())) {
+            params.put("itunes_url", urlInfo.getUrl());
+        }
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
     }
     }
 
 

+ 54 - 35
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -8,13 +8,16 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.client.HttpClientBuilder;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.entity.*;
 import org.jeecg.modules.ctop.entity.*;
 import org.jeecg.modules.ctop.mapper.*;
 import org.jeecg.modules.ctop.mapper.*;
+import org.jeecg.modules.ctop.service.IByteDanceAdvertisePlanService;
 import org.jeecg.modules.ctop.service.IByteDanceAdvertiserDataService;
 import org.jeecg.modules.ctop.service.IByteDanceAdvertiserDataService;
 import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.jeecgframework.poi.excel.annotation.Excel;
@@ -25,9 +28,9 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.InputStreamReader;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
+import java.net.URI;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 
 /**
 /**
  * @author 宋英豪
  * @author 宋英豪
@@ -98,55 +101,54 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
         return resultMap;
     }
     }
 
 
-    private void getAdvertiserPlanByPageNumber(String accountId, Integer pageNumber, String ids) {
-        CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
-        //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_get");
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", "application/json");
-        headers.put("Access-Token", cTopOauthToken.getAccessToken());
-
-        TreeMap<String, Object> params = new TreeMap<>();
-        params.put("advertiser_id", cTopOauthToken.getAccountId());
-        params.put("page", pageNumber + "");
-        JSONObject filtering = new JSONObject();
-        if (null != ids && !"".equals(ids.trim())) {
-            String[] idsArray = ids.split(",");
-            JSONArray filterIdsArray = new JSONArray();
-            for (int i = 0; i < idsArray.length; i++) {
-                Long id = Long.parseLong(idsArray[i]);
-                filterIdsArray.add(id);
+    public void getAd(String accountId, int pageNum, String ids) {
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+        String[] idString = ids.split(",");
+        JSONArray getIds = new JSONArray();
+        if (null != idString && idString.length > 0) {
+            for (int i = 0; i < idString.length; i++) {
+                Long getId = Long.parseLong(idString[i]);
+                getIds.add(getId);
             }
             }
-            filtering.put("ids", filterIdsArray);
         }
         }
-        params.put("filtering", filtering.toJSONString());
 
 
-        String result = HttpUtils.httpGetRequest(url, headers, params);
-        JSONObject jsonObject = JSONObject.parseObject(result);
-        Integer code = jsonObject.getInteger("code");
+        // 请求地址
+        String url = "https://ad.toutiao.com/open_api/2/ad/get/";
+        // 请求参数
+        Map<String, Object> filtering = new HashMap<>();
+        filtering.put("ids", getIds);
 
 
+        Map<String, Object> param = new HashMap<>();
+        param.put("advertiser_id", token.getAccountId());
+        param.put("page", pageNum);
+        param.put("page_size", 100);
+        param.put("filtering", filtering);
+
+        JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+        Integer code = resultObject.getInteger("code");
         if (null == code || !code.equals(0)) {
         if (null == code || !code.equals(0)) {
-            log.error("获取广告计划信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.error("获取广告计划信息接口异常==》accountId:{},message:{}", accountId, resultObject.getString("message"));
             return;
             return;
         }
         }
-        JSONArray data = jsonObject.getJSONObject("data").getJSONArray("list");
+        JSONArray data = resultObject.getJSONObject("data").getJSONArray("list");
         if (null == data || data.size() <= 0) {
         if (null == data || data.size() <= 0) {
-            log.error("获取广告计划信息不存在==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.error("获取广告计划信息不存在==》accountId:{},message:{}", accountId, resultObject.getString("message"));
             return;
             return;
         }
         }
         for (int i = 0; i < data.size(); i++) {
         for (int i = 0; i < data.size(); i++) {
             JSONObject dataObject = data.getJSONObject(i);
             JSONObject dataObject = data.getJSONObject(i);
+            System.out.println(dataObject.toJSONString());
             ByteDanceAdvertisePlan advertisePlan = new ByteDanceAdvertisePlan(dataObject, accountId);
             ByteDanceAdvertisePlan advertisePlan = new ByteDanceAdvertisePlan(dataObject, accountId);
             //清除清数据,插入新数据
             //清除清数据,插入新数据
             advertisePlanMapper.deleteById(advertisePlan.getId());
             advertisePlanMapper.deleteById(advertisePlan.getId());
             advertisePlanMapper.insert(advertisePlan);
             advertisePlanMapper.insert(advertisePlan);
         }
         }
-        getAdvertiserPlanByPageNumber(accountId, pageNumber + 1, ids);
+        getAd(accountId, pageNum + 1, ids);
     }
     }
 
 
     @Override
     @Override
     public Map<String, Object> getAdvertiserPlan(String accountId, String ids) {
     public Map<String, Object> getAdvertiserPlan(String accountId, String ids) {
-        getAdvertiserPlanByPageNumber(accountId, 1, ids);
+        getAd(accountId, 1, ids);
         Map<String, Object> resultMap = new HashMap<>();
         Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("code", 0);
         resultMap.put("code", 0);
         resultMap.put("message", "获取广告计划信息成功");
         resultMap.put("message", "获取广告计划信息成功");
@@ -628,6 +630,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return null;
         return null;
     }
     }
 
 
+    @Override
     public JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template) {
     public JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template) {
 
 
         // 请求地址
         // 请求地址
@@ -636,12 +639,26 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         JSONObject data = new JSONObject();
         JSONObject data = new JSONObject();
         data.put("advertiser_id", token.getAccountId());
         data.put("advertiser_id", token.getAccountId());
         data.put("ad_id", adId);
         data.put("ad_id", adId);
-        data = setUserOrentationData(data, template);
+        data = setUserOrentationData(data, template, adId);
         return HttpUtils.bytedancePostRequest(token.getAccessToken(), url, data);
         return HttpUtils.bytedancePostRequest(token.getAccessToken(), url, data);
     }
     }
 
 
+    @Autowired
+    private IByteDanceAdvertisePlanService advertisePlanService;
+
+    @Override
+    public JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId) {
+        //根据adId获取公告计划信息
+        ByteDanceAdvertisePlan advertisePlan = advertisePlanService.getById(adId);
+        data.put("modify_time", advertisePlan.getModifyTime());
+        data = setUserOrentationData(data, template);
+        System.out.println(data.toJSONString());
+        return data;
+    }
+
     @Override
     @Override
     public JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template) {
     public JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template) {
+        //根据adId获取公告计划信息
         if (null != template.getGender() && !"".equals(template.getGender().trim())) {
         if (null != template.getGender() && !"".equals(template.getGender().trim())) {
             data.put("gender", template.getGender());
             data.put("gender", template.getGender());
         }
         }
@@ -676,7 +693,8 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
             data.put("activate_type", activateTypeArray);
             data.put("activate_type", activateTypeArray);
         }
         }
         if (null != template.getPlatform() && !"".equals(template.getPlatform().trim())) {
         if (null != template.getPlatform() && !"".equals(template.getPlatform().trim())) {
-            JSONArray platformArray = JSONArray.parseArray(template.getPlatform());
+            JSONArray platformArray = new JSONArray();
+            platformArray.add(template.getPlatform());
             data.put("platform", platformArray);
             data.put("platform", platformArray);
         }
         }
         if (null != template.getCity() && !"".equals(template.getCity().trim())) {
         if (null != template.getCity() && !"".equals(template.getCity().trim())) {
@@ -743,12 +761,13 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
             JSONArray excludeFlowPackageArray = JSONArray.parseArray(template.getExcludeFlowPackage());
             JSONArray excludeFlowPackageArray = JSONArray.parseArray(template.getExcludeFlowPackage());
             data.put("exclude_flow_package", excludeFlowPackageArray);
             data.put("exclude_flow_package", excludeFlowPackageArray);
         }
         }
+        if (null != template.getAutoExtendEnabled() && !"".equals(template.getAutoExtendEnabled().trim())) {
+            data.put("auto_extend_enabled", template.getAutoExtendEnabled());
+        }
         return data;
         return data;
     }
     }
 
 
 
 
-
-
     private void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber, String ids) {
     private void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber, String ids) {
         CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
         CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
         //2: 根据token以及用户id获取用户信息数据
         //2: 根据token以及用户id获取用户信息数据

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceUserOrientationTemplateServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.service.impl;
 package org.jeecg.modules.ctop.service.impl;
 
 
+import com.alibaba.fastjson.JSONObject;
 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;
@@ -30,12 +31,11 @@ public class ByteDanceUserOrientationTemplateServiceImpl extends ServiceImpl<Byt
     private ByteDanceUserOrientationTemplateMapper templateMapper;
     private ByteDanceUserOrientationTemplateMapper templateMapper;
 
 
     @Override
     @Override
-    public Map<String, Object> insertTemplate(ByteDanceUserOrientationTemplate template) {
+    public Map<String, Object> insertTemplate(JSONObject template) {
         Map<String, Object> resultMap = new HashMap<>();
         Map<String, Object> resultMap = new HashMap<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        template.setAdvertiserId(user.getId());
-        template.setStatus(1);
-        templateMapper.insert(template);
+        ByteDanceUserOrientationTemplate orientationTemplate = new ByteDanceUserOrientationTemplate(user.getId(), template);
+        this.saveOrUpdate(orientationTemplate);
         resultMap.put("success", true);
         resultMap.put("success", true);
         resultMap.put("message", "投放目标模板保存成功");
         resultMap.put("message", "投放目标模板保存成功");
         return resultMap;
         return resultMap;

+ 46 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -12,10 +12,16 @@ import org.apache.http.impl.cookie.BasicClientCookie;
 import org.jeecg.common.util.ResultMapUtils;
 import org.jeecg.common.util.ResultMapUtils;
 import org.jeecg.common.util.StatusCode;
 import org.jeecg.common.util.StatusCode;
 import org.jeecg.modules.ctop.entity.BindAccountLogin;
 import org.jeecg.modules.ctop.entity.BindAccountLogin;
+import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
 import org.jeecg.modules.ctop.entity.BytedanceUrlInfo;
 import org.jeecg.modules.ctop.entity.BytedanceUrlInfo;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
 import org.jeecg.modules.ctop.mapper.BindAccountLoginMapper;
 import org.jeecg.modules.ctop.mapper.BindAccountLoginMapper;
+import org.jeecg.modules.ctop.mapper.ByteDanceUserOrientationTemplateMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceUrlInfoMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceUrlInfoMapper;
+import org.jeecg.modules.ctop.service.IByteDanceAdvertiserDataService;
+import org.jeecg.modules.ctop.service.IByteDanceUserOrientationTemplateService;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
+import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.openqa.selenium.By;
 import org.openqa.selenium.By;
 import org.openqa.selenium.Cookie;
 import org.openqa.selenium.Cookie;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebDriver;
@@ -28,6 +34,9 @@ import org.springframework.stereotype.Service;
 
 
 import java.util.*;
 import java.util.*;
 
 
+/**
+ * @author jeecg-boot
+ */
 @Slf4j
 @Slf4j
 @Service
 @Service
 public class CreateInternalServiceImpl implements ICreateInternalService {
 public class CreateInternalServiceImpl implements ICreateInternalService {
@@ -140,11 +149,15 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         }
         }
         return resultMap;
         return resultMap;
     }
     }
+
     @Override
     @Override
     public Map<String, Object> createInternal(JSONObject requestJson) {
     public Map<String, Object> createInternal(JSONObject requestJson) {
+        System.out.println(requestJson);
         Map<String, Object> resultMap = new HashMap<>();
         Map<String, Object> resultMap = new HashMap<>();
         //1:获取用户名密码
         //1:获取用户名密码
         Long accountId = requestJson.getLong("accountId");
         Long accountId = requestJson.getLong("accountId");
+        System.out.println(accountId);
+        Long userOrientationId = requestJson.getLong("userOrientationId");
         BindAccountLogin bindAccountLogin = bindAccountLoginMapper.selectById(accountId);
         BindAccountLogin bindAccountLogin = bindAccountLoginMapper.selectById(accountId);
         if (null == bindAccountLogin) {
         if (null == bindAccountLogin) {
             ResultMapUtils.setResultMap(resultMap, StatusCode.ACCOUNT_HAS_NOT_EXIST.getCode());
             ResultMapUtils.setResultMap(resultMap, StatusCode.ACCOUNT_HAS_NOT_EXIST.getCode());
@@ -307,7 +320,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                         planParam.put("classify", 5);  //广告类别  5 内广
                         planParam.put("classify", 5);  //广告类别  5 内广
                         planParam.put("projectid", "");
                         planParam.put("projectid", "");
                         planParam.put("localGeolocation", new ArrayList<String>());
                         planParam.put("localGeolocation", new ArrayList<String>());
-                        planParam.put("external_action", 4);
+//                        planParam.put("external_action", 4);
                         planParam.put("open_url", ""); //  应用直达链接
                         planParam.put("open_url", ""); //  应用直达链接
                         planParam.put("style_type", 0);
                         planParam.put("style_type", 0);
                         planParam.put("location_type", 4); //受众位置类型
                         planParam.put("location_type", 4); //受众位置类型
@@ -346,7 +359,16 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                         planParam.put("app_bid_ratio", new Object());
                         planParam.put("app_bid_ratio", new Object());
                         planParam.put("campaign_id", campaignId);
                         planParam.put("campaign_id", campaignId);
                         String downLoadMode = requestJson.getString("downloadMode");
                         String downLoadMode = requestJson.getString("downloadMode");
-                        planParam.put("app_type", 201); //app 类型 201 应用推广 安卓 201 应用推广 ios
+                        if ("IOS".equals(urlInfo.getType())) {
+                            planParam.put("app_type", 202); //app 类型 201 应用推广 安卓 201 应用推广 ios
+                        } else if ("android".equals(urlInfo.getType())) {
+                            planParam.put("app_type", 201);
+                        }
+                        Long convertId = requestJson.getLong("convertId");
+                        if (null != convertId && convertId != 0) {
+                            planParam.put("convert_id", convertId);
+                        }
+                        System.out.println(planParam);
                         String createResult = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/overture/ad/create/", planParam, header);
                         String createResult = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/overture/ad/create/", planParam, header);
                         JSONObject result = JSONObject.parseObject(createResult);
                         JSONObject result = JSONObject.parseObject(createResult);
                         System.out.println(result.toJSONString());
                         System.out.println(result.toJSONString());
@@ -358,6 +380,21 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                             resultMap.put("success", false);
                             resultMap.put("success", false);
                             return resultMap;
                             return resultMap;
                         }
                         }
+                        Long adId = result.getJSONObject("data").getLong("ad_id");
+
+                        //修改用户定向
+                        ByteDanceUserOrientationTemplate template = userOrientationTemplateMapper.selectById(userOrientationId);
+                        if (null != template) {
+                            CtopOauthToken token = tokenService.getOauthTokenByAccountId(bindAccountLogin.getAccountId());
+                            if (null != token) {
+                                //获取modify_time
+                                Thread.sleep(5000L);
+                                advertiserDataService.getAdvertiserPlan(bindAccountLogin.getAccountId(), adId + "");
+
+                                System.out.println(111);
+                                advertiserDataService.updateAd(token, adId, template);
+                            }
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -373,4 +410,11 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         return resultMap;
         return resultMap;
     }
     }
+
+    @Autowired
+    private ByteDanceUserOrientationTemplateMapper userOrientationTemplateMapper;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
 }
 }

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/sign/itext5/Extension.java

@@ -2,6 +2,9 @@ package org.jeecg.modules.ctop.sign.itext5;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
+/**
+ * @author jeecg-boot
+ */
 @Data
 @Data
 public class Extension {
 public class Extension {
     private String oid;
     private String oid;

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/AdConvertVo.java

@@ -2,6 +2,9 @@ package org.jeecg.modules.ctop.vo;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 
 
+/**
+ * @author jeecg-boot
+ */
 public class AdConvertVo implements Serializable {
 public class AdConvertVo implements Serializable {
     /**
     /**
      * 广告主id
      * 广告主id

+ 26 - 25
jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/mock/MockController.java

@@ -28,7 +28,7 @@ import lombok.extern.slf4j.Slf4j;
 public class MockController {
 public class MockController {
 
 
 	private final String JSON_PATH = "classpath:org/jeecg/modules/demo/mock/json";
 	private final String JSON_PATH = "classpath:org/jeecg/modules/demo/mock/json";
-	
+
 	/**
 	/**
 	 * 通用json访问接口
 	 * 通用json访问接口
 	 * 格式: http://localhost:8080/jeecg-boot/api/json/{filename}
 	 * 格式: http://localhost:8080/jeecg-boot/api/json/{filename}
@@ -40,18 +40,18 @@ public class MockController {
 		String jsonpath = "classpath:org/jeecg/modules/demo/mock/json/"+filename+".json";
 		String jsonpath = "classpath:org/jeecg/modules/demo/mock/json/"+filename+".json";
 		return readJson(jsonpath);
 		return readJson(jsonpath);
 	}
 	}
-	
-	@GetMapping(value = "/asynTreeList")
+
+    @GetMapping(value = "/asynTreeList")
 	public String asynTreeList(String id) {
 	public String asynTreeList(String id) {
 		return readJson(JSON_PATH + "/asyn_tree_list_" + id + ".json");
 		return readJson(JSON_PATH + "/asyn_tree_list_" + id + ".json");
 	}
 	}
-	
-	@GetMapping(value = "/user")
+
+    @GetMapping(value = "/user")
 	public String user() {
 	public String user() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/user.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/user.json");
 	}
 	}
-	
-	/**
+
+    /**
 	 * 老的登录获取用户信息接口
 	 * 老的登录获取用户信息接口
 	 * @return
 	 * @return
 	 */
 	 */
@@ -79,16 +79,16 @@ public class MockController {
     public String permissionNoPage() {
     public String permissionNoPage() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/permission_no_page.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/permission_no_page.json");
 	}
 	}
-	
-	/**
+
+    /**
 	 * 省市县
 	 * 省市县
 	 */
 	 */
 	@GetMapping(value = "/area")
 	@GetMapping(value = "/area")
 	public String area() {
 	public String area() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/area.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/area.json");
 	}
 	}
-	
-	/**
+
+    /**
 	  * 测试报表数据
 	  * 测试报表数据
 	 */
 	 */
 	@GetMapping(value = "/report/getYearCountInfo")
 	@GetMapping(value = "/report/getYearCountInfo")
@@ -107,8 +107,8 @@ public class MockController {
 	public String getCabinetCountInfo() {
 	public String getCabinetCountInfo() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
 	}
 	}
-	
-	/**
+
+    /**
 	   * 实时磁盘监控
 	   * 实时磁盘监控
 	 * @param request
 	 * @param request
 	 * @param response
 	 * @param response
@@ -124,8 +124,8 @@ public class MockController {
 	        File[] fs = File.listRoots();
 	        File[] fs = File.listRoots();
 	        log.info("查询磁盘信息:"+fs.length+"个");
 	        log.info("查询磁盘信息:"+fs.length+"个");
 	        List<Map<String,Object>> list = new ArrayList<>();
 	        List<Map<String,Object>> list = new ArrayList<>();
-	        
-	        for (int i = 0; i < fs.length; i++) {
+
+            for (int i = 0; i < fs.length; i++) {
 	        	if(fs[i].getTotalSpace()==0) {
 	        	if(fs[i].getTotalSpace()==0) {
 	        		continue;
 	        		continue;
 	        	}
 	        	}
@@ -158,18 +158,18 @@ public class MockController {
 	public String activity() {
 	public String activity() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_activity.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_activity.json");
 	}
 	}
-	
-	@GetMapping(value = "/workplace/teams")
+
+    @GetMapping(value = "/workplace/teams")
 	public String teams() {
 	public String teams() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_teams.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_teams.json");
 	}
 	}
-	
-	@GetMapping(value = "/workplace/radar")
+
+    @GetMapping(value = "/workplace/radar")
 	public String radar() {
 	public String radar() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_radar.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_radar.json");
 	}
 	}
-	
-	@GetMapping(value = "/task/process")
+
+    @GetMapping(value = "/task/process")
 	public String taskProcess() {
 	public String taskProcess() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/task_process.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/task_process.json");
 	}
 	}
@@ -182,8 +182,8 @@ public class MockController {
 	public String sysDataLogJson() {
 	public String sysDataLogJson() {
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/sysdatalog.json");
 		return readJson("classpath:org/jeecg/modules/demo/mock/json/sysdatalog.json");
 	}
 	}
-	
-	/**
+
+    /**
 	 * 读取json格式文件
 	 * 读取json格式文件
 	 * @param jsonSrc
 	 * @param jsonSrc
 	 * @return
 	 * @return
@@ -195,8 +195,9 @@ public class MockController {
 			//json = FileUtils.re.readFileToString(jsonFile);
 			//json = FileUtils.re.readFileToString(jsonFile);
 			//换个写法,解决springboot读取jar包中文件的问题
 			//换个写法,解决springboot读取jar包中文件的问题
 			InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", ""));
 			InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", ""));
-			json = IOUtils.toString(stream);
-		} catch (IOException e) {
+            json = stream.toString();
+//			json = IOUtils.toString(stream);
+        } catch (Exception e) {
 			log.error(e.getMessage(),e);
 			log.error(e.getMessage(),e);
 		}
 		}
 		return json;
 		return json;

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java

@@ -9,6 +9,7 @@ import java.util.Map;
 
 
 /**
 /**
  * 素材库工具接口
  * 素材库工具接口
+ * @author jeecg-boot
  */
  */
 @RestController
 @RestController
 public class FileController {
 public class FileController {

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/UploadController.java

@@ -11,6 +11,9 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * @author jeecg-boot
+ */
 @RestController
 @RestController
 @RequestMapping("upload")
 @RequestMapping("upload")
 public class UploadController {
 public class UploadController {

+ 16 - 19
jeecg-boot-module-system/src/main/java/org/jeecg/modules/industry/controller/IndustryController.java

@@ -47,18 +47,15 @@ import io.swagger.annotations.ApiOperation;
 public class IndustryController {
 public class IndustryController {
 	@Autowired
 	@Autowired
 	private IIndustryService industryService;
 	private IIndustryService industryService;
-	
-	/**
+
+     /**
 	  * 分页列表查询
 	  * 分页列表查询
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/list", method = RequestMethod.GET)
 	@RequestMapping(value = "/list", method = RequestMethod.GET)
 	public Result<List<IndustryTree>> list() {
 	public Result<List<IndustryTree>> list() {
 		Result<List<IndustryTree>> result = new Result<List<IndustryTree>>();
 		Result<List<IndustryTree>> result = new Result<List<IndustryTree>>();
-//		QueryWrapper<Industry> queryWrapper = QueryGenerator.initQueryWrapper(industry, req.getParameterMap());
-//		Page<Industry> page = new Page<Industry>(pageNo, pageSize);
 		List<Industry> list = industryService.list();
 		List<Industry> list = industryService.list();
-//		IPage<Industry> pageList = industryService.page(page, queryWrapper);
 		List<IndustryTree> treeList = new ArrayList<IndustryTree>();
 		List<IndustryTree> treeList = new ArrayList<IndustryTree>();
 		getTreeList(treeList,list,null);
 		getTreeList(treeList,list,null);
 		result.setSuccess(true);
 		result.setSuccess(true);
@@ -114,8 +111,8 @@ public class IndustryController {
 
 
 		 }
 		 }
 	 }
 	 }
-	
-	/**
+
+     /**
 	  *   添加
 	  *   添加
 	 * @param industry
 	 * @param industry
 	 * @return
 	 * @return
@@ -134,8 +131,8 @@ public class IndustryController {
 		}
 		}
 		return result;
 		return result;
 	}
 	}
-	
-	/**
+
+     /**
 	  *  编辑
 	  *  编辑
 	 * @param industry
 	 * @param industry
 	 * @return
 	 * @return
@@ -155,11 +152,11 @@ public class IndustryController {
 				result.success("修改成功!");
 				result.success("修改成功!");
 			}
 			}
 		}
 		}
-		
-		return result;
+
+        return result;
 	}
 	}
-	
-	/**
+
+     /**
 	  *   通过id删除
 	  *   通过id删除
 	 * @param id
 	 * @param id
 	 * @return
 	 * @return
@@ -178,11 +175,11 @@ public class IndustryController {
 				result.success("删除成功!");
 				result.success("删除成功!");
 			}
 			}
 		}
 		}
-		
-		return result;
+
+        return result;
 	}
 	}
-	
-	/**
+
+     /**
 	  *  批量删除
 	  *  批量删除
 	 * @param ids
 	 * @param ids
 	 * @return
 	 * @return
@@ -200,8 +197,8 @@ public class IndustryController {
 		}
 		}
 		return result;
 		return result;
 	}
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	  * 通过id查询
 	 * @param id
 	 * @param id
 	 * @return
 	 * @return

+ 43 - 39
jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/controller/ActuatorRedisController.java

@@ -20,6 +20,9 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
+/**
+ * @author jeecg-boot
+ */
 @Slf4j
 @Slf4j
 @RestController
 @RestController
 @RequestMapping("/actuator/redis")
 @RequestMapping("/actuator/redis")
@@ -49,43 +52,44 @@ public class ActuatorRedisController {
     public Map<String, Object> getMemoryInfo() throws Exception {
     public Map<String, Object> getMemoryInfo() throws Exception {
         return redisService.getMemoryInfo();
         return redisService.getMemoryInfo();
     }
     }
-    
-  //update-begin--Author:zhangweijian  Date:20190425 for:获取磁盘信息
-  	/**
-  	 * @功能:获取磁盘信息
-  	 * @param request
-  	 * @param response
-  	 * @return
-  	 */
-  	@GetMapping("/queryDiskInfo")
-  	public Result<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
-  		Result<List<Map<String,Object>>> res = new Result<>();
-  		try {
-  			// 当前文件系统类
-  	        FileSystemView fsv = FileSystemView.getFileSystemView();
-  	        // 列出所有windows 磁盘
-  	        File[] fs = File.listRoots();
-  	        log.info("查询磁盘信息:"+fs.length+"个");
-  	        List<Map<String,Object>> list = new ArrayList<>();
-  	        
-  	        for (int i = 0; i < fs.length; i++) {
-  	        	if(fs[i].getTotalSpace()==0) {
-  	        		continue;
-  	        	}
-  	        	Map<String,Object> map = new HashMap<>();
-  	        	map.put("name", fsv.getSystemDisplayName(fs[i]));
-  	        	map.put("max", fs[i].getTotalSpace());
-  	        	map.put("rest", fs[i].getFreeSpace());
-  	        	map.put("restPPT", (fs[i].getTotalSpace()-fs[i].getFreeSpace())*100/fs[i].getTotalSpace());
-  	        	list.add(map);
-  	        	log.info(map.toString());
-  	        }
-  	        res.setResult(list);
-  	        res.success("查询成功");
-  		} catch (Exception e) {
-  			res.error500("查询失败"+e.getMessage());
-  		}
-  		return res;
-  	}
-  	//update-end--Author:zhangweijian  Date:20190425 for:获取磁盘信息
+
+    //update-begin--Author:zhangweijian  Date:20190425 for:获取磁盘信息
+
+    /**
+     * @功能:获取磁盘信息
+     * @param request
+     * @param response
+     * @return
+     */
+    @GetMapping("/queryDiskInfo")
+    public Result<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
+        Result<List<Map<String,Object>>> res = new Result<>();
+        try {
+            // 当前文件系统类
+            FileSystemView fsv = FileSystemView.getFileSystemView();
+            // 列出所有windows 磁盘
+            File[] fs = File.listRoots();
+            log.info("查询磁盘信息:"+fs.length+"个");
+            List<Map<String,Object>> list = new ArrayList<>();
+
+            for (int i = 0; i < fs.length; i++) {
+                if(fs[i].getTotalSpace()==0) {
+                    continue;
+                }
+                Map<String,Object> map = new HashMap<>();
+                map.put("name", fsv.getSystemDisplayName(fs[i]));
+                map.put("max", fs[i].getTotalSpace());
+                map.put("rest", fs[i].getFreeSpace());
+                map.put("restPPT", (fs[i].getTotalSpace()-fs[i].getFreeSpace())*100/fs[i].getTotalSpace());
+                list.add(map);
+                log.info(map.toString());
+            }
+            res.setResult(list);
+            res.success("查询成功");
+        } catch (Exception e) {
+            res.error500("查询失败"+e.getMessage());
+        }
+        return res;
+    }
+    //update-end--Author:zhangweijian  Date:20190425 for:获取磁盘信息
 }
 }

+ 6 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/vo/DefContants.java

@@ -1,7 +1,10 @@
 package org.jeecg.modules.shiro.vo;
 package org.jeecg.modules.shiro.vo;
 
 
+/**
+ * @author jeecg-boot
+ */
 public class DefContants {
 public class DefContants {
-	
-	public static String X_ACCESS_TOKEN = "X-Access-Token";
-	
+
+    public static String X_ACCESS_TOKEN = "X-Access-Token";
+
 }
 }

+ 17 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/web/TestWebController.java

@@ -21,31 +21,34 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+/**
+ * @author jeecg-boot
+ */
 @RestController
 @RestController
 public class TestWebController {
 public class TestWebController {
- 
+
     private ISysUserService userService;
     private ISysUserService userService;
- 
+
     @Autowired
     @Autowired
     public void setService(ISysUserService userService) {
     public void setService(ISysUserService userService) {
         this.userService = userService;
         this.userService = userService;
     }
     }
- 
+
     @PostMapping("/login")
     @PostMapping("/login")
     public ResponseBean login(@RequestParam("username") String username,
     public ResponseBean login(@RequestParam("username") String username,
                               @RequestParam("password") String password) {
                               @RequestParam("password") String password) {
-    	SysUser user = userService.getUserByName(username);
-    	if(user==null) {
-    		return new ResponseBean(200, "用户不存在!", JwtUtil.sign(username, user.getPassword()));
-    	}
-    	String passwordEncode = PasswordUtil.encrypt(username, password, user.getSalt());
+        SysUser user = userService.getUserByName(username);
+        if(user==null) {
+            return new ResponseBean(200, "用户不存在!", JwtUtil.sign(username, user.getPassword()));
+        }
+        String passwordEncode = PasswordUtil.encrypt(username, password, user.getSalt());
         if (passwordEncode.equals(user.getPassword())) {
         if (passwordEncode.equals(user.getPassword())) {
             return new ResponseBean(200, "Login success", JwtUtil.sign(username, user.getPassword()));
             return new ResponseBean(200, "Login success", JwtUtil.sign(username, user.getPassword()));
         } else {
         } else {
             throw new UnauthorizedException();
             throw new UnauthorizedException();
         }
         }
     }
     }
- 
+
     @GetMapping("/article")
     @GetMapping("/article")
     public ResponseBean article() {
     public ResponseBean article() {
         Subject subject = SecurityUtils.getSubject();
         Subject subject = SecurityUtils.getSubject();
@@ -55,28 +58,28 @@ public class TestWebController {
             return new ResponseBean(200, "You are guest", null);
             return new ResponseBean(200, "You are guest", null);
         }
         }
     }
     }
- 
+
     @GetMapping("/require_auth")
     @GetMapping("/require_auth")
     @RequiresAuthentication
     @RequiresAuthentication
     public ResponseBean requireAuth() {
     public ResponseBean requireAuth() {
         return new ResponseBean(200, "You are authenticated", null);
         return new ResponseBean(200, "You are authenticated", null);
     }
     }
- 
+
     @GetMapping("/require_role")
     @GetMapping("/require_role")
     @RequiresRoles("admin")
     @RequiresRoles("admin")
     public ResponseBean requireRole() {
     public ResponseBean requireRole() {
         return new ResponseBean(200, "You are visiting require_role", null);
         return new ResponseBean(200, "You are visiting require_role", null);
     }
     }
- 
+
     @GetMapping("/require_permission")
     @GetMapping("/require_permission")
     @RequiresPermissions(logical = Logical.AND, value = {"view", "edit"})
     @RequiresPermissions(logical = Logical.AND, value = {"view", "edit"})
     public ResponseBean requirePermission() {
     public ResponseBean requirePermission() {
         return new ResponseBean(200, "You are visiting permission require edit,view", null);
         return new ResponseBean(200, "You are visiting permission require edit,view", null);
     }
     }
- 
+
     @RequestMapping(path = "/401")
     @RequestMapping(path = "/401")
     @ResponseStatus(HttpStatus.UNAUTHORIZED)
     @ResponseStatus(HttpStatus.UNAUTHORIZED)
     public ResponseBean unauthorized() {
     public ResponseBean unauthorized() {
         return new ResponseBean(401, "Unauthorized", null);
         return new ResponseBean(401, "Unauthorized", null);
     }
     }
-}
+}

+ 30 - 0
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -6,11 +6,16 @@ import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.ResultMapUtils;
 import org.jeecg.common.util.ResultMapUtils;
 import org.jeecg.common.util.StatusCode;
 import org.jeecg.common.util.StatusCode;
 import org.jeecg.common.util.jsonschema.JsonschemaUtil;
 import org.jeecg.common.util.jsonschema.JsonschemaUtil;
+import org.jeecg.modules.ctop.entity.ByteDanceUserOrientationTemplate;
 import org.jeecg.modules.ctop.entity.BytedanceAreaInfo;
 import org.jeecg.modules.ctop.entity.BytedanceAreaInfo;
 import org.jeecg.modules.ctop.entity.BytedanceInterestCategory;
 import org.jeecg.modules.ctop.entity.BytedanceInterestCategory;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
+import org.jeecg.modules.ctop.mapper.ByteDanceUserOrientationTemplateMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceAreaInfoMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceAreaInfoMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceInterestCategoryMapper;
 import org.jeecg.modules.ctop.mapper.BytedanceInterestCategoryMapper;
+import org.jeecg.modules.ctop.service.IByteDanceAdvertiserDataService;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
+import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecg.modules.ctop.service.IReportService;
 import org.jeecg.modules.ctop.service.IReportService;
 import org.jeecg.modules.demo.mock.MockController;
 import org.jeecg.modules.demo.mock.MockController;
 import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
 import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
@@ -127,6 +132,31 @@ public class SampleTest {
             });
             });
         });
         });
     }
     }
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private ByteDanceUserOrientationTemplateMapper userOrientationTemplateMapper;
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+
+    @Test
+    public void testEditPlan() throws Exception {
+        String accountId = "74099510334";
+        Long userOrientationId = 5L;
+        Long adId = 1643004580559934L;
+        //修改用户定向
+        ByteDanceUserOrientationTemplate template = userOrientationTemplateMapper.selectById(userOrientationId);
+        if (null != template) {
+            CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+            if (null != token) {
+                //获取modify_time
+                Thread.sleep(5000L);
+                advertiserDataService.getAdvertiserPlan(accountId, adId + "");
+                advertiserDataService.updateAd(token, adId, template);
+            }
+        }
+    }
     @Test
     @Test
     public void setJSONFile() {
     public void setJSONFile() {
         String path = "C:\\Users\\宋英豪\\Downloads\\data_20190222\\city.json";
         String path = "C:\\Users\\宋英豪\\Downloads\\data_20190222\\city.json";

+ 11 - 1
module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils.java

@@ -115,6 +115,7 @@ public class HttpUtils {
                     result.append(line);
                     result.append(line);
                 }
                 }
                 bufferedReader.close();
                 bufferedReader.close();
+                System.out.println(JSONObject.parseObject(result.toString()));
                 return JSONObject.parseObject(result.toString());
                 return JSONObject.parseObject(result.toString());
             }
             }
         } catch (ClientProtocolException e) {
         } catch (ClientProtocolException e) {
@@ -569,7 +570,7 @@ public class HttpUtils {
         if (null != treeMap && !treeMap.isEmpty()) {
         if (null != treeMap && !treeMap.isEmpty()) {
             for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
             for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
                 String key = entry.getKey();
                 String key = entry.getKey();
-                String value = UrlEncoded.encodeString((String) entry.getValue());
+                String value = UrlEncoded.encodeString((String) entry.getValue().toString());
                 result += (key + "=" + value + seperator);
                 result += (key + "=" + value + seperator);
             }
             }
             if (result.length() > 0) {
             if (result.length() > 0) {
@@ -579,6 +580,15 @@ public class HttpUtils {
         return result;
         return result;
     }
     }
 
 
+    public static void main(String[] args) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("add", 1);
+        params.forEach((k, v) -> {
+
+        });
+
+    }
+
 
 
     public static String httpGetRequest(String url, Map<String, String> headers, TreeMap<String, Object> params) {
     public static String httpGetRequest(String url, Map<String, String> headers, TreeMap<String, Object> params) {
         HttpClient httpClient = createSslClientDefault();
         HttpClient httpClient = createSslClientDefault();