|
|
|
@ -2,6 +2,7 @@ package com.cuit.solarenergy.controller;
|
|
|
|
|
|
|
|
|
|
import com.cuit.solarenergy.base.annotation.AopLog;
|
|
|
|
|
import com.cuit.solarenergy.base.annotation.AuthToken;
|
|
|
|
|
import com.cuit.solarenergy.entity.BaseMapVoRet;
|
|
|
|
|
import com.cuit.solarenergy.entity.MonitorRet;
|
|
|
|
|
import com.cuit.solarenergy.entity.TGeoserverinfo;
|
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.RetResponse;
|
|
|
|
@ -9,6 +10,7 @@ import com.cuit.solarenergy.entity.vo.ret.RetResult;
|
|
|
|
|
import com.cuit.solarenergy.exception.ParamsException;
|
|
|
|
|
import com.cuit.solarenergy.service.DataImportService;
|
|
|
|
|
import com.cuit.solarenergy.utils.ErrorMessage;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -51,10 +53,10 @@ public class DataController {
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<TGeoserverinfo>> getRefionInfo(String region) {
|
|
|
|
|
public RetResult<List<TGeoserverinfo>> getRefionInfo() {
|
|
|
|
|
try {
|
|
|
|
|
log.info("区域查询");
|
|
|
|
|
List<TGeoserverinfo> regionInfo = dataImportService.getRefionInfo(region);
|
|
|
|
|
List<TGeoserverinfo> regionInfo = dataImportService.getRefionInfo();
|
|
|
|
|
return RetResponse.makeOKRsp(regionInfo);
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
return RetResponse.makeErrRsp("查询错误!"+e.getMessage());
|
|
|
|
@ -73,20 +75,43 @@ public class DataController {
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<String>> getTifByRegion(String region) {
|
|
|
|
|
public RetResult<List<TGeoserverinfo>> getTifByRegion(String region) {
|
|
|
|
|
try {
|
|
|
|
|
log.info("Tif查询");
|
|
|
|
|
List<String> regionInfo = dataImportService.getTifByRegion(region);
|
|
|
|
|
List<TGeoserverinfo> regionInfo = dataImportService.getTifByRegion(region);
|
|
|
|
|
return RetResponse.makeOKRsp(regionInfo);
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
return RetResponse.makeErrRsp("查询tif文件失败!"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@AopLog
|
|
|
|
|
// @AopLog
|
|
|
|
|
// @AuthToken
|
|
|
|
|
// @ApiOperation("3、图层查询")
|
|
|
|
|
// @PreAuthorize("hasAuthority('minio:upload')")
|
|
|
|
|
// @RequestMapping(value = "/dataimport/getLayer", method = {RequestMethod.GET})
|
|
|
|
|
// @ApiResponses({
|
|
|
|
|
// @ApiResponse(code = 200, message = "成功"),
|
|
|
|
|
// @ApiResponse(code = 401, message = "访问未经授权"),
|
|
|
|
|
// @ApiResponse(code = 403, message = "访问被禁止的"),
|
|
|
|
|
// @ApiResponse(code = 404, message = "未找到访问接口"),
|
|
|
|
|
// @ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
// @ApiResponse(code = 900, message = "失败")
|
|
|
|
|
// })
|
|
|
|
|
// public RetResult<List<String>> getLayer() {
|
|
|
|
|
// try {
|
|
|
|
|
// log.info("图层查询");
|
|
|
|
|
// List<String> layer = dataImportService.getLayer();
|
|
|
|
|
// return RetResponse.makeOKRsp(layer);
|
|
|
|
|
// }catch (ParamsException e){
|
|
|
|
|
// return RetResponse.makeErrRsp("查询tif文件失败!"+e.getMessage());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
@AuthToken
|
|
|
|
|
@ApiOperation("3、图层查询")
|
|
|
|
|
@PreAuthorize("hasAuthority('minio:upload')")
|
|
|
|
|
@RequestMapping(value = "/dataimport/getLayer", method = {RequestMethod.GET})
|
|
|
|
|
@AopLog
|
|
|
|
|
@ApiOperationSupport(order = 8)
|
|
|
|
|
// @PreAuthorize("hasAuthority('common:getBaseMapLayes')")
|
|
|
|
|
@ApiOperation("8、查询取底图图层列表名称及地址")
|
|
|
|
|
@RequestMapping(value = "/common/getBaseMapLayes", method = {RequestMethod.GET})
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(code = 200, message = "成功"),
|
|
|
|
|
@ApiResponse(code = 401, message = "访问未经授权"),
|
|
|
|
@ -95,13 +120,14 @@ public class DataController {
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<String>> getLayer() {
|
|
|
|
|
public RetResult<List<BaseMapVoRet>> getBaseMapLayes() {
|
|
|
|
|
List<BaseMapVoRet> baseMapVoRets = null;
|
|
|
|
|
try {
|
|
|
|
|
log.info("图层查询");
|
|
|
|
|
List<String> layer = dataImportService.getLayer();
|
|
|
|
|
return RetResponse.makeOKRsp(layer);
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
return RetResponse.makeErrRsp("查询tif文件失败!"+e.getMessage());
|
|
|
|
|
baseMapVoRets = dataImportService.getBaseMapList();
|
|
|
|
|
return RetResponse.makeOKRsp(baseMapVoRets);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return RetResponse.makeRsp(500, "服务器错误...");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@AopLog
|
|
|
|
@ -191,5 +217,27 @@ public class DataController {
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
return RetResponse.makeErrRsp("查询监测点详情失败!"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@AopLog
|
|
|
|
|
@AuthToken
|
|
|
|
|
@ApiOperation("9、获取数据时间")
|
|
|
|
|
@PreAuthorize("hasAuthority('minio:upload')")
|
|
|
|
|
@RequestMapping(value = "/dataimport/getCurrentTime", method = {RequestMethod.GET})
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(code = 200, message = "成功"),
|
|
|
|
|
@ApiResponse(code = 401, message = "访问未经授权"),
|
|
|
|
|
@ApiResponse(code = 403, message = "访问被禁止的"),
|
|
|
|
|
@ApiResponse(code = 404, message = "未找到访问接口"),
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<String>> getCurrentTime() {
|
|
|
|
|
try {
|
|
|
|
|
log.info("获取当前时间");
|
|
|
|
|
List<String> currentTime = dataImportService.getCurrentTime();
|
|
|
|
|
return RetResponse.makeOKRsp(currentTime);
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
return RetResponse.makeErrRsp("获取当前时间失败!"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|