|
@@ -43,8 +43,14 @@ public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMap
|
|
|
@Override
|
|
|
public void monitorCreative(TrackMonitorConfigure configure, Long accountId, String accessToken, String userId, String startDate, String endDate, Integer page) {
|
|
|
log.info("开始自定义创意监测链接预警,accountId:{}", accountId);
|
|
|
- String clickTrackUrl = configure.getClickTrackUrl().trim();
|
|
|
- String actionbarClickUrl = configure.getActionbarClickUrl().trim();
|
|
|
+ String clickTrackUrl = "";
|
|
|
+ if (!Check.isNull(configure.getClickTrackUrl())) {
|
|
|
+ clickTrackUrl = configure.getClickTrackUrl().trim();
|
|
|
+ }
|
|
|
+ String actionbarClickUrl = "";
|
|
|
+ if (!Check.isNull(configure.getActionbarClickUrl())) {
|
|
|
+ actionbarClickUrl = configure.getActionbarClickUrl().trim();
|
|
|
+ }
|
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Content-Type", " application/json");
|
|
@@ -58,6 +64,7 @@ public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMap
|
|
|
param.put("end_date", endDate);
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
+ System.err.println(resultJson);
|
|
|
if (Check.isNull(resultJson)) {
|
|
|
log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
|
|
|
return;
|
|
@@ -121,8 +128,14 @@ public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMap
|
|
|
@Override
|
|
|
public void monitorProgramCreative(TrackMonitorConfigure configure, Long accountId, String accessToken, String userId, String startDate, String endDate, Integer page) {
|
|
|
log.info("开始程序化创意监测链接预警,accountId:{}", accountId);
|
|
|
- String clickTrackUrl = configure.getClickTrackUrl().trim();
|
|
|
- String actionbarClickUrl = configure.getActionbarClickUrl().trim();
|
|
|
+ String clickTrackUrl = "";
|
|
|
+ if (!Check.isNull(configure.getClickTrackUrl())) {
|
|
|
+ clickTrackUrl = configure.getClickTrackUrl().trim();
|
|
|
+ }
|
|
|
+ String actionbarClickUrl = "";
|
|
|
+ if (!Check.isNull(configure.getActionbarClickUrl())) {
|
|
|
+ actionbarClickUrl = configure.getActionbarClickUrl().trim();
|
|
|
+ }
|
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.PROGRAM_LIST;
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Content-Type", " application/json");
|
|
@@ -136,6 +149,7 @@ public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMap
|
|
|
param.put("end_date", endDate);
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
+ System.err.println(resultJson);
|
|
|
if (Check.isNull(resultJson)) {
|
|
|
log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
|
|
|
return;
|
|
@@ -197,6 +211,16 @@ public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMap
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String a = " a";
|
|
|
+ String b = "a";
|
|
|
+ if (a.trim().equals(b)) {
|
|
|
+ System.err.println(123);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void doOperation(Long accountId, String accessToken, Map<Long, JSONObject> unitMap, String userId) {
|
|
|
List<TrackMonitorLogs> trackMonitorLogs = new ArrayList<>();
|
|
|
for (Map.Entry<Long, JSONObject> entry : unitMap.entrySet()) {
|