| | |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = dataLibService.zipDbData(ue, dre.getEntities().get(0), dre.getFilter(), dre.getPwd()); |
| | | String depcode = null == dre.getDepcodes() || dre.getDepcodes().isEmpty() ? null : dre.getDepcodes().get(0); |
| | | String guid = dataLibService.zipDbData(ue, dre.getEntities().get(0), depcode, dre.getDirs(), dre.getFilter(), dre.getPwd()); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | |
| | | |
| | | private List<String> depcodes; |
| | | |
| | | private String dirs; |
| | | |
| | | public DownloadReqEntity() { |
| | | } |
| | | |
| | |
| | | public void setDepcodes(List<String> depcodes) { |
| | | this.depcodes = depcodes; |
| | | } |
| | | |
| | | public String getDirs() { |
| | | return dirs; |
| | | } |
| | | |
| | | public void setDirs(String dirs) { |
| | | this.dirs = dirs; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 打包DB数据 |
| | | */ |
| | | public String zipDbData(UserEntity ue, String name, String filter, String pwd) throws Exception { |
| | | public String zipDbData(UserEntity ue, String name, String depcode, String dirs, String filter, String pwd) throws Exception { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return null; |
| | |
| | | if (baseMapper instanceof GeomBaseMapper) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | if (!StringHelper.isEmpty(depcode)) { |
| | | wrapper.likeRight("depid", depcode); |
| | | } |
| | | |
| | | dirs = DataLibService.copeCodes(dirs, "dirid"); |
| | | if (!StringHelper.isEmpty(dirs)) { |
| | | wrapper.apply(dirs); |
| | | } |
| | | |
| | | List<?> list = baseMapper.selectList(wrapper); |
| | | if (null == list || 0 == list.size()) { |