瀏覽代碼

fix : 头条APP推广渠道兼容星广联投任务id

bilingfeng 2 周之前
父節點
當前提交
7e559403cc

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 < (游戏聊天记录功能上线-04 ・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (头条渠道兼容星广联投任务id ・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 0 - 6
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/AgentController.java

@@ -81,7 +81,6 @@ public class AgentController {
         return ResultVO.ok(agentService.add(dto));
     }
 
-
     @PreAuthorize(permissionKey = "manage:agent:configPutStatus")
     @PutMapping("/configPutStatus/{agentIds}/{putStatus}")
     public ResultVO<Boolean> configPutStatus(@PathVariable("agentIds") List<Long> agentIds, @PathVariable("putStatus") Integer putStatus) {
@@ -94,9 +93,4 @@ public class AgentController {
         return ResultVO.ok(agentService.configBackPolicy(agentIds, backPolicyId));
     }
 
-    @PutMapping("/user/agent/log/update")
-    public ResultVO<Void> userAgentLogUpdate(@RequestParam Boolean isRunUpdate) {
-        userAgentLogService.userAgentLogUpdate(isRunUpdate);
-        return ResultVO.ok();
-    }
 }

+ 6 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/AgentAddParam.java

@@ -63,6 +63,12 @@ public class AgentAddParam {
     @ApiModelProperty(notes = "头条回传 url")
     private String reportUrl;
 
+    /**
+     * 头条星广联投任务 id
+     */
+    @ApiModelProperty(notes = "头条星广联投任务 id")
+    private Long xgltDemandId;
+
     /**
      * 投放状态
      */

+ 5 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/AgentVO.java

@@ -53,6 +53,11 @@ public class AgentVO {
      */
     private String reportUrl;
 
+    /**
+     * 头条星广联投任务 id
+     */
+    private Long xgltDemandId;
+
     /**
      * 投放状态
      */

+ 0 - 7
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IUserAgentLogService.java

@@ -11,13 +11,6 @@ import com.zanxiang.game.module.mybatis.entity.UserAgentLog;
  */
 public interface IUserAgentLogService extends IService<UserAgentLog> {
 
-    /**
-     * 数据修正
-     *
-     * @param isRunUpdate : 是否执行修正
-     */
-    void userAgentLogUpdate(boolean isRunUpdate);
-
     /**
      * 注册代理日志
      *

+ 1 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -151,6 +151,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
                 .userActionSetId(dto.getUserActionSetId())
                 .reportToken(dto.getReportToken())
                 .reportUrl(dto.getReportUrl())
+                .xgltDemandId(dto.getXgltDemandId())
                 .backPolicyId(dto.getBackPolicyId())
                 .putStatus(dto.getPutStatus())
                 .createTime(LocalDateTime.now())

+ 0 - 50
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserAgentLogServiceImpl.java

@@ -1,6 +1,5 @@
 package com.zanxiang.game.module.manage.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.manage.service.IUserAgentLogService;
 import com.zanxiang.game.module.mybatis.entity.Agent;
@@ -8,13 +7,9 @@ import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.entity.UserAgentLog;
 import com.zanxiang.game.module.mybatis.mapper.UserAgentLogMapper;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Objects;
-
 /**
  * @author : lingfeng
  * @time : 2023-07-20
@@ -24,51 +19,6 @@ import java.util.Objects;
 @Service
 public class UserAgentLogServiceImpl extends ServiceImpl<UserAgentLogMapper, UserAgentLog> implements IUserAgentLogService {
 
-    @Override
-    public void userAgentLogUpdate(boolean isRunUpdate) {
-        List<UserAgentLog> errorList = super.list(new LambdaQueryWrapper<UserAgentLog>()
-                .isNotNull(UserAgentLog::getOldAgentId)
-                .isNotNull(UserAgentLog::getNewAgentId)
-                .apply("old_agent_id=new_agent_id"));
-        if (CollectionUtils.isEmpty(errorList)) {
-            log.error("查询到可修正的数据列表为空!!!");
-            return;
-        }
-        log.error("查询到数据 count : {}", errorList.size());
-        if (!isRunUpdate) {
-            return;
-        }
-        int count = 0;
-        for (UserAgentLog userAgentLog : errorList) {
-            this.agentLogUpdate(userAgentLog);
-            count++;
-            log.error("第 count : {} 条数据, id : {} 修正", count, userAgentLog.getId());
-        }
-        log.error("=========== 全部修正完成 ===========");
-    }
-
-    private void agentLogUpdate(UserAgentLog userAgentLog) {
-        //不是错误数据
-        if (!Objects.equals(userAgentLog.getOldAgentId(), userAgentLog.getNewAgentId())) {
-            return;
-        }
-        //根据 userId 和 createTime 查询上一条数据
-        UserAgentLog beforeLog = super.getOne(new LambdaQueryWrapper<UserAgentLog>()
-                .eq(UserAgentLog::getUserId, userAgentLog.getUserId())
-                .lt(UserAgentLog::getCreateTime, userAgentLog.getCreateTime())
-                .orderByDesc(UserAgentLog::getCreateTime)
-                .last("limit 1"));
-        //未查询到上一条记录, 不做修正
-        if (beforeLog == null) {
-            log.error("查询上一条记录结果为空-------!!!!!!, logId : {}", userAgentLog.getId());
-            return;
-        }
-        //数据修正
-        userAgentLog.setOldAgentId(beforeLog.getNewAgentId());
-        userAgentLog.setOldChannel(beforeLog.getNewChannel());
-        super.updateById(userAgentLog);
-    }
-
     @Override
     public boolean regAgentLog(User user) {
         if (Agent.DEFAULT_AGENT.equals(user.getAgentId()) || Strings.isBlank(user.getChannel())) {

+ 5 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Agent.java

@@ -83,6 +83,11 @@ public class Agent implements Serializable {
      */
     private String reportUrl;
 
+    /**
+     * 头条星广联投任务 id
+     */
+    private Long xgltDemandId;
+
     /**
      * 投放状态
      */