|
|
|
@ -322,7 +322,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
saveUploadStatus(json.getString("messageType"),json.getString("messageId"),fileName);
|
|
|
|
|
syncAddTaskStatus(json,true);
|
|
|
|
|
/*解析入库*/
|
|
|
|
|
if(isLastLevel()) {
|
|
|
|
|
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.put("id", CustomUtil.getId());
|
|
|
|
|
map.put("taskId", taskId);
|
|
|
|
|
map.put("cacheFilePath", fileName);
|
|
|
|
|
map.put("status", "0");
|
|
|
|
|
map.put("type", messageType);
|
|
|
|
|
map.putAll(params);
|
|
|
|
|
map.put("id", CustomUtil.getId());
|
|
|
|
|
map.put("updateTime", new Date());
|
|
|
|
|
Map<String,Object> columns = getColumn("basic_upload_status");
|
|
|
|
|
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;
|
|
|
|
|
String tableName = params.get("tableName").toString();
|
|
|
|
|
String tableKey = params.get("tableKey").toString();
|
|
|
|
@ -494,7 +492,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
orderNum++;
|
|
|
|
|
|
|
|
|
|
if(isUplaod) {
|
|
|
|
|
if(isUpload) {
|
|
|
|
|
String result = "";
|
|
|
|
|
try {
|
|
|
|
|
result = relay("",JSON.toJSONString(data),files,syncIp);
|
|
|
|
@ -524,7 +522,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
saveIdcLog(messageType,"",tableName +">success",i *limit,total);
|
|
|
|
|
}
|
|
|
|
|
syncAddTask(data,isUplaod);
|
|
|
|
|
syncAddTaskStatus(data,isUpload);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -534,8 +532,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
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 datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
|
|
|
|
|
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("taskId", json.get("messageId"));
|
|
|
|
|
map.put("cacheFilePath", fileName);
|
|
|
|
|
saveExportStatus(map);
|
|
|
|
|
if(isUpload) {
|
|
|
|
|
saveUploadStatus(map);
|
|
|
|
|
} else {
|
|
|
|
|
saveExportStatus(map);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|