Merge remote-tracking branch 'origin/master'
| | |
| | | select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a where a.dircode like (select code from lf.sys_dir where name='西气东输四线天然气管道工程(吐鲁番-中卫)(00116DT02)') || '%'; |
| | | |
| | | select * from lf.sys_report order by code |
| | | select * from lf.sys_layer |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | -- 项目表 |
| | | select a.*,st_astext(geom) from bs.bs_project a; |
| | | |
| | |
| | | select name,code,(select count(*) from lf.sys_meta b where b.depcode like a.code || '%'), |
| | | (select count(sizes) from lf.sys_meta b where b.depcode like a.code || '%') |
| | | from lf.sys_dep a where name in ('测绘室','勘察室','地灾专业','洞库专业'); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | --------------------------------------------------------- |
| | | -- 0100000000,02000000,030000,040100,0100000002,02000002,040102,0100000003,02000003,0100000001,02000001,040101,030001,01,02,02000001 |
| | | select * from lf.sys_meta where dircode like '01%' or dircode like '02%' or dircode like '030000%' |
| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.controller.all.BaseQueryController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.CountEntity; |
| | | import com.lf.server.entity.sys.ReportEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据统计 |
| | |
| | | @Api(tags = "数据管理\\数据统计") |
| | | @RestController |
| | | @RequestMapping("/dataCount") |
| | | public class DataCountController extends BaseQueryController { |
| | | public class DataCountController extends BaseController { |
| | | @Autowired |
| | | ReportService reportService; |
| | | |
| | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "lf.sys_report"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "countOperates"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<ReportEntity>> selectByPageAndCount(String name, String code, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | int count = reportService.selectCount(name, code); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ReportEntity> rs = reportService.selectByPage(name, code, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | @ApiOperation(value = "查询数据量统计") |
| | | @GetMapping(value = "/selectCountSizes") |
| | | public ResponseMsg<Object> selectCountSizes() { |
| | | try { |
| | | List<CountEntity> list = reportService.countSizes(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询服务调用量统计") |
| | | @GetMapping(value = "/selectCountServices") |
| | | public ResponseMsg<Object> selectCountServices() { |
| | | try { |
| | | List<CountEntity> list = reportService.countServices(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询用户流量统计") |
| | | @GetMapping(value = "/selectCountOperates") |
| | | public ResponseMsg<Object> selectCountOperates() { |
| | | try { |
| | | List<CountEntity> list = reportService.countOperates(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ReportEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.UploadAttachService; |
| | | import com.lf.server.service.sys.ReportService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "lf.sys_report"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = reportService.selectCount(name); |
| | | int count = reportService.selectCount(name, null); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ReportEntity> rs = reportService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | List<ReportEntity> rs = reportService.selectByPage(name, null, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | } |
| | | } |
| | |
| | | * 查询记录数 |
| | | * |
| | | * @param name 名称 |
| | | * @param code 编码 |
| | | * @return 记录数 |
| | | */ |
| | | public Integer selectCount(String name); |
| | | public Integer selectCount(String name, String code); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param name 名称 |
| | | * @param code 编码 |
| | | * @param limit 记录数 |
| | | * @param offset 偏移量 |
| | | * @return 列表 |
| | | */ |
| | | public List<ReportEntity> selectByPage(String name, Integer limit, Integer offset); |
| | | public List<ReportEntity> selectByPage(String name, String code, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * 查询所有 |
| | |
| | | DownloadService downloadService; |
| | | |
| | | @Override |
| | | public Integer selectCount(String name) { |
| | | public Integer selectCount(String name, String code) { |
| | | name = StringHelper.getLikeStr(name); |
| | | |
| | | return reportMapper.selectCount(name); |
| | | return reportMapper.selectCount(name, code); |
| | | } |
| | | |
| | | @Override |
| | | public List<ReportEntity> selectByPage(String name, Integer limit, Integer offset) { |
| | | public List<ReportEntity> selectByPage(String name, String code, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeStr(name); |
| | | |
| | | return reportMapper.selectByPage(name, limit, offset); |
| | | return reportMapper.selectByPage(name, code, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | </if> |
| | | <if test="code != null"> |
| | | code = #{code} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | </if> |
| | | <if test="code != null"> |
| | | code = #{code} |
| | | </if> |
| | | </where> |
| | | order by a.id desc |
| | | limit #{limit} offset #{offset} |