Aggiunti servizi per retrieve lista resi fornitori
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:
@@ -278,7 +278,7 @@
|
||||
}, {
|
||||
"profileName" : "IME_TE",
|
||||
"connectionType" : "MSSQL",
|
||||
"dbName" : "IME_TE",
|
||||
"dbName" : "IME_TE_peppe",
|
||||
"username" : "SA",
|
||||
"password" : "sZ",
|
||||
"host" : "192.168.2.214",
|
||||
|
||||
@@ -102,7 +102,7 @@ public enum IntegryCustomerDB {
|
||||
Igood_ShopService("shop_service"),
|
||||
|
||||
|
||||
Ime_ImeTe("ime_te"),
|
||||
Ime_ImeTe("ime_te_peppe"),
|
||||
|
||||
|
||||
Integry_Studioml("studioml"),
|
||||
|
||||
@@ -15,7 +15,8 @@ public class Migration_20250417110238 extends BaseMigration implements Migration
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Maggio_MaggioSrl) &&
|
||||
!isCustomerDb(IntegryCustomerDB.Biolevante_Biolevante))
|
||||
!isCustomerDb(IntegryCustomerDB.Biolevante_Biolevante) &&
|
||||
!isCustomerDb(IntegryCustomerDB.Ime_ImeTe))
|
||||
return;
|
||||
|
||||
//Aggiorno la view mvw_mtb_colr_with_giacenza
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package it.integry.ems_model.entity.key;
|
||||
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
public class DtbDocrKey extends DtbDoctKey {
|
||||
|
||||
@SqlField("id_riga")
|
||||
private int idRiga;
|
||||
|
||||
public DtbDocrKey() {
|
||||
}
|
||||
|
||||
public DtbDocrKey(String codAnag, String codDtip, LocalDate dataDoc, Integer numDoc, String serDoc, int idRiga) {
|
||||
super(codAnag, codDtip, dataDoc, numDoc, serDoc);
|
||||
this.idRiga = idRiga;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof DtbDocrKey)) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
DtbDocrKey that = (DtbDocrKey) o;
|
||||
return getIdRiga() == that.getIdRiga();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode(), getIdRiga());
|
||||
}
|
||||
|
||||
public int getIdRiga() {
|
||||
return idRiga;
|
||||
}
|
||||
|
||||
public DtbDocrKey setIdRiga(int idRiga) {
|
||||
this.idRiga = idRiga;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package it.integry.ems_model.entity.key;
|
||||
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class MtbColrKey extends MtbColtKey {
|
||||
|
||||
@SqlField("riga")
|
||||
private int riga;
|
||||
|
||||
public MtbColrKey() {
|
||||
|
||||
@@ -447,6 +447,15 @@ public class WMSUtility {
|
||||
.setNote(insertUDCRowRequestDTO.getDescrizione());
|
||||
}
|
||||
|
||||
if(insertUDCRowRequestDTO.getDocumentReso() != null) {
|
||||
targetMtbColr.setCodAnagDoc(insertUDCRowRequestDTO.getDocumentReso().getCodAnag())
|
||||
.setCodDtipDoc(insertUDCRowRequestDTO.getDocumentReso().getCodDtip())
|
||||
.setSerDoc(insertUDCRowRequestDTO.getDocumentReso().getSerDoc())
|
||||
.setNumDoc(insertUDCRowRequestDTO.getDocumentReso().getNumDoc())
|
||||
.setDataDoc(UtilityDate.toDate(insertUDCRowRequestDTO.getDocumentReso().getDataDoc()))
|
||||
.setIdRigaDoc(insertUDCRowRequestDTO.getDocumentReso().getIdRiga());
|
||||
}
|
||||
|
||||
targetMtbColr.setOperation(OperationType.INSERT);
|
||||
targetMtbColt.getMtbColr().add(targetMtbColr);
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class WMSAccettazioneService {
|
||||
String defaultPosizioneColliAccettazione = setupGest.getSetup("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE");
|
||||
|
||||
MtbColt udcMtbColt = new MtbColt()
|
||||
.setGestione(GestioneEnum.ACQUISTO.getText())
|
||||
.setGestione(createUDCRequestDTO.isReso() ? GestioneEnum.VENDITA.getText() : GestioneEnum.ACQUISTO.getText())
|
||||
.setNumCollo(createUDCRequestDTO.getNumCollo())
|
||||
.setSerCollo(createUDCRequestDTO.getSerCollo())
|
||||
.setCodMdep(createUDCRequestDTO.getCodMdep())
|
||||
|
||||
@@ -17,6 +17,7 @@ public class CreateUDCRequestDTO {
|
||||
private String posizione;
|
||||
|
||||
private String annotazioni;
|
||||
private boolean reso;
|
||||
|
||||
private String barcodeUl;
|
||||
|
||||
@@ -86,6 +87,15 @@ public class CreateUDCRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isReso() {
|
||||
return reso;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setReso(boolean reso) {
|
||||
this.reso = reso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.retail.wms.dto;
|
||||
|
||||
import it.integry.ems_model.entity.MtbColt;
|
||||
import it.integry.ems_model.entity.key.DtbDocrKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -31,6 +32,8 @@ public class InsertUDCRowRequestDTO {
|
||||
|
||||
private String fullName;
|
||||
|
||||
private DtbDocrKey documentReso;
|
||||
|
||||
public MtbColt getTargetMtbColt() {
|
||||
return targetMtbColt;
|
||||
}
|
||||
@@ -201,4 +204,13 @@ public class InsertUDCRowRequestDTO {
|
||||
this.fullName = fullName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DtbDocrKey getDocumentReso() {
|
||||
return documentReso;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setDocumentReso(DtbDocrKey documentReso) {
|
||||
this.documentReso = documentReso;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package it.integry.ems.retail.wms.generic.controller;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.Import.dto.AnomalieDTO;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.properties.EmsProperties;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.retail.dto.PrintOrderCloseDTO;
|
||||
import it.integry.ems.retail.pvmRetail.dto.GiacenzaColliInMagDTO;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package it.integry.ems.retail.wms.vendita.controller;
|
||||
package it.integry.ems.retail.wms.resi.controller;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.retail.wms.vendita.dto.RetrieveDocumentsByBarcodeUdcResponseDTO;
|
||||
import it.integry.ems.retail.wms.vendita.dto.RetrieveUltimeConsegneClienteResponseDTO;
|
||||
import it.integry.ems.retail.wms.vendita.service.WMSResiClientiService;
|
||||
import it.integry.ems.retail.wms.resi.dto.RetrieveDocumentsByBarcodeUdcResponseDTO;
|
||||
import it.integry.ems.retail.wms.resi.dto.RetrieveUltimeConsegneClienteResponseDTO;
|
||||
import it.integry.ems.retail.wms.resi.service.WMSResiClientiService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -0,0 +1,52 @@
|
||||
package it.integry.ems.retail.wms.resi.controller;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.retail.wms.resi.dto.RetrieveUltimiArriviFornitoriRequestDTO;
|
||||
import it.integry.ems.retail.wms.resi.dto.RetrieveUltimiArriviFornitoriResponseDTO;
|
||||
import it.integry.ems.retail.wms.resi.service.WMSResiFornitoreService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@Scope("request")
|
||||
@RequestMapping("wms/resi-fornitore")
|
||||
public class WMSResiFornitoreController {
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private WMSResiFornitoreService wmsResiFornitoreService;
|
||||
|
||||
@Autowired
|
||||
private MultiDBTransactionManager multiDBTransactionManager;
|
||||
|
||||
@GetMapping("retrieve-fornitori")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse retrieveClienti() throws Exception {
|
||||
return ServiceRestResponse.createEntityPositiveResponse(wmsResiFornitoreService.retrieveFornitori());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = "retrieve-ultimi-arrivi")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse retrieveUltimiArrivi(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestParam String codMdep,
|
||||
@RequestBody RetrieveUltimiArriviFornitoriRequestDTO requestBody) throws Exception {
|
||||
|
||||
RetrieveUltimiArriviFornitoriResponseDTO response = new RetrieveUltimiArriviFornitoriResponseDTO()
|
||||
.setDocuments(wmsResiFornitoreService.retrieveUltimiArrivi(codMdep,
|
||||
requestBody.getCodAnag(),
|
||||
requestBody.getCodMarts(),
|
||||
requestBody.getLimitConsegnePerCli(),
|
||||
requestBody.getLimitDays()));
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(response);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.integry.ems.retail.wms.vendita.dto;
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
@@ -54,6 +54,9 @@ public class ResoClienteDTO {
|
||||
@SqlField("cod_mdep")
|
||||
private String codMdep;
|
||||
|
||||
@SqlField("data_reg")
|
||||
private LocalDate dataReg;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
@@ -197,4 +200,13 @@ public class ResoClienteDTO {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataReg() {
|
||||
return dataReg;
|
||||
}
|
||||
|
||||
public ResoClienteDTO setDataReg(LocalDate dataReg) {
|
||||
this.dataReg = dataReg;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class ResoFornitoreDTO {
|
||||
|
||||
|
||||
@SqlField("cod_anag")
|
||||
private String codAnag;
|
||||
|
||||
@SqlField("counter_consegna")
|
||||
private long counterConsegna;
|
||||
|
||||
@SqlField("cod_dtip")
|
||||
private String codDtip;
|
||||
|
||||
@SqlField("data_doc")
|
||||
private LocalDate dataDoc;
|
||||
|
||||
@SqlField("ser_doc")
|
||||
private String serDoc;
|
||||
|
||||
@SqlField("num_doc")
|
||||
private int numDoc;
|
||||
|
||||
@SqlField("destinatario")
|
||||
private String destinatario;
|
||||
|
||||
@SqlField("indirizzo")
|
||||
private String indirizzo;
|
||||
|
||||
@SqlField("rag_soc")
|
||||
private String ragSoc;
|
||||
|
||||
@SqlField("compilato_da")
|
||||
private String compilatoDa;
|
||||
|
||||
@SqlField("rif_ord")
|
||||
private String rifOrd;
|
||||
|
||||
@SqlField("data_ord")
|
||||
private LocalDate dataOrd;
|
||||
|
||||
@SqlField("num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@SqlField("data_iniz_trasp")
|
||||
private LocalDate dataInizTrasp;
|
||||
|
||||
@SqlField("gestione")
|
||||
private String gestione;
|
||||
|
||||
@SqlField("cod_mdep")
|
||||
private String codMdep;
|
||||
|
||||
@SqlField("data_reg")
|
||||
private LocalDate dataReg;
|
||||
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getCounterConsegna() {
|
||||
return counterConsegna;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setCounterConsegna(long counterConsegna) {
|
||||
this.counterConsegna = counterConsegna;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setDataDoc(LocalDate dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setNumDoc(int numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDestinatario() {
|
||||
return destinatario;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setDestinatario(String destinatario) {
|
||||
this.destinatario = destinatario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return indirizzo;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setIndirizzo(String indirizzo) {
|
||||
this.indirizzo = indirizzo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRagSoc() {
|
||||
return ragSoc;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setRagSoc(String ragSoc) {
|
||||
this.ragSoc = ragSoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCompilatoDa() {
|
||||
return compilatoDa;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setCompilatoDa(String compilatoDa) {
|
||||
this.compilatoDa = compilatoDa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRifOrd() {
|
||||
return rifOrd;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setRifOrd(String rifOrd) {
|
||||
this.rifOrd = rifOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setDataOrd(LocalDate dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataInizTrasp() {
|
||||
return dataInizTrasp;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setDataInizTrasp(LocalDate dataInizTrasp) {
|
||||
this.dataInizTrasp = dataInizTrasp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataReg() {
|
||||
return dataReg;
|
||||
}
|
||||
|
||||
public ResoFornitoreDTO setDataReg(LocalDate dataReg) {
|
||||
this.dataReg = dataReg;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.integry.ems.retail.wms.vendita.dto;
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import it.integry.ems_model.entity.key.DtbDoctKey;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.integry.ems.retail.wms.vendita.dto;
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RetrieveUltimiArriviFornitoriRequestDTO {
|
||||
|
||||
|
||||
private String codAnag;
|
||||
private List<String> codMarts;
|
||||
private Integer limitConsegnePerCli;
|
||||
private Integer limitDays;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public RetrieveUltimiArriviFornitoriRequestDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getCodMarts() {
|
||||
return codMarts;
|
||||
}
|
||||
|
||||
public RetrieveUltimiArriviFornitoriRequestDTO setCodMarts(List<String> codMarts) {
|
||||
this.codMarts = codMarts;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getLimitConsegnePerCli() {
|
||||
return limitConsegnePerCli;
|
||||
}
|
||||
|
||||
public RetrieveUltimiArriviFornitoriRequestDTO setLimitConsegnePerCli(Integer limitConsegnePerCli) {
|
||||
this.limitConsegnePerCli = limitConsegnePerCli;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getLimitDays() {
|
||||
return limitDays;
|
||||
}
|
||||
|
||||
public RetrieveUltimiArriviFornitoriRequestDTO setLimitDays(Integer limitDays) {
|
||||
this.limitDays = limitDays;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package it.integry.ems.retail.wms.resi.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RetrieveUltimiArriviFornitoriResponseDTO {
|
||||
|
||||
private List<ResoFornitoreDTO> documents;
|
||||
|
||||
|
||||
public List<ResoFornitoreDTO> getDocuments() {
|
||||
return documents;
|
||||
}
|
||||
|
||||
public RetrieveUltimiArriviFornitoriResponseDTO setDocuments(List<ResoFornitoreDTO> documents) {
|
||||
this.documents = documents;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package it.integry.ems.retail.wms.vendita.service;
|
||||
package it.integry.ems.retail.wms.resi.service;
|
||||
|
||||
import it.integry.ems.retail.wms.vendita.dto.ResoClienteDTO;
|
||||
import it.integry.ems.retail.wms.resi.dto.ResoClienteDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UserSession;
|
||||
import it.integry.ems_model.entity.GtbAnag;
|
||||
@@ -38,7 +38,8 @@ public class WMSResiClientiService {
|
||||
|
||||
String sql = "SELECT consegne.*, " +
|
||||
" rag_soc," +
|
||||
" dtb_doct.gestione " +
|
||||
" dtb_doct.gestione, " +
|
||||
" dtb_doct.data_reg " +
|
||||
"FROM WMS_GetUltimeConsegneClienti(" +
|
||||
limitConsegnePerCli + ", " +
|
||||
UtilityDB.valueToString(codAnag) + ", " +
|
||||
@@ -0,0 +1,64 @@
|
||||
package it.integry.ems.retail.wms.resi.service;
|
||||
|
||||
import it.integry.ems.retail.wms.resi.dto.ResoFornitoreDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UserSession;
|
||||
import it.integry.ems_model.entity.AtbForn;
|
||||
import it.integry.ems_model.entity.GtbAnag;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
public class WMSResiFornitoreService {
|
||||
|
||||
@Autowired
|
||||
private MultiDBTransactionManager multiDBTransactionManager;
|
||||
|
||||
@Autowired
|
||||
private UserSession userSession;
|
||||
|
||||
public List<GtbAnag> retrieveFornitori() throws Exception {
|
||||
String sql = "SELECT DISTINCT " + GtbAnag.ENTITY + ".* " +
|
||||
"FROM " + GtbAnag.ENTITY + " " +
|
||||
"INNER JOIN " + AtbForn.ENTITY + " ON " + AtbForn.ENTITY + ".cod_anag = " + GtbAnag.ENTITY + ".cod_anag " +
|
||||
"WHERE flag_stato = 'A'";
|
||||
|
||||
final List<GtbAnag> result = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, GtbAnag.class);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<ResoFornitoreDTO> retrieveUltimiArrivi(String codMdep, String codAnag, List<String> codMarts, Integer limitConsegnePerCli, Integer limitDays) throws Exception {
|
||||
|
||||
String codMartsJoined = null;
|
||||
|
||||
if (codMarts != null && !codMarts.isEmpty()) {
|
||||
codMartsJoined = StringUtils.join(codMarts, "|");
|
||||
}
|
||||
|
||||
String sql = "SELECT consegne.*, " +
|
||||
" rag_soc," +
|
||||
" dtb_doct.gestione, " +
|
||||
" dtb_doct.data_reg " +
|
||||
"FROM WMS_GetUltimeConsegneFornitori(" +
|
||||
limitConsegnePerCli + ", " +
|
||||
UtilityDB.valueToString(codAnag) + ", " +
|
||||
UtilityDB.valueToString(codMartsJoined) + ", " +
|
||||
UtilityDB.valueToString(codMdep) + ", " +
|
||||
(limitDays == null ? 60 : limitDays) + ") consegne " +
|
||||
"INNER JOIN dtb_doct ON consegne.num_doc = dtb_doct.num_doc AND consegne.data_doc = dtb_doct.data_doc AND consegne.cod_anag = dtb_doct.cod_anag AND consegne.cod_dtip = dtb_doct.cod_dtip AND consegne.ser_doc = dtb_doct.ser_doc " +
|
||||
"LEFT OUTER JOIN gtb_anag ON consegne.cod_anag = gtb_anag.cod_anag " +
|
||||
"ORDER BY rag_soc, " +
|
||||
" counter_consegna ";
|
||||
|
||||
final List<ResoFornitoreDTO> result = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, ResoFornitoreDTO.class);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user