version1
admin 2 years ago
parent 7de9d27d9c
commit 8c1076fcaf

@ -253,11 +253,15 @@ public class IdcServiceImpl implements IdcService {
if(isLastLevel()) {
success = analyToDB(json,files);
} else {
syncAddTaskStatus(json,false);
syncAddTaskStatus(json,false,success);
}
String host = getNextHost();
if(success)
post(host+"/spssync/common/success",params);
if(success) {
String ret = post(host+"/spssync/common/success",params);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -330,7 +334,7 @@ public class IdcServiceImpl implements IdcService {
}
}
syncAddTaskStatus(json,true);
syncAddTaskStatus(json,true,true);
/*解析入库*/
if(isLastLevel()) {
if(!analyToDB(json,files))
@ -370,7 +374,6 @@ public class IdcServiceImpl implements IdcService {
private void saveUploadStatus(Map<String,Object> params) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("status", "0");
map.putAll(params);
map.put("id", CustomUtil.getId());
map.put("updateTime", new Date());
@ -382,7 +385,6 @@ public class IdcServiceImpl implements IdcService {
private void saveExportStatus(Map<String,Object> params) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("status", "1");
map.put("receiveStatus", "0");
map.putAll(params);
map.put("id", CustomUtil.getId());
@ -531,7 +533,7 @@ public class IdcServiceImpl implements IdcService {
}
saveIdcLog(messageType,"",tableName +">success",i *limit,total);
}
syncAddTaskStatus(data,isUpload);
syncAddTaskStatus(data,isUpload,success);
}
}
}
@ -542,7 +544,7 @@ public class IdcServiceImpl implements IdcService {
}
/*增加同步任务状态*/
private void syncAddTaskStatus(Map<String,Object> json,boolean isUpload) {
private void syncAddTaskStatus(Map<String,Object> json,boolean isUpload,boolean success) {
String content = JSON.toJSONString(json);
String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
String fileName = filePath +datePath+"/"+json.get("messageType")+"-"+json.get("messageId")+".udi";
@ -560,6 +562,7 @@ public class IdcServiceImpl implements IdcService {
map.put("scheduleType", isUpload ? "1" : "0");
map.put("taskId", json.get("messageId"));
map.put("cacheFilePath", fileName);
map.put("status", success ? "1" : "0");
if(isUpload) {
saveUploadStatus(map);
} else {

Loading…
Cancel
Save