version1
admin 2 years ago
parent 0693b860e4
commit a12745fbc4

@ -322,7 +322,7 @@ public class IdcServiceImpl implements IdcService {
} }
} }
saveUploadStatus(json.getString("messageType"),json.getString("messageId"),fileName); syncAddTaskStatus(json,true);
/*解析入库*/ /*解析入库*/
if(isLastLevel()) { if(isLastLevel()) {
if(!analyToDB(json,files)) if(!analyToDB(json,files))
@ -360,13 +360,11 @@ public class IdcServiceImpl implements IdcService {
} }
private void saveUploadStatus(String messageType,String taskId,String fileName) { 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("id", CustomUtil.getId());
map.put("taskId", taskId);
map.put("cacheFilePath", fileName);
map.put("status", "0"); map.put("status", "0");
map.put("type", messageType); map.putAll(params);
map.put("id", CustomUtil.getId());
map.put("updateTime", new Date()); map.put("updateTime", new Date());
Map<String,Object> columns = getColumn("basic_upload_status"); Map<String,Object> columns = getColumn("basic_upload_status");
String sql = "insert into basic_upload_status "+DBAUtils.parseInsert(map, columns); String sql = "insert into basic_upload_status "+DBAUtils.parseInsert(map, columns);
@ -415,7 +413,7 @@ public class IdcServiceImpl implements IdcService {
} }
private boolean syncMasterData(Map<String,Object> params,boolean isUplaod,String syncIp) { private boolean syncMasterData(Map<String,Object> params,boolean isUpload,String syncIp) {
boolean success=false; boolean success=false;
String tableName = params.get("tableName").toString(); String tableName = params.get("tableName").toString();
String tableKey = params.get("tableKey").toString(); String tableKey = params.get("tableKey").toString();
@ -494,7 +492,7 @@ public class IdcServiceImpl implements IdcService {
orderNum++; orderNum++;
if(isUplaod) { if(isUpload) {
String result = ""; String result = "";
try { try {
result = relay("",JSON.toJSONString(data),files,syncIp); result = relay("",JSON.toJSONString(data),files,syncIp);
@ -524,7 +522,7 @@ public class IdcServiceImpl implements IdcService {
} }
saveIdcLog(messageType,"",tableName +">success",i *limit,total); saveIdcLog(messageType,"",tableName +">success",i *limit,total);
} }
syncAddTask(data,isUplaod); syncAddTaskStatus(data,isUpload);
} }
} }
} }
@ -534,8 +532,8 @@ public class IdcServiceImpl implements IdcService {
return success; return success;
} }
/*增加同步任务*/ /*增加同步任务状态*/
private void syncAddTask(Map<String,Object> json,boolean isUpload) { private void syncAddTaskStatus(Map<String,Object> json,boolean isUpload) {
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";
@ -553,7 +551,11 @@ 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);
saveExportStatus(map); if(isUpload) {
saveUploadStatus(map);
} else {
saveExportStatus(map);
}
} }

Loading…
Cancel
Save