文件下载

master
chengqf 2 years ago
parent e2fda72926
commit bf675bc6df

@ -89,7 +89,6 @@ public class FileServiceImpl implements FileService {
if(!isExists)
return ResultVOUtils.error(9999,filePath + filePathSlash + imagePath + strs[0]);
String result = relayFile(files,host);
logger.error(result);
if (IDCUtils.isJson(result)) {
BaseResponse baseResponse = JSON.parseObject(result,BaseResponse.class);
return baseResponse;
@ -106,8 +105,10 @@ public class FileServiceImpl implements FileService {
if(map!=null&&map.get("syncIp")!=null) {
String result = IDCUtils.post(map.get("syncIp").toString()+"/spssync/file/downloadFile", params);
JSONObject object = JSON.parseObject(result);
boolean success = false;
if(IDCUtils.isJson(result)) {
JSONObject object = JSON.parseObject(result);
if(object.getInteger("code")==20000) {
String[] files = params.get("fileName").toString().split(",");
success = true;
@ -116,6 +117,7 @@ public class FileServiceImpl implements FileService {
success = false;
}
}
}
if(!success)
return ResultVOUtils.error(9999,"失败");
} else {
@ -216,7 +218,6 @@ public class FileServiceImpl implements FileService {
try {
Response response = client.newCall(req).execute();
result = response.body().string();
logger.info("result--->" + result);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();

Loading…
Cancel
Save