Creata setup VARIETA_EDITABLE in previsioni raccolta pvm
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250529103927 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PVM", "PREVISIONI_RACCOLTA", "VARIETA_EDITABLE", "N",
|
||||
"Mostra o meno il campo varietà in fase di nuova produzione", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,6 +43,7 @@ public class UtilityLocalDate {
|
||||
public static boolean isAfterToday(LocalDate inputDate) {
|
||||
return inputDate != null && inputDate.isAfter(getNow());
|
||||
}
|
||||
|
||||
public static boolean isSameDay(LocalDateTime date1, LocalDateTime date2) {
|
||||
|
||||
if (date1 == null && date2 == null) {
|
||||
@@ -55,6 +56,7 @@ public class UtilityLocalDate {
|
||||
|
||||
return date1.toLocalDate().equals(date2.toLocalDate());
|
||||
}
|
||||
|
||||
public static boolean isSameDay(LocalDate date1, LocalDate date2) {
|
||||
if (date1 == null && date2 == null) {
|
||||
return true;
|
||||
@@ -72,9 +74,9 @@ public class UtilityLocalDate {
|
||||
}
|
||||
|
||||
public static LocalDate localDateFromDate(Date dateToConvert) {
|
||||
if(dateToConvert == null) return null;
|
||||
if (dateToConvert == null) return null;
|
||||
|
||||
if (dateToConvert instanceof java.sql.Date){
|
||||
if (dateToConvert instanceof java.sql.Date) {
|
||||
dateToConvert = new Date(dateToConvert.getTime());
|
||||
}
|
||||
return dateToConvert.toInstant()
|
||||
@@ -83,7 +85,7 @@ public class UtilityLocalDate {
|
||||
}
|
||||
|
||||
public static LocalDateTime localDateTimeFromDate(Date dateToConvert) {
|
||||
if(dateToConvert == null) return null;
|
||||
if (dateToConvert == null) return null;
|
||||
|
||||
return dateToConvert.toInstant()
|
||||
.atZone(currentZone)
|
||||
@@ -91,7 +93,7 @@ public class UtilityLocalDate {
|
||||
}
|
||||
|
||||
public static LocalDateTime localDateTimeFromLocalDate(LocalDate dateToConvert) {
|
||||
if(dateToConvert == null) return null;
|
||||
if (dateToConvert == null) return null;
|
||||
|
||||
return dateToConvert
|
||||
.atStartOfDay();
|
||||
@@ -121,7 +123,7 @@ public class UtilityLocalDate {
|
||||
}
|
||||
|
||||
public static Date localDateTimeToDate(LocalDateTime localDateTime) {
|
||||
if(localDateTime == null) return null;
|
||||
if (localDateTime == null) return null;
|
||||
|
||||
long seconds = localDateTimeToTime(localDateTime, null);
|
||||
return new Date(seconds * 1000);
|
||||
@@ -133,12 +135,14 @@ public class UtilityLocalDate {
|
||||
}
|
||||
|
||||
public static Date localDateToDate(LocalDate localDate) {
|
||||
if (localDate == null) return null;
|
||||
|
||||
// long seconds = localDateToTime(localDate);
|
||||
long seconds = localDate.atStartOfDay(currentZone).toEpochSecond();
|
||||
return new Date(seconds * 1000);
|
||||
}
|
||||
|
||||
public static long daysAfterDate (LocalDate dataIniz, LocalDate dataFine) {
|
||||
public static long daysAfterDate(LocalDate dataIniz, LocalDate dataFine) {
|
||||
return DAYS.between(dataIniz, dataFine);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user