Empty
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.4.13</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>org.ccalm</groupId>
|
||||
|
||||
@@ -116,7 +116,7 @@ public class AirTemperature implements ServletContextAware {
|
||||
|
||||
//Example request: http://ccalm.org/AirTemperature?date=20210531
|
||||
//Example request: http://127.0.0.1:8080/AirTemperature?date=20210531
|
||||
if(date==null || date.equals(""))
|
||||
if(date==null || date.isEmpty()))
|
||||
{
|
||||
//Если день не задан то ищем максимальный день не старше 10 дней и прибавляем 1 день
|
||||
String sql="select to_char(max(date)+'1 days'::interval, 'YYYYMMDD') from main.air_temperature_dates where hours=0 and date > now() - '10 days'::interval";
|
||||
@@ -132,7 +132,7 @@ public class AirTemperature implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(date==null || date.equals(""))
|
||||
if(date==null || date.isEmpty())
|
||||
{
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
date=dateFormat.format(new Date()); //Date like as "20170327".
|
||||
@@ -191,7 +191,7 @@ public class AirTemperature implements ServletContextAware {
|
||||
StringBuffer answer2=new StringBuffer(strPos2);
|
||||
Tools.CutBeforeFirst(answer2,":");
|
||||
String posEnd = Tools.CutBeforeFirst(answer2,":");
|
||||
if(posEnd==null || posEnd.equals("")) posEnd=""; else
|
||||
if(posEnd==null || posEnd.isEmpty()) posEnd=""; else
|
||||
{
|
||||
posEnd=String.valueOf(Long.parseLong(posEnd)-1);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class SoilTmperature implements ServletContextAware {
|
||||
} catch (SQLException ex) {
|
||||
logger.error("N3:"+ex.getMessage(),ex);
|
||||
}
|
||||
if(date==null || date.equals(""))
|
||||
if(date==null || date.isEmpty())
|
||||
{
|
||||
//Если день не задан то ищем максимальный день не старше 10 дней и прибавляем 1 день
|
||||
String sql="select to_char(max(date)+'1 days'::interval, 'YYYYMMDD') from main.soil_temperature_dates where hours=0 and date > now() - '10 days'::interval";
|
||||
@@ -152,7 +152,7 @@ public class SoilTmperature implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(date==null || date.equals(""))
|
||||
if(date==null || date.isEmpty())
|
||||
{
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
date=dateFormat.format(new Date()); //Date like as "20170327".
|
||||
@@ -216,7 +216,7 @@ public class SoilTmperature implements ServletContextAware {
|
||||
StringBuffer answer2=new StringBuffer(strPos2);
|
||||
Tools.CutBeforeFirst(answer2,":");
|
||||
String posEnd = Tools.CutBeforeFirst(answer2,":");
|
||||
if(posEnd==null || posEnd.equals("")) posEnd=""; else
|
||||
if(posEnd==null || posEnd.isEmpty()) posEnd=""; else
|
||||
{
|
||||
posEnd=String.valueOf(Long.parseLong(posEnd)-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user