Финишная прямая, тестирую

This commit is contained in:
Igor I
2025-01-08 17:53:19 +05:00
parent d7fa8eea7a
commit 7081e6ea20
5 changed files with 141 additions and 132 deletions

View File

@ -13,17 +13,17 @@ spring:
#custom.config.db_url=jdbc:postgresql://192.168.0.90:5432/weather?ApplicationName=weather&sslmode=require
custom:
config:
data_dir: O:\\temp\\CCALM\\
#data_dir: /temp/CCALM/
#data_dir: O:\\temp\\CCALM\\
data_dir: /data/
db_all:
url: jdbc:postgresql://92.46.48.43:5444/weather?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://192.168.0.90:5432/weather?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://92.46.48.43:5444/weather?ApplicationName=kz_mcp_weather&sslmode=require
url: jdbc:postgresql://192.168.0.90:5432/weather?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://127.0.0.1:5432/weather?ApplicationName=kz_mcp_weather&sslmode=require
login: postgres
password: PasSecrKey1
db_ru:
url: jdbc:postgresql://92.46.48.43:5444/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://192.168.0.90:5433/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://92.46.48.43:5444/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
url: jdbc:postgresql://192.168.0.90:5432/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
#url: jdbc:postgresql://127.0.0.1:5432/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
login: postgres
password: PasSecrKey1

View File

@ -319,7 +319,6 @@ public class AirTemperature implements ServletContextAware {
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
{
try {
String sql= """
insert into main.air_temperature(
val,
@ -344,6 +343,9 @@ public class AirTemperature implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
} catch (SQLException ex) {
logger.error("E10:"+ex.getMessage(),ex);
//throw new Exception("Failed insert ...");
}
}
}
@ -357,14 +359,13 @@ public class AirTemperature implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
}
}
}
} catch (SQLException ex) {
logger.error("N10:"+ex.getMessage(),ex);
logger.error("E11:"+ex.getMessage(),ex);
//throw new Exception("Failed insert ...");
}
}
}
}
}
}
pos++;
@ -373,7 +374,7 @@ public class AirTemperature implements ServletContextAware {
//Cut data piece from big country of Russia
try {
String sql="delete from main.points where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),w.geom);";
String sql="delete from main.points p where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),ST_SetSRID(st_makepoint(p.lon,p.lat),4326));";
if(st_all!=null) st_all.executeUpdate(sql);
if(st_ru!=null) st_ru.executeUpdate(sql);
} catch (SQLException ex) {
@ -390,8 +391,12 @@ public class AirTemperature implements ServletContextAware {
try {
String sql = "END TRANSACTION;";
if(st_all!=null) st_all.executeUpdate(sql);
if(st_ru!=null) st_ru.executeUpdate(sql);
if(st_all!=null) {
st_all.executeUpdate(sql);
}
if(st_ru!=null) {
st_ru.executeUpdate(sql);
}
} catch (SQLException ex) {
logger.error("N13:"+ex.getMessage(),ex);
}

View File

@ -19,7 +19,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import tctable.Tools;
import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
/*
* Server buffer for map tiles.
*/

View File

@ -339,7 +339,6 @@ public class Precipitation implements ServletContextAware {
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
{
try {
String sql= """
insert into main.precipitation(
val,
@ -364,6 +363,9 @@ public class Precipitation implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
} catch (SQLException ex) {
logger.error("E10:"+ex.getMessage(),ex);
//throw new Exception("Failed insert precipitation...");
}
}
}
@ -377,12 +379,11 @@ public class Precipitation implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
}
}
}
} catch (SQLException ex) {
logger.error("N10:"+ex.getMessage(),ex);
throw new Exception("Failed insert precipitation...");
logger.error("E10:"+ex.getMessage(),ex);
//throw new Exception("Failed insert precipitation...");
}
}
}
}
@ -394,7 +395,7 @@ public class Precipitation implements ServletContextAware {
//Cut data piece from big country of Russia
try {
String sql="delete from main.points where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),w.geom);";
String sql="delete from main.points p where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),ST_SetSRID(st_makepoint(p.lon,p.lat),4326));";
st_all.executeUpdate(sql);
st_ru.executeUpdate(sql);
} catch (SQLException ex) {

View File

@ -358,7 +358,7 @@ public class SoilTmperature implements ServletContextAware {
if(!country_id.isEmpty() && !country_id.equals("null"))
{
try {
String sql="""
insert into main.soil_temperature(
val,
@ -383,6 +383,9 @@ public class SoilTmperature implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
} catch (SQLException ex) {
logger.error("E10:"+ex.getMessage(),ex);
//throw new Exception("Failed insert soil temperature...");
}
}
}
@ -396,12 +399,11 @@ public class SoilTmperature implements ServletContextAware {
pstmt.setString(4, date + " " + time);
pstmt.setInt(5, Integer.valueOf(forecast));
pstmt.executeUpdate();
}
}
}
} catch (SQLException ex) {
logger.error("N11: "+ex.getMessage(),ex);
throw new Exception("Failed insert soil temperature...");
logger.error("E10:"+ex.getMessage(),ex);
//throw new Exception("Failed insert soil temperature...");
}
}
}
}
@ -413,7 +415,7 @@ public class SoilTmperature implements ServletContextAware {
//Cut data piece from big country of Russia
try {
String sql="delete from main.points where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),w.geom);";
String sql="delete from main.points p where country_id=7 and not ST_Contains(ST_SetSRID(ST_GeomFromText('POLYGON((10.00 66.00,10.00 40.00,179.00 40.00,179.00 66.00,10.00 66.00))'),4326),ST_SetSRID(st_makepoint(p.lon,p.lat),4326));";
st_all.executeUpdate(sql);
st_ru.executeUpdate(sql);
} catch (SQLException ex) {