| | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.entity.all.BaseGeoEntity; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.ctrl.KeyValueEntity; |
| | |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | | import com.lf.server.mapper.all.GeomBaseMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.data.DictService; |
| | | import com.lf.server.service.data.DirService; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.data.MetaService; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "wkt", value = "WKT(著名文本)", dataType = "String", paramType = "query", example = ""), |
| | | //@ApiImplicitParam(name = "srid", value = "空间引用标识符", dataType = "Integer", paramType = "query", example = "4326"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10") |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "是/否包含空间信息", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | @PostMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<Object>> selectByPage(String name, String depcode, String dirs, String filter, String wkt, Integer pageIndex, Integer pageSize) { |
| | | public ResponseMsg<List<Object>> selectByPage(String name, String depcode, String dirs, String filter, String wkt, Integer pageIndex, Integer pageSize, Integer hasGeom) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | if (null == baseMapper) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | |
| | | wrapper.apply(dirs); |
| | | } |
| | | |
| | | boolean hasWkt = null != hasGeom && hasGeom > 0 && baseMapper instanceof GeomBaseMapper; |
| | | if (hasWkt) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.asc("gid")); |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | if (hasWkt && null != paged.getRecords()) { |
| | | copeWkt(paged.getRecords()); |
| | | } |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理WKT |
| | | */ |
| | | private void copeWkt(List<?> list) { |
| | | for (int i = 0, c = list.size(); i < c; i++) { |
| | | Object obj = list.get(i); |
| | | setWktEncrypt(obj); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置WKT加密 |
| | | */ |
| | | private void setWktEncrypt(Object obj) { |
| | | if (obj instanceof BaseGeoEntity) { |
| | | BaseGeoEntity entity = (BaseGeoEntity) obj; |
| | | if (StringHelper.isEmpty(entity.getGeom())) { |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | String wkt = AesHelper.encrypt(entity.getGeom()); |
| | | entity.setGeom(wkt); |
| | | } catch (Exception ex) { |
| | | entity.setGeom(null); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "缓冲区查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "映射名称", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "wkt", value = "WKT(著名文本)", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "buffer", value = "缓冲区大小", dataType = "Double", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "limit", value = "限制条数", dataType = "Integer", paramType = "query", example = "20") |
| | | }) |
| | | @GetMapping(value = "/selectByBuffer") |
| | | public ResponseMsg<List<?>> selectByBuffer(String name, String wkt, Double buffer, Integer limit) { |
| | | try { |
| | | if (StringHelper.isEmpty(wkt)) { |
| | | return fail("WKT不能为空", null); |
| | | } |
| | | if (null == limit || limit < 1 || limit > StaticData.ONE_HUNDRED) { |
| | | limit = 20; |
| | | } |
| | | if (null == buffer || buffer < 0 || buffer > StaticData.ONE_HUNDRED_THOUSAND) { |
| | | buffer = 10.0; |
| | | } |
| | | |
| | | GeomBaseMapper baseMapper = ClassHelper.getGeoBaseMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | baseQueryService.addBufferWrapper(baseMapper, wrapper, wkt, buffer); |
| | | wrapper.last("limit " + limit); |
| | | |
| | | List<?> list = baseMapper.selectList(wrapper); |
| | | |
| | | return success(null == list ? 0 : list.size(), list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | public ResponseMsg<String> selectWktById(String name, Integer gid) { |
| | | try { |
| | | GeomBaseMapper baseMapper = ClassHelper.getGeoBaseMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("查询对象不存在", null); |
| | | if (null == baseMapper) { |
| | | return fail("查询对象不存在或不是空间表", null); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (StringHelper.isNull(tab)) { |
| | | return fail("查询对象不存在", null); |
| | | return fail("查询对象的表名不存在", null); |
| | | } |
| | | |
| | | String wkt = baseMapper.selectWktById(tab, gid); |
| | |
| | | |
| | | return success(wkt); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据GID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "映射名称", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "gid", value = "GID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByGid") |
| | | public ResponseMsg<Object> selectByGid(String name, int gid) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (null == baseMapper) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | if (baseMapper instanceof GeomBaseMapper) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | wrapper.eq("gid", gid); |
| | | |
| | | Object obj = baseMapper.selectOne(wrapper); |
| | | setWktEncrypt(obj); |
| | | |
| | | return success(null == obj ? 0 : 1, obj); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据实体名查询表名") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "映射名称", dataType = "String", paramType = "query", example = "dlgagnp") |
| | | }) |
| | | @GetMapping(value = "/selectTabByEntity") |
| | | public ResponseMsg<Object> selectTabByEntity(String name) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | |
| | | return success(tab); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | if (StringHelper.isEmpty(field) || StringHelper.isSqlInjection(field)) { |
| | | return fail("查询字段不正确", null); |
| | | } |
| | | if (!StringHelper.isEmpty(value)) { |
| | | value = value.trim().replace("'", ""); |
| | | } |
| | | |
| | | value = StringHelper.getLikeStr2(value); |
| | | value = StringHelper.isEmpty(value) ? "%" : StringHelper.getLikeUpperStr(value); |
| | | List<String> rs = baseMapper.selectFieldFuzzy(tab, field, value); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs() { |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = baseQueryService.selectTabs(); |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dirs", value = "目录编码", dataType = "String", paramType = "query", example = "00,01"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | public ResponseMsg<List<TabEntity>> selectTabsByPage(String depcode, String dirs, String tab, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Boolean hasGeom, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | |
| | | } |
| | | dirs = DataLibService.copeCodes(dirs, "dirid"); |
| | | if (dirs != null) { |
| | | filters += String.format(" and (%s)", dirs); |
| | | filters += String.format(" and %s", dirs); |
| | | } |
| | | |
| | | int count = baseQueryService.selectTabsForCount(tab); |
| | | String field = null == hasGeom || !hasGeom ? "gid" : "geom"; |
| | | int count = baseQueryService.selectTabsForCount(tab, field); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, filters, pageSize, pageSize * (pageIndex - 1)); |
| | | List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, field, filters, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), 0); |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询元数据中溢出的单位ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "reqEntity", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectMetaOverflowDep") |
| | | public ResponseMsg<Object> selectMetaOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("请选择要下载的文件ID"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = downloadService.selectMetaOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectDbOverflowDep") |
| | | public ResponseMsg<Object> selectDbOverflowDep(@RequestBody DownloadReqEntity reqEntity, HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<Object> selectDbOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == reqEntity || null == reqEntity.getEntities() || reqEntity.getEntities().isEmpty()) { |
| | | if (null == dr || null == dr.getEntities() || dr.getEntities().isEmpty()) { |
| | | return fail("请选择要下载的实体名"); |
| | | } |
| | | reqEntity.setWkt(AesHelper.decrypt(reqEntity.getWkt())); |
| | | if (StringHelper.isEmpty(reqEntity.getWkt())) { |
| | | return fail("请选择要下载的WKT范围"); |
| | | if (!StringHelper.isEmpty(dr.getWkt())) { |
| | | dr.setWkt(AesHelper.decrypt(dr.getWkt())); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | List<String> list = dataLibService.selectDbOverflowDep(ue, reqEntity.getEntities(), reqEntity.getWkt()); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = dataLibService.selectDbOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请求DB数据下载") |
| | | @ApiOperation(value = "下载DB数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dre", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body") |
| | | @ApiImplicitParam(name = "dr", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadDbReq") |
| | | public ResponseMsg<Object> downloadDbReq(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) { |
| | | @PostMapping(value = "/downloadDbData") |
| | | public ResponseMsg<Object> downloadDbData(@RequestBody DownloadReqEntity dr, HttpServletRequest req) { |
| | | try { |
| | | if (null == dre || StringHelper.isEmpty(dre.getPwd())) { |
| | | return fail("密码不能为空"); |
| | | } |
| | | if (null == dre.getEntities() || dre.getEntities().isEmpty()) { |
| | | if (null == dr || null == dr.getEntities() || dr.getEntities().isEmpty()) { |
| | | return fail("请选择要下载的实体名"); |
| | | } |
| | | dre.setWkt(AesHelper.decrypt(dre.getWkt())); |
| | | if (StringHelper.isEmpty(dre.getWkt())) { |
| | | return fail("请选择要下载的WKT范围"); |
| | | if (StringHelper.isEmpty(dr.getPwd())) { |
| | | return fail("密码不能为空"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dre)) { |
| | | if (!DownloadService.decryptPwd(dr)) { |
| | | return fail("密码解密失败", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(dre.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(dr.getPwd())) { |
| | | return fail("密码不符合要求"); |
| | | } |
| | | if (!StringHelper.isEmpty(dr.getWkt())) { |
| | | dr.setWkt(AesHelper.decrypt(dr.getWkt())); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String depcode = null == dre.getDepcodes() || dre.getDepcodes().isEmpty() ? null : dre.getDepcodes().get(0); |
| | | String guid = dataLibService.createZipFile(ue, dre.getEntities(), depcode, dre.getDirs(), dre.getWkt(), dre.getPwd()); |
| | | String guid = dataLibService.downloadDbReq(ue, dr); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请求实体数据下载") |
| | | @ApiOperation(value = "查看文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dre", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body") |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadEntityReq") |
| | | public ResponseMsg<Object> downloadEntityReq(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dre || StringHelper.isEmpty(dre.getPwd())) { |
| | | return fail("密码不能为空"); |
| | | } |
| | | if (null == dre.getEntities() || dre.getEntities().isEmpty()) { |
| | | return fail("请选择要下载的实体名"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dre)) { |
| | | return fail("密码解密失败", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(dre.getPwd())) { |
| | | return fail("密码不符合要求"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | 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) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | @GetMapping(value = "/downloadForView") |
| | | public void downloadForView(String guid, HttpServletResponse res) { |
| | | metaService.downloadForView(guid, true, res); |
| | | } |
| | | |
| | | @SysLog() |
| | |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询基础地理类别") |
| | | @GetMapping(value = "/selectBaseType") |
| | | public ResponseMsg<Object> selectBaseType() { |
| | | @ApiOperation(value = "查询目录类别") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "D") |
| | | }) |
| | | @GetMapping(value = "/selectDirTypes") |
| | | public ResponseMsg<Object> selectDirTypes(String name) { |
| | | try { |
| | | List<KeyValueEntity> list = baseQueryService.selectBaseType(); |
| | | List<KeyValueEntity> list = baseQueryService.selectDirTypes(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询业务类别") |
| | | @GetMapping(value = "/selectBusinessType") |
| | | public ResponseMsg<Object> selectBusinessType() { |
| | | try { |
| | | List<KeyValueEntity> list = baseQueryService.selectBusinessType(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据元数据ID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectMetaById") |
| | | public ResponseMsg<MetaEntity> selectMetaById(int id) { |
| | | try { |
| | | MetaEntity entity = metaService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |