中继中转服务完善

version1
admin 2 years ago
parent 59e628be5d
commit 0693b860e4

@ -297,8 +297,8 @@ public class IdcServiceImpl implements IdcService {
String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
String fileName = filePath +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi";
String backFileName = backFilePath +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi";
FileUtils.makeDirectory(fileName);
FileUtils.makeDirectory(backFileName);
FileUtils.makeDirectory( filePath +datePath+"/");
FileUtils.makeDirectory(backFilePath +datePath+"/");
FileUtils.SaveFileAs(content, fileName);
FileUtils.SaveFileAs(content, backFileName);
@ -333,9 +333,10 @@ public class IdcServiceImpl implements IdcService {
String host = getNextHost();
String result = relay(request.getHeader("reqNo"),content,saveFiles,host);
if(IDCUtils.isJson(result)) {
JSONObject object = JSON.parseObject(result);
if(object.getInteger("code")!=20000)
return ResultVOUtils.error(9000, "转发失败");
BaseResponse object = JSON.parseObject(result,BaseResponse.class);
return object;
} else {
return ResultVOUtils.error(9000, "转发失败");
}
}
@ -539,8 +540,8 @@ public class IdcServiceImpl implements IdcService {
String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
String fileName = filePath +datePath+"/"+json.get("messageType")+"-"+json.get("messageId")+".udi";
String backFileName = backFilePath +datePath+"/"+json.get("messageType")+"-"+json.get("messageId")+".udi";
FileUtils.makeDirectory(fileName);
FileUtils.makeDirectory(backFileName);
FileUtils.makeDirectory(filePath +datePath+"/");
FileUtils.makeDirectory(backFilePath +datePath+"/");
FileUtils.SaveFileAs(content, fileName);
FileUtils.SaveFileAs(content, backFileName);
@ -760,7 +761,7 @@ public class IdcServiceImpl implements IdcService {
/*是否需要转发*/
private boolean isRelay() {
String relayHost = getNextHost();
return !StringUtils.isEmpty(relayHost);
return StringUtils.isEmpty(relayHost) ? false : true;
}

Loading…
Cancel
Save