|
|
@ -2,14 +2,12 @@ package com.cuit.solarenergy.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.cuit.solarenergy.base.annotation.AopLog;
|
|
|
|
import com.cuit.solarenergy.base.annotation.AopLog;
|
|
|
|
import com.cuit.solarenergy.base.annotation.AuthToken;
|
|
|
|
import com.cuit.solarenergy.base.annotation.AuthToken;
|
|
|
|
import com.cuit.solarenergy.entity.BaseMapVoRet;
|
|
|
|
import com.cuit.solarenergy.entity.*;
|
|
|
|
import com.cuit.solarenergy.entity.MonitorRet;
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.ElementValueRet;
|
|
|
|
import com.cuit.solarenergy.entity.TGeoserverinfo;
|
|
|
|
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.RetResponse;
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.RetResponse;
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.RetResult;
|
|
|
|
import com.cuit.solarenergy.entity.vo.ret.RetResult;
|
|
|
|
import com.cuit.solarenergy.exception.ParamsException;
|
|
|
|
import com.cuit.solarenergy.exception.ParamsException;
|
|
|
|
import com.cuit.solarenergy.service.DataImportService;
|
|
|
|
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.ApiOperationSupport;
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
@ -21,9 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestPart;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -165,10 +161,10 @@ public class DataController {
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
})
|
|
|
|
})
|
|
|
|
public RetResult<List<String>> getElementInfo() {
|
|
|
|
public RetResult<List<ElementRet>> getElementInfo() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
log.info("查询要素详情");
|
|
|
|
log.info("查询要素详情");
|
|
|
|
List<String> element = dataImportService.getElementInfo();
|
|
|
|
List<ElementRet> element = dataImportService.getElementInfo();
|
|
|
|
return RetResponse.makeOKRsp(element);
|
|
|
|
return RetResponse.makeOKRsp(element);
|
|
|
|
}catch (ParamsException e){
|
|
|
|
}catch (ParamsException e){
|
|
|
|
return RetResponse.makeErrRsp("查询要素失败!"+e.getMessage());
|
|
|
|
return RetResponse.makeErrRsp("查询要素失败!"+e.getMessage());
|
|
|
@ -187,10 +183,10 @@ public class DataController {
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
})
|
|
|
|
})
|
|
|
|
public RetResult<List<String>> getValueByElement(String Element) {
|
|
|
|
public RetResult<List<ElementValue>> getValueByElement(String Element) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
log.info("根据要素详情查询具体值");
|
|
|
|
log.info("根据要素详情查询具体值");
|
|
|
|
List<String> value = dataImportService.getValueByElement(Element);
|
|
|
|
List<ElementValue> value = dataImportService.getValueByElement(Element);
|
|
|
|
return RetResponse.makeOKRsp(value);
|
|
|
|
return RetResponse.makeOKRsp(value);
|
|
|
|
}catch (ParamsException e){
|
|
|
|
}catch (ParamsException e){
|
|
|
|
return RetResponse.makeErrRsp("查询数据失败!"+e.getMessage());
|
|
|
|
return RetResponse.makeErrRsp("查询数据失败!"+e.getMessage());
|
|
|
@ -218,7 +214,7 @@ public class DataController {
|
|
|
|
return RetResponse.makeErrRsp("查询监测点详情失败!"+e.getMessage());
|
|
|
|
return RetResponse.makeErrRsp("查询监测点详情失败!"+e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@AopLog
|
|
|
|
@AopLog
|
|
|
|
@AuthToken
|
|
|
|
@AuthToken
|
|
|
|
@ApiOperation("9、获取数据时间")
|
|
|
|
@ApiOperation("9、获取数据时间")
|
|
|
|
@PreAuthorize("hasAuthority('minio:upload')")
|
|
|
|
@PreAuthorize("hasAuthority('minio:upload')")
|
|
|
@ -240,4 +236,26 @@ public class DataController {
|
|
|
|
return RetResponse.makeErrRsp("获取当前时间失败!"+e.getMessage());
|
|
|
|
return RetResponse.makeErrRsp("获取当前时间失败!"+e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@AopLog
|
|
|
|
|
|
|
|
@AuthToken
|
|
|
|
|
|
|
|
@ApiOperation("10、获取要素状态")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('minio:upload')")
|
|
|
|
|
|
|
|
@RequestMapping(value = "/dataimport/getElementStatus", 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<ElementValueRet>> getElementStatus(String element) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
log.info("获取当前要素状态");
|
|
|
|
|
|
|
|
List<ElementValueRet> currentTime = dataImportService.getElementStatus(element);
|
|
|
|
|
|
|
|
return RetResponse.makeOKRsp(currentTime);
|
|
|
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
|
|
|
return RetResponse.makeErrRsp("获取当前时间失败!"+e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|