Финишная прямая, тестирую
This commit is contained in:
@ -13,17 +13,17 @@ spring:
|
|||||||
#custom.config.db_url=jdbc:postgresql://192.168.0.90:5432/weather?ApplicationName=weather&sslmode=require
|
#custom.config.db_url=jdbc:postgresql://192.168.0.90:5432/weather?ApplicationName=weather&sslmode=require
|
||||||
custom:
|
custom:
|
||||||
config:
|
config:
|
||||||
data_dir: O:\\temp\\CCALM\\
|
#data_dir: O:\\temp\\CCALM\\
|
||||||
#data_dir: /temp/CCALM/
|
data_dir: /data/
|
||||||
db_all:
|
db_all:
|
||||||
url: jdbc:postgresql://92.46.48.43:5444/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://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
|
#url: jdbc:postgresql://127.0.0.1:5432/weather?ApplicationName=kz_mcp_weather&sslmode=require
|
||||||
login: postgres
|
login: postgres
|
||||||
password: PasSecrKey1
|
password: PasSecrKey1
|
||||||
db_ru:
|
db_ru:
|
||||||
url: jdbc:postgresql://92.46.48.43:5444/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:5433/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
|
#url: jdbc:postgresql://127.0.0.1:5432/weather_ru?ApplicationName=kz_mcp_weather&sslmode=require
|
||||||
login: postgres
|
login: postgres
|
||||||
password: PasSecrKey1
|
password: PasSecrKey1
|
||||||
|
|||||||
@ -319,7 +319,6 @@ public class AirTemperature implements ServletContextAware {
|
|||||||
|
|
||||||
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
|
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
String sql= """
|
String sql= """
|
||||||
insert into main.air_temperature(
|
insert into main.air_temperature(
|
||||||
val,
|
val,
|
||||||
@ -344,6 +343,9 @@ public class AirTemperature implements ServletContextAware {
|
|||||||
pstmt.setString(4, date + " " + time);
|
pstmt.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
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.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
pstmt.executeUpdate();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.error("N10:"+ex.getMessage(),ex);
|
logger.error("E11:"+ex.getMessage(),ex);
|
||||||
|
//throw new Exception("Failed insert ...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
@ -373,7 +374,7 @@ public class AirTemperature implements ServletContextAware {
|
|||||||
|
|
||||||
//Cut data piece from big country of Russia
|
//Cut data piece from big country of Russia
|
||||||
try {
|
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_all!=null) st_all.executeUpdate(sql);
|
||||||
if(st_ru!=null) st_ru.executeUpdate(sql);
|
if(st_ru!=null) st_ru.executeUpdate(sql);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
@ -390,8 +391,12 @@ public class AirTemperature implements ServletContextAware {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String sql = "END TRANSACTION;";
|
String sql = "END TRANSACTION;";
|
||||||
if(st_all!=null) st_all.executeUpdate(sql);
|
if(st_all!=null) {
|
||||||
if(st_ru!=null) st_ru.executeUpdate(sql);
|
st_all.executeUpdate(sql);
|
||||||
|
}
|
||||||
|
if(st_ru!=null) {
|
||||||
|
st_ru.executeUpdate(sql);
|
||||||
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.error("N13:"+ex.getMessage(),ex);
|
logger.error("N13:"+ex.getMessage(),ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
|
|
||||||
import tctable.Tools;
|
import tctable.Tools;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
//import javax.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
/*
|
/*
|
||||||
* Server buffer for map tiles.
|
* Server buffer for map tiles.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -339,7 +339,6 @@ public class Precipitation implements ServletContextAware {
|
|||||||
|
|
||||||
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
|
if(country_id!=null && !country_id.equals("") && !country_id.equals("null"))
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
String sql= """
|
String sql= """
|
||||||
insert into main.precipitation(
|
insert into main.precipitation(
|
||||||
val,
|
val,
|
||||||
@ -364,6 +363,9 @@ public class Precipitation implements ServletContextAware {
|
|||||||
pstmt.setString(4, date + " " + time);
|
pstmt.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
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.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
pstmt.executeUpdate();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.error("N10:"+ex.getMessage(),ex);
|
logger.error("E10:"+ex.getMessage(),ex);
|
||||||
throw new Exception("Failed insert precipitation...");
|
//throw new Exception("Failed insert precipitation...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +395,7 @@ public class Precipitation implements ServletContextAware {
|
|||||||
|
|
||||||
//Cut data piece from big country of Russia
|
//Cut data piece from big country of Russia
|
||||||
try {
|
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_all.executeUpdate(sql);
|
||||||
st_ru.executeUpdate(sql);
|
st_ru.executeUpdate(sql);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
|
|||||||
@ -358,7 +358,7 @@ public class SoilTmperature implements ServletContextAware {
|
|||||||
|
|
||||||
if(!country_id.isEmpty() && !country_id.equals("null"))
|
if(!country_id.isEmpty() && !country_id.equals("null"))
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
String sql="""
|
String sql="""
|
||||||
insert into main.soil_temperature(
|
insert into main.soil_temperature(
|
||||||
val,
|
val,
|
||||||
@ -383,6 +383,9 @@ public class SoilTmperature implements ServletContextAware {
|
|||||||
pstmt.setString(4, date + " " + time);
|
pstmt.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
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.setString(4, date + " " + time);
|
||||||
pstmt.setInt(5, Integer.valueOf(forecast));
|
pstmt.setInt(5, Integer.valueOf(forecast));
|
||||||
pstmt.executeUpdate();
|
pstmt.executeUpdate();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.error("N11: "+ex.getMessage(),ex);
|
logger.error("E10:"+ex.getMessage(),ex);
|
||||||
throw new Exception("Failed insert soil temperature...");
|
//throw new Exception("Failed insert soil temperature...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +415,7 @@ public class SoilTmperature implements ServletContextAware {
|
|||||||
|
|
||||||
//Cut data piece from big country of Russia
|
//Cut data piece from big country of Russia
|
||||||
try {
|
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_all.executeUpdate(sql);
|
||||||
st_ru.executeUpdate(sql);
|
st_ru.executeUpdate(sql);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user