文件下载

master
chengqf 2 years ago
parent e2fda72926
commit bf675bc6df

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

Loading…
Cancel
Save