version1
admin 2 years ago
parent 7de9d27d9c
commit 8c1076fcaf

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

Loading…
Cancel
Save