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,29 @@
|
||||
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_20241028093025 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Maggio)) {
|
||||
updateSetupValue("IMPORT_COLLI", "COLLI_DA_PRODUZIONE", "AUTO_START", "S");
|
||||
updateSetupValue("IMPORT_COLLI", "COLLI_DA_PRODUZIONE", "AUTO_STOP", "S");
|
||||
|
||||
updateSetupValue("PICKING", "PICKING_LIBERO", "FLAG_ASK_COMMESSA_LAV", "S");
|
||||
updateSetupValue("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_CAR", "S");
|
||||
updateSetupValue("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_SCAR", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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_20241028160131 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("W_DDOCU_RC", "DIFFERITA", "CHECK_ORDINI_A", "N",
|
||||
"verifica se negli ordini agganciati nelle bolle ci sono degli articoli inevasi", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("W_DDOCU_RC", "DIFFERITA", "CHECK_ORDINI_V", "N",
|
||||
"verifica se negli ordini agganciati nelle bolle ci sono degli articoli inevasi", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
if(isCustomer(IntegryCustomer.Smetar))
|
||||
updateSetupValue("W_DDOCU_RC", "DIFFERITA", "CHECK_ORDINI_A", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,18 @@
|
||||
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_20241023183023 extends BaseMigration implements MigrationModelInterface {
|
||||
public class Migration_20241028161444 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Maggio)) {
|
||||
updateSetupValue("COLLI", "COLLI_DA_PRODUZIONE", "AUTO_START", "S");
|
||||
updateSetupValue("COLLI", "COLLI_DA_PRODUZIONE", "AUTO_STOP", "S");
|
||||
}
|
||||
executeStatement("ALTER TABLE vtb_clie ADD data_cons_obbl BIT DEFAULT 0",
|
||||
"UPDATE vtb_clie SET data_cons_obbl = 0",
|
||||
"ALTER TABLE vtb_clie ALTER COLUMN data_cons_obbl BIT NOT NULL;");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.ems.migration.service;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.migration.MigrationComponent;
|
||||
import it.integry.ems.migration.dto.MigrationStatusDTO;
|
||||
@@ -138,8 +137,10 @@ public class MigrationSetupService {
|
||||
|
||||
public void executeAll() throws Exception {
|
||||
for (AvailableConnectionsModel availableConnectionsModel : settingsModel.getAvailableConnections()) {
|
||||
if (!Stream.of(multiDBTransactionManager.getActiveConnections())
|
||||
.anyMatch(advancedDataSource -> advancedDataSource.getDataSource().getDbName().equalsIgnoreCase(availableConnectionsModel.getDbName()))) {
|
||||
if (multiDBTransactionManager.getActiveConnections().stream()
|
||||
.noneMatch(advancedDataSource ->
|
||||
advancedDataSource.getDataSource().getDbName().equalsIgnoreCase(availableConnectionsModel.getDbName()) &&
|
||||
advancedDataSource.isInternalDb())) {
|
||||
multiDBTransactionManager.addConnection(availableConnectionsModel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,16 +354,28 @@ public class GeneraOrdLav {
|
||||
// SERVIZI ORDINE DI LAVORAZIONE (SOLO SE DEPOSITO TERZISTA)
|
||||
// -----------------------------------------------------------
|
||||
if (checkDepTerzista) {
|
||||
List<DtbOrds> dtbOrds = setSpese(conn, qtaProd, qtaProdDist, codProd);
|
||||
List<DtbOrds> dtbOrds = setSpese(conn, qtaProd, qtaProdDist, codProd, ordProdSetupDTO.getCodSpesaTerzista());
|
||||
ordT.getDtbOrds().addAll(dtbOrds);
|
||||
}
|
||||
|
||||
if (isTerzista && !UtilityString.isNullOrEmpty(ordProdSetupDTO.getCodSpesaTerzista())) {
|
||||
sql = Query.format(
|
||||
"SELECT id_riga FROM dtb_ords WHERE gestione = %s AND data_ord = %s AND num_ord = %s AND cod_spes = %s",
|
||||
ordT.getGestione(), ordT.getDataOrd(), ordT.getNumOrd(), ordProdSetupDTO.getCodSpesaTerzista()
|
||||
);
|
||||
Integer idRiga = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
|
||||
DtbOrds dtbOrds = new DtbOrds()
|
||||
.setIdRiga(idRiga)
|
||||
.setQta(row.getQta())
|
||||
.setUntMis(row.getUntMis())
|
||||
.setValUnt(row.getValUnt())
|
||||
.setImporto(row.getImportoRiga())
|
||||
.setCodSpes(ordProdSetupDTO.getCodSpesaTerzista());
|
||||
if (idRiga != null) {
|
||||
dtbOrds.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
|
||||
ordT.getDtbOrds().add(dtbOrds);
|
||||
}
|
||||
} else {
|
||||
@@ -1534,7 +1546,7 @@ public class GeneraOrdLav {
|
||||
}
|
||||
}
|
||||
|
||||
private static List<DtbOrds> setSpese(Connection conn, BigDecimal qtaProd, BigDecimal qtaProdDist, String codProd) throws Exception {
|
||||
private static List<DtbOrds> setSpese(Connection conn, BigDecimal qtaProd, BigDecimal qtaProdDist, String codProd, String codSpesaTerzista) throws Exception {
|
||||
BigDecimal rapporto = qtaProd.divide(qtaProdDist, EmsRestConstants.cifreDecMax, RoundingMode.HALF_UP);
|
||||
String sql = "SELECT jtb_dist_clav_dir.cod_jcos_dir as cod_spes, "
|
||||
+ " ISNULL(jtb_dist_clav_dir.descrizione, gtb_spes.descrizione) as descrizione, "
|
||||
@@ -1550,6 +1562,13 @@ public class GeneraOrdLav {
|
||||
+ " jtb_dist_clav_dir.num_fase = 0 AND "
|
||||
+ " jtb_dist_clav_dir.flag_fase_pref = 'S' ";
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(codSpesaTerzista)) {
|
||||
sql += Query.format(
|
||||
"AND jtb_dist_clav_dir.cod_jcos_dir <> %s ",
|
||||
codSpesaTerzista
|
||||
);
|
||||
}
|
||||
|
||||
return new ResultSetMapper().mapQuerySetToList(conn, sql, DtbOrds.class, OperationType.INSERT);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.types.ApplicationName;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@PropertyReactive
|
||||
@Table(VtbClie.ENTITY)
|
||||
@@ -264,6 +265,9 @@ public class VtbClie extends EntityBase {
|
||||
@SqlField(value = "nome_negozio", maxLength = 255)
|
||||
private String nomeNegozio;
|
||||
|
||||
@SqlField(value = "data_cons_obbl", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean dataConsObbl;
|
||||
|
||||
@Priority(1)
|
||||
private GtbAnag gtbAnag;
|
||||
|
||||
@@ -1003,6 +1007,14 @@ public class VtbClie extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getDataConsObbl() {
|
||||
return dataConsObbl;
|
||||
}
|
||||
|
||||
public void setDataConsObbl(Boolean dataConsObbl) {
|
||||
this.dataConsObbl = dataConsObbl;
|
||||
}
|
||||
|
||||
public List<TtbClieLine> getTtbClieLine() {
|
||||
return ttbClieLine;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class SetupGest {
|
||||
ResultSet res;
|
||||
String value = null;
|
||||
|
||||
if (precode.length() != 0) {
|
||||
if (!precode.isEmpty()) {
|
||||
gestName = precode + "_" + gestName;
|
||||
}
|
||||
String query = "SELECT value FROM stb_gest_setup"
|
||||
|
||||
@@ -391,7 +391,8 @@ public class PackagesImportService {
|
||||
.setDataOrd(importColliProd.getDataOrd())
|
||||
.setNumOrd(importColliProd.getNumOrd())
|
||||
.setPesoLordoKg(importColliProd.getPesoLordo())
|
||||
.setPesoNettoKg(importColliProd.getPesoNetto());
|
||||
.setPesoNettoKg(importColliProd.getPesoNetto())
|
||||
.setCodJcom(importColliProd.getCodJcom());
|
||||
if (importColliProd.getGestione().equalsIgnoreCase("A")) {
|
||||
mtbColr.setRigaOrd(importColliProd.getRigaOrd());
|
||||
} else {
|
||||
|
||||
@@ -1259,7 +1259,8 @@ public class ProductionService {
|
||||
" dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordr.riga_ord,\n" +
|
||||
" dtb_ordr.cod_mart,\n" +
|
||||
" IIF(dtb_ordt.qta_evasa_prod = 0, dtb_ordt.qta_prod, dtb_ordt.qta_evasa_prod) AS qta_ord\n" +
|
||||
" (IIF(dtb_ordt.qta_evasa_prod = 0, dtb_ordt.qta_prod, dtb_ordt.qta_evasa_prod) *\n" +
|
||||
" dtb_ordt.rap_conv_prod) AS qta_ord\n" +
|
||||
"FROM jtb_lotr\n" +
|
||||
" INNER JOIN dtb_ordt ON jtb_lotr.gestione = dtb_ordt.gestione AND\n" +
|
||||
" jtb_lotr.data_ord = dtb_ordt.data_ord AND\n" +
|
||||
|
||||
Reference in New Issue
Block a user