|
|
|
@ -15,6 +15,7 @@ import com.cuit.solarenergy.service.SolarenergyService;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
@ -52,8 +53,12 @@ public class SimulAndPredicController {
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<TGeoserverinfo>> getSolarSimulation(SolarPredicReq solarReq) {
|
|
|
|
|
public RetResult<TGeoserverinfo> getSolarSimulation(SolarPredicReq solarReq) {
|
|
|
|
|
try {
|
|
|
|
|
//检验参数
|
|
|
|
|
if (StringUtils.isEmpty(solarReq.getRegionname()) || solarReq.getRegionname().equals("")){
|
|
|
|
|
throw new ParamsException("区域名称不能为空");
|
|
|
|
|
}
|
|
|
|
|
log.info("太阳能日总辐射实时模拟");
|
|
|
|
|
// 获取当前日期和时间的 Calendar 对象
|
|
|
|
|
String time = solarReq.getTime();
|
|
|
|
@ -66,7 +71,7 @@ public class SimulAndPredicController {
|
|
|
|
|
}
|
|
|
|
|
//3.查询tif
|
|
|
|
|
log.info("Tif查询");
|
|
|
|
|
List<TGeoserverinfo> regionInfo = dataImportService.getTifByRegion(solarReq.getRegionname());
|
|
|
|
|
TGeoserverinfo regionInfo = dataImportService.getTifByRegionAndTime(solarReq.getRegionname());
|
|
|
|
|
return RetResponse.makeOKRsp(regionInfo);
|
|
|
|
|
}catch (RuntimeException e){
|
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟有误!"+e.getMessage());
|
|
|
|
@ -86,8 +91,12 @@ public class SimulAndPredicController {
|
|
|
|
|
@ApiResponse(code = 500, message = "服务器内部错误"),
|
|
|
|
|
@ApiResponse(code = 900, message = "失败")
|
|
|
|
|
})
|
|
|
|
|
public RetResult<List<TGeoserverinfo>> getSolarPrediction(SolarPredicReq solarReq) {
|
|
|
|
|
public RetResult<TGeoserverinfo> getSolarPrediction(SolarPredicReq solarReq) {
|
|
|
|
|
try {
|
|
|
|
|
//检验参数
|
|
|
|
|
if (StringUtils.isEmpty(solarReq.getRegionname()) || solarReq.getRegionname().equals("")){
|
|
|
|
|
throw new ParamsException("区域名称不能为空");
|
|
|
|
|
}
|
|
|
|
|
log.info("太阳能日总辐射预报");
|
|
|
|
|
// 获取当前日期和时间的 Calendar 对象
|
|
|
|
|
String time = solarReq.getTime();
|
|
|
|
@ -100,7 +109,7 @@ public class SimulAndPredicController {
|
|
|
|
|
}
|
|
|
|
|
//3.查询tif
|
|
|
|
|
log.info("Tif查询");
|
|
|
|
|
List<TGeoserverinfo> regionInfo = dataImportService.getTifByRegion(solarReq.getRegionname());
|
|
|
|
|
TGeoserverinfo regionInfo = dataImportService.getTifByRegionAndTime(solarReq.getRegionname());
|
|
|
|
|
return RetResponse.makeOKRsp(regionInfo);
|
|
|
|
|
}catch (RuntimeException e){
|
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟有误!"+e.getMessage());
|
|
|
|
|