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:
@@ -88,9 +88,9 @@ public class DataSource extends BasicDataSource {
|
||||
// this.setMaxWaitMillis(-1L); // Infinito (DEFAULT)
|
||||
|
||||
// Validazione veloce ed efficiente
|
||||
this.setValidationQuery("SELECT 1");
|
||||
this.setValidationQueryTimeout(5); // Ridotto a 1 secondo
|
||||
this.setTestWhileIdle(true); // Testa connessioni idle
|
||||
// this.setValidationQuery("SELECT 1");
|
||||
// this.setValidationQueryTimeout(60); // Ridotto a 1 secondo
|
||||
// this.setTestWhileIdle(true); // Testa connessioni idle
|
||||
|
||||
// Eviction ottimizzata per READ_UNCOMMITTED
|
||||
// this.setTimeBetweenEvictionRunsMillis(1 * 1000); // Ogni 30 secondi
|
||||
@@ -104,10 +104,10 @@ public class DataSource extends BasicDataSource {
|
||||
this.setLogAbandoned(UtilityDebug.isDebugExecution()); // Disabilita in produzione per performance
|
||||
|
||||
// Performance boosts massimi
|
||||
this.setPoolPreparedStatements(true);
|
||||
// this.setPoolPreparedStatements(true);
|
||||
// this.setMaxOpenPreparedStatements(200);
|
||||
// this.setCacheState(true);
|
||||
this.setFastFailValidation(true);
|
||||
// this.setCacheState(true);
|
||||
// this.setFastFailValidation(true);
|
||||
|
||||
// Ottimizzazioni specifiche per SQL Server con READ_UNCOMMITTED
|
||||
if (connectionModel.getConnectionType() == EmsRestConstants.DB_TYPE.MSSQL) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.integry.ems.rules.completing;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.entity.JtbComt;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
|
||||
@@ -46,20 +45,19 @@ public class CommesseRules extends QueryRules {
|
||||
public static String getNextCodJcom(Connection conn, JtbComt jtbComt) throws Exception {
|
||||
String className = "W_JCOMMT_RC", generazioneAutomatica = "N", aggiungiGestione = "N";
|
||||
String codJcom = null;
|
||||
SetupGest setup = new SetupGest();
|
||||
|
||||
// Acquisizione configurazioni commessa
|
||||
if ("V".equals(jtbComt.getGestione())) {
|
||||
generazioneAutomatica = (String) setup.getSetup(conn, className, "SETUP", "GEN_AUTOMATICA_COMM_VEN");
|
||||
generazioneAutomatica = setupGest.getSetup(conn, className, "SETUP", "GEN_AUTOMATICA_COMM_VEN");
|
||||
if (UtilityString.isNullOrEmpty(generazioneAutomatica)) {
|
||||
generazioneAutomatica = "N";
|
||||
}
|
||||
aggiungiGestione = (String) setup.getSetup(conn, className, "SETUP", "AGGIUNGI_GEST_VEN");
|
||||
aggiungiGestione = setupGest.getSetup(conn, className, "SETUP", "AGGIUNGI_GEST_VEN");
|
||||
if (UtilityString.isNullOrEmpty(aggiungiGestione)) {
|
||||
aggiungiGestione = "N";
|
||||
}
|
||||
} else if ("L".equals(jtbComt.getGestione()) || "A".equals(jtbComt.getGestione())) {
|
||||
generazioneAutomatica = (String) setup.getSetup(conn, className, "SETUP", "GEN_AUTOMATICA_COMM_LAV");
|
||||
generazioneAutomatica = setupGest.getSetup(conn, className, "SETUP", "GEN_AUTOMATICA_COMM_LAV");
|
||||
if (UtilityString.isNullOrEmpty(generazioneAutomatica)) {
|
||||
generazioneAutomatica = "N";
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package it.integry.ems.rules.completing;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.rules.util.DroolsUtil;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -14,7 +13,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DistBaseRules extends QueryRules {
|
||||
protected static SetupGest setupGest = new SetupGest();
|
||||
|
||||
public static String completeUntMisProd(Connection connection, String codProd) throws SQLException {
|
||||
String sql = "SELECT mtb_aart.unt_mis FROM mtb_aart " + " WHERE mtb_aart.cod_mart = '" + codProd + "'";
|
||||
|
||||
@@ -14,7 +14,6 @@ import it.integry.ems_model.entity.common.DtbBaseDocR;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdR;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdT;
|
||||
import it.integry.ems_model.rules.util.DroolsUtil;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -475,8 +474,6 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
Date dataDocBolla = null;
|
||||
Integer numDocBolla = null;
|
||||
|
||||
SetupGest setup = new SetupGest();
|
||||
|
||||
if (testata.getOperation() == OperationType.NO_OP) {
|
||||
testata.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
@@ -543,7 +540,7 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
String whereCondTestata = testata.getEntityHolder().getWherePK(testata);
|
||||
String sql = "select mtb_colt.gestione, mtb_colt.data_collo, mtb_colt.ser_collo, mtb_colt.num_collo from mtb_colt where " + whereCondTestata;
|
||||
colliFromDB = new ResultSetMapper().mapQuerySetToList(conn, sql, MtbColt.class);
|
||||
calcColli = setup.getSetupBoolean(conn, "DATI_AZIENDA", "DOCU_ORD", "CALC_COLLI");
|
||||
calcColli = setupGest.getSetupBoolean(conn, "DATI_AZIENDA", "DOCU_ORD", "CALC_COLLI");
|
||||
|
||||
/*20-04-20 (FABIO): commentato la lettura dei colli da MtbColt al momento, ma è una logica che non dovrebbe più essere utilizzata,
|
||||
* ma in tal caso dovremmo valuare delle poche aziende che hanno il flag calc_colli = 'N' se è giusto che calcoli il numero dei colli
|
||||
|
||||
@@ -14,7 +14,6 @@ import it.integry.ems_model.entity.common.DtbDocOrdR;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdT;
|
||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import it.integry.ems_model.rules.util.DroolsUtil;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.*;
|
||||
|
||||
@@ -961,8 +960,7 @@ public class DocOrdRules extends QueryRules {
|
||||
}
|
||||
|
||||
public static DtbOrdt completeDatiOrdProd(Connection connection, DtbOrdt dtbOrdt) throws Exception {
|
||||
SetupGest setup = new SetupGest();
|
||||
boolean disableTriggerOrdl = setup.getSetupBoolean(connection, "DTB_ORDT", "SETUP", "DISABLE_TRIGGER_ORDL");
|
||||
boolean disableTriggerOrdl = setupGest.getSetupBoolean(connection, "DTB_ORDT", "SETUP", "DISABLE_TRIGGER_ORDL");
|
||||
|
||||
if (!disableTriggerOrdl || (dtbOrdt.isGeneraOrdLavDaProd() && dtbOrdt.getParent() != null)) return null;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.ems.rules.completing;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems._context.ApplicationContextProvider;
|
||||
import it.integry.ems.rules.businessLogic.enums.TipoEmissione;
|
||||
import it.integry.ems.rules.completing.dto.DatiPartitaMagDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
@@ -18,19 +19,20 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class DocumentRules extends QueryRules {
|
||||
public static Date getDataRicezioneAllegati(Connection conn, List<DrlDocAttached> drlDocAttached) throws Exception {
|
||||
SetupGest setupGest = new SetupGest();
|
||||
String minDataRic = setupGest.getSetup(conn, "CTB_MOVI", "SETUP", "SET_DATA_RICEZIONE");
|
||||
Date dataRicMin = UtilityString.parseDate(minDataRic);
|
||||
|
||||
LocalDateTime dataRicMin = LocalDateTime.parse(minDataRic, CommonConstants.DATETIME_YMD_DASHED_FORMATTER);
|
||||
|
||||
String idAttach = drlDocAttached.get(0).getIdAttach();
|
||||
String sqlAttach =
|
||||
"SELECT CASE WHEN " + UtilityDB.valueDateToString(dataRicMin, CommonConstants.DATE_FORMAT_YMD) + " is not null AND datetime_attach >= " + UtilityDB.valueDateToString(dataRicMin, CommonConstants.DATE_FORMAT_YMD) + " THEN datetime_attach ELSE null END " +
|
||||
"SELECT IIF(" + UtilityDB.valueToString(dataRicMin) + " is not null AND datetime_attach >= " + UtilityDB.valueToString(dataRicMin) + ",datetime_attach, null) " +
|
||||
" FROM stb_files_attached " +
|
||||
" WHERE id_attach = " + UtilityDB.valueToString(idAttach);
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package it.integry.ems.rules.completing;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity.common.*;
|
||||
import it.integry.ems_model.rules.util.DroolsUtil;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -14,13 +14,15 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class PurchasesRules extends QueryRules {
|
||||
@@ -504,32 +506,26 @@ public class PurchasesRules extends QueryRules {
|
||||
}
|
||||
|
||||
public static Boolean checkChangeDataInizLisa(Connection conn, AtbListData entity) throws Exception {
|
||||
Boolean ret = false;
|
||||
Logger logger = LogManager.getLogger();
|
||||
String sql = "SELECT data_iniz FROM atb_list_data "
|
||||
+ "WHERE cod_alis = " + UtilityDB.valueToString(entity.getCodAlis()) + " AND "
|
||||
+ "versione = " + UtilityDB.valueToString(entity.getVersione()) + " AND "
|
||||
+ "data_iniz <> " + UtilityDB.valueToString(entity.getDataIniz()) + " AND "
|
||||
+ "cod_promo is null ";
|
||||
PreparedStatement ps = conn.prepareStatement(sql);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
final Date dataIniz = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
|
||||
if (dataIniz != null) {
|
||||
String ls_message = "Data inizio modificata sul listino " + entity.getCodAlis() + " versione " + entity.getVersione().toString() + " Utente " + entity.getUsername();
|
||||
logger.error(ls_message);
|
||||
SetupGest setup = new SetupGest();
|
||||
String blocca = (String) setup.getSetup(conn, "W_ALISTDATA_RC", "DATA_INIZ", "CHK_VARIAZIONE");
|
||||
|
||||
if ("S".equals(blocca)) {
|
||||
ret = true;
|
||||
boolean blocca = setupGest.getSetupBoolean(conn, "W_ALISTDATA_RC", "DATA_INIZ", "CHK_VARIAZIONE");
|
||||
if (blocca) {
|
||||
throw new Exception("Impossibile modificare la data del listino " + entity.getCodAlis() + " versione " + entity.getVersione().toString());
|
||||
}
|
||||
}
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
|
||||
return ret;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Boolean checkScontiPromoAcq(Connection conn, AtbListData entity) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user