[WMS] Implementati documenti scarico in CloseUDS del Picking Libero di Lavorazione
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913102433 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PICKING", "PICKING_LIBERO", "FLAG_ASK_COMMESSA_LAV", "N",
|
||||
"Se 'S' allora all'apertura del Picking Libero di lavorazione verrà chiesta la commessa", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
createSetup("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_CAR", "N",
|
||||
"Se 'S' abilita la generazione dei documenti di carico lavorazione. Il codice documento è letto dalla setup W_PORDI_RC > SETUP_DOCUMENTI > COD_DTIP_CAR.", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
createSetup("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_SCAR", "N",
|
||||
"Se 'S' abilita la generazione dei documenti di scarico lavorazione. Il codice documento è letto dalla setup W_PORDI_RC > SETUP_DOCUMENTI > COD_DTIP_SCAR.", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -356,7 +356,7 @@ public class OrtoFruttaProductionService {
|
||||
if (colloDest == null) {
|
||||
colloDest = wmsLavorazioneService.createUDC(new CreateUDCRequestDTO().setCodMdep(posizione.getCodMdep()).setPosizione(posizione.getPosizione()));
|
||||
}
|
||||
wmsGenericService.spostaArtsTraUL(collo, colloDest);
|
||||
wmsGenericService.spostaArtsTraUL(collo, colloDest, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ public class WMSAccettazioneService {
|
||||
|
||||
|
||||
colloDest.setMtbCols(new ArrayList<>());
|
||||
wmsGenericService.spostaArtsTraUL(udc, colloDest);
|
||||
wmsGenericService.spostaArtsTraUL(udc, colloDest, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -655,7 +655,7 @@ public class WMSAccettazioneService {
|
||||
colloDest.setMtbCols(new ArrayList<>());
|
||||
colloDest.setMtbColr(new ArrayList<>());
|
||||
colloCarico.getMtbColr().get(0).setDatetimeRow(DateUtils.addMinutes(Calendar.getInstance().getTime(), 5));
|
||||
wmsGenericService.spostaArtsTraUL(colloCarico, colloDest);
|
||||
wmsGenericService.spostaArtsTraUL(colloCarico, colloDest, false);
|
||||
|
||||
return colloCarico;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public class InsertUDSRowRequestDTO {
|
||||
private Integer numOrd;
|
||||
private Integer rigaOrd;
|
||||
|
||||
private String codJcom;
|
||||
|
||||
private String contrassegnoDa;
|
||||
|
||||
public MtbColr getSourceMtbColr() {
|
||||
@@ -124,6 +126,15 @@ public class InsertUDSRowRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public InsertUDSRowRequestDTO setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContrassegnoDa() {
|
||||
return contrassegnoDa;
|
||||
}
|
||||
|
||||
@@ -554,8 +554,12 @@ public class WMSGenericController {
|
||||
ServiceRestResponse spostaArtsTraUL(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO) throws Exception {
|
||||
|
||||
wmsGenericService.spostaArtsTraUL(spostaArtsTraULRequestDTO.getSourceMtbColt(), spostaArtsTraULRequestDTO.getDestinationMtbColt());
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
final SpostaArtsTraULResponseDTO spostaArtsTraULResponseDTO = wmsGenericService.spostaArtsTraUL(
|
||||
spostaArtsTraULRequestDTO.getSourceMtbColt(),
|
||||
spostaArtsTraULRequestDTO.getDestinationMtbColt(),
|
||||
spostaArtsTraULRequestDTO.isFlagForceUseRefs());
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(spostaArtsTraULResponseDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ public class SpostaArtsTraULRequestDTO {
|
||||
|
||||
private MtbColt destinationMtbColt;
|
||||
|
||||
private boolean flagForceUseRefs;
|
||||
|
||||
public MtbColt getSourceMtbColt() {
|
||||
return sourceMtbColt;
|
||||
}
|
||||
@@ -25,4 +27,13 @@ public class SpostaArtsTraULRequestDTO {
|
||||
this.destinationMtbColt = destinationMtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagForceUseRefs() {
|
||||
return flagForceUseRefs;
|
||||
}
|
||||
|
||||
public SpostaArtsTraULRequestDTO setFlagForceUseRefs(boolean flagForceUseRefs) {
|
||||
this.flagForceUseRefs = flagForceUseRefs;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package it.integry.ems.retail.wms.generic.dto;
|
||||
|
||||
import it.integry.ems_model.entity.MtbColr;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SpostaArtsTraULResponseDTO {
|
||||
|
||||
private List<MtbColr> generatedMtbColr;
|
||||
|
||||
|
||||
public List<MtbColr> getGeneratedMtbColr() {
|
||||
return generatedMtbColr;
|
||||
}
|
||||
|
||||
public SpostaArtsTraULResponseDTO setGeneratedMtbColr(List<MtbColr> generatedMtbColr) {
|
||||
this.generatedMtbColr = generatedMtbColr;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import it.integry.ems.service.PrinterService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UserSession;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems.utility.UtilityLogger;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
import it.integry.ems_model.entity.*;
|
||||
@@ -48,7 +47,6 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1729,7 +1727,7 @@ public class WMSGenericService {
|
||||
BigDecimal qtaCnf,
|
||||
BigDecimal numCnfToMove) throws Exception {
|
||||
|
||||
BigDecimal initialQtaToMove = new BigDecimal(qtaToMove.floatValue());
|
||||
BigDecimal initialQtaToMove = BigDecimal.valueOf(qtaToMove.floatValue());
|
||||
|
||||
if (posizioneSource == null) {
|
||||
throw new Exception("Nessuna posizione sorgente selezionata");
|
||||
@@ -1977,8 +1975,9 @@ public class WMSGenericService {
|
||||
UtilityEntity.throwEntitiesException(entitiesToSave);
|
||||
}
|
||||
|
||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destinationMtbColt) throws Exception {
|
||||
public SpostaArtsTraULResponseDTO spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destinationMtbColt, boolean flagForceUseRefs) throws Exception {
|
||||
|
||||
SpostaArtsTraULResponseDTO response = new SpostaArtsTraULResponseDTO();
|
||||
List<MtbColr> mtbColrsToMove = sourceMtbColt.getMtbColr();
|
||||
|
||||
if (mtbColrsToMove != null && !mtbColrsToMove.isEmpty()) {
|
||||
@@ -1991,8 +1990,8 @@ public class WMSGenericService {
|
||||
|
||||
boolean destroyMtbColrReferences = false;
|
||||
|
||||
//Se le gestioni sono uguali faccio uno storno sulla sorgente e non lavoro con i riferimenti
|
||||
if ((UtilityString.equalsIgnoreCase(sourceMtbColt.getGestione(), "V") && UtilityString.equalsIgnoreCase(destinationMtbColt.getGestione(), "V")) ||
|
||||
//Se le gestioni sono uguali faccio uno storno sulla sorgente e non lavoro con i riferimenti (solo se non volontariamente forzata)
|
||||
if (!flagForceUseRefs && (UtilityString.equalsIgnoreCase(sourceMtbColt.getGestione(), "V") && UtilityString.equalsIgnoreCase(destinationMtbColt.getGestione(), "V")) ||
|
||||
(UtilityString.equalsIgnoreCase(sourceMtbColt.getGestione(), "V") && sourceMtbColt.getSegno() == -1 && UtilityString.equalsIgnoreCase(destinationMtbColt.getGestione(), "L"))) {
|
||||
destroyMtbColrReferences = true;
|
||||
|
||||
@@ -2061,8 +2060,12 @@ public class WMSGenericService {
|
||||
}
|
||||
|
||||
entityProcessor.processEntityList(mtbColts, true);
|
||||
}
|
||||
UtilityEntity.throwEntitiesException(mtbColts);
|
||||
|
||||
response.setGeneratedMtbColr(destinationMtbColt.getMtbColr());
|
||||
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
public List<AnomalieDTO> scaricoMateriaPrimaDaDistintaBase(String codMdep, String codJfas, Boolean useRapportoMatPrima, List<ScaricoMateriaPrimaDTO> scaricoMateriaPrimaDTOList) throws Exception {
|
||||
|
||||
@@ -212,6 +212,8 @@ public class WMSLavorazioneService {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
mtbColtToClose.getMtbColr().clear();
|
||||
mtbColtToClose.setOraFinePrep(new Date())
|
||||
.setOperation(OperationType.UPDATE);
|
||||
@@ -291,6 +293,7 @@ public class WMSLavorazioneService {
|
||||
.setNumOrd(insertUDSRowRequestDTO.getNumOrd())
|
||||
.setRigaOrd(insertUDSRowRequestDTO.getRigaOrd())
|
||||
.setDatetimeRow(new Date())
|
||||
.setCodJcom(insertUDSRowRequestDTO.getCodJcom())
|
||||
.setMtbColrInfoProd(mtbColrInfoProd);
|
||||
targetMtbColr.setOperation(OperationType.INSERT);
|
||||
targetMtbColt.getMtbColr().add(targetMtbColr);
|
||||
|
||||
Reference in New Issue
Block a user