| | |
| | | |
| | | /** |
| | | * 请求元数据下载 |
| | | * |
| | | * @param ue 用户实体 |
| | | * @param dr 请求下载实体 |
| | | * @return 下载文件GUID |
| | | * @throws Exception 异常 |
| | | */ |
| | | public String downloadMeteReq(UserEntity ue, DownloadReqEntity dr) throws Exception { |
| | | List<MetaEntity> list = selectMetaFiles(dr.getIds()); |
| | |
| | | return null; |
| | | } |
| | | |
| | | return zipFiles(ue, list, dr.getPwd()); |
| | | } |
| | | |
| | | /** |
| | | * 打包文件 |
| | | * |
| | | * @param ue 用户实体 |
| | | * @param list 元数据文件集合 |
| | | * @param pwd 密码 |
| | | * @return 下载文件GUID |
| | | */ |
| | | public String zipFiles(UserEntity ue, List<MetaEntity> list, String pwd) throws Exception { |
| | | Map<String, List<String>> tabs = getTabs(list); |
| | | rmRepeatMetas(list); |
| | | |
| | |
| | | } |
| | | |
| | | String zipFile = pathHelper.getDownloadFullPath() + File.separator + tempName + ".zip"; |
| | | ZipFile zip = Zip4jHelper.createZipFile(zipFile, pwd); |
| | | ZipFile zip = Zip4jHelper.createZipFile(zipFile, dr.getPwd()); |
| | | ZipParameters params = Zip4jHelper.getZipParams(true); |
| | | addMetaFiles(zip, params, list); |
| | | if (dataMap.size() > 0) { |
| | |
| | | addAnnex(zip, params, annexMap); |
| | | } |
| | | |
| | | String dbPwd = Md5Helper.reverse(Md5Helper.generate(pwd)); |
| | | String dbPwd = Md5Helper.reverse(Md5Helper.generate(dr.getPwd())); |
| | | DownloadEntity de = getDownloadEntity(ue, zipFile, dbPwd); |
| | | int rows = downloadService.insert(de); |
| | | if (de.getId() > 0) { |