Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -158,7 +158,7 @@ public class JtbFlav extends EntityBase {
|
|||||||
private String iban;
|
private String iban;
|
||||||
|
|
||||||
@SqlField(value = "altre_mansioni", maxLength = 8000)
|
@SqlField(value = "altre_mansioni", maxLength = 8000)
|
||||||
private String altre_mansioni;
|
private String altreMansioni;
|
||||||
|
|
||||||
private String precode;
|
private String precode;
|
||||||
|
|
||||||
@@ -522,6 +522,10 @@ public class JtbFlav extends EntityBase {
|
|||||||
this.iban = iban;
|
this.iban = iban;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAltreMansioni() { return altreMansioni; }
|
||||||
|
|
||||||
|
public void setAltreMansioni(String altreMansioni) { this.altreMansioni = altreMansioni; }
|
||||||
|
|
||||||
public String getPrecode() {
|
public String getPrecode() {
|
||||||
return precode;
|
return precode;
|
||||||
}
|
}
|
||||||
@@ -539,13 +543,6 @@ public class JtbFlav extends EntityBase {
|
|||||||
this.jtbFlavEventi = jtbFlavEventi;
|
this.jtbFlavEventi = jtbFlavEventi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAltre_mansioni() {
|
|
||||||
return altre_mansioni;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAltre_mansioni(String altre_mansioni) {
|
|
||||||
this.altre_mansioni = altre_mansioni;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void insertChilds() throws Exception {
|
protected void insertChilds() throws Exception {
|
||||||
|
|||||||
@@ -1015,10 +1015,11 @@ public class DocumentiAcquistoImportService {
|
|||||||
anomalie.add(
|
anomalie.add(
|
||||||
AnomalieDTO.error(String.format("Nessun deposito agganciato all'intercode %s", rifOrdApulia.getCodicePv() ))
|
AnomalieDTO.error(String.format("Nessun deposito agganciato all'intercode %s", rifOrdApulia.getCodicePv() ))
|
||||||
);
|
);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String codMdep = result.get("cod_mdep").toString();
|
String codMdep = (String) result.get("cod_mdep");
|
||||||
String codForn = result.get("cod_forn").toString();
|
String codForn = (String) result.get("cod_forn");
|
||||||
|
|
||||||
sql = "select dtb_ordt.data_ord, dtb_ordt.num_ord, dtb_ordr.riga_ord, dtb_ordr.cod_mart, dtb_ordr.cod_art_for\n" +
|
sql = "select dtb_ordt.data_ord, dtb_ordt.num_ord, dtb_ordr.riga_ord, dtb_ordr.cod_mart, dtb_ordr.cod_art_for\n" +
|
||||||
"from dtb_ordt \n" +
|
"from dtb_ordt \n" +
|
||||||
@@ -1068,13 +1069,9 @@ public class DocumentiAcquistoImportService {
|
|||||||
", Codice deposito: " + codMdep
|
", Codice deposito: " + codMdep
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (!listDocumentDtb.isEmpty() && listDocumentWdtb.isEmpty()) {
|
|
||||||
entityReturn.addAll(processRifOrdApuliaList(listDocumentDtb, selectOrdine, anomalie, tipiDoc, ds, pIva, false));
|
|
||||||
} else if (listDocumentDtb.isEmpty()) {
|
|
||||||
entityReturn.addAll(processRifOrdApuliaList(listDocumentWdtb, selectOrdine, anomalie, tipiDoc, ds, pIva, true));
|
|
||||||
} else {
|
} else {
|
||||||
entityReturn.addAll(processRifOrdApuliaList(listDocumentDtb, selectOrdine, anomalie, tipiDoc, ds, pIva, false));
|
if( !listDocumentDtb.isEmpty()) entityReturn.add(processRifOrdApuliaList(listDocumentDtb, selectOrdine, anomalie, tipiDoc, ds, pIva, false));
|
||||||
entityReturn.addAll(processRifOrdApuliaList(listDocumentWdtb, selectOrdine, anomalie, tipiDoc, ds, pIva, true));
|
if( !listDocumentWdtb.isEmpty()) entityReturn.add(processRifOrdApuliaList(listDocumentWdtb, selectOrdine, anomalie, tipiDoc, ds, pIva, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1097,8 +1094,7 @@ public class DocumentiAcquistoImportService {
|
|||||||
storedProcedure.close();
|
storedProcedure.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<EntityBase> processRifOrdApuliaList(List<HashMap<String, Object>> listDocument, List<HashMap<String, Object>> selectOrdine, List<AnomalieDTO> anomalie, String tipiDoc, AdvancedDataSource ds, String pIva, boolean isWdtb) throws Exception {
|
private DtbBaseDocT processRifOrdApuliaList(List<HashMap<String, Object>> listDocument, List<HashMap<String, Object>> selectOrdine, List<AnomalieDTO> anomalie, String tipiDoc, AdvancedDataSource ds, String pIva, boolean isWdtb) throws Exception {
|
||||||
List<EntityBase> entityList = new ArrayList<>();
|
|
||||||
DtbBaseDocT dtbBaseDoct;
|
DtbBaseDocT dtbBaseDoct;
|
||||||
|
|
||||||
if (isWdtb) {
|
if (isWdtb) {
|
||||||
@@ -1114,6 +1110,11 @@ public class DocumentiAcquistoImportService {
|
|||||||
.setSerDoc(listDocument.get(0).get("ser_doc").toString())
|
.setSerDoc(listDocument.get(0).get("ser_doc").toString())
|
||||||
.setCodAnag(listDocument.get(0).get("cod_anag").toString());
|
.setCodAnag(listDocument.get(0).get("cod_anag").toString());
|
||||||
|
|
||||||
|
if (isWdtb)
|
||||||
|
((WdtbDoct) dtbBaseDoct).setWdtbDocr(new ArrayList<>());
|
||||||
|
else
|
||||||
|
((DtbDoct) dtbBaseDoct).setDtbDocr(new ArrayList<>());
|
||||||
|
|
||||||
List<DtbBaseDocR> baseDtbDocrList = new ArrayList<>();
|
List<DtbBaseDocR> baseDtbDocrList = new ArrayList<>();
|
||||||
|
|
||||||
for (HashMap<String, Object> document : listDocument) {
|
for (HashMap<String, Object> document : listDocument) {
|
||||||
@@ -1162,56 +1163,37 @@ public class DocumentiAcquistoImportService {
|
|||||||
existingObject.getSerDoc().equals(dtbBaseDocr.getSerDoc()));
|
existingObject.getSerDoc().equals(dtbBaseDocr.getSerDoc()));
|
||||||
|
|
||||||
if (!existsInList) {
|
if (!existsInList) {
|
||||||
|
if (isWdtb)
|
||||||
|
((WdtbDoct) dtbBaseDoct).getWdtbDocr().add((WdtbDocr) dtbBaseDocr);
|
||||||
|
else
|
||||||
|
((DtbDoct) dtbBaseDoct).getDtbDocr().add((DtbDocr) dtbBaseDocr);
|
||||||
baseDtbDocrList.add(dtbBaseDocr);
|
baseDtbDocrList.add(dtbBaseDocr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWdtb) {
|
|
||||||
WdtbDoct wdtbDoct = (WdtbDoct) dtbBaseDoct;
|
|
||||||
List<WdtbDocr> wdtbDocrList = new ArrayList<>();
|
|
||||||
for (DtbBaseDocR dtbBaseDocr : baseDtbDocrList) {
|
|
||||||
wdtbDocrList.add((WdtbDocr) dtbBaseDocr);
|
|
||||||
}
|
|
||||||
|
|
||||||
wdtbDoct.setWdtbDocr(wdtbDocrList);
|
|
||||||
entityList.add(wdtbDoct);
|
|
||||||
} else {
|
|
||||||
DtbDoct dtbDoct = (DtbDoct) dtbBaseDoct;
|
|
||||||
List<DtbDocr> dtbDocrList = new ArrayList<>();
|
|
||||||
for (DtbBaseDocR dtbBaseDocr : baseDtbDocrList) {
|
|
||||||
dtbDocrList.add((DtbDocr) dtbBaseDocr);
|
|
||||||
}
|
|
||||||
|
|
||||||
dtbDoct.setDtbDocr(dtbDocrList);
|
|
||||||
entityList.add(dtbDoct);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<EntityBase> entityReturn = new ArrayList<>();
|
|
||||||
MultiDBTransactionManager m = new MultiDBTransactionManager();
|
MultiDBTransactionManager m = new MultiDBTransactionManager();
|
||||||
try {
|
try {
|
||||||
m.addConnection(ds.getProfileName(), ds.getDataSource());
|
m.addConnection(ds.getProfileName(), ds.getDataSource());
|
||||||
m.setPrimaryDs(ds.getProfileName());
|
m.setPrimaryDs(ds.getProfileName());
|
||||||
|
|
||||||
for (EntityBase e : entityList) {
|
if (!isWdtb) {
|
||||||
if (!isWdtb) {
|
UpdProgOrdini(m, (DtbDoct) dtbBaseDoct, -1);
|
||||||
UpdProgOrdini(m, (DtbDoct) e, -1);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
entityProcessor.processEntity(e, true, false, requestData.getUsername(), m, false);
|
entityProcessor.processEntity(dtbBaseDoct, true, false, requestData.getUsername(), m, false);
|
||||||
entityReturn.add(e);
|
|
||||||
|
|
||||||
if (!isWdtb) {
|
|
||||||
UpdProgOrdini(m, (DtbDoct) e, 1);
|
if (!isWdtb) {
|
||||||
}
|
UpdProgOrdini(m, (DtbDoct) dtbBaseDoct, 1);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
m.rollbackAll();
|
m.rollbackAll();
|
||||||
}
|
}
|
||||||
m.closeAll();
|
m.closeAll();
|
||||||
|
|
||||||
return entityReturn;
|
return dtbBaseDoct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user