master
admin 2 years ago
parent 5ea26a6115
commit 5863370b48

@ -118,21 +118,23 @@ public class IdcServiceImpl implements IdcService {
} else { } else {
id = params.get("id").toString(); id = params.get("id").toString();
} }
Map<String,Object> map = dbDao.get("select * from basic_export_status where id='"+id+"'"); Map<String,Object> map = dbDao.get("select * from basic_export_status where id='"+id+"'");
if(map==null) if(map==null)
ResultVOUtils.error(9000, "下载任务不存在"); return ResultVOUtils.error(9000, "下载任务不存在");
if(!FileUtils.isFileExist(map.get("cacheFilePath").toString())) if(!(map.get("cacheFilePath")!=null&&FileUtils.isFileExist(map.get("cacheFilePath").toString())))
ResultVOUtils.error(9000, "下载文件不存在"); return ResultVOUtils.error(9000, "下载文件不存在");
String json = FileUtils.readFileAll(map.get("cacheFilePath").toString()); String json = FileUtils.readFileAll(map.get("cacheFilePath").toString());
JSONObject object = JSON.parseObject(json); JSONObject object = JSON.parseObject(json);
if(object==null) if(object==null)
ResultVOUtils.error(9000, "任务下载失败"); return ResultVOUtils.error(9000, "任务下载失败");
if(object!=null&&object.getInteger("code")!=null) { if(object!=null&&object.getInteger("code")!=null) {
BaseResponse response = JSON.parseObject(json,BaseResponse.class); BaseResponse response = JSON.parseObject(json,BaseResponse.class);
return response; return response;
} }
logger.info("json-->"+json);
return ResultVOUtils.success(object); return ResultVOUtils.success(object);
} }

Loading…
Cancel
Save