@ -136,7 +136,7 @@ public class AcceptJSON implements ServletContextAware {
ex . printStackTrace ( ) ;
}
StringBuilder sb = new StringBuilder ( ) ;
StringBuilder sb = new StringBuilder ( 1024 ) ;
try
{
String strURL = " http://91.185.13.233:98/get_fito " ;
@ -1422,8 +1422,9 @@ public class AcceptJSON implements ServletContextAware {
lastDate = LocalDate . parse ( obj . getString ( " date " ) ) ;
}
}
if ( lastDate = = null ) lastDate = LocalDate . parse ( " 2024-10-01 " ) ;
if ( lastDate = = null )
lastDate = LocalDate . parse ( " 2025-02-11 " ) ;
//lastDate = LocalDate.parse("2024-10-01");
//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 ) ) ) {
@ -2322,7 +2323,6 @@ public class AcceptJSON implements ServletContextAware {
}
}
} catch ( CustomException e ) {
if ( e . isSaveToLog ( ) ) {
String uuid = UUID . randomUUID ( ) . toString ( ) ;
@ -2382,61 +2382,61 @@ public class AcceptJSON implements ServletContextAware {
result . country_id = " 10 " ; //Uzbekistan
result . country_uid = " 05592f5a-1c8b-4d87-a47f-67697cc12c49 " ; //Uzbekistan
if ( ! obj . isNull ( " region_name " ) ) {
switch ( obj . optString ( " region_name " , null ) ) {
case " Sirdaryo viloyati " :
if ( ! obj . isNull ( " region_name " ) & & ! obj . optString ( " region_name " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " region_name " , null ) . trim ( ) ) {
case " Sirdaryo viloyati " , " Сырдарьинская область " :
result . region_id = " 31 " ;
result . region_uid = " 8f4f586f-6159-4fbf-a627-2c8d637abb5e " ;
break ;
case " Toshkent shahri " :
case " Toshkent shahri " , " Город Ташкент " :
result . region_id = " 156 " ;
result . region_uid = " 1ed7b6f3-47a8-4128-ae0a-c160f5c3af08 " ;
break ;
case " Toshkent viloyati " :
case " Toshkent viloyati " , " Ташкентская область " :
result . region_id = " 157 " ;
result . region_uid = " c8fccdc4-256a-4699-ab09-16c51351bf28 " ;
break ;
case " Surxondaryo viloyati " :
case " Surxondaryo viloyati " , " Сурхандарьинская область " :
result . region_id = " 30 " ;
result . region_uid = " 369c296d-5ff5-4570-88ad-0e94ccf9cb7c " ;
break ;
case " Jizzax viloyati " :
case " Jizzax viloyati " , " Джизакская область " :
result . region_id = " 25 " ;
result . region_uid = " a7185680-7afc-47f1-954e-3d0f8b296592 " ;
break ;
case " Республики Каракалпакстан " :
case " Qoraqalpog‘ iston Respublikasi " , " Республики Каракалпакстан" :
result . region_id = " 22 " ;
result . region_uid = " 421ce759-b571-454e-b390-a73bee9b8b2c " ;
break ;
case " Xorazm viloyati " :
case " Xorazm viloyati " , " Хорезмская область " :
result . region_id = " 34 " ;
result . region_uid = " 8bc74ac4-ce06-4317-9982-b1492c72edb7 " ;
break ;
case " Andijon viloyati " :
case " Andijon viloyati " , " Андижанская область " :
result . region_id = " 23 " ;
result . region_uid = " a045faa8-eb12-40db-be30-be6e41e59bb2 " ;
break ;
case " Fargʻ ona viloyati " :
case " Fargʻ ona viloyati " , " Ферганская область " :
result . region_id = " 33 " ;
result . region_uid = " e97ac81d-dab5-4496-9e0f-0c5508972539 " ;
break ;
case " Namangan viloyati " :
case " Namangan viloyati " , " Наманганская область " :
result . region_id = " 28 " ;
result . region_uid = " e931af2e-0035-4149-b3b9-00895e4e1453 " ;
break ;
case " Buxoro viloyati " :
case " Buxoro viloyati " , " Бухарская область " :
result . region_id = " 24 " ;
result . region_uid = " 0caf3854-48ad-40ed-9602-302c28b1a5b8 " ;
break ;
case " Navoiy viloyati " :
case " Navoiy viloyati " , " Навоийская область " :
result . region_id = " 27 " ;
result . region_uid = " ef244a76-8e7c-4e16-ad80-058b740fa6ca " ;
break ;
case " Qashqadaryo viloyati " :
case " Qashqadaryo viloyati " , " Кашкадарьинская область " :
result . region_id = " 158 " ;
result . region_uid = " cf9a0a6e-18fa-41a0-bd9d-39c5fd1260c1 " ;
break ;
case " Samarqand viloyati " :
case " Samarqand viloyati " , " Самаркандская область " :
result . region_id = " 29 " ;
result . region_uid = " 2a6adb56-19a7-4f28-9a00-87559db91db9 " ;
break ;
@ -2455,8 +2455,8 @@ public class AcceptJSON implements ServletContextAware {
}
//Биотоп
if ( ! obj . isNull ( " biotope_type " ) ) {
switch ( obj . optString ( " biotope_type " , null ) ) {
if ( ! obj . isNull ( " biotope_type " ) & & ! obj . optString ( " biotope_type " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " biotope_type " , null ) . trim ( ) ) {
case " CIT степь " , " CIT steppe " :
result . bio_biotope_id = " 1 " ;
result . bio_biotope_uid = " e6fa860a-ca2f-4cd7-8cfc-b97d86d2cd2d " ;
@ -2517,35 +2517,35 @@ public class AcceptJSON implements ServletContextAware {
result . bio_biotope_id = " 17 " ;
result . bio_biotope_uid = " c82f2609-b50a-4ca4-babc-ae3426f22b81 " ;
break ;
case " Другое " , " Other locust " :
case " Other locust " , " Другое " , " DAL большая саксоулная горбатка в саксаулах " , " Другие саранчовые " :
result . bio_biotope_id = " 18 " ;
result . bio_biotope_uid = " e99a8868-2582-41e8-9c01-bef5fca8f0d1 " ;
break ;
default :
throw new CustomException ( 10000 , " Not find biotopee: " + obj . optString ( " biotope_type " , null ) , null , true ) ;
throw new CustomException ( 10000 , " Not find biotope_typ e: " + obj . optString ( " biotope_type " , null ) , null , true ) ;
}
}
//растительность
if ( ! obj . isNull ( " vegetation " ) ) {
switch ( obj . optString ( " vegetation " , null ) ) {
case " Plant absent " :
if ( ! obj . isNull ( " vegetation " ) & & ! obj . optString ( " vegetation " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " vegetation " , null ) . trim ( ) ) {
case " Plant absent " , " Растения отсутствуют " , " Отсутствует " :
result . bio_greenery_id = " 8 " ;
result . bio_greenery_uid = " 5621f2f2-56e8-486f-abc0-7eba996b6724 " ;
break ;
case " Plant dry " :
case " Plant dry " , " Засохшие трава " , " Высохшая трава " :
result . bio_greenery_id = " 7 " ;
result . bio_greenery_uid = " 04ba0a4a-0557-490f-a08b-0db51a83cf7c " ;
break ;
case " Желтеющая трава " : //Plant drying
case " Plant drying " , " Желтеющая трава" :
result . bio_greenery_id = " 6 " ;
result . bio_greenery_uid = " 99381409-ad1a-4ac8-95df-415ccb1334e1 " ;
break ;
case " Plant green " :
case " Plant green " , " Свежая проросщая трава " , " Зелёная трава " :
result . bio_greenery_id = " 5 " ;
result . bio_greenery_uid = " 8fab82b8-8924-458d-b3f1-90a18ed75f9b " ;
break ;
case " Plant greening " :
case " Plant greening " , " Всходы зеленых трав " :
result . bio_greenery_id = " 4 " ;
result . bio_greenery_uid = " 682993e1-3e5b-4aa0-9f11-c2a30a9c5908 " ;
break ;
@ -2555,21 +2555,21 @@ public class AcceptJSON implements ServletContextAware {
}
//Густота растительного покрова
if ( ! obj . isNull ( " vegetation_cover " ) ) {
switch ( obj . optString ( " vegetation_cover " , null ) ) {
case " Sparse " : //Sparse
if ( ! obj . isNull ( " vegetation_cover " ) & & ! obj . optString ( " vegetation_cover " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " vegetation_cover " , null ) . trim ( ) ) {
case " Sparse " , " Редкая " : //Sparse
result . bio_greenery_cover_id = " 8 " ;
result . bio_greenery_cover_uid = " c70a145b-cfe4-4ad9-9ef8-814c9e3a1fac " ;
break ;
case " Medium " : //Medium
case " Medium " , " Средняя " : //Medium
result . bio_greenery_cover_id = " 9 " ;
result . bio_greenery_cover_uid = " d66bdde4-72a7-497f-b5e8-3174aebd7165 " ;
break ;
case " Густая " : //Dense
case " Dense " , " Густая" : //Dense
result . bio_greenery_cover_id = " 10 " ;
result . bio_greenery_cover_uid = " 4c12085b-4f42-4ba2-9236-465d5c5d0690 " ;
break ;
case " Absent " : //Absent
case " Absent " , " Отсутствует " : //Absent
result . bio_greenery_cover_id = " 0 " ;
result . bio_greenery_cover_uid = " f712fe9a-2e42-44b9-b3dc-a7a1dc4767e8 " ;
break ;
@ -2579,22 +2579,37 @@ public class AcceptJSON implements ServletContextAware {
}
result . bio_temperature = obj . optString ( " air_temperature " , null ) ;
if ( result . bio_temperature . isEmpty ( ) ) result . bio_temperature = null ;
if ( result . bio_temperature ! = null & & result . bio_temperature . isEmpty ( ) ) result . bio_temperature = null ;
result . bio_wind = obj . optString ( " wind_speed " , null ) ;
if ( result . bio_wind . isEmpty ( ) ) result . bio_wind = null ;
if ( result . bio_wind ! = null & & result . bio_wind . isEmpty ( ) ) result . bio_wind = null ;
//Вид саранчи
if ( ! obj . isNull ( " subject_name " ) ) {
switch ( obj . optString ( " subject_name " , null ) . replace ( " ' " , " " ) ) {
case " Мароккская саранча " :
result . locust_type_id = " 2 " ;
break ;
case " Итальянский прус " :
if ( ! obj . isNull ( " subject_name " ) & & ! obj . optString ( " subject_name " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " subject_name " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " CIT - Italian locust " , " CIT - итальянский прус " , " Итальянский прус " , " Итальянский прус, Кузнечики " :
result . locust_type_id = " 1 " ;
result . locust_type_uid = " 688e484b-babd-4a48-b318-be85e40682b0 " ;
break ;
case " Азиатская саранча " :
case " DMA - Moroccan locust " , " DMA - мароккская саранча " , " Мароккская саранча " , " Мароккская саранча, Азиаткая саранча " , " Мароккская саранча, Атбасарка " , " Мароккская саранча, Туранский прус " , " Мароккская саранча, Кузнечики " :
result . locust_type_id = " 2 " ;
result . locust_type_uid = " 8dd9e74f-d7ba-492a-8c75-7aed4f0847c6 " ;
break ;
case " LMI - Asian migratory locust " , " LMI - азиатская перелетная саранча " , " Азиаткая саранча " :
result . locust_type_id = " 3 " ;
result . locust_type_uid = " d61a5325-e8c7-497a-9cff-7ee4c4e1e37d " ;
break ;
case " CIT & DMA " , " Пустынная саранча, Мароккская саранча " , " Итальянский прус, Мароккская саранча, Атбасарка, Кузнечики " , " Итальянский прус, Мароккская саранча, Туранский прус " , " Итальянский прус, Мароккская саранча, Кузнечики " :
result . locust_type_id = " 5 " ;
result . locust_type_uid = " a85e8007-2303-4797-9f74-6cdc07da553f " ;
break ;
case " CIT & LMI " , " Пустынная саранча, Итальянский прус, Мароккская саранча " , " Итальянский прус, Мароккская саранча " :
result . locust_type_id = " 6 " ;
result . locust_type_uid = " 4effd7bb-f19e-4a98-a724-691da12c163e " ;
break ;
case " Other " , " Другое " , " Другие саранчовые " , " Другие саранчовые, Пустынная саранча " , " Другие саранчовые, Атбасарка, Кузнечики " , " Большая саксаульная горбатка, Мароккская саранча " , " Большая саксаульная горбатка, Туранский прус " , " Другие саранчовые, Туранский прус " , " Пустынная саранча, Итальянский прус " , " Кузнечики " , " Другие саранчовые, Атбасарка " , " Другие саранчовые, Итальянский прус " , " Другие саранчовые, Мароккская саранча " , " Большая саксаульная горбатка " , " Пустынная саранча " , " Атбасарка " , " Туранский прус " , " Другие саранчовые, Большая саксаульная горбатка " , " Другие саранчовые, Итальянский прус, Мароккская саранча " , " Другие саранчовые, Кузнечики " , " Другие саранчовые, Итальянский прус, Кузнечики " , " Другие саранчовые, Мароккская саранча, Атбасарка " , " Другие саранчовые, Мароккская саранча, Азиаткая саранча " :
result . locust_type_id = " 4 " ;
result . locust_type_uid = " bf79cae1-1e01-4e7f-8ec1-deb06936a58e " ;
break ;
default :
throw new CustomException ( 10000 , " Not find subject_name: " + obj . optString ( " subject_name " , null ) , null , true ) ;
@ -2609,25 +2624,25 @@ public class AcceptJSON implements ServletContextAware {
result . eggs_capsules_density_to = obj . optString ( " eggs_pods_density_to_m2 " , null ) ;
result . eggs_capsules = obj . optString ( " eggs_average_number_egg_pod " , null ) ;
result . eggs_live = obj . optString ( " eggs_viable " , null ) ;
if ( ! obj . isNull ( " eggs_natural_enemies " ) ) {
switch ( obj . optString ( " eggs_natural_enemies " , null ) . replace ( " ' " , " " ) ) {
case " not " , " Нет " :
if ( ! obj . isNull ( " eggs_natural_enemies " ) & & ! obj . optString ( " eggs_natural_enemies " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " eggs_natural_enemies " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " not " , " Нет " , " Нет, Грибные заболевание " :
result . eggs_enemies_id = " 5 " ;
result . eggs_enemies_uid = " 52580c53-3d13-4b93-b84e-fcf9cbd50e01 " ;
break ;
case " Other " , " Другое " :
case " Other " , " Другое " , " Другое, Нет " , " Другое, Личинки мух, Личинки жуков " , " Другое, Личинки мух " , " Другое, Естественные враги 2 ru " :
result . eggs_enemies_id = " 4 " ;
result . eggs_enemies_uid = " d13c793f-f65e-4a34-9307-940289cd4265 " ;
break ;
case " Larvae of beetles " , " Личинки жуков " :
case " Larvae of beetles " , " Личинки жуков " , " Другое, Личинки жуков " , " Личинки жуков, Нет " :
result . eggs_enemies_id = " 3 " ;
result . eggs_enemies_uid = " 76cf72d8-8ac5-44de-98f3-a7221d2c7985 " ;
break ;
case " Larvae of flies " , " Личинки мух " :
case " Larvae of flies " , " Личинки мух " , " Личинки мух, Личинки жуков " :
result . eggs_enemies_id = " 2 " ;
result . eggs_enemies_uid = " e2e573a3-9859-46f9-99e6-f97d7fc37ea2 " ;
break ;
case " Fungal diseases " , " Грибные заболевания " :
case " Fungal diseases " , " Грибные заболевания " , " Грибные заболевание " :
result . eggs_enemies_id = " 1 " ;
result . eggs_enemies_uid = " d0cf06f4-6e1f-4da2-b836-45dfdef5da98 " ;
break ;
@ -2637,9 +2652,9 @@ public class AcceptJSON implements ServletContextAware {
}
result . larva_born = null ; // not used
if ( ! obj . isNull ( " hoppers_hatching " ) ) {
switch ( obj . optString ( " hoppers_hatching " , null ) . replace ( " ' " , " " ) ) {
case " Beginning " , " Начало " :
if ( ! obj . isNull ( " hoppers_hatching " ) & & ! obj . optString ( " hoppers_hatching " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " hoppers_hatching " , null ) . replace ( " ' " , " " ) . trim ( ) . trim ( ) ) {
case " Beginning " , " Начало " :
result . larva_born_id = " 1 " ;
result . larva_born_uid = " 392db9f2-bfaa-44e0-8ca3-bb3cf1ff937a " ;
break ;
@ -2653,8 +2668,8 @@ public class AcceptJSON implements ServletContextAware {
}
//Hopper stages
if ( ! obj . isNull ( " hoppers_stages " ) ) {
switch ( obj . optString ( " hoppers_stages " , null ) . replace ( " ' " , " " ) ) {
/*if(!obj.isNull("hoppers_appearance") && !obj.optString("hoppers_appearance","").isBlank()){
switch (obj.optString("hoppers_appearance",null).replace("'", "").trim()) {
case "Early","Младшие":
result.larva_age_id="1";
result.larva_age_uid="becdbc31-094e-48bb-aef0-93f88abff12d";
@ -2676,13 +2691,13 @@ public class AcceptJSON implements ServletContextAware {
result.larva_age_uid="5acd65b3-e32f-4984-83ad-dfba2b7f0205";
break;
default:
throw new CustomException( 10000 , " Not find hoppers_hatching: " + obj . optString ( " hoppers_hatching " , null ) , null , true ) ;
}
throw new CustomException(10000, "Not find hoppers_appearance: " + obj.optString("hoppers_appearance",null),null,true);
}
}*/
//Appearance
if ( ! obj . isNull ( " hoppers_appearance " ) ) {
switch ( obj . optString ( " hoppers_appearance " , null ) . replace ( " ' " , " " ) ) {
if ( ! obj . isNull ( " hoppers_stages " ) & & ! obj . optString ( " hoppers_stages " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " hoppers_stages " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Solitary " , " Одиночная " :
result . larva_age_id = " 1 " ;
result . larva_age_uid = " 30fa1f49-166e-4a17-9cd8-d611b36844f8 " ;
@ -2696,13 +2711,13 @@ public class AcceptJSON implements ServletContextAware {
result . larva_age_uid = " 683cdba3-2f4c-4e61-b667-936c524136b4 " ;
break ;
default :
throw new CustomException ( 10000 , " Not find hoppers_hatching : " + obj . optString ( " hoppers_hatching " , null ) , null , true ) ;
throw new CustomException ( 10000 , " Not find hoppers_stages : " + obj . optString ( " hoppers_stages " , null ) , null , true ) ;
}
}
//Spatial distribution
if ( ! obj . isNull ( " hoppers_spatial_distribution " ) ) {
switch ( obj . optString ( " hoppers_spatial_distribution " , null ) . replace ( " ' " , " " ) ) {
if ( ! obj . isNull ( " hoppers_spatial_distribution " ) & & ! obj . optString ( " hoppers_spatial_distribution " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " hoppers_spatial_distribution " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Isolated " , " Одиночные " :
result . larva_behavior_id = " 1 " ;
result . larva_behavior_uid = " 64a7a8f5-b44d-4fd7-b78c-3c0837f57b99 " ;
@ -2726,9 +2741,9 @@ public class AcceptJSON implements ServletContextAware {
result . kuliguli_density_to = obj . optString ( " bands_density_to_m2 " , null ) ;
result . kuliguli_size = obj . optString ( " bands_sizes_m2 " , null ) ;
result . kuliguli_count = obj . optString ( " bands_number_in_ha " , null ) ;
if ( ! obj . isNull ( " bands_behaviour " ) ) {
switch ( obj . optString ( " bands_behaviour " , null ) . replace ( " ' " , " " ) ) {
case " Marching " , " Миграция " :
if ( ! obj . isNull ( " bands_behaviour " ) & & ! obj . optString ( " bands_behaviour " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " bands_behaviour " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Marching " , " Миграция " , " Миргация " :
result . kuliguli_action_id = " 1 " ;
result . kuliguli_action_uid = " 4399f28c-b1ed-44f6-8af5-351cd944d408 " ;
break ;
@ -2740,7 +2755,7 @@ public class AcceptJSON implements ServletContextAware {
result . kuliguli_action_id = " 3 " ;
result . kuliguli_action_uid = " 0fca9acd-9447-4653-9ca7-7dcac7cb495e " ;
break ;
case " Stupor " , " Оцепенение " :
case " Stupor " , " Оцепенение " , " Оцепененине " :
result . kuliguli_action_id = " 4 " ;
result . kuliguli_action_uid = " 63bb9eba-c4ad-4e2d-a1cd-ada1695abac5 " ;
break ;
@ -2752,8 +2767,8 @@ public class AcceptJSON implements ServletContextAware {
throw new CustomException ( 10000 , " Not find bands_behaviour: " + obj . optString ( " bands_behaviour " , null ) , null , true ) ;
}
}
if ( ! obj . isNull ( " bands_stages " ) ) {
switch ( obj . optString( " bands_stages" , null ) . replace ( " ' " , " " ) ) {
/*if(!obj.isNull("bands_stages") && !obj.optString("bands_stages","").isBlank()){
switch (obj. optString(" bands_stages",null).replace("'", "").trim()) {
case "Early","Младшие":
result.kuliguli_age_id="1";
result.kuliguli_age_uid="becdbc31-094e-48bb-aef0-93f88abff12d";
@ -2775,39 +2790,11 @@ public class AcceptJSON implements ServletContextAware {
result.kuliguli_age_uid="5acd65b3-e32f-4984-83ad-dfba2b7f0205";
break;
default:
throw new CustomException( 10000 , " Not find bands_behaviour: " + obj . optString ( " bands_behaviour " , null ) , null , true ) ;
throw new CustomException(10000, "Not find bands_stages: " + obj.optString("bands_stages",null),null,true);
}
}
//Adults (Имаго)
if ( ! obj . isNull ( " adults_fledging " ) ) {
switch ( obj . optString ( " adults_fledging " , null ) . replace ( " ' " , " " ) ) {
case " Beginning " , " Начало " :
result . imago_wing_id = " 7 " ;
result . imago_wing_uid = " 312bf2ac-dbdb-40be-b716-7f02f751a65e " ;
break ;
case " Mass " , " Массовое " :
result . imago_wing_id = " 6 " ;
result . imago_wing_uid = " 97d5a02c-c3ed-4627-ae14-4f92d6eb2945 " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_fledging: " + obj . optString ( " adults_fledging " , null ) , null , true ) ;
}
}
if ( ! obj . isNull ( " adults_maturity " ) ) { //Половозрелость (да, нет)
switch ( obj . optString ( " adults_maturity " , null ) . toLowerCase ( ) . replace ( " ' " , " " ) ) {
case " yes " , " да " :
result . imago_maturity = " true " ;
break ;
case " no " , " нет " :
result . imago_maturity = " false " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_maturity: " + obj . optString ( " adults_maturity " , null ) , null , true ) ;
}
}
if ( ! obj . isNull ( " bands_stages " ) ) { // Bands stages
switch ( obj . optString ( " bands_stages " , null ) . replace ( " ' " , " " ) ) {
}*/
if ( ! obj . isNull ( " bands_stages " ) & & ! obj . optString ( " bands_stages " , " " ) . isBlank ( ) ) { // Bands stages
switch ( obj . optString ( " bands_stages " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Solitary " , " Стадная " :
result . imago_phase_id = " 4 " ;
result . imago_phase_uid = " a1325ab8-15f5-406a-be8d-d6ba78b18d11 " ;
@ -2825,8 +2812,31 @@ public class AcceptJSON implements ServletContextAware {
}
}
if ( ! obj . isNull ( " adults_spatial_distribution " ) ) { // Bands stages
switch ( obj . optString ( " adults_spatial_distribution " , null ) . replace ( " ' " , " " ) ) {
//Adults (Имаго)
if ( ! obj . isNull ( " adults_fledging " ) & & ! obj . optString ( " adults_fledging " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " adults_fledging " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Beginning " , " Начало " :
result . imago_wing_id = " 7 " ;
result . imago_wing_uid = " 312bf2ac-dbdb-40be-b716-7f02f751a65e " ;
break ;
case " Mass " , " Массовое " :
result . imago_wing_id = " 6 " ;
result . imago_wing_uid = " 97d5a02c-c3ed-4627-ae14-4f92d6eb2945 " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_fledging: " + obj . optString ( " adults_fledging " , null ) , null , true ) ;
}
}
if ( ! obj . isNull ( " adults_maturity " ) & & ! obj . optString ( " adults_maturity " , " " ) . isBlank ( ) ) { //Половозрелость (да, нет)
if ( obj . getBoolean ( " adults_maturity " ) )
result . imago_maturity = " true " ;
else
result . imago_maturity = " false " ;
}
if ( ! obj . isNull ( " adults_spatial_distribution " ) & & ! obj . optString ( " adults_spatial_distribution " , " " ) . isBlank ( ) ) { // Bands stages
switch ( obj . optString ( " adults_spatial_distribution " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Isolated " , " Одиночные " :
result . imago_action_id = " 1 " ;
result . imago_action_uid = " c0b25ce8-7454-459a-9a54-b459eea1573a " ;
@ -2845,55 +2855,34 @@ public class AcceptJSON implements ServletContextAware {
}
result . imago_density = obj . optString ( " adults_density_m2 " , null ) ;
result . imago_density_ga = obj . optString ( " adults_density_ha " , null ) ;
if ( ! obj . isNull ( " adults_roosting " ) ) { //Половозрелость (да, нет)
switch ( obj . optString ( " adults_roosting " , null ) . toLowerCase ( ) . replace ( " ' " , " " ) ) {
case " yes " , " да " :
if ( ! obj . isNull ( " adults_roosting " ) & & ! obj . optString ( " adults_roosting " , " " ) . isBlank ( ) ) { //Половозрелость (да, нет)
if ( obj . getBoolean ( " adults_roosting " ) )
result . imago_feeding = " true " ;
break ;
case " no " , " нет " :
else
result . imago_feeding = " false " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_roosting: " + obj . optString ( " adults_roosting " , null ) , null , true ) ;
}
if ( ! obj . isNull ( " adults_copulation " ) & & ! obj . optString ( " adults_copulation " , " " ) . isBlank ( ) ) { // Спаривание
if ( obj . getBoolean ( " adults_copulation " ) ) {
result . imago_copulation = " true " ;
} else {
result . imago_copulation = " false " ;
}
}
if ( ! obj . isNull ( " adults_copulation " ) ) { // Спаривание
switch ( obj . optString ( " adults_copulation " , null ) . toLowerCase ( ) . replace ( " ' " , " " ) ) {
case " yes " , " да " :
result . imago_copulation = " true " ;
break ;
case " no " , " нет " :
result . imago_copulation = " false " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_copulation: " + obj . optString ( " adults_copulation " , null ) , null , true ) ;
}
}
//result.imago_laying = obj.optString("adults_laying",null);
if ( ! obj . isNull ( " adults_laying " ) ) { // Яйцекладка
switch ( obj . optString ( " adults_laying " , null ) . toLowerCase ( ) . replace ( " ' " , " " ) ) {
case " yes " , " да " :
if ( ! obj . isNull ( " adults_laying " ) & & ! obj . optString ( " adults_laying " , " " ) . isBlank ( ) ) { // Яйцекладка
if ( obj . getBoolean ( " adults_laying " ) ) {
result . imago_laying = " true " ;
break ;
case " no " , " нет " :
} else {
result . imago_laying = " false " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_laying: " + obj . optString ( " adults_laying " , null ) , null , true ) ;
}
}
//result.imago_flying = obj.optString("adults_flying",null);
if ( ! obj . isNull ( " adults_flying " ) ) { // Полёты
switch ( obj . optString ( " adults_flying " , null ) . toLowerCase ( ) . replace ( " ' " , " " ) ) {
case " yes " , " да " :
if ( ! obj . isNull ( " adults_flying " ) & & ! obj . optString ( " adults_flying " , " " ) . isBlank ( ) ) { // Полёты
if ( obj . getBoolean ( " adults_flying " ) ) {
result . imago_flying = " true " ;
break ;
case " no " , " нет " :
} else {
result . imago_flying = " false " ;
break ;
default :
throw new CustomException ( 10000 , " Not find adults_flying: " + obj . optString ( " adults_flying " , null ) , null , true ) ;
}
}
@ -2904,8 +2893,8 @@ public class AcceptJSON implements ServletContextAware {
//result.swarm_copulation = obj.optString("",null); // boolean,
//result.swarm_laying = obj.optString("",null); // boolean,
result . swarm_flying_direction_id = obj . optString ( " swarms_flying_direction " , null ) ; // integer,
if ( ! obj . isNull ( " swarms_height " ) ) {
switch ( obj . optString ( " swarms_height " , null ) . replace ( " ' " , " " ) ) {
if ( ! obj . isNull ( " swarms_height " ) & & ! obj . optString ( " swarms_height " , " " ) . isBlank ( ) ) {
switch ( obj . optString ( " swarms_height " , null ) . replace ( " ' " , " " ) . trim ( ) ) {
case " Low height " , " Низкая " :
result . swarm_height_id = " 1 " ;
result . swarm_height_uid = " 0d60a2d7-d732-4199-b966-bd72870a07cc " ;