|
@@ -149,7 +149,8 @@ public class MaterialUploadTaskServiceImpl
|
|
String result = exceptInfoForRestTemplate(url, requestJson, headerMap);
|
|
String result = exceptInfoForRestTemplate(url, requestJson, headerMap);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
if (!Check.isNull(resultJson)) {
|
|
if (!Check.isNull(resultJson)) {
|
|
- if (resultJson.getInteger("code") == 0) {
|
|
|
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
|
+ if (code == 0) {
|
|
materialUploadTaskMapper.syncKuaishou(task.getSignature());
|
|
materialUploadTaskMapper.syncKuaishou(task.getSignature());
|
|
materialUploadTaskMapper.updateStatusById(task.getId(), 3, "同步成功", new Date());
|
|
materialUploadTaskMapper.updateStatusById(task.getId(), 3, "同步成功", new Date());
|
|
log.info(
|
|
log.info(
|
|
@@ -159,7 +160,13 @@ public class MaterialUploadTaskServiceImpl
|
|
resultJson);
|
|
resultJson);
|
|
} else {
|
|
} else {
|
|
String message = resultJson.getString("message");
|
|
String message = resultJson.getString("message");
|
|
- materialUploadTaskMapper.updateStatusById(task.getId(), 4, message, new Date());
|
|
|
|
|
|
+ if (code == 400001 && message.equals("文件操作过于频繁")) {
|
|
|
|
+ materialUploadTaskMapper.updateStatusById(task.getId(), 0, "素材待同步", new Date());
|
|
|
|
+ } else if (code == 500000 && message.equals("系统错误")) {
|
|
|
|
+ materialUploadTaskMapper.updateStatusById(task.getId(), 0, "素材待同步", new Date());
|
|
|
|
+ } else {
|
|
|
|
+ materialUploadTaskMapper.updateStatusById(task.getId(), 4, message, new Date());
|
|
|
|
+ }
|
|
log.error("快手同步素材失败,返回信息:{},请求参数:{}", resultJson, requestJson);
|
|
log.error("快手同步素材失败,返回信息:{},请求参数:{}", resultJson, requestJson);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|