Przeglądaj źródła

预警-添加操作记录

yangzian 3 lat temu
rodzic
commit
0f5c2c623c

+ 25 - 5
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/MonitorBytedanceServiceImpl.java

@@ -11,7 +11,9 @@ import org.jeecg.modules.bytedance.advertise.mapper.MonitorBytedanceActionTrackU
 import org.jeecg.modules.bytedance.advertise.service.IAiBytedanceAdvertiserStrategyService;
 import org.jeecg.modules.bytedance.advertise.service.IMonitorBytedanceService;
 import org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo;
+import org.jeecg.modules.bytedance.common.entity.BytedanceOperationLog;
 import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
+import org.jeecg.modules.bytedance.common.mapper.BytedanceOperationLogMapper;
 import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
 import org.jeecg.modules.bytedance.common.service.IUserAllocationService;
 import org.jeecg.modules.bytedance.common.utils.Check;
@@ -20,10 +22,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 /**
  * 规则账户清洗数据
@@ -50,7 +49,8 @@ public class MonitorBytedanceServiceImpl implements IMonitorBytedanceService {
     @Resource
     private ICtopOauthTokenService tokenService;
 
-
+    @Resource
+    private BytedanceOperationLogMapper bytedanceOperationLogMapper;
 
     @Resource
     private CorpWexinUtils corpWexinUtils;
@@ -72,6 +72,17 @@ public class MonitorBytedanceServiceImpl implements IMonitorBytedanceService {
             return Result.errorMsg("该账户已配置监测链接,请勿重复设置!");
         }
         monitorBytedanceActionTrackUrlMapper.insertAccountTrackUrl(monitorBytedanceAdVo);
+
+        //添加修改记录
+        BytedanceOperationLog bytedanceOperationLog = new BytedanceOperationLog();
+        bytedanceOperationLog.setOldData(null);
+        bytedanceOperationLog.setNewData(monitorBytedanceAdVo);
+        bytedanceOperationLog.setOperationType("头条第三方监测链接-新增");
+        bytedanceOperationLog.setOperationContent("账户:"+monitorBytedanceAdVo.getAccountId()+"新增监测链接:"+monitorBytedanceAdVo.getActionTrackUrl());
+        bytedanceOperationLog.setCreateById(monitorBytedanceAdVo.getCreateUserId());
+        bytedanceOperationLog.setCreateTime(new Date());
+        bytedanceOperationLogMapper.insert(bytedanceOperationLog);
+
         return Result.successMsg("成功。",null);
     }
 
@@ -88,6 +99,15 @@ public class MonitorBytedanceServiceImpl implements IMonitorBytedanceService {
     @Override
     public Result updAccountActionTrackUrl(MonitorBytedanceAdVo monitorBytedanceAdVo) {
         monitorBytedanceActionTrackUrlMapper.updAccountActionTrackUrl(monitorBytedanceAdVo);
+        //添加修改记录
+        BytedanceOperationLog bytedanceOperationLog = new BytedanceOperationLog();
+        bytedanceOperationLog.setOldData(null);
+        bytedanceOperationLog.setNewData(monitorBytedanceAdVo);
+        bytedanceOperationLog.setOperationType("头条第三方监测链接-修改");
+        bytedanceOperationLog.setOperationContent("账户:"+monitorBytedanceAdVo.getAccountId()+"修改内容。");
+        bytedanceOperationLog.setCreateById(monitorBytedanceAdVo.getCreateUserId());
+        bytedanceOperationLog.setCreateTime(new Date());
+        bytedanceOperationLogMapper.insert(bytedanceOperationLog);
         return Result.successMsg("修改成功。", null);
     }