| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.lf.server.entity.all.BaseEntity; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.sys.AttachEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | |
| | | /** |
| | | * 查询DB中溢出的单位编码 |
| | | */ |
| | | public List<String> selectDbOverflowDep(UserEntity ue, List<String> entities, String wkt) { |
| | | public List<String> selectDbOverflowDep(UserEntity ue, DownloadReqEntity dr) { |
| | | if (StringHelper.isEmpty(dr.getWkt())) { |
| | | return selectDbOverflowDep4Wkt(ue, dr.getEntities(), dr.getWkt()); |
| | | } |
| | | |
| | | return selectDbOverflowDep4Prop(ue, dr.getEntities().get(0), dr.getIds(), dr.getFilter()); |
| | | } |
| | | |
| | | /** |
| | | * 查询DB中溢出的单位编码-空间查询 |
| | | */ |
| | | public List<String> selectDbOverflowDep4Wkt(UserEntity ue, List<String> entities, String wkt) { |
| | | List<String> rs = new ArrayList<>(); |
| | | for (String enity : entities) { |
| | | for (String entity : entities) { |
| | | try { |
| | | GeomBaseMapper<?> baseMapper = ClassHelper.getGeoBaseMapper(enity); |
| | | GeomBaseMapper<?> baseMapper = ClassHelper.getGeoBaseMapper(entity); |
| | | if (null == baseMapper) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | |
| | | addDepCodes(rs, ids); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询DB中溢出的单位编码-属性查询 |
| | | */ |
| | | public List<String> selectDbOverflowDep4Prop(UserEntity ue, String entity, List<Integer> gids, String filter) { |
| | | List<String> rs = new ArrayList<>(); |
| | | try { |
| | | BasicMapper<?> baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | return rs; |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.select("depid"); |
| | | baseQueryService.addFilterWrapper(wrapper, filter); |
| | | if (null != gids && gids.size() > 0) { |
| | | wrapper.apply(String.format("gid in (%s)", StringHelper.join(gids, ","))); |
| | | } |
| | | wrapper.groupBy("depid"); |
| | | |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | addDepCodes(rs, ids); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return rs; |
| | | } |
| | | |
| | | /** |
| | | * 添加单位编码 |
| | | */ |
| | | private void addDepCodes(List<String> rs, List<String> ids) { |