Compare commits

...

4 Commits

Author SHA1 Message Date
Igor I 86e570ca61 Add Locust types 2026-06-09 19:00:12 +05:00
Igor I 4b3dc84500 Fix Exception 2026-06-09 08:12:10 +05:00
igor a2982790f6 Merge branch 'develop' of https://git.ccalm.org/igor/org.ccalm.main into develop 2026-03-18 07:33:07 +05:00
igor 1cc842d9da Update POM 2026-03-18 07:32:56 +05:00
4 changed files with 26 additions and 9 deletions
+13 -1
View File
@@ -35,9 +35,21 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependency>
<!-- WEB без Tomcat -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Undertow вместо Tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@@ -163,7 +175,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version> <version>3.1.2</version>
<configuration> <configuration>
<systemPropertyVariables> <systemPropertyVariables>
<spring.config.location>file:org-ccalm-main.yml</spring.config.location> <spring.config.location>file:org-ccalm-main.yml</spring.config.location>
+10 -6
View File
@@ -154,7 +154,7 @@ public class AcceptJSON implements ServletContextAware {
} }
} }
if(lastDate==null) { if(lastDate==null) {
lastDate = LocalDate.parse("2025-07-16"); lastDate = LocalDate.parse("2026-01-01");
} }
//By number of day downloading data and write result of downloading to database, try or false, after repair need repeat download //By number of day downloading data and write result of downloading to database, try or false, after repair need repeat download
@@ -428,7 +428,7 @@ public class AcceptJSON implements ServletContextAware {
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/** /**
* Пример запроса: http://127.0.0.1:8081/AcceptJSON но в теле нужно поменять строку "Year y = Year.of(2024);" а также номер дня * Пример запроса: https://127.0.0.1:8081/AcceptJSON но в теле нужно поменять строку "Year y = Year.of(2024);" а также номер дня
* @param user * @param user
* @param model * @param model
* @param file * @param file
@@ -513,6 +513,10 @@ public class AcceptJSON implements ServletContextAware {
for (Object o : jsonArray) { for (Object o : jsonArray) {
JSONObject jsonObj = (JSONObject) o; JSONObject jsonObj = (JSONObject) o;
FrmLocustModel locust = new FrmLocustModel(); FrmLocustModel locust = new FrmLocustModel();
//locust.seq = obj.getLong("seq")*1000;
locust.country_id = "7"; //Russia
locust.country_uid = "d8509c7a-6d50-480c-bc2f-d3568c86059b"; //Russia
locust.company_uid = "2925b0a4-2bc5-4083-b3f1-9fddd909289e"; //ФГБУ "Россельхозцентр" locust.company_uid = "2925b0a4-2bc5-4083-b3f1-9fddd909289e"; //ФГБУ "Россельхозцентр"
try{ try{
@@ -1220,7 +1224,7 @@ public class AcceptJSON implements ServletContextAware {
} }
} }
if(lastDate==null) if(lastDate==null)
lastDate = LocalDate.parse("2025-02-11"); lastDate = LocalDate.parse("2026-01-01");
//By number of day downloading data and write result of downloading to database, try or false, after repair need repeat download //By number of day downloading data and write result of downloading to database, try or false, after repair need repeat download
while(lastDate.isBefore(LocalDate.now().minusDays(3))){ while(lastDate.isBefore(LocalDate.now().minusDays(3))){
@@ -1335,7 +1339,7 @@ public class AcceptJSON implements ServletContextAware {
result.uid = obj.getString("uuid"); result.uid = obj.getString("uuid");
result.eid = String.valueOf(obj.getInt("id")); //Internal identifier in the Uzbek database result.eid = String.valueOf(obj.getInt("id")); //Internal identifier in the Uzbek database
result.seq = obj.getLong("seq")*1000; //result.seq = obj.getLong("seq")*1000;
result.country_id = "10"; //Uzbekistan result.country_id = "10"; //Uzbekistan
result.country_uid = "05592f5a-1c8b-4d87-a47f-67697cc12c49"; //Uzbekistan result.country_uid = "05592f5a-1c8b-4d87-a47f-67697cc12c49"; //Uzbekistan
@@ -1579,7 +1583,7 @@ public class AcceptJSON implements ServletContextAware {
result.locust_type_id = "2"; result.locust_type_id = "2";
result.locust_type_uid = "8dd9e74f-d7ba-492a-8c75-7aed4f0847c6"; result.locust_type_uid = "8dd9e74f-d7ba-492a-8c75-7aed4f0847c6";
break; break;
case "LMI - Asian migratory locust", "LMI - азиатская перелетная саранча", "Азиаткая саранча": case "LMI - Asian migratory locust", "LMI - азиатская перелетная саранча", "Азиаткая саранча", "Азиатская саранча", "Мароккская саранча, Азиатская саранча":
result.locust_type_id = "3"; result.locust_type_id = "3";
result.locust_type_uid = "d61a5325-e8c7-497a-9cff-7ee4c4e1e37d"; result.locust_type_uid = "d61a5325-e8c7-497a-9cff-7ee4c4e1e37d";
break; break;
@@ -1591,7 +1595,7 @@ public class AcceptJSON implements ServletContextAware {
result.locust_type_id = "6"; result.locust_type_id = "6";
result.locust_type_uid = "4effd7bb-f19e-4a98-a724-691da12c163e"; result.locust_type_uid = "4effd7bb-f19e-4a98-a724-691da12c163e";
break; break;
case "Other", "Другое", "Другие саранчовые", "Другие саранчовые, Пустынная саранча", "Другие саранчовые, Атбасарка, Кузнечики", "Большая саксаульная горбатка, Мароккская саранча", "Большая саксаульная горбатка, Туранский прус", "Другие саранчовые, Туранский прус", "Пустынная саранча, Итальянский прус", "Кузнечики", "Другие саранчовые, Атбасарка", "Другие саранчовые, Итальянский прус", "Другие саранчовые, Мароккская саранча", "Большая саксаульная горбатка", "Пустынная саранча", "Атбасарка", "Туранский прус", "Другие саранчовые, Большая саксаульная горбатка", "Другие саранчовые, Итальянский прус, Мароккская саранча", "Другие саранчовые, Кузнечики", "Другие саранчовые, Итальянский прус, Кузнечики", "Другие саранчовые, Мароккская саранча, Атбасарка", "Другие саранчовые, Мароккская саранча, Азиаткая саранча": case "Other", "Другое", "Другие саранчовые", "Другие саранчовые, Пустынная саранча", "Другие саранчовые, Атбасарка, Кузнечики", "Большая саксаульная горбатка, Мароккская саранча", "Большая саксаульная горбатка, Туранский прус", "Другие саранчовые, Туранский прус", "Пустынная саранча, Итальянский прус", "Кузнечики", "Другие саранчовые, Атбасарка", "Другие саранчовые, Итальянский прус", "Другие саранчовые, Мароккская саранча", "Большая саксаульная горбатка", "Пустынная саранча", "Атбасарка", "Туранский прус", "Другие саранчовые, Большая саксаульная горбатка", "Другие саранчовые, Итальянский прус, Мароккская саранча", "Другие саранчовые, Кузнечики", "Другие саранчовые, Итальянский прус, Кузнечики", "Другие саранчовые, Мароккская саранча, Атбасарка", "Другие саранчовые, Мароккская саранча, Азиаткая саранча", "Другие саранчовые, Пустынная саранча, Итальянский" :
result.locust_type_id = "4"; result.locust_type_id = "4";
result.locust_type_uid = "bf79cae1-1e01-4e7f-8ec1-deb06936a58e"; result.locust_type_uid = "bf79cae1-1e01-4e7f-8ec1-deb06936a58e";
break; break;
@@ -125,9 +125,9 @@ public class EngineController implements ServletContextAware {
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper()); List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
for (int i = 0; i < ret.size(); i++) { for (int i = 0; i < ret.size(); i++) {
JSONObject obj = new JSONObject(ret.get(i)); JSONObject obj = new JSONObject(ret.get(i));
country_id=obj.getLong("country_id"); country_id=obj.getLong("country_id"); //TODO Проверить должно по идее country_uid везде использоваться...
} }
} catch( DataAccessException ex ) } catch( Exception ex )
{ {
logger.error(ex.getMessage()); logger.error(ex.getMessage());
} }
File diff suppressed because one or more lines are too long