管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-03 0fc0c51bec7133391e9cc89c0c7d9ee34c966434
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -19,6 +19,7 @@
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;
@@ -65,6 +66,9 @@
    @Autowired
    BaseQueryService baseQueryService;
    @Autowired
    DictService dictService;
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
@@ -89,7 +93,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -132,7 +136,7 @@
            return success(paged.getTotal(), paged.getRecords());
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -163,7 +167,7 @@
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -193,7 +197,7 @@
            return success(wkt);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -228,7 +232,7 @@
            return success(rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -244,7 +248,7 @@
            return success(rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -260,20 +264,23 @@
            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 = "点")
    })
    @GetMapping(value = "/selectTabs")
    public ResponseMsg<List<TabEntity>> selectTabs() {
    public ResponseMsg<List<TabEntity>> selectTabs(String name) {
        try {
            List<TabEntity> list = baseQueryService.selectTabs();
            List<TabEntity> list = dictService.selectDictTab(name);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -287,7 +294,7 @@
            @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, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
@@ -314,7 +321,7 @@
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -341,7 +348,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -362,7 +369,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -389,7 +396,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -410,7 +417,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -430,7 +437,7 @@
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), 0);
            return fail(ex, 0);
        }
    }
@@ -456,7 +463,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -476,7 +483,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -512,7 +519,7 @@
            return success(guid);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -544,8 +551,18 @@
            return success(guid);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查看文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body")
    })
    @GetMapping(value = "/downloadForView")
    public void downloadForView(String guid, HttpServletResponse res) {
        metaService.downloadForView(guid, true, res);
    }
    @SysLog()
@@ -575,7 +592,7 @@
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -591,7 +608,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -607,7 +624,23 @@
            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);
        }
    }
}