|
@@ -3,6 +3,7 @@ package com.zhiqiyun.open.mvc.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.dliyun.oap.framework.service.RouterService;
|
|
import com.dliyun.oap.framework.service.RouterService;
|
|
|
import com.dliyun.oap.framework.service.ServiceMethodHandler;
|
|
import com.dliyun.oap.framework.service.ServiceMethodHandler;
|
|
|
|
|
+import com.zhiqiyun.open.core.enmus.BzDataType;
|
|
|
import com.zhiqiyun.open.core.models.bz.BaseDataInfo;
|
|
import com.zhiqiyun.open.core.models.bz.BaseDataInfo;
|
|
|
import com.zhiqiyun.open.core.service.AppKeyInfoService;
|
|
import com.zhiqiyun.open.core.service.AppKeyInfoService;
|
|
|
import com.zhiqiyun.open.core.service.BaseDataInfoService;
|
|
import com.zhiqiyun.open.core.service.BaseDataInfoService;
|
|
@@ -61,7 +62,7 @@ public class IndexController {
|
|
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
@PostMapping("/bz/base/findByMapBounds")
|
|
@PostMapping("/bz/base/findByMapBounds")
|
|
|
- public Result findByMapBounds(BigDecimal maxlng, BigDecimal maxlat, BigDecimal minlng, BigDecimal minlat) {
|
|
|
|
|
|
|
+ public Result findByMapBounds(BigDecimal maxlng, BigDecimal maxlat, BigDecimal minlng, BigDecimal minlat, BzDataType dataType) {
|
|
|
QueryWrapper<BaseDataInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BaseDataInfo> queryWrapper = new QueryWrapper<>();
|
|
|
if (maxlng != null) {
|
|
if (maxlng != null) {
|
|
|
queryWrapper.le("lng", maxlng);
|
|
queryWrapper.le("lng", maxlng);
|
|
@@ -75,11 +76,28 @@ public class IndexController {
|
|
|
if (minlat != null) {
|
|
if (minlat != null) {
|
|
|
queryWrapper.ge("lat", minlat);
|
|
queryWrapper.ge("lat", minlat);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (dataType != null) {
|
|
|
|
|
+ queryWrapper.eq("data_type", dataType);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
List<BaseDataInfo> listData = this.baseDataInfoService.list(queryWrapper);
|
|
List<BaseDataInfo> listData = this.baseDataInfoService.list(queryWrapper);
|
|
|
return Result.instance(Result.Code.SUCCESS).setData(listData);
|
|
return Result.instance(Result.Code.SUCCESS).setData(listData);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ @PostMapping("/bz/base/findByGroupByDataType")
|
|
|
|
|
+ public Result findByGroupByDataType() {
|
|
|
|
|
+ QueryWrapper<BaseDataInfo> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.select("data_type, count(1) num");
|
|
|
|
|
+ queryWrapper.groupBy("data_type");
|
|
|
|
|
+ List<Map<String, Object>> listData = this.baseDataInfoService.listMaps(queryWrapper);
|
|
|
|
|
+ for (Map<String, Object> dataMap : listData) {
|
|
|
|
|
+ BzDataType dataType = BzDataType.valueOf(Integer.parseInt(dataMap.get("data_type").toString()));
|
|
|
|
|
+ dataMap.put("dataType", dataType);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Result.instance(Result.Code.SUCCESS).setData(listData);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/")
|
|
@GetMapping("/")
|
|
|
public void index(HttpServletResponse response) throws IOException {
|
|
public void index(HttpServletResponse response) throws IOException {
|
|
|
response.sendRedirect("/index.html");
|
|
response.sendRedirect("/index.html");
|