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:
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #2 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<configuration default="false" name="Tomcat9Wingest (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #1 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<configuration default="false" name="Tomcat9 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20241030124317 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"ALTER TABLE vtb_viaggi\n" +
|
||||
" ADD stato TINYINT DEFAULT 0 NOT NULL\n" +
|
||||
" CHECK ([stato] = 0 OR [stato] = 1 OR [stato] = 2);",
|
||||
"EXEC sp_addextendedproperty 'MS_Description', 'Valori possibili: 0 -> Pianificato, 1 -> Carico, 2 -> Spedito', 'SCHEMA',\n" +
|
||||
" 'dbo', 'TABLE', 'vtb_viaggi', 'COLUMN', 'stato';"
|
||||
);
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.RossoGargano_RossoGargano)) {
|
||||
executeStatement(
|
||||
"UPDATE vtb_viaggi\n" +
|
||||
"SET stato = 2\n" +
|
||||
"WHERE confermato = 1"
|
||||
);
|
||||
}
|
||||
|
||||
executeStatement(
|
||||
"EXEC DropDefault 'vtb_viaggi', 'confermato';",
|
||||
"ALTER TABLE vtb_viaggi\n" +
|
||||
" DROP COLUMN confermato;"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -591,7 +591,7 @@ public class LoadColliService {
|
||||
" mvw_colr_sum.num_ord AS 'num_ord',\n" +
|
||||
" mvw_colr_sum.riga_ord AS 'riga_ord',\n" +
|
||||
" mvw_colr_sum.qta_cnf / ISNULL(dtb_ordr.rap_conv, 1) AS 'qta_cnf',\n" +
|
||||
" ISNULL(dtb_ordr.descrizione_estesa, mtb_aart.descrizione_estesa) AS 'descrizione_estesa',\n" +
|
||||
" IIF(mvw_colr_sum.cod_mart <> dtb_ordr.cod_mart OR dtb_ordr.descrizione_estesa is null, mtb_aart.descrizione_estesa, dtb_ordr.descrizione_estesa) AS 'descrizione_estesa',\n" +
|
||||
" dtb_ordr.cod_promo AS 'cod_promo',\n" +
|
||||
" dtb_ordr.cod_art_for AS 'cod_art_for',\n" +
|
||||
" mvw_kit.flag_kit AS 'articolo_composto',\n" +
|
||||
@@ -641,7 +641,8 @@ public class LoadColliService {
|
||||
" dtb_ordr.perc_prov, dtb_ordr.val_prov, dtb_ordr.perc_prov2, dtb_ordr.val_prov2, dtb_ordr.perc_gest,\n" +
|
||||
" dtb_ordr.val_gest, dtb_ordr.perc_ispe, dtb_ordr.val_ispe, dtb_ordr.perc_promo, dtb_ordr.val_promo,\n" +
|
||||
" dtb_ordr.perc_oneri, dtb_ordr.val_oneri, mvw_colr_sum.data_ord, mvw_colr_sum.num_ord, mvw_colr_sum.riga_ord,\n" +
|
||||
" mvw_colr_sum.qta_cnf, ISNULL(dtb_ordr.descrizione_estesa, mtb_aart.descrizione_estesa), dtb_ordr.cod_promo,\n" +
|
||||
" mvw_colr_sum.qta_cnf, IIF(mvw_colr_sum.cod_mart <> dtb_ordr.cod_mart OR dtb_ordr.descrizione_estesa is null, mtb_aart.descrizione_estesa, dtb_ordr.descrizione_estesa),\n " +
|
||||
" dtb_ordr.cod_promo,\n" +
|
||||
" mtb_aart.flag_stato, dtb_ordr.cod_art_for, mvw_kit.flag_kit, dtb_ordr.cod_jcom,\n" +
|
||||
" ISNULL(dtb_ordr.unt_ord2, mtb_aart.unt_mis2), ISNULL(dtb_ordr.unt_ord3, mtb_aart.unt_mis3), mtb_aart.tara_kg,\n" +
|
||||
" dtb_ordr.cod_kit, dtb_ordr.cod_alis, dtb_ordr.note,\n" +
|
||||
|
||||
@@ -30,6 +30,14 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
boolean flagPrzIva = UtilityString.isNullOrEmpty(row.getFlagPrzIva()) ? false : row.getFlagPrzIva().equalsIgnoreCase("S");
|
||||
String gestione = row.getGestione();
|
||||
|
||||
int segno = 1;
|
||||
if ( row instanceof DtbDocr ) {
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT cast(segno_qta_car as int) FROM dtb_tipi WHERE cod_dtip = %S", ((DtbDocr) row).getCodDtip());
|
||||
segno = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn,sql);
|
||||
}
|
||||
|
||||
Date dataReg = null, dataValidita = null;
|
||||
if (row instanceof DtbDocr) {
|
||||
dataReg = ((DtbDocr) row).getDataReg();
|
||||
@@ -49,8 +57,7 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
" CASE " + UtilityDB.valueToString(gestione) +
|
||||
" WHEN 'V' THEN flag_calc_prz " +
|
||||
" WHEN 'A' THEN flag_calc_prz_acq ELSE 'N' END as flag_calc_prz, " +
|
||||
"CASE " + UtilityDB.valueToString(gestione) +
|
||||
" WHEN 'V' THEN esposizione_comp ELSE 'N' END as esposizione_comp, " +
|
||||
" esposizione_comp, " +
|
||||
" cod_aliq " +
|
||||
" FROM mtb_aart" +
|
||||
" WHERE cod_mart = " + UtilityDB.valueToString(codMart);
|
||||
@@ -60,10 +67,13 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
String codAliqArt = null, flagCalcPrz = null;
|
||||
boolean esponiComp = false, articoloComposto = false;
|
||||
if (datiArticolo != null && datiArticolo.size() > 0) {
|
||||
articoloComposto = ((String) datiArticolo.get("articolo_composto")).equalsIgnoreCase("S");
|
||||
flagCalcPrz = (String) datiArticolo.get("flag_calc_prz");
|
||||
esponiComp = ((String) datiArticolo.get("esposizione_comp")).equalsIgnoreCase("S");
|
||||
codAliqArt = (String) datiArticolo.get("cod_aliq");
|
||||
articoloComposto = UtilityHashMap.<String>getValueIfExists(datiArticolo, "articolo_composto").equalsIgnoreCase("S");
|
||||
flagCalcPrz = UtilityHashMap.getValueIfExists(datiArticolo, "flag_calc_prz");
|
||||
esponiComp = UtilityHashMap.<String>getValueIfExists(datiArticolo, "esposizione_comp").equalsIgnoreCase("S");
|
||||
codAliqArt = UtilityHashMap.getValueIfExists(datiArticolo, "cod_aliq");
|
||||
if (gestione.equalsIgnoreCase("A") && segno == 1) {
|
||||
esponiComp = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Imposto codice kit e ordinamento
|
||||
@@ -214,7 +224,7 @@ public class DocOrdCalTotaliRules extends QueryRules {
|
||||
|
||||
}
|
||||
|
||||
if (!esponiComp && "C".equals(flagCalcPrz)) {
|
||||
if (!esponiComp && "C".equalsIgnoreCase(flagCalcPrz)) {
|
||||
if (flagPrzIva) {
|
||||
row.setValUntIva(totComponenti);
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@ import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.entity.common.DtbBaseDocT;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdR;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdT;
|
||||
@@ -976,7 +977,7 @@ public class DocOrdRules extends QueryRules {
|
||||
.setCodMart(dtbOrdt.getCodProd())
|
||||
.setDescrizione(dtbOrdt.getDescrizioneProd())
|
||||
.setDescrizioneEstesa(dtbOrdt.getDescrEstesaProd())
|
||||
.setFlagEvaso(dtbOrdt.getFlagEvasoProd())
|
||||
.setFlagEvaso(FlagEvaso.from(dtbOrdt.getFlagEvasoProd()))
|
||||
.setDataCons(dtbOrdt.getDataConsProd())
|
||||
.setUntOrd(dtbOrdt.getUntMisProd())
|
||||
.setRapConv(dtbOrdt.getRapConvProd())
|
||||
|
||||
@@ -14,6 +14,7 @@ import it.integry.ems_model.business_logic.dto.OrdProdSetupDTO;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
@@ -239,7 +240,7 @@ public class GeneraOrdLav {
|
||||
BigDecimal valUnt = row.getValUnt();
|
||||
Integer rigaOrd = row.getRigaOrd();
|
||||
String codJcom = row.getCodJcom();
|
||||
String flagEvasoProd = row.getFlagEvaso();
|
||||
FlagEvaso flagEvasoProd = row.getFlagEvaso();
|
||||
|
||||
// Generazione automatica nuova commessa
|
||||
if (genAutoCommOrdProd && UtilityString.isNullOrEmpty(codJcom)) {
|
||||
@@ -321,11 +322,11 @@ public class GeneraOrdLav {
|
||||
.setColliPedana(row.getColliPedana())
|
||||
.setCodTcolUl(row.getCodTcolUl())
|
||||
.setCodTcolUi(row.getCodTcolUi())
|
||||
.setFlagEvasoProd(flagEvasoProd)
|
||||
.setFlagEvasoProd(flagEvasoProd.getValue().toString())
|
||||
.setGeneraOrdLavDaProd(dtbOrdt.isGeneraOrdLavDaProd());
|
||||
|
||||
String flagAnnulla = "N";
|
||||
if (UtilityString.equalsIgnoreCase(row.getFlagEvaso(), "A")) {
|
||||
if (row.getFlagEvaso() == FlagEvaso.ANNULLATO) {
|
||||
flagAnnulla = "S";
|
||||
}
|
||||
ordT.setFlagAnnulla(flagAnnulla);
|
||||
|
||||
@@ -7,6 +7,7 @@ import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.rules.completing.dto.UntMisDTO;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.entity.common.DtbDocOrdR;
|
||||
import it.integry.ems_model.entity.common.DtbOrdCommonR;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -99,7 +100,7 @@ public class DtbOrdr extends DtbOrdCommonR implements EquatableEntityInterface<D
|
||||
private String descrizioneEstesa;
|
||||
|
||||
@SqlField(value = "flag_evaso", maxLength = 1, nullable = false, defaultObjectValue = "I")
|
||||
private String flagEvaso;
|
||||
private FlagEvaso flagEvaso;
|
||||
|
||||
@SqlField(value = "flag_evaso_forzato", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||
private String flagEvasoForzato;
|
||||
@@ -572,11 +573,11 @@ public class DtbOrdr extends DtbOrdCommonR implements EquatableEntityInterface<D
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagEvaso() {
|
||||
public FlagEvaso getFlagEvaso() {
|
||||
return flagEvaso;
|
||||
}
|
||||
|
||||
public DtbOrdr setFlagEvaso(String flagEvaso) {
|
||||
public DtbOrdr setFlagEvaso(FlagEvaso flagEvaso) {
|
||||
this.flagEvaso = flagEvaso;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -58,8 +59,8 @@ public class VtbViaggi extends EntityBase {
|
||||
@SqlField(value = "posizione", nullable = false, defaultObjectValue = "0")
|
||||
private Short posizione;
|
||||
|
||||
@SqlField(value = "confermato", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean confermato;
|
||||
@SqlField(value = "stato", nullable = false, defaultObjectValue = "0")
|
||||
private Stato stato;
|
||||
|
||||
@Priority(value = 101, copyPk = false)
|
||||
private List<VtbViaggi> vtbViaggiList;
|
||||
@@ -163,12 +164,12 @@ public class VtbViaggi extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getConfermato() {
|
||||
return confermato;
|
||||
public Stato getStato() {
|
||||
return stato;
|
||||
}
|
||||
|
||||
public VtbViaggi setConfermato(Boolean confermato) {
|
||||
this.confermato = confermato;
|
||||
public VtbViaggi setStato(Stato stato) {
|
||||
this.stato = stato;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -191,7 +192,6 @@ public class VtbViaggi extends EntityBase {
|
||||
}
|
||||
|
||||
public enum Mezzo implements IBaseEnum<Mezzo> {
|
||||
|
||||
VETTORE((short) 0), MITTENTE((short) 1), DESTINATARIO((short) 2);
|
||||
|
||||
private final short value;
|
||||
@@ -229,4 +229,45 @@ public class VtbViaggi extends EntityBase {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Stato implements IBaseEnum<Stato> {
|
||||
PIANIFICATO((short) 0), CARICO((short) 1), SPEDITO((short) 2);
|
||||
|
||||
private final short value;
|
||||
|
||||
Stato(final short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Stato from(Object value) {
|
||||
short castValue = (short) value;
|
||||
|
||||
for (Stato b : Stato.values()) {
|
||||
if (b.value == castValue)
|
||||
return b;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public short getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stato fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package it.integry.ems_model.entity._enum;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import it.integry.ems_model.entity.DtbOrdr;
|
||||
|
||||
public enum FlagEvaso implements IBaseEnum<FlagEvaso> {
|
||||
INEVASO('I'), EVASO('E'), ANNULLATO('A');
|
||||
|
||||
private final Character value;
|
||||
|
||||
FlagEvaso(Character value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static FlagEvaso from(Object value) {
|
||||
Character castValue = null;
|
||||
|
||||
if (value instanceof Character)
|
||||
castValue = (Character) value;
|
||||
else if (value instanceof String)
|
||||
castValue = ((String) value).charAt(0);
|
||||
|
||||
for (FlagEvaso b : FlagEvaso.values()) {
|
||||
if (b.value == castValue)
|
||||
return b;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Character getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlagEvaso fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
@@ -165,9 +165,7 @@ public class SqlFieldHolder {
|
||||
else if (dtoType.equals(LocalDate.class))
|
||||
converter = data -> ((Timestamp) data).toLocalDateTime().toLocalDate();
|
||||
|
||||
}
|
||||
|
||||
else if (sqlType.equals(Date.class)) {
|
||||
} else if (sqlType.equals(Date.class)) {
|
||||
if (dtoType.equals(Date.class))
|
||||
converter = data -> (Date) data;
|
||||
else if (dtoType.equals(Instant.class))
|
||||
@@ -177,8 +175,7 @@ public class SqlFieldHolder {
|
||||
else if (dtoType.equals(LocalDate.class))
|
||||
converter = data -> UtilityLocalDate.localDateFromDate((Date) data);
|
||||
|
||||
}
|
||||
else if (dtoType.equals(Date.class)) {
|
||||
} else if (dtoType.equals(Date.class)) {
|
||||
converter = data -> {
|
||||
try {
|
||||
return UtilityString.parseDate(data.toString());
|
||||
@@ -186,8 +183,7 @@ public class SqlFieldHolder {
|
||||
return data;
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (dtoType.equals(LocalDate.class)) {
|
||||
} else if (dtoType.equals(LocalDate.class)) {
|
||||
converter = data -> {
|
||||
try {
|
||||
return UtilityString.parseLocalDate(data.toString());
|
||||
@@ -227,9 +223,7 @@ public class SqlFieldHolder {
|
||||
|
||||
if (dtoType instanceof Class && ((Class) dtoType).isEnum()) {
|
||||
final Class clazz = (Class) dtoType;
|
||||
if (sqlType.equals(String.class)) {
|
||||
converter = data -> Enum.valueOf(clazz, (String) data);
|
||||
} else if (IBaseEnum.class.isAssignableFrom(clazz)) {
|
||||
if (IBaseEnum.class.isAssignableFrom(clazz)) {
|
||||
converter = data -> {
|
||||
try {
|
||||
Method method = clazz.getMethod("from", Object.class);
|
||||
@@ -238,6 +232,8 @@ public class SqlFieldHolder {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
};
|
||||
} else if (sqlType.equals(String.class)) {
|
||||
converter = data -> Enum.valueOf(clazz, (String) data);
|
||||
} else {
|
||||
converter = data -> {
|
||||
try {
|
||||
@@ -789,7 +785,7 @@ public class SqlFieldHolder {
|
||||
}
|
||||
|
||||
public static String getSqlValueFieldAsString(Object obj, boolean removeSpace) {
|
||||
String dato = null;
|
||||
String dato;
|
||||
if (obj != null && obj.getClass().isEnum()) {
|
||||
if (IBaseEnum.class.isAssignableFrom(obj.getClass())) {
|
||||
obj = ((IBaseEnum) obj).get();
|
||||
@@ -797,8 +793,8 @@ public class SqlFieldHolder {
|
||||
obj = obj.toString();
|
||||
}
|
||||
}
|
||||
if (obj instanceof String) {
|
||||
String string = (String) obj;
|
||||
if (obj instanceof String || obj instanceof Character) {
|
||||
String string = obj instanceof String ? (String) obj : obj.toString();
|
||||
if (removeSpace)
|
||||
string = string.trim();
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ public class SteUPService {
|
||||
LocalDate now = UtilityLocalDate.getNow();
|
||||
|
||||
String pathFile = UtilityDirs.getEmsApiTempDirectoryPath() + File.separator + userNameCreator + File.separator;
|
||||
String fileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".json";
|
||||
String fileName = codMdep + "_" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".json";
|
||||
StringWriter writer = new StringWriter();
|
||||
new ObjectMapper().writeValue(writer, entry);
|
||||
String contentBody = writer.toString();
|
||||
@@ -702,11 +702,16 @@ public class SteUPService {
|
||||
|
||||
for (Map.Entry<String, List<HashMap<String, Object>>> entry : pluByCodMarts.entrySet()) {
|
||||
List<HashMap<String, Object>> hashMapList = entry.getValue();
|
||||
String codMart = entry.getKey();
|
||||
System.out.println(codMart);
|
||||
|
||||
boolean containBarcode = hashMapList.stream().anyMatch(x -> finalBarcodes.contains(((String) x.get("barcode"))));
|
||||
|
||||
if (!containBarcode)
|
||||
barcodes.add(hashMapList.stream().filter(x -> x.get("barcode") !=null).findFirst().map(x -> x.get("barcode").toString()).get());
|
||||
if (!containBarcode) {
|
||||
java.util.stream.Stream<HashMap<String, Object>> barcode = hashMapList.stream().filter(x -> x.get("barcode") != null);
|
||||
if (barcode.count() > 0)
|
||||
barcodes.add(barcode.findFirst().map(x -> x.get("barcode").toString()).get());
|
||||
}
|
||||
}
|
||||
// barcodes = pluRepo.stream().filter(a-> !finalBarcodes.contains(((String) a.get("barcode")))).map(a->(String) a.get("barcode")).collect(Collectors.toList());
|
||||
} else {
|
||||
|
||||
@@ -742,8 +742,8 @@ public class DocumentiExportManagerService {
|
||||
|
||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||
|
||||
EntityExportResponse<List<File>> entityResponse = new EntityExportResponse<List<File>>();
|
||||
entityResponse.setResponse(new ArrayList<File>());
|
||||
EntityExportResponse<List<File>> entityResponse = new EntityExportResponse<>();
|
||||
entityResponse.setResponse(new ArrayList<>());
|
||||
|
||||
Map<String, String> setup = setupGest.getExportSetupSection(conn, type, format);
|
||||
|
||||
@@ -799,20 +799,14 @@ public class DocumentiExportManagerService {
|
||||
" FROM Wtb_users inner join Wtb_user_groups on Wtb_users.key_group = Wtb_user_groups.Key_group " +
|
||||
" WHERE Wtb_users.user_name = " + UtilityDB.valueToString(user.getUserName());
|
||||
|
||||
PreparedStatement ps = conn.prepareStatement(query);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
HashMap<String, Object> datiUtente = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, query);
|
||||
|
||||
String userCode = "";
|
||||
String userGroup = "";
|
||||
|
||||
if (rs.next()) {
|
||||
userCode = UtilityString.streNull(rs.getString("user_code"));
|
||||
userGroup = UtilityString.streNull(rs.getString("user_group"));
|
||||
if (UtilityHashMap.isPresent(datiUtente) ) {
|
||||
userCode = UtilityString.streNull(UtilityHashMap.getValueIfExists(datiUtente, "user_code"));
|
||||
userGroup = UtilityString.streNull(UtilityHashMap.getValueIfExists(datiUtente, "user_group"));
|
||||
}
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
|
||||
String whereCondDoc = "";
|
||||
String tableNameCondDoc = "";
|
||||
|
||||
@@ -869,20 +863,19 @@ public class DocumentiExportManagerService {
|
||||
query = UtilityDB.addwhereCond(query, whereCondFiltro, false);
|
||||
query = UtilityDB.addwhereCond(query, whereCondDoc, false);
|
||||
|
||||
ps = conn.prepareStatement(query);
|
||||
rs = ps.executeQuery();
|
||||
List<HashMap<String, Object>> listaDoc = UtilityDB.executeSimpleQuery(conn, query);
|
||||
|
||||
while (rs.next()) {
|
||||
String codAnag = rs.getString("cod_anag");
|
||||
String codVdes = rs.getString("cod_vdes");
|
||||
Date dataDoc = rs.getDate("data_doc");
|
||||
String serDoc = rs.getString("ser_doc");
|
||||
Integer numDoc = (Integer) rs.getObject("num_doc");
|
||||
String codFornTD = rs.getString("cod_forn_td");
|
||||
String nomeFile = rs.getString("nome_file");
|
||||
String gestione = rs.getString("gestione");
|
||||
Timestamp dataFile = rs.getTimestamp("data_file");
|
||||
String codDtip = rs.getString("cod_dtip");
|
||||
for ( HashMap<String, Object> doc : listaDoc ) {
|
||||
String codAnag = UtilityHashMap.getValueIfExists (doc, "cod_anag");
|
||||
String codVdes = UtilityHashMap.getValueIfExists (doc, "cod_vdes");
|
||||
Date dataDoc = UtilityHashMap.getValueIfExists (doc,"data_doc");
|
||||
String serDoc = UtilityHashMap.getValueIfExists (doc, "ser_doc");
|
||||
Integer numDoc = UtilityHashMap.getValueIfExists (doc,"num_doc");
|
||||
String codFornTD = UtilityHashMap.getValueIfExists (doc, "cod_forn_td");
|
||||
String nomeFile = UtilityHashMap.getValueIfExists (doc, "nome_file");
|
||||
String gestione = UtilityHashMap.getValueIfExists (doc, "gestione");
|
||||
Timestamp dataFile = UtilityHashMap.getValueIfExists (doc,"data_file");
|
||||
String codDtip = UtilityHashMap.getValueIfExists (doc, "cod_dtip");
|
||||
|
||||
if (gestione.equalsIgnoreCase("A") && UtilityString.isNullOrEmpty(codVdes)) {
|
||||
throw new Exception("Attenzione, ci sono dei documenti senza codice destinatario, impossibile esportare");
|
||||
@@ -1030,7 +1023,7 @@ public class DocumentiExportManagerService {
|
||||
+ " azienda.cod_fiscale as c_fisc_clie, "
|
||||
+ " gtb_anag.part_iva as p_iva_forn, "
|
||||
+ " IsNull(vtb_dest.cod_affiliazione, dtb_ordt.cod_vdes) as cod_deposito, "
|
||||
+ " mtb_depo.cod_mdep as cod_dest, "
|
||||
+ " IsNull(mtb_depo_intercode.intercode, mtb_depo.cod_mdep) as cod_dest, "
|
||||
+ " dtb_tipi.segno_qta_scar - dtb_tipi.segno_qta_car AS flag_ven_res, "
|
||||
+ " dtb_doct.data_doc_val AS data_doc_val, "
|
||||
+ " dtb_doct.num_doc_val AS num_doc_val, "
|
||||
@@ -1213,19 +1206,10 @@ public class DocumentiExportManagerService {
|
||||
query = UtilityDB.addwhereCond(query, whereCond, true);
|
||||
query = UtilityDB.addwhereCond(query, whereCondFiltro, true);
|
||||
|
||||
PreparedStatement psRow = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
ResultSet rsRow = psRow.executeQuery();
|
||||
rsRow.last();
|
||||
Integer countRow = rsRow.getRow();
|
||||
rsRow.beforeFirst();
|
||||
|
||||
if (countRow > 0) {
|
||||
ResultSetMapper mapper = new ResultSetMapper();
|
||||
|
||||
String stringFile = mapper.mapResultSetToCSV(rsRow, DocumentiDialogoDTO.Export.class, '\t', true, true);
|
||||
String stringFile = new ResultSetMapper().mapQueryToCSV(conn, query, DocumentiDialogoDTO.Export.class, '\t', true, true);
|
||||
|
||||
if ( !UtilityString.isNullOrEmpty(stringFile)) {
|
||||
String filePath = pathFile + File.separator + fileName;
|
||||
|
||||
//Salvare il file
|
||||
File file = new File(filePath);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
@@ -1234,13 +1218,8 @@ public class DocumentiExportManagerService {
|
||||
IOUtils.closeQuietly(fos);
|
||||
entityResponse.getResponse().add(file);
|
||||
}
|
||||
rsRow.close();
|
||||
psRow.close();
|
||||
}
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
|
||||
query =
|
||||
"SELECT dtb_doct.cod_anag, " +
|
||||
"dtb_doct.cod_vdes, " +
|
||||
@@ -1259,14 +1238,8 @@ public class DocumentiExportManagerService {
|
||||
query = UtilityDB.addwhereCond(query, whereCondFiltro, false);
|
||||
query = UtilityDB.addwhereCond(query, whereCondDoc, false);
|
||||
|
||||
ps = conn.prepareStatement(query);
|
||||
rs = ps.executeQuery();
|
||||
|
||||
ResultSetMapper mapperDtbDoct = new ResultSetMapper();
|
||||
List<DtbDoct> dtbDoctList = mapperDtbDoct.mapResultSetToList(rs, DtbDoct.class);
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
List<DtbDoct> dtbDoctList = new ResultSetMapper().mapQuerySetToList(conn, query, DtbDoct.class);
|
||||
|
||||
entityResponse.setExtraInfo(dtbDoctList);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@@ -319,7 +320,7 @@ public class OrdiniBiolevanteExchService {
|
||||
dtbOrdr.setCodTcolUl(codTcolUl);
|
||||
dtbOrdr.setDataCons(dataCons);
|
||||
if (UtilityString.streNull(flagStato).compareTo("I") == 0) {
|
||||
dtbOrdr.setFlagEvaso("A");
|
||||
dtbOrdr.setFlagEvaso(FlagEvaso.ANNULLATO);
|
||||
}
|
||||
if (!UtilityString.isNullOrEmpty(noteRigaOrd)) {
|
||||
dtbOrdr.setNote(noteRigaOrd);
|
||||
|
||||
@@ -20,6 +20,7 @@ import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.exception.EntityException;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.ApplicationName;
|
||||
@@ -977,7 +978,7 @@ public class OrdiniWebImportService {
|
||||
dtbOrdr.setGruppoCons(gruppoCons);
|
||||
dtbOrdr.setCodOann(codOann);
|
||||
dtbOrdr.setPartitaMag(partitaMag);
|
||||
dtbOrdr.setFlagEvaso(flagEvaso);
|
||||
dtbOrdr.setFlagEvaso(FlagEvaso.from(flagEvaso));
|
||||
dtbOrdr.setValUntIva(wrapperInnerRs.getBigDecimal("val_unt_iva"));
|
||||
/*
|
||||
PER LE AZIENDE FLOROVIVAISTICHE E' NECESSARIO:
|
||||
|
||||
@@ -9,6 +9,7 @@ import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity._enum.FlagEvaso;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@@ -367,7 +368,7 @@ public class ProductionLineClosureService {
|
||||
dtbOrdr.setDataOrd(dataOrdRif);
|
||||
dtbOrdr.setNumOrd(numOrdRif);
|
||||
dtbOrdr.setRigaOrd(rigaOrdRif);
|
||||
dtbOrdr.setFlagEvaso("E");
|
||||
dtbOrdr.setFlagEvaso(FlagEvaso.EVASO);
|
||||
List<DtbOrdr> listDtbOrdr = new ArrayList<DtbOrdr>();
|
||||
listDtbOrdr.add(dtbOrdr);
|
||||
dtbOrdt.setDtbOrdr(listDtbOrdr);
|
||||
|
||||
Reference in New Issue
Block a user