Merge branch 'master' into feature/RefactoringGestioneColli
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-10-16 16:14:31 +02:00
6 changed files with 84 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
package it.integry.ems.adapter;
import it.integry.ems_model.utility.UtilityString;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class XmlLocalDateAdapter extends XmlAdapter<String, LocalDate> {
private DateTimeFormatter sdf;
public XmlLocalDateAdapter() {
sdf = DateTimeFormatter.ofPattern("dd-MM-yyyy");
}
public XmlLocalDateAdapter(String format) {
sdf = DateTimeFormatter.ofPattern(format);
}
@Override
public String marshal(LocalDate arg0) throws Exception {
return arg0.format(sdf);
}
@Override
public LocalDate unmarshal(String arg0) throws Exception {
String format = UtilityString.determineDateFormat(arg0);
if (format != null && !"dd-MM-yyyy".equals(format))
sdf = DateTimeFormatter.ofPattern(format);
return LocalDate.parse(arg0,sdf);
}
}

View File

@@ -0,0 +1,36 @@
package it.integry.ems.adapter;
import it.integry.ems_model.utility.UtilityString;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class XmlLocalDateTimeAdapter extends XmlAdapter<String, LocalDateTime> {
private DateTimeFormatter sdf;
public XmlLocalDateTimeAdapter() {
sdf = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss");
}
public XmlLocalDateTimeAdapter(String format) {
sdf = DateTimeFormatter.ofPattern(format);
}
@Override
public String marshal(LocalDateTime arg0) throws Exception {
return arg0.format(sdf);
}
@Override
public LocalDateTime unmarshal(String arg0) throws Exception {
String format = UtilityString.determineDateFormat(arg0);
if (format != null && !"dd-MM-yyyy HH:mm:ss".equals(format))
sdf = DateTimeFormatter.ofPattern(format);
return LocalDateTime.parse(arg0,sdf);
}
}

View File

@@ -494,10 +494,12 @@ public class ActivityService {
String activityId = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
long seconds = (long) (stbActivity.getOreRapportino().floatValue() * 60L * 60L);
long minuti = (long) (stbActivity.getOreRapportino().floatValue() * 60L);
if (stbActivity.getEffectiveTime() != null) {
stbActivity.setEffectiveEndtime(stbActivity.getEffectiveTime().plusSeconds(seconds));
stbActivity.setEffectiveEndtime(stbActivity.getEffectiveTime().plusMinutes(minuti));
} else {
stbActivity.setEffectiveTime(stbActivity.getEffectiveEndtime().minusMinutes(minuti));
}
if (UtilityString.isNullOrEmpty(activityId)) {

View File

@@ -1,18 +1,20 @@
package it.integry.ems.document.farm_mes.dto;
import it.integry.ems.adapter.XmlDateAdapter;
import it.integry.ems.adapter.XmlLocalDateTimeAdapter;
import javax.ejb.Local;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@XmlRootElement(name = "NOTE_PRODUTTIVE")
public class NoteProduttive {
private Date dataOrd;
private LocalDate dataNota;
private LocalDateTime dataNota;
int numOrd;
String gestione, note;
@@ -26,13 +28,13 @@ public class NoteProduttive {
this.dataOrd = dataOrd;
}
public LocalDate getDataNota() {
public LocalDateTime getDataNota() {
return dataNota;
}
@XmlElement(name = "DATA_NOTA")
@XmlJavaTypeAdapter(XmlDateAdapter.class)
public void setDataNota(LocalDate dataNota) {
@XmlJavaTypeAdapter(XmlLocalDateTimeAdapter.class)
public void setDataNota(LocalDateTime dataNota) {
this.dataNota = dataNota;
}

View File

@@ -853,7 +853,7 @@ public class FarmMesImportService {
ldt_dataOrd = noteProduttive.getDataOrd();
numOrd = noteProduttive.getNumOrd();
noteProd = noteProduttive.getNote();
dataNota = noteProduttive.getDataNota().atStartOfDay();
dataNota = noteProduttive.getDataNota();
// ACQUISIZIONE DATI ORDINE
sql =

View File

@@ -226,7 +226,7 @@ public class MmposServices {
} else if (!flagTrans.equalsIgnoreCase("CS") &&
"C".equals(flagTrans.substring(0, 1)) || "R".equals(flagTrans.substring(0, 1))) {
List<NtbDocr> ntbDocr;
if ( row.getFlTrans().equalsIgnoreCase("CX") && row.getOpTrans().equalsIgnoreCase("ST"))
if (row.getFlTrans().equalsIgnoreCase("CX") && row.getOpTrans().equalsIgnoreCase("ST"))
continue;
ntbDocr = getRow(row, multiDBTransactionManager.getPrimaryConnection(), impostaDatiOrdine, impostaKit, mmpos.getPrimaryConnection(), elencoPromozioni);
@@ -446,7 +446,7 @@ public class MmposServices {
}
ntbDocr.setPrzUntIva(przUnt);
boolean isStorno = false;
if (!UtilityString.isNullOrEmpty(row.getKeysRef()) && row.getParam1() != null) {
if (row.getParam1() != null) {
isStorno = true;
try {
if (Integer.parseInt(row.getParam1()) != 0) {
@@ -454,6 +454,7 @@ public class MmposServices {
BigDecimal valsco = row.getPrezzo().subtract(
row.getPrezzoNetto().divide(param1, 5, RoundingMode.HALF_UP).multiply(row.getQuantita()));
ntbDocr.setValSco(valsco);
} else {
ntbDocr.setValSco(BigDecimal.ZERO);
}