Merge branch 'develop' into feature/JDK11
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:
@@ -66,7 +66,7 @@ public class OrdiniImporter extends BaseEntityImporter<List<EntityBase>> impleme
|
||||
OrdiniImportService ordiniImportService = getContextBean(OrdiniImportService.class);
|
||||
|
||||
for (DialogoJsonDTO dto: dialogoJsonDTO) {
|
||||
result.add(ordiniImportService.importOrdineDialogo(dto, type, format));
|
||||
result.add(ordiniImportService.importOrdineTuidi(dto, type, format));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class OrdiniImportService {
|
||||
private GeocodingService geocodingService;
|
||||
|
||||
|
||||
public EntityBase importOrdineDialogo(DialogoJsonDTO dialogoJsonDTO, String type, String format) throws Exception {
|
||||
public EntityBase importOrdineTuidi(DialogoJsonDTO dialogoJsonDTO, String type, String format) throws Exception {
|
||||
boolean isAcquisto = dialogoJsonDTO.getFornitore() != null;
|
||||
|
||||
String sql = (
|
||||
|
||||
@@ -38,6 +38,7 @@ import java.sql.ResultSet;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@@ -304,7 +305,7 @@ public class ImportListiniVenditaService {
|
||||
|
||||
public List<EntityBase> importListinoCarelli(String type, String format, ImportRequestDTO requestDTO, List<AnomalieDTO> anomalie, boolean headless) throws Exception {
|
||||
List<EntityBase> entityList = null;
|
||||
Date dataInizio = null, dataFine = null, localDate = new Date(), currentDataInizio = null, currentDataFine;
|
||||
LocalDate dataInizio = null, dataFine = null, currentDataInizio = null, currentDataFine;
|
||||
boolean areDatesEqual = true, isVolantino = format.equalsIgnoreCase(ListiniVenditaImporter.Format.VOLANTINI.toString());
|
||||
List<MtbLisvData> listMtbLisvData = new ArrayList<>();
|
||||
|
||||
@@ -338,14 +339,14 @@ public class ImportListiniVenditaService {
|
||||
String dataInizioString = dataInizioFine(true, row);
|
||||
String dataFineString = dataInizioFine(false, row);
|
||||
|
||||
SimpleDateFormat formatDate = new SimpleDateFormat("dd/MM/yyyy");
|
||||
String formatDate = "dd/MM/yyyy";
|
||||
|
||||
if (!dataInizioString.isEmpty()) {
|
||||
currentDataInizio = formatDate.parse(dataInizioString);
|
||||
currentDataInizio = UtilityString.parseLocalDate(dataInizioString, formatDate);
|
||||
|
||||
// Verifica che dataInizio sia maggiore di localDate
|
||||
if (currentDataInizio.compareTo(localDate) <= 0) {
|
||||
throw new Exception(String.format("La data di inizio è precedente o uguale alla data corrente. (Riga: %s)", row.getRowNum() + 1));
|
||||
if (currentDataInizio.isBefore(LocalDate.now()) ) {
|
||||
throw new Exception(String.format("La data di inizio è precedente. (Riga: %s)", row.getRowNum() + 1));
|
||||
}
|
||||
|
||||
// Controlla se la data di inizio è diversa dalla prima data
|
||||
@@ -361,7 +362,7 @@ public class ImportListiniVenditaService {
|
||||
}
|
||||
|
||||
if (!dataFineString.isEmpty()) {
|
||||
currentDataFine = formatDate.parse(dataFineString);
|
||||
currentDataFine = UtilityString.parseLocalDate(dataFineString, formatDate);
|
||||
|
||||
// Verifica che dataFine sia maggiore di dataInizio
|
||||
if (currentDataFine.compareTo(currentDataInizio) < 0) {
|
||||
@@ -387,7 +388,7 @@ public class ImportListiniVenditaService {
|
||||
"MAX_GG_PROMO"));
|
||||
|
||||
if (maxGiorni != 0) {
|
||||
int count = UtilityDate.DaysAfter(dataInizio, dataFine);
|
||||
long count = UtilityLocalDate.daysAfterDate(dataInizio, dataFine);
|
||||
if (count > maxGiorni) {
|
||||
throw new Exception(String.format("Differenza tra data inizio e data fine maggiore di: %s (Riga: %s)", maxGiorni, row.getRowNum() + 1));
|
||||
}
|
||||
@@ -406,8 +407,8 @@ public class ImportListiniVenditaService {
|
||||
riga.setPrzVendIva(prezzo);
|
||||
riga.setTipoVariazione("I");
|
||||
riga.setCodVlis(codVlis);
|
||||
riga.setDataIniz(dataInizio);
|
||||
riga.setDataFine(dataFine);
|
||||
riga.setDataIniz(UtilityLocalDate.localDateToDate(dataInizio));
|
||||
riga.setDataFine(UtilityLocalDate.localDateToDate(dataFine));
|
||||
if (isVolantino) {
|
||||
riga.setCodPromo(dataInizioString);
|
||||
riga.setDescrPromo("VOL " + dataInizioString +
|
||||
|
||||
@@ -533,7 +533,6 @@ public class SystemController {
|
||||
@RequestParam(value = "md5User", required = false) String md5User,
|
||||
@RequestBody(required = false) LoginRequestDTO loginRequestDTO) {
|
||||
try {
|
||||
logger.debug("Login: " + username);
|
||||
if (loginRequestDTO != null) {
|
||||
username = UtilityString.isNull(loginRequestDTO.getUsername(), username);
|
||||
password = UtilityString.isNull(loginRequestDTO.getPassword(), password);
|
||||
|
||||
Reference in New Issue
Block a user