|
@@ -222,6 +222,9 @@ public class CallbackController {
|
|
|
userAllocation.setCreateTime(new Date());
|
|
|
userAllocation.setUpdateTime(new Date());
|
|
|
//自动投放,0关闭,1开启
|
|
|
+ if (json.getInteger("dataSync") == 2) {
|
|
|
+ userAllocation.setAccountStatus(1);
|
|
|
+ }
|
|
|
|
|
|
userAllocation.setAutoDelivery(autoDelivery);
|
|
|
userAllocation.setMaterialType(materialTypeStr);
|
|
@@ -238,21 +241,25 @@ public class CallbackController {
|
|
|
Integer materialType = materialTypeArr.getInteger(0);
|
|
|
//账号绑定
|
|
|
bindAccountAuthService.addBindAccount(accountId, KuaishouInterfaceConstant.LOGIN_TYPE_KUAISHOU, advertiserId);
|
|
|
- Thread t = new Thread() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- try {
|
|
|
- kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
|
|
|
-
|
|
|
- if (!Check.isNull(materialType) && materialType != 0) {
|
|
|
- synchronMaterials(materialType, accountId, projectId);
|
|
|
+ if (json.getInteger("dataSync") == 1) {
|
|
|
+ Thread t = new Thread() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
|
|
|
+
|
|
|
+ if (!Check.isNull(materialType) && materialType != 0) {
|
|
|
+ synchronMaterials(materialType, accountId, projectId);
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
- t.start();
|
|
|
+ };
|
|
|
+ t.start();
|
|
|
+ } else if (json.getInteger("dataSync") == 2) {
|
|
|
+ log.info("客户自运营,无需获取数据");
|
|
|
+ }
|
|
|
}
|
|
|
detailService.removeById(id);
|
|
|
return "授权绑定成功";
|