Rimossa dichiarazione setupGest da alcune regole
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:
@@ -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,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