|
|
@ -13,10 +13,7 @@ import com.cuit.solarenergy.service.DataImportService;
|
|
|
|
import com.cuit.solarenergy.service.GeoServerPubService;
|
|
|
|
import com.cuit.solarenergy.service.GeoServerPubService;
|
|
|
|
import com.cuit.solarenergy.service.SolarenergyService;
|
|
|
|
import com.cuit.solarenergy.service.SolarenergyService;
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiResponse;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiResponses;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@ -58,10 +55,12 @@ public class SimulAndPredicController {
|
|
|
|
public RetResult<List<TGeoserverinfo>> getSolarSimulation(SolarPredicReq solarReq) {
|
|
|
|
public RetResult<List<TGeoserverinfo>> getSolarSimulation(SolarPredicReq solarReq) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
log.info("太阳能日总辐射实时模拟");
|
|
|
|
log.info("太阳能日总辐射实时模拟");
|
|
|
|
|
|
|
|
// 获取当前日期和时间的 Calendar 对象
|
|
|
|
|
|
|
|
String time = solarReq.getTime();
|
|
|
|
//1.辐射出图
|
|
|
|
//1.辐射出图
|
|
|
|
String pathFile = solarenergyService.calSolarRadiation(RasterSolarRadiationOperation.SolarEadiationAnalysisType.DAY_TOTAL_SOLARRADIATION_AMOUNT,"", 0, 2000);
|
|
|
|
String pathFile = solarenergyService.calSolarRadiation(RasterSolarRadiationOperation.SolarEadiationAnalysisType.DAY_TOTAL_SOLARRADIATION_AMOUNT,time, 0, 2000);
|
|
|
|
//2.发布geoserverter服务并存入数据库
|
|
|
|
//2.发布geoserverter服务并存入数据库
|
|
|
|
Long aLong = geoServerPubService.pubGeoServerAndSavetoDB("style_tyn", "EPSG:3857",pathFile, solarReq.getRegionname());
|
|
|
|
Long aLong = geoServerPubService.pubGeoServerAndSavetoDB("style_tynday", "EPSG:3857",pathFile, solarReq.getRegionname());
|
|
|
|
if (Objects.isNull(aLong)|| aLong == -1){
|
|
|
|
if (Objects.isNull(aLong)|| aLong == -1){
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟服务有误");
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟服务有误");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -95,7 +94,7 @@ public class SimulAndPredicController {
|
|
|
|
//1.辐射出图
|
|
|
|
//1.辐射出图
|
|
|
|
String pathFile = solarenergyService.calSolarRadiation(RasterSolarRadiationOperation.SolarEadiationAnalysisType.DAY_TOTAL_SOLARRADIATION_AMOUNT, time, 0, 2000);
|
|
|
|
String pathFile = solarenergyService.calSolarRadiation(RasterSolarRadiationOperation.SolarEadiationAnalysisType.DAY_TOTAL_SOLARRADIATION_AMOUNT, time, 0, 2000);
|
|
|
|
//2.发布geoserverter服务并存入数据库
|
|
|
|
//2.发布geoserverter服务并存入数据库
|
|
|
|
Long aLong = geoServerPubService.pubGeoServerAndSavetoDB("style_tyn", "EPSG:3857",pathFile, solarReq.getRegionname());
|
|
|
|
Long aLong = geoServerPubService.pubGeoServerAndSavetoDB("style_tynday", "EPSG:3857",pathFile, solarReq.getRegionname());
|
|
|
|
if (Objects.isNull(aLong)|| aLong == -1){
|
|
|
|
if (Objects.isNull(aLong)|| aLong == -1){
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟服务有误");
|
|
|
|
return RetResponse.makeErrRsp("太阳能日总辐射实时模拟服务有误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|