|
@@ -163,12 +163,12 @@ public class CallbackController {
|
|
|
BigDecimal warningAmount = json.getBigDecimal("WarningAmount");
|
|
|
String systemType = json.getString("systemType");
|
|
|
|
|
|
- /* TODO
|
|
|
+
|
|
|
Integer autoDelivery = json.getInteger("autoDelivery");
|
|
|
String materialTypeStr = json.getString("materialType");
|
|
|
//物料类型,0-不同步,1应用包,(2人群包,3定向包)
|
|
|
JSONArray materialTypeArr = json.getJSONArray("materialType");
|
|
|
-*/
|
|
|
+
|
|
|
CtopOauthToken topOauthToken = new CtopOauthToken();
|
|
|
topOauthToken.setId(String.valueOf(accountId));
|
|
|
topOauthToken.setAppId(json.getLong("appId"));
|
|
@@ -203,7 +203,7 @@ public class CallbackController {
|
|
|
userAllocation.setSystemType(systemType);
|
|
|
// 获取快手昵称
|
|
|
userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
|
|
|
- if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
|
|
|
+ if (null != authBeginTime && !authBeginTime.trim().equals("")) {
|
|
|
userAllocation.setAuthBeginTime(authBeginTime);
|
|
|
}
|
|
|
userAllocation.setMediaId(mediaId);
|
|
@@ -214,9 +214,9 @@ public class CallbackController {
|
|
|
userAllocation.setCreateTime(new Date());
|
|
|
userAllocation.setUpdateTime(new Date());
|
|
|
//自动投放,0关闭,1开启
|
|
|
- /* TODO
|
|
|
+
|
|
|
userAllocation.setAutoDelivery(autoDelivery);
|
|
|
- userAllocation.setMaterialType(materialTypeStr);*/
|
|
|
+ userAllocation.setMaterialType(materialTypeStr);
|
|
|
allocationMapper.deleteById(userAllocation.getId());
|
|
|
Map<String, Object> deleteUserMap = new HashMap<>();
|
|
|
deleteUserMap.put("advertiser_id", advertiserId);
|
|
@@ -227,7 +227,7 @@ public class CallbackController {
|
|
|
if (i > 0) {
|
|
|
log.info("同步分配用户表完成,task_id:{},accountId:{}", state, accountId);
|
|
|
}
|
|
|
- /* TODO Integer materialType = materialTypeArr.getInteger(0);*/
|
|
|
+ Integer materialType = materialTypeArr.getInteger(0);
|
|
|
//账号绑定
|
|
|
bindAccountAuthService.addBindAccount(accountId, KuaishouInterfaceConstant.LOGIN_TYPE_KUAISHOU, advertiserId);
|
|
|
Thread t = new Thread() {
|
|
@@ -235,10 +235,10 @@ public class CallbackController {
|
|
|
public void run() {
|
|
|
try {
|
|
|
kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
|
|
|
- /* TODO
|
|
|
+
|
|
|
if (!Check.isNull(materialType) && materialType != 0) {
|
|
|
synchronMaterials(materialType, accountId, projectId);
|
|
|
- }*/
|
|
|
+ }
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -261,13 +261,13 @@ public class CallbackController {
|
|
|
//1 有效项目模板
|
|
|
List<Long> ids = kuaishouAppPackageService.queryByAppVersion(projectId, null, 1);
|
|
|
JSONObject data = new JSONObject();
|
|
|
- data.put("accountIds",accountIds);
|
|
|
- data.put("message","授权同步应用");
|
|
|
+ data.put("accountIds", accountIds);
|
|
|
+ data.put("message", "授权同步应用");
|
|
|
log.info("同步账户应用,应用模板={}", ids);
|
|
|
if (!Check.isNull(ids)) {
|
|
|
for (Long id : ids) {
|
|
|
- data.put("id",id);
|
|
|
- kuaishouAppPackageService.pushAppPackage(id, accountIds,data);
|
|
|
+ data.put("id", id);
|
|
|
+ kuaishouAppPackageService.pushAppPackage(id, accountIds, data);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -385,7 +385,7 @@ public class CallbackController {
|
|
|
userAllocation.setProjectId(projectId);
|
|
|
userAllocation.setSystemType(systemType);
|
|
|
userAllocation.setAuthName((String) advertiserDataMap.get("name"));
|
|
|
- if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
|
|
|
+ if (null != authBeginTime && !authBeginTime.trim().equals("")) {
|
|
|
userAllocation.setAuthBeginTime(authBeginTime);
|
|
|
}
|
|
|
userAllocation.setAdvertiserId(advertiserId);
|
|
@@ -440,7 +440,7 @@ public class CallbackController {
|
|
|
userAllocation.setProjectId(projectId);
|
|
|
userAllocation.setSystemType(systemType);
|
|
|
userAllocation.setAuthName((String) advertiserDataMap.get("name"));
|
|
|
- if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
|
|
|
+ if (null != authBeginTime && !authBeginTime.trim().equals("")) {
|
|
|
userAllocation.setAuthBeginTime(authBeginTime);
|
|
|
}
|
|
|
userAllocation.setAdvertiserId(advertiserId);
|