Compare commits
17 Commits
feature/SD
...
20240312_1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cbad55f27 | ||
| 8af9d93cff | |||
| 9c906bdd17 | |||
| 6e784624dd | |||
| 9523fde5fc | |||
| eb1e3c5efc | |||
| 8753f6c84a | |||
| ccd705d863 | |||
| d805ed379b | |||
| 12e05c60d1 | |||
| 548d9d17a1 | |||
| 5a803989c5 | |||
| 315c45a938 | |||
| 95d0d0cf63 | |||
| 6826110fa0 | |||
| 09be88a375 | |||
| edafed5d4e |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -58,3 +58,4 @@ modules.xml
|
||||
*/target/*
|
||||
*.ckie
|
||||
/ts
|
||||
/temp
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#spring.profiles.active=@activatedProperties@
|
||||
project.version=20231119_074200
|
||||
project.version=20240312_152104
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user