Merge remote-tracking branch 'origin/develop' into develop
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,26 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20241105102316 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Salpar_VgAlimenti))
|
||||
return;
|
||||
|
||||
executeStatement("update vtb_dest set flag_stampa_prezzi = 'S' where flag_stampa_prezzi = 'N'");
|
||||
executeStatement("update vtb_clie set flag_stampa_prezzi = 'S' where flag_stampa_prezzi = 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -477,4 +477,24 @@ public class OrderRules extends QueryRules {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void setCodVvetIdViaggio(Connection conn, DtbOrdt dtbOrdt) throws SQLException {
|
||||
if ( dtbOrdt.getDtbOrdr() != null && dtbOrdt.getDtbOrdr().size() > 0 ){
|
||||
List<String> listaIdViaggio = dtbOrdt.getDtbOrdr().stream()
|
||||
.filter(x->x.getIdViaggio() != null)
|
||||
.map(
|
||||
DtbOrdr::getIdViaggio
|
||||
).distinct().collect(Collectors.toList());
|
||||
|
||||
String sql =
|
||||
String.format(
|
||||
"SELECT TOP 1 cod_vvet FROM vtb_viaggi WHERE id_viaggio in (%s) ORDER BY data_ora_iniz_trasp DESC",
|
||||
UtilityDB.listValueToString(listaIdViaggio));
|
||||
|
||||
String codVvet = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
if ( !UtilityString.isNullOrEmpty(codVvet)){
|
||||
dtbOrdt.setCodVvet(codVvet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,9 @@ then
|
||||
}
|
||||
CommonRules.completePosRigaEntity(conn, $testata);
|
||||
OrdWebRules.completeIdArtOrd(conn, $testata);
|
||||
if ($testata.getGestione().equalsIgnoreCase("V")) {
|
||||
OrderRules.setCodVvetIdViaggio(conn, $testata);
|
||||
}
|
||||
if ($testata.getExecuteRecalc() ) {
|
||||
DocOrdCalTotaliRules.calcTotali(conn, $testata);
|
||||
OrderRules.sospendiOrdine(conn, $testata);
|
||||
|
||||
@@ -694,24 +694,28 @@ public class SteUPService {
|
||||
} else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) {
|
||||
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep, codJfas, activityTypeId, null, dataCreation, true, barcodes);
|
||||
if (repartiFreschi != null && repartiFreschi.contains(codJfas)) {
|
||||
List<String> finalBarcodes = barcodes;
|
||||
barcodes = new ArrayList<>();
|
||||
if ( barcodes != null && barcodes.size() > 0 ) {
|
||||
List<String> finalBarcodes = barcodes;
|
||||
barcodes = new ArrayList<>();
|
||||
|
||||
Map<String, List<HashMap<String, Object>>> pluByCodMarts = pluRepo.stream()
|
||||
.collect(groupingBy(x -> x.get("cod_mart").toString()));
|
||||
Map<String, List<HashMap<String, Object>>> pluByCodMarts = pluRepo.stream()
|
||||
.collect(groupingBy(x -> x.get("cod_mart").toString()));
|
||||
|
||||
for (Map.Entry<String, List<HashMap<String, Object>>> entry : pluByCodMarts.entrySet()) {
|
||||
List<HashMap<String, Object>> hashMapList = entry.getValue();
|
||||
String codMart = entry.getKey();
|
||||
System.out.println(codMart);
|
||||
for (Map.Entry<String, List<HashMap<String, Object>>> entry : pluByCodMarts.entrySet()) {
|
||||
List<HashMap<String, Object>> hashMapList = entry.getValue();
|
||||
String codMart = entry.getKey();
|
||||
logger.info("Articolo: " + codMart);
|
||||
|
||||
boolean containBarcode = hashMapList.stream().anyMatch(x -> finalBarcodes.contains(((String) x.get("barcode"))));
|
||||
boolean containBarcode = hashMapList.stream().anyMatch(x -> finalBarcodes.contains(((String) x.get("barcode"))));
|
||||
|
||||
if (!containBarcode) {
|
||||
java.util.stream.Stream<HashMap<String, Object>> barcode = hashMapList.stream().filter(x -> x.get("barcode") != null);
|
||||
if (barcode.count() > 0)
|
||||
barcodes.add(barcode.findFirst().map(x -> x.get("barcode").toString()).get());
|
||||
if (!containBarcode) {
|
||||
java.util.stream.Stream<HashMap<String, Object>> barcode = hashMapList.stream().filter(x -> x.get("barcode") != null);
|
||||
if (barcode.count() > 0)
|
||||
barcodes.add(barcode.findFirst().map(x -> x.get("barcode").toString()).get());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
barcodes.addAll(pluRepo.stream().filter(x -> x.get("barcode") != null).map(x->x.get("barcode").toString()).collect(Collectors.toList()));
|
||||
}
|
||||
// barcodes = pluRepo.stream().filter(a-> !finalBarcodes.contains(((String) a.get("barcode")))).map(a->(String) a.get("barcode")).collect(Collectors.toList());
|
||||
} else {
|
||||
|
||||
@@ -114,6 +114,7 @@ public class WMSAccettazioneBollaService {
|
||||
" FROM Wdtb_docr left outer join mtb_aart on Wdtb_docr.cod_mart = mtb_aart.cod_mart \n" +
|
||||
" left outer join mtb_grup on mtb_aart.cod_mgrp = mtb_grup.cod_mgrp \n" +
|
||||
" WHERE wdtb_docr.cod_art_for is not null AND \n" +
|
||||
" wdtb_docr.cod_mart is not null AND \n" +
|
||||
" ( mtb_grup.tipo_mgrp is null or mtb_grup.tipo_mgrp <> 'FTT') \n" +
|
||||
" group by Wdtb_docr.num_doc,\n" +
|
||||
" Wdtb_docr.data_doc,\n" +
|
||||
|
||||
Reference in New Issue
Block a user