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,33 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250116150858 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Carelli)) return;
|
||||
|
||||
createOrUpdateView("gvw_part_iva_infragroup", "ALTER VIEW [dbo].[gvw_part_iva_infragroup] AS\n" +
|
||||
" SELECT part_iva\n" +
|
||||
" FROM gestfood.dbo.azienda\n" +
|
||||
" UNION\n" +
|
||||
" SELECT part_iva\n" +
|
||||
" FROM panimal.dbo.azienda\n" +
|
||||
" UNION\n" +
|
||||
" SELECT part_iva\n" +
|
||||
" FROM carelli.dbo.azienda\n" +
|
||||
" UNION\n" +
|
||||
" SELECT part_iva\n" +
|
||||
" FROM format.dbo.azienda");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class DocumentiExporter extends BaseEntityExporter implements IEntityExpo
|
||||
break;
|
||||
case SICILIANI_ORGCONS:
|
||||
SicilianiDMSExportService orgCons = context.getBean(SicilianiDMSExportService.class);
|
||||
entityExportResponse = orgCons.syncOrgCons(jsonBody.get("whereCond").asText(), jsonBody.get("queryPercPesoOrdViaggio").asText(), jsonBody.get("dataCons").asText());
|
||||
entityExportResponse = orgCons.syncOrgCons(jsonBody.get("whereCond").asText(), jsonBody.get("queryPercPesoOrdViaggio").asText(), jsonBody.get("dataCons").asText(), username);
|
||||
break;
|
||||
case SICILIANI_TAGLIACUCI:
|
||||
SicilianiDMSExportService tagliaCuci = context.getBean(SicilianiDMSExportService.class);
|
||||
|
||||
@@ -180,7 +180,7 @@ public class SicilianiDMSExportService {
|
||||
return response;
|
||||
}
|
||||
|
||||
public EntityExportResponse syncOrgCons(String whereCond, String queryDettPesoViaggio, String dataCons) throws Exception {
|
||||
public EntityExportResponse syncOrgCons(String whereCond, String queryDettPesoViaggio, String dataCons, String userNAme) throws Exception {
|
||||
EntityExportResponse<List<File>> response = new EntityExportResponse<List<File>>();
|
||||
response.setResponse(new ArrayList<File>());
|
||||
String profileDBAlyante = setupGest.getSetup("DMS", "PROFILE", "ALYANTE");
|
||||
@@ -195,7 +195,7 @@ public class SicilianiDMSExportService {
|
||||
try {
|
||||
String codiceDitta = setupGest.getSetup("DMS", "SETUP", "CODICE_DITTA");
|
||||
String serverObject = setupGest.getSetup("DMS", "PROFILE", "DB_INTERSCAMBIO");
|
||||
|
||||
String userUnlockIDViaggio = setupGest.getSetupUser(conn, "W_VORGCONS_DISP", "SETUP","ABILITA_SBLOCCO_ID_VIAGGIO", userNAme);
|
||||
|
||||
String columnPercPesoOrdine = "";
|
||||
String tableCostoViaggi = "";
|
||||
@@ -324,7 +324,7 @@ public class SicilianiDMSExportService {
|
||||
((String) UtilityHashMap.getValueIfExists(x, "lockIdViaggio")).equalsIgnoreCase("S")).findFirst();
|
||||
|
||||
|
||||
if (!lockIdViaggio.isPresent()) {
|
||||
if (!lockIdViaggio.isPresent() || userUnlockIDViaggio.equalsIgnoreCase("S")) {
|
||||
if (flagExistOrd.compareTo("N") == 0) {
|
||||
sql = "INSERT INTO dtb_infoviaggi " +
|
||||
"( ditta, " +
|
||||
@@ -453,7 +453,7 @@ public class SicilianiDMSExportService {
|
||||
((Integer) UtilityHashMap.getValueIfExists(x, "id_viaggio")).equals(idViaggio) &&
|
||||
((String) UtilityHashMap.getValueIfExists(x, "lockIdViaggio")).equalsIgnoreCase("S")).findFirst();
|
||||
|
||||
if (!lockIdViaggio.isPresent()) {
|
||||
if (!lockIdViaggio.isPresent() || userUnlockIDViaggio.equalsIgnoreCase("S")) {
|
||||
sql = "delete from dtb_infoviaggi " +
|
||||
" from dtb_infoviaggi " +
|
||||
" where chiave_traxal = " + UtilityDB.valueToString(keyOrd);
|
||||
|
||||
@@ -246,9 +246,9 @@ public class DistribuzioneColliService {
|
||||
List<DtbOrdr> orderRows = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), dtbOrdrSql, DtbOrdr.class, 30);
|
||||
if (orderRows == null) orderRows = new ArrayList<>();
|
||||
|
||||
orderTestate = Stream.of(orderTestate)
|
||||
orderTestate = orderTestate.stream()
|
||||
.distinct()
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<MtbColr> mtbColrsToSave = new ArrayList<>();
|
||||
|
||||
@@ -313,9 +313,10 @@ public class DistribuzioneColliService {
|
||||
MtbColr sourceMtbColr = groupedMtbColrs.get(i);
|
||||
final MtbColr finalSourceMtbColr = sourceMtbColr;
|
||||
|
||||
MtbAart currentMtbAart = Stream.of(mtbAarts)
|
||||
MtbAart currentMtbAart = mtbAarts.stream()
|
||||
.filter(mtbAart -> finalSourceMtbColr.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
|
||||
.single();
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
//Mi calcolo una qta_cnf media
|
||||
if ("S".equalsIgnoreCase(currentMtbAart.getFlagQtaCnfFissa())) {
|
||||
@@ -336,20 +337,20 @@ public class DistribuzioneColliService {
|
||||
//solo se la partita non è NULL sull'ordine ed è uguale su collo e ordine
|
||||
List<DtbOrdr> artOrderRowsWithPart = null;
|
||||
if (flagRaggXQtaCnf.equalsIgnoreCase("S") && "N".equalsIgnoreCase(currentMtbAart.getFlagQtaCnfFissa())) {
|
||||
artOrderRowsWithPart = Stream.of(orderRows)
|
||||
artOrderRowsWithPart = orderRows.stream()
|
||||
.filter(dtbOrdr -> UtilityString.equalsIgnoreCase(dtbOrdr.getCodMart(), finalSourceMtbColr.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getPartitaMag(), finalSourceMtbColr.getPartitaMag()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodTagl(), finalSourceMtbColr.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodCol(), finalSourceMtbColr.getCodCol()) &&
|
||||
Objects.equals(dtbOrdr.getQtaCnf().setScale(5, RoundingMode.HALF_UP), finalSourceMtbColr.getQtaCnf().setScale(5, RoundingMode.HALF_UP)))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
artOrderRowsWithPart = Stream.of(orderRows)
|
||||
artOrderRowsWithPart = orderRows.stream()
|
||||
.filter(dtbOrdr -> UtilityString.equalsIgnoreCase(dtbOrdr.getCodMart(), finalSourceMtbColr.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getPartitaMag(), finalSourceMtbColr.getPartitaMag()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodTagl(), finalSourceMtbColr.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodCol(), finalSourceMtbColr.getCodCol()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
for (int j = 0; j < artOrderRowsWithPart.size() && sourceMtbColr.getQtaCol().compareTo(BigDecimal.ZERO) > 0; j++) {
|
||||
@@ -403,20 +404,20 @@ public class DistribuzioneColliService {
|
||||
//solo se la partita è NULL sull'ordine
|
||||
List<DtbOrdr> artOrderRowsNoPart = null;
|
||||
if (flagRaggXQtaCnf.equalsIgnoreCase("S") && "N".equalsIgnoreCase(currentMtbAart.getFlagQtaCnfFissa())) {
|
||||
artOrderRowsNoPart = Stream.of(orderRows)
|
||||
artOrderRowsNoPart = orderRows.stream()
|
||||
.filter(dtbOrdr -> UtilityString.equalsIgnoreCase(dtbOrdr.getCodMart(), finalSourceMtbColr.getCodMart()) &&
|
||||
(dtbOrdr.getPartitaMag() == null) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodTagl(), finalSourceMtbColr.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodCol(), finalSourceMtbColr.getCodCol()) &&
|
||||
Objects.equals(dtbOrdr.getQtaCnf().setScale(5, RoundingMode.HALF_UP), finalSourceMtbColr.getQtaCnf().setScale(5, RoundingMode.HALF_UP)))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
artOrderRowsNoPart = Stream.of(orderRows)
|
||||
artOrderRowsNoPart = orderRows.stream()
|
||||
.filter(dtbOrdr -> UtilityString.equalsIgnoreCase(dtbOrdr.getCodMart(), finalSourceMtbColr.getCodMart()) &&
|
||||
(dtbOrdr.getPartitaMag() == null) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodTagl(), finalSourceMtbColr.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(dtbOrdr.getCodCol(), finalSourceMtbColr.getCodCol()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
for (int j = 0; j < artOrderRowsNoPart.size() && sourceMtbColr.getQtaCol().compareTo(BigDecimal.ZERO) > 0; j++) {
|
||||
@@ -496,7 +497,7 @@ public class DistribuzioneColliService {
|
||||
if (dtbOrdrToUpdate != null && !dtbOrdrToUpdate.isEmpty()) {
|
||||
|
||||
//Creo le testate per ogni ordine trovato nelle righe
|
||||
List<DtbOrdt> dtbOrdtToUpdate = Stream.of(dtbOrdrToUpdate)
|
||||
List<DtbOrdt> dtbOrdtToUpdate = dtbOrdrToUpdate.stream()
|
||||
.map(dtbOrdr -> {
|
||||
DtbOrdt dtbOrdt = new DtbOrdt();
|
||||
dtbOrdt.setGestione(dtbOrdr.getGestione());
|
||||
@@ -507,7 +508,7 @@ public class DistribuzioneColliService {
|
||||
return dtbOrdt;
|
||||
})
|
||||
.distinct()
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
if (dtbOrdtToUpdate != null && !dtbOrdtToUpdate.isEmpty()) {
|
||||
@@ -544,13 +545,13 @@ public class DistribuzioneColliService {
|
||||
mtbColrToSave.setQueryTimeoutSeconds(30);
|
||||
|
||||
//Carico tutte le righe che combaciano con qta > 0
|
||||
List<MtbColr> found = Stream.of(sourceMtbColrs)
|
||||
List<MtbColr> found = sourceMtbColrs.stream()
|
||||
.filter(mtbColr -> UtilityString.equalsIgnoreCase(mtbColr.getPartitaMag(), mtbColrToSave.getPartitaMag()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodMart(), mtbColrToSave.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodTagl(), mtbColrToSave.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodCol(), mtbColrToSave.getCodCol()) &&
|
||||
mtbColr.getQtaCol().compareTo(BigDecimal.ZERO) > 0)
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
BigDecimal qtaTotToSubstract = mtbColrToSave.getQtaCol();
|
||||
|
||||
@@ -662,13 +663,13 @@ public class DistribuzioneColliService {
|
||||
groupedMtbColr.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
groupedMtbColr.setNumCnf(null);
|
||||
|
||||
List<MtbColr> match = Stream.of(mtbColrsToSave)
|
||||
List<MtbColr> match = mtbColrsToSave.stream()
|
||||
.filter(mtbColr -> UtilityString.equalsIgnoreCase(mtbColr.getCodMart(), groupedMtbColr.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodCol(), groupedMtbColr.getCodCol()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodTagl(), groupedMtbColr.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getPartitaMag(), groupedMtbColr.getPartitaMag()) &&
|
||||
UtilityString.equalsIgnoreCase(mtbColr.getCodJcom(), groupedMtbColr.getCodJcom()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (match != null && !match.isEmpty()) {
|
||||
groupedMtbColr.setNumOrd(match.get(0).getNumOrd());
|
||||
@@ -689,7 +690,7 @@ public class DistribuzioneColliService {
|
||||
sourceMtbColt.setDataDistribuzione(new Date());
|
||||
sourceMtbColt.setQueryTimeoutSeconds(30);
|
||||
|
||||
boolean anyRowInSourceMtbColt = Stream.of(sourceMtbColt.getMtbColr())
|
||||
boolean anyRowInSourceMtbColt = sourceMtbColt.getMtbColr().stream()
|
||||
.anyMatch(x -> x.getOperation() != OperationType.DELETE &&
|
||||
UtilityBigDecimal.greaterThan(x.getQtaCol(), BigDecimal.ZERO) ||
|
||||
UtilityBigDecimal.greaterThan(x.getNumCnf(), BigDecimal.ZERO) ||
|
||||
@@ -732,7 +733,7 @@ public class DistribuzioneColliService {
|
||||
|
||||
private void checkInDistribution(MtbColt sourceMtbColt) throws Exception {
|
||||
|
||||
if (Stream.of(this.mCurrentlyDistributingMtbColt)
|
||||
if (this.mCurrentlyDistributingMtbColt.stream()
|
||||
.anyMatch(x -> x.getGestione().equalsIgnoreCase(sourceMtbColt.getGestione()) &&
|
||||
x.getNumCollo().equals(sourceMtbColt.getNumCollo()) &&
|
||||
x.getSerCollo().equalsIgnoreCase(sourceMtbColt.getSerCollo()) &&
|
||||
|
||||
@@ -398,8 +398,10 @@ public class FLProductionService {
|
||||
|
||||
|
||||
if ("S".compareTo(isDBcentrale) == 0) {
|
||||
passaporto = getNextNumPassaporto(connDBCentrale, codCentroAziDBCentrale, flAggListinoProdDTO.getDataProd());
|
||||
passaportoDBCentrale = passaporto;
|
||||
/* passaporto = getNextNumPassaporto(connDBCentrale, codCentroAziDBCentrale, flAggListinoProdDTO.getDataProd());
|
||||
passaportoDBCentrale = passaporto;*/
|
||||
|
||||
passaporto = flAggListinoProdDTO.getPassaporto();
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(flAggListinoProdDTO.getCodAlis())) {
|
||||
@@ -438,7 +440,7 @@ public class FLProductionService {
|
||||
String erroreMessage = mtbListData.getException().getMessage();
|
||||
throw new Exception(erroreMessage);
|
||||
} else {
|
||||
if ("N".compareTo(contoLavoro) == 0) {
|
||||
if ("N".compareTo(contoLavoro) == 0 && isDBcentrale.compareTo("N") == 0) {
|
||||
/*******************************************************
|
||||
* AGGIORNAMENTO LISTINO FORNITORE DATABASE CENTRALE
|
||||
* ******************************************************/
|
||||
|
||||
Reference in New Issue
Block a user