| | |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | | import com.lf.server.mapper.all.GeomBaseMapper; |
| | | import com.lf.server.mapper.data.MetaMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.sys.MetaDownService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaEntity> selectGdbByGuid(String guid) { |
| | | return metaMapper.selectGdbByGuid(guid); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectMetasForCount(String depcode, String dirs, String name) { |
| | | depcode = StringHelper.getRightLike(depcode); |
| | | name = StringHelper.getLikeUpperStr(name); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public MetaEntity selectByGuid(String guid, String tab) { |
| | | return metaMapper.selectByGuid(guid, tab); |
| | | public MetaEntity selectByGuid(String guid, String dircode, String tab) { |
| | | return metaMapper.selectByGuid(guid, dircode, tab); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (str.contains("bs.s_explorationpoint ")) { |
| | | list.add(str.replace("bs.s_explorationpoint ", "bs.s_surveyworksite ")); |
| | | } |
| | | if (str.contains("bs.m_surface_deformation_data ")) { |
| | | list.add(str.replace("bs.m_surface_deformation_data ", "bs.m_surface_deformation_data_date ")); |
| | | } |
| | | |
| | | i++; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | MetaEntity me = selectByGuid(guid, null); |
| | | MetaEntity me = selectByGuid(guid, null, null); |
| | | if (me == null) { |
| | | WebHelper.writeStr2Page(res, StaticData.NO_FILE); |
| | | return; |
| | |
| | | |
| | | /** |
| | | * 请求元数据下载 |
| | | * |
| | | * @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) { |
| | |
| | | String filter = String.format("parentid in (%s)", StringHelper.join(ids, ",")); |
| | | |
| | | QueryWrapper<T> wrapper = new QueryWrapper<T>(); |
| | | if (baseMapper instanceof GeomBaseMapper) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | wrapper.apply(filter); |
| | | |
| | | return wrapper; |
| | |
| | | case StaticData.MPT: |
| | | addMultiFile(uploadPath, mf, zip, params, StaticData.MPT_EXT); |
| | | break; |
| | | case StaticData.JPG: |
| | | addMultiFile(uploadPath, mf, zip, params, StaticData.JPG_EXT); |
| | | break; |
| | | case StaticData.IMG: |
| | | addMultiFile(uploadPath, mf, zip, params, StaticData.IMG_EXT); |
| | | break; |
| | |
| | | addMultiFile(uploadPath, mf, zip, params, StaticData.SHP_EXT); |
| | | break; |
| | | case StaticData.GDB: |
| | | continue; |
| | | case StaticData.OSGB: |
| | | addFolderFile(uploadPath, mf, zip, params); |
| | | break; |
| | | default: |
| | |
| | | private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) { |
| | | DownloadEntity de = new DownloadEntity(); |
| | | de.setName(FileHelper.getFileName(file)); |
| | | // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告 |
| | | // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告,7-附件文件,8-瓦片文件 |
| | | de.setType(3); |
| | | de.setSizes(FileHelper.sizeToMb(new File(file).length())); |
| | | de.setDepid(ue.getDepid()); |