[ROSSOGARGANO]

fix creazione colli di scarico mp
fix creazione campi senza destinatario
This commit is contained in:
2024-08-01 13:18:16 +02:00
parent 7052434ff1
commit 86ea8ccc36
3 changed files with 13 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ public class AgribookFieldService {
public List<EntityBase> createField(MultiDBTransactionManager connection, AgribookNewFieldRequestDTO dto, String username, RequestDataDTO requestDataDTO) throws Exception { public List<EntityBase> createField(MultiDBTransactionManager connection, AgribookNewFieldRequestDTO dto, String username, RequestDataDTO requestDataDTO) throws Exception {
List<EntityBase> entityList = new ArrayList<>(); List<EntityBase> entityList = new ArrayList<>();
String codVdes = UtilityString.isNull(dto.getCodVdes(), this.suggestCodVdes(connection, dto.getCodAnag())); String codVdes = UtilityString.isNull(dto.getCodVdes(), dto.isNewDes()?this.suggestCodVdes(connection, dto.getCodAnag()):null);
if (dto.isNewDes()) { if (dto.isNewDes()) {
if (UtilityString.isNullOrEmpty(codVdes)) { if (UtilityString.isNullOrEmpty(codVdes)) {
throw new Exception("Impossibile calcolare il codice destinatario!"); throw new Exception("Impossibile calcolare il codice destinatario!");
@@ -166,7 +166,7 @@ public class AgribookFieldService {
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(),
"SELECT cod_mdep from mtb_depo where " + "SELECT cod_mdep from mtb_depo where " +
" cod_anag = " + UtilityDB.valueToString(codAnag) + " " + " cod_anag = " + UtilityDB.valueToString(codAnag) + " " +
" and cod_vdes = " + UtilityDB.valueToString(codVdes)); " and ISNULL(cod_vdes,'') = ISNULL(" + UtilityDB.valueToString(codVdes)+",'')");
} }
private String suggestCodVdes(MultiDBTransactionManager multiDBTransactionManager, String codAnag) throws Exception { private String suggestCodVdes(MultiDBTransactionManager multiDBTransactionManager, String codAnag) throws Exception {

View File

@@ -11,6 +11,7 @@ public class MagazzinoBufferVersamentoMaterialeRequestDTO {
private String serCollo; private String serCollo;
private Integer numCollo; private Integer numCollo;
private LocalDate dataCollo; private LocalDate dataCollo;
private String codJfas;
public MtbColt getInputMtbColt() { public MtbColt getInputMtbColt() {
@@ -49,4 +50,13 @@ public class MagazzinoBufferVersamentoMaterialeRequestDTO {
this.dataCollo = dataCollo; this.dataCollo = dataCollo;
return this; return this;
} }
public String getCodJfas() {
return codJfas;
}
public MagazzinoBufferVersamentoMaterialeRequestDTO setCodJfas(String codJfas) {
this.codJfas = codJfas;
return this;
}
} }

View File

@@ -99,6 +99,7 @@ public class WMSMagazzinoBufferService {
.setNumCollo(magazzinoBufferVersamentoMaterialeRequestDTO.getNumCollo()) .setNumCollo(magazzinoBufferVersamentoMaterialeRequestDTO.getNumCollo())
.setCodMdep(mtbColtRef.getCodMdep()) .setCodMdep(mtbColtRef.getCodMdep())
.setPosizione(posizione) .setPosizione(posizione)
.setCodJfas(magazzinoBufferVersamentoMaterialeRequestDTO.getCodJfas())
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO)); .setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO));
wmsLavorazioneService.insertUDSRow(new InsertUDSRowRequestDTO() wmsLavorazioneService.insertUDSRow(new InsertUDSRowRequestDTO()