|
|
@@ -128,9 +128,16 @@ public class ToolsSiteServiceImpl implements IToolsSiteService {
|
|
|
if ("SHARE_ONLY".equals(searchType)) {
|
|
|
advertiserApplet.setAppShare("1");
|
|
|
advertiserApplet.setShareAdvertiserId(resultObj.getLong("advertiser_id"));
|
|
|
+ } else {
|
|
|
+ //小程序审核成功,判断是否主动创建落地页
|
|
|
+ if ("AUDIT_ACCEPTED".equals(advertiserApplet.getAuditStatus()))
|
|
|
+ pushCreateSite(advertiserId, advertiserApplet.getInstanceId());
|
|
|
}
|
|
|
if (!toolsSiteMapper.updateAdvertiserAppList(advertiserApplet)) {
|
|
|
- toolsSiteMapper.insertAdvertiserAppList(advertiserApplet);
|
|
|
+ if (toolsSiteMapper.insertAdvertiserAppList(advertiserApplet))
|
|
|
+ toolsSiteMapper.delFailAdvertiserApp(advertiserApplet.getAdvertiserId());
|
|
|
+ } else {
|
|
|
+ toolsSiteMapper.delFailAdvertiserApp(advertiserApplet.getAdvertiserId());
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -182,7 +189,10 @@ public class ToolsSiteServiceImpl implements IToolsSiteService {
|
|
|
advertiserApplet.setShareAdvertiserId(resultObj.getLong("advertiser_id"));
|
|
|
}
|
|
|
if (!toolsSiteMapper.updateAdvertiserAppList(advertiserApplet)) {
|
|
|
- toolsSiteMapper.insertAdvertiserAppList(advertiserApplet);
|
|
|
+ if (toolsSiteMapper.insertAdvertiserAppList(advertiserApplet))
|
|
|
+ toolsSiteMapper.delFailAdvertiserApp(advertiserApplet.getAdvertiserId());
|
|
|
+ } else {
|
|
|
+ toolsSiteMapper.delFailAdvertiserApp(advertiserApplet.getAdvertiserId());
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -221,7 +231,10 @@ public class ToolsSiteServiceImpl implements IToolsSiteService {
|
|
|
for (int i = 0; i < jsList.size(); i++) {
|
|
|
AdvertiserToolsSite advertiserToolsSite = new AdvertiserToolsSite(jsList.getJSONObject(i), advertiserId, "1");
|
|
|
if (!toolsSiteMapper.updateAdvertiserToolsSite(advertiserToolsSite)) {
|
|
|
- toolsSiteMapper.insertAdvertiserToolsSite(advertiserToolsSite);
|
|
|
+ if (toolsSiteMapper.insertAdvertiserToolsSite(advertiserToolsSite))
|
|
|
+ toolsSiteMapper.delFailAdvertiserToolsSite(advertiserToolsSite.getAdvertiserId());
|
|
|
+ } else {
|
|
|
+ toolsSiteMapper.delFailAdvertiserToolsSite(advertiserToolsSite.getAdvertiserId());
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -231,4 +244,22 @@ public class ToolsSiteServiceImpl implements IToolsSiteService {
|
|
|
updateSiteStatus(advertiserId, page + 1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //主动去创建落地页
|
|
|
+ private void pushCreateSite(Long advertiserId, Long instanceId) {
|
|
|
+ JSONObject object = toolsSiteMapper.queryIsCreateSite(advertiserId, instanceId);
|
|
|
+ //有数据 说明还没有创建落地页,执行创建
|
|
|
+ if (!Check.isNull(object)) {
|
|
|
+ Long taskId = object.getLong("task_id");
|
|
|
+ String url = "https://api.deepthink.artlinkworld.cn/task/createTask";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("taskId", taskId);
|
|
|
+ param.put("advertiserId", advertiserId);
|
|
|
+ String s = HttpUtils.httpPostRequest(url, param, null);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
+ if (!Check.isNull(jsonObject) && jsonObject.getInteger("code") == 0) {
|
|
|
+ log.info("任务:{}({}),advertiserId: {} 执行创建落地页", object.getString("task_name"), taskId, advertiserId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|