Refactoring del servizio di versamento e rientro del materiale da MES
Some checks failed
IntegryManagementSystem_Multi/pipeline/head Something is wrong with the build of this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@@ -117,7 +117,7 @@ public class DistribuzioneColliService {
|
||||
.map(MtbColr::getCodMart)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts,multiDBTransactionManager);
|
||||
List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
|
||||
//Lettura del filtro ordini
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.ems.product.importaz.service;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -25,7 +24,10 @@ import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.types.TypeDbObject;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import it.integry.ems_model.utility.UtilityBarcode;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -45,7 +47,6 @@ import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
@@ -224,7 +225,7 @@ public class ProductServices {
|
||||
}
|
||||
|
||||
public List<MtbAart> getArticoliByCodMarts(List<String> codMarts) throws Exception {
|
||||
return WMSUtility.getArticoliByCodMarts(codMarts,multiDBTransactionManager);
|
||||
return WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager.getPrimaryConnection());
|
||||
}
|
||||
|
||||
public List<EntityBase> importArticoliBiolevante() throws Exception {
|
||||
|
||||
@@ -6,39 +6,61 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class MaterialeVersatoSuOrdineDTO {
|
||||
|
||||
@SqlField("gestione")
|
||||
private String gestione;
|
||||
|
||||
@SqlField("data_collo")
|
||||
private LocalDate dataCollo;
|
||||
|
||||
@SqlField("ser_collo")
|
||||
private String serCollo;
|
||||
|
||||
@SqlField("num_collo")
|
||||
private Integer numCollo;
|
||||
|
||||
@SqlField("num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@SqlField("data_ord")
|
||||
private LocalDate dataOrd;
|
||||
|
||||
@SqlField("qta_versata")
|
||||
private BigDecimal qtaVersata;
|
||||
|
||||
@SqlField("partita_mag")
|
||||
private String partitaMag;
|
||||
|
||||
@SqlField("unt_mis")
|
||||
private String untMis;
|
||||
|
||||
@SqlField("cod_mart")
|
||||
private String codMart;
|
||||
|
||||
@SqlField("qta_cnf")
|
||||
private BigDecimal qtaCnf;
|
||||
|
||||
@SqlField("qta_cnf_art")
|
||||
private BigDecimal qtaCnfArt;
|
||||
|
||||
@SqlField("num_Cnf")
|
||||
private BigDecimal numCnf;
|
||||
|
||||
@SqlField("rap_conv2")
|
||||
private BigDecimal rapConv2;
|
||||
|
||||
@SqlField("unt_mis2")
|
||||
private String untMis2;
|
||||
|
||||
@SqlField("descrizione")
|
||||
private String descrizione;
|
||||
|
||||
@SqlField("barcode_ul_in")
|
||||
private String barcodeUlIn;
|
||||
|
||||
@SqlField("barcode_ul_out")
|
||||
private String barcodeUlOut;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
@@ -182,4 +204,22 @@ public class MaterialeVersatoSuOrdineDTO {
|
||||
this.qtaCnfArt = qtaCnfArt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUlIn() {
|
||||
return barcodeUlIn;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setBarcodeUlIn(String barcodeUlIn) {
|
||||
this.barcodeUlIn = barcodeUlIn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUlOut() {
|
||||
return barcodeUlOut;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setBarcodeUlOut(String barcodeUlOut) {
|
||||
this.barcodeUlOut = barcodeUlOut;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,13 @@ import it.integry.ems.production.dto.*;
|
||||
import it.integry.ems.report.dto.JasperDTO;
|
||||
import it.integry.ems.report.dto.PairsDTO;
|
||||
import it.integry.ems.retail.pvmRetail.service.PvmService;
|
||||
import it.integry.ems.retail.wms.Utility.WMSUtility;
|
||||
import it.integry.ems.retail.wms.dto.CreateUDSRequestDTO;
|
||||
import it.integry.ems.retail.wms.dto.CreateUDSRequestOrderDTO;
|
||||
import it.integry.ems.retail.wms.dto.InsertUDSRowRequestDTO;
|
||||
import it.integry.ems.retail.wms.generic.dto.MvwSitArtUdcDetInventarioDTO;
|
||||
import it.integry.ems.retail.wms.generic.service.WMSGenericService;
|
||||
import it.integry.ems.retail.wms.generic.service.WMSGiacenzaULService;
|
||||
import it.integry.ems.retail.wms.lavorazione.service.WMSLavorazioneService;
|
||||
import it.integry.ems.rules.completing.DocumentRules;
|
||||
import it.integry.ems.service.*;
|
||||
@@ -101,6 +103,7 @@ public class MesProductionServiceV2 {
|
||||
|
||||
@Autowired
|
||||
private MailTemplateService mailTemplateService;
|
||||
|
||||
@Autowired
|
||||
private PvmService pvmService;
|
||||
|
||||
@@ -110,6 +113,9 @@ public class MesProductionServiceV2 {
|
||||
@Autowired
|
||||
private WMSGenericService wmsGenericService;
|
||||
|
||||
@Autowired
|
||||
private WMSGiacenzaULService wmsGiacenzaULService;
|
||||
|
||||
public BasePanelAnswerDTO callSupervisorServiceGET(String serviceIp, int servicePort, String serviceName, HashMap<String, String> queryParams) throws Exception {
|
||||
String url = String.format("http://%s:%d/%s", serviceIp, servicePort, serviceName);
|
||||
StringBuilder srb = new StringBuilder();
|
||||
@@ -1309,7 +1315,7 @@ public class MesProductionServiceV2 {
|
||||
|
||||
List<MtbColr> rows = collo.getMtbColr();
|
||||
if (UtilityList.isNullOrEmpty(rows)) {
|
||||
MaterialeVersatoSuOrdineDTO versamentoSuOrdine = getVersamentoBarcodeSuOrdine(dto.getOrdine(), dto.getBarcode());
|
||||
MaterialeVersatoSuOrdineDTO versamentoSuOrdine = getPreviousVersamentoBarcodeSuOrdine(dto.getOrdine(), dto.getBarcode());
|
||||
if (versamentoSuOrdine != null && UtilityBigDecimal.greaterThan(versamentoSuOrdine.getQtaVersata(), BigDecimal.ZERO)) {
|
||||
response.setVersamento(versamentoSuOrdine);
|
||||
return response;
|
||||
@@ -1322,11 +1328,16 @@ public class MesProductionServiceV2 {
|
||||
DtbOrdt ordineLav = completeDatiOrdine(dto.getOrdine());
|
||||
String codMgrpSL = setupGest.getSetup("w_lpianoprod_rc", "SETUP", "GRUPPO_SL");
|
||||
boolean matchLottoSlToOrdine = setupGest.getSetupDetBoolean("MES", "SETUP", "VINCOLA_LOTTO_ORDINE_A_SL", dto.getCodJfas());
|
||||
List<MtbAart> arts = rows.stream().map(MtbColr::getCodMart).map(MtbAart::fromCodMart).distinct().collect(java.util.stream.Collectors.toList());
|
||||
if (arts.size() > 1)
|
||||
|
||||
List<String> codMarts = rows.stream()
|
||||
.map(MtbColr::getCodMart)
|
||||
.collect(java.util.stream.Collectors.toList());
|
||||
|
||||
if (codMarts.size() > 1)
|
||||
throw new Exception("Impossibile versare a produzione una pedana mista!");
|
||||
|
||||
final MtbAart rowArt = entityProcessor.processEntity(arts.get(0), true, multiDBTransactionManager);
|
||||
MtbAart rowArt = WMSUtility.getArticoloByCodMart(codMarts.get(0), multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
GiacenzaArtInBarcodeDTO invDto = new GiacenzaArtInBarcodeDTO();
|
||||
invDto
|
||||
.setBarcodeUl(dto.getBarcode())
|
||||
@@ -1339,9 +1350,12 @@ public class MesProductionServiceV2 {
|
||||
.setQtaCnfArt(rowArt.getQtaCnf())
|
||||
.setNumCnf(BigDecimal.ZERO);
|
||||
|
||||
entityProcessor.processEntityList(arts, true);
|
||||
for (MtbColr row : rows) {
|
||||
DtbOrdr rowOrdine = ordineLav.getDtbOrdr().stream().filter(ordRow -> ordRow.getCodMart().equalsIgnoreCase(rowArt.getCodMart())).findFirst().orElse(null);
|
||||
DtbOrdr rowOrdine = ordineLav.getDtbOrdr().stream()
|
||||
.filter(ordRow -> ordRow.getCodMart().equalsIgnoreCase(rowArt.getCodMart()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (rowOrdine == null) {
|
||||
throw new Exception(String.format("L'articolo '%s' non è presente nell'ordine selezionato!", rowArt.getCodMart()));
|
||||
// anomalie.add(AnomalieDTO.error(String.format("L'articolo '%s' non è presente nell'ordine selezionato!", rowArt.getCodMart())));
|
||||
@@ -1368,7 +1382,7 @@ public class MesProductionServiceV2 {
|
||||
|
||||
}
|
||||
|
||||
private MaterialeVersatoSuOrdineDTO getVersamentoBarcodeSuOrdine(DtbOrdt ordine, String barcode) throws Exception {
|
||||
private MaterialeVersatoSuOrdineDTO getPreviousVersamentoBarcodeSuOrdine(DtbOrdt ordine, String barcode) throws Exception {
|
||||
|
||||
Ean128Model model;
|
||||
try {
|
||||
@@ -1387,29 +1401,27 @@ public class MesProductionServiceV2 {
|
||||
" mtb_aart.unt_mis2,\n" +
|
||||
" mtb_aart.rap_conv2,\n" +
|
||||
" mtb_aart.qta_cnf as qta_cnf_art,\n" +
|
||||
" mtb_colr.qta_cnf,\n" +
|
||||
" IIF(mtb_aart.flag_qta_cnf_fissa = 'S', mtb_aart.qta_cnf, SUM(qta_col) / SUM(num_cnf)) AS qta_cnf,\n" +
|
||||
" SUM(num_cnf) AS num_cnf,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" SUM(qta_col) AS qta_versata,\n" +
|
||||
" mtb_colr.data_ord,\n" +
|
||||
" mtb_colr.num_ord\n" +
|
||||
" mtb_colr.num_ord,\n" +
|
||||
" mtb_colr.barcode_ul_out\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = mtb_colr.cod_mart\n" +
|
||||
" INNER JOIN mtb_colt ON mtb_colr.gestione = mtb_colt.gestione AND mtb_colr.data_collo = mtb_colt.data_collo AND\n" +
|
||||
" mtb_colr.ser_collo = mtb_colt.ser_collo AND mtb_colr.num_collo = mtb_colt.num_collo\n" +
|
||||
" INNER JOIN mtb_colt rif\n" +
|
||||
" ON mtb_colr.gestione_rif = rif.gestione AND mtb_colr.data_collo_rif = rif.data_collo AND\n" +
|
||||
" mtb_colr.ser_collo_rif = rif.ser_collo AND mtb_colr.num_collo_rif = rif.num_collo\n" +
|
||||
"WHERE mtb_colt.gestione = 'L'\n" +
|
||||
" AND mtb_colt.segno = -1\n" +
|
||||
" AND mtb_colr.data_ord = {}\n" +
|
||||
" AND mtb_colr.num_ord = {}\n" +
|
||||
" AND (rif.barcode_ul = {} or rif.barcode_ul ={})\n" +
|
||||
"GROUP BY mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart,\n" +
|
||||
" mtb_aart.unt_mis, mtb_colr.partita_mag, mtb_colr.data_ord, mtb_colr.num_ord,mtb_colr.qta_cnf, mtb_aart.unt_mis2,\n" +
|
||||
" mtb_aart.rap_conv2, mtb_aart.descrizione, mtb_aart.qta_cnf", ordine.getDataOrd(), ordine.getNumOrd(), barcode, sscc);
|
||||
" AND (mtb_colr.barcode_ul_out = {} or mtb_colr.barcode_ul_out = {})\n" +
|
||||
"GROUP BY mtb_aart.flag_qta_cnf_fissa, " +
|
||||
" mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart,\n" +
|
||||
" mtb_aart.unt_mis, mtb_colr.partita_mag, mtb_colr.data_ord, mtb_colr.num_ord, mtb_aart.unt_mis2,\n" +
|
||||
" mtb_aart.rap_conv2, mtb_aart.descrizione, mtb_aart.qta_cnf, mtb_colr.barcode_ul_in, mtb_colr.barcode_ul_out", ordine.getDataOrd(), ordine.getNumOrd(), barcode, sscc);
|
||||
|
||||
MaterialeVersatoSuOrdineDTO rowVersamento = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MaterialeVersatoSuOrdineDTO.class);
|
||||
|
||||
@@ -1425,13 +1437,11 @@ public class MesProductionServiceV2 {
|
||||
return ordine;
|
||||
}
|
||||
|
||||
public Object versaMaterialeSuOrdine(VersamentoMaterialeSuOrdineDTO dto) throws Exception {
|
||||
public MtbColt versaMaterialeSuOrdine(VersamentoMaterialeSuOrdineDTO dto) throws Exception {
|
||||
String sourceBarcodeUl = dto.getMtbColt().getBarcodeUl();
|
||||
|
||||
|
||||
MtbColt colloDaVersare = pvmService.getColloByBarcode(dto.getMtbColt().getBarcodeUl(), true);
|
||||
colloDaVersare.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(colloDaVersare, multiDBTransactionManager);
|
||||
List<MvwSitArtUdcDetInventarioDTO> contenuto = wmsGenericService.getGiacenzaCollo(colloDaVersare);
|
||||
List<MvwSitArtUdcDetInventarioDTO> contenuto =
|
||||
wmsGiacenzaULService.retrieveArtsInGiacenzaByBarcodeUl(multiDBTransactionManager.getPrimaryConnection(), sourceBarcodeUl);
|
||||
|
||||
if (UtilityList.isNullOrEmpty(contenuto)) {
|
||||
throw new Exception("La UL seleionata non contiene alcun articolo da versare!");
|
||||
@@ -1464,7 +1474,7 @@ public class MesProductionServiceV2 {
|
||||
}
|
||||
|
||||
List<CreateUDSRequestOrderDTO> ordini = new ArrayList<>();
|
||||
MaterialeVersatoSuOrdineDTO versamentoEsistente = getVersamentoBarcodeSuOrdine(dto.getOrdine(), colloDaVersare.getBarcodeUl());
|
||||
MaterialeVersatoSuOrdineDTO versamentoEsistente = getPreviousVersamentoBarcodeSuOrdine(dto.getOrdine(), sourceBarcodeUl);
|
||||
MtbColt uds;
|
||||
if (versamentoEsistente == null) {
|
||||
CreateUDSRequestOrderDTO orderDTO = new CreateUDSRequestOrderDTO()
|
||||
@@ -1482,7 +1492,8 @@ public class MesProductionServiceV2 {
|
||||
uds = wmsLavorazioneService.createUDS(requestDTO);
|
||||
|
||||
} else {
|
||||
uds = new MtbColt(versamentoEsistente.getGestione(), versamentoEsistente.getDataCollo(), versamentoEsistente.getNumCollo(), versamentoEsistente.getSerCollo());
|
||||
uds = new MtbColt(versamentoEsistente.getGestione(), versamentoEsistente.getDataCollo(), versamentoEsistente.getNumCollo(), versamentoEsistente.getSerCollo())
|
||||
.setBarcodeUl(versamentoEsistente.getBarcodeUlIn());
|
||||
}
|
||||
|
||||
for (MvwSitArtUdcDetInventarioDTO scarico : contenuto) {
|
||||
@@ -1497,6 +1508,9 @@ public class MesProductionServiceV2 {
|
||||
|
||||
MtbColr sourceMtbColr = new MtbColr();
|
||||
sourceMtbColr
|
||||
.setBarcodeUlIn(scarico.getBarcodeUl())
|
||||
.setPosizioneIn(scarico.getPosizione())
|
||||
.setCodMdepIn(scarico.getCodMdep())
|
||||
.setNumCollo(scarico.getNumCollo())
|
||||
.setSerCollo(scarico.getSerCollo())
|
||||
.setDataCollo(scarico.getDataCollo())
|
||||
|
||||
@@ -381,7 +381,7 @@ public class WMSUtility {
|
||||
|
||||
|
||||
if (insertUDCRowRequestDTO.getCodMart() != null) {
|
||||
MtbAart mtbAart = getArticoloByCodMart(insertUDCRowRequestDTO.getCodMart(), multiDBTransactionManager);
|
||||
MtbAart mtbAart = getArticoloByCodMart(insertUDCRowRequestDTO.getCodMart(), multiDBTransactionManager.getPrimaryConnection());
|
||||
if (mtbAart == null)
|
||||
throw new InvalidArticoloException(insertUDCRowRequestDTO.getCodMart());
|
||||
|
||||
@@ -410,18 +410,18 @@ public class WMSUtility {
|
||||
.setSavedMtbColr(targetMtbColr);
|
||||
}
|
||||
|
||||
public static MtbAart getArticoloByCodMart(String codMart, MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
public static MtbAart getArticoloByCodMart(String codMart, Connection connection) throws Exception {
|
||||
if (UtilityString.isNullOrEmpty(codMart))
|
||||
return null;
|
||||
|
||||
List<MtbAart> mtbAarts = getArticoliByCodMarts(new ArrayList<>(Collections.singleton(codMart)), multiDBTransactionManager);
|
||||
List<MtbAart> mtbAarts = getArticoliByCodMarts(new ArrayList<>(Collections.singleton(codMart)), connection);
|
||||
if (mtbAarts == null || mtbAarts.isEmpty())
|
||||
return null;
|
||||
|
||||
return mtbAarts.get(0);
|
||||
}
|
||||
|
||||
public static List<MtbAart> getArticoliByCodMarts(List<String> codMarts, MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
public static List<MtbAart> getArticoliByCodMarts(List<String> codMarts, Connection connection) throws Exception {
|
||||
if (codMarts == null || codMarts.isEmpty()) return null;
|
||||
|
||||
String query =
|
||||
@@ -430,13 +430,13 @@ public class WMSUtility {
|
||||
+ " WHERE cod_mart IN (" + UtilityQuery.concatStringFieldsWithSeparator(codMarts, ",") + ")";
|
||||
|
||||
|
||||
List<MtbAart> listMtbAart = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), query, MtbAart.class);
|
||||
List<MtbAart> listMtbAart = UtilityDB.executeSimpleQueryDTO(connection, query, MtbAart.class);
|
||||
|
||||
if (listMtbAart != null && !listMtbAart.isEmpty()) {
|
||||
List<String> untMisStrings = listMtbAart.stream()
|
||||
.map(MtbAart::getUntMis)
|
||||
.collect(Collectors.toList());
|
||||
List<MtbUntMis> listUntMis = getUntMisFromCod(untMisStrings, multiDBTransactionManager);
|
||||
List<MtbUntMis> listUntMis = getUntMisFromCod(untMisStrings, connection);
|
||||
|
||||
for (final MtbAart mtbAart : listMtbAart) {
|
||||
Optional<MtbUntMis> mtbUntMis = Stream.of(listUntMis)
|
||||
@@ -454,14 +454,14 @@ public class WMSUtility {
|
||||
return listMtbAart;
|
||||
}
|
||||
|
||||
public static List<MtbUntMis> getUntMisFromCod(List<String> untMisCods, MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
public static List<MtbUntMis> getUntMisFromCod(List<String> untMisCods, Connection connection) throws Exception {
|
||||
List<String> untMisStrings = Stream.of(untMisCods)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
String queryUntMis = "SELECT * FROM mtb_unt_mis WHERE unt_mis IN (" + UtilityQuery.concatStringFieldsWithSeparator(untMisStrings, ",") + ")";
|
||||
final List<MtbUntMis> mtbUntMis = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), queryUntMis, MtbUntMis.class);
|
||||
final List<MtbUntMis> mtbUntMis = UtilityDB.executeSimpleQueryDTO(connection, queryUntMis, MtbUntMis.class);
|
||||
return mtbUntMis != null ? mtbUntMis : new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class WMSAccettazioneBollaService {
|
||||
.map(SitBollaAccettazioneDTO::getCodMart)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList()),multiDBTransactionManager);
|
||||
.collect(Collectors.toList()), multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
final Map<String, BigDecimal> qtaCnfsByArt = articoliByCodMarts.stream()
|
||||
.collect(Collectors.toMap(MtbAart::getCodMart, MtbAart::getQtaCnf));
|
||||
|
||||
@@ -7,6 +7,7 @@ import it.integry.ems.retail.pvmRetail.service.PvmService;
|
||||
import it.integry.ems.retail.wms.Utility.WMSUtility;
|
||||
import it.integry.ems.retail.wms.documenti.dto.DocumentArtDTO;
|
||||
import it.integry.ems.retail.wms.documenti.dto.RetrieveLottiDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.entity.MtbUntMis;
|
||||
import it.integry.ems_model.entity._enum.GestioneEnum;
|
||||
@@ -18,8 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -115,7 +114,7 @@ public class WMSDocumentService {
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
final List<MtbUntMis> untMisFromCod = WMSUtility.getUntMisFromCod(untMiss,multiDBTransactionManager);
|
||||
final List<MtbUntMis> untMisFromCod = WMSUtility.getUntMisFromCod(untMiss, multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
for (DocumentArtDTO art : arts) {
|
||||
final MtbUntMis mtbUntMis = untMisFromCod.stream().filter(x -> x.getUntMis().equalsIgnoreCase(art.getUntMis()))
|
||||
|
||||
@@ -6,6 +6,7 @@ public class RetrieveArtsInGiacenzaByArtRequestDTO {
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
|
||||
private String barcodeUl;
|
||||
private String posizione;
|
||||
|
||||
public String getCodMdep() {
|
||||
@@ -35,6 +36,15 @@ public class RetrieveArtsInGiacenzaByArtRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public RetrieveArtsInGiacenzaByArtRequestDTO setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ public class WMSGenericService {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
final List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager);
|
||||
final List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
|
||||
//Carico la giacenza degli articoli
|
||||
@@ -2134,7 +2134,6 @@ public class WMSGenericService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (dtbDoct != null && !UtilityString.isNullOrEmpty(requestDTO.getAnnotazioni())) {
|
||||
DtbDocr dtbDocr = new DtbDocr()
|
||||
.setDescrizione(UtilityString.substring(requestDTO.getAnnotazioni(), 0, 40))
|
||||
@@ -2480,7 +2479,7 @@ public class WMSGenericService {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager);
|
||||
List<MtbAart> mtbAarts = WMSUtility.getArticoliByCodMarts(codMarts, multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
List<MtbColt> mtbColtToSave = new ArrayList<>();
|
||||
List<MtbColr> successMtbColr = new ArrayList<>();
|
||||
@@ -2665,37 +2664,17 @@ public class WMSGenericService {
|
||||
}
|
||||
List<MtbColt> mtbColtsToInsert = new ArrayList<>();
|
||||
|
||||
List<HashMap<String, Object>> mvwToSearch = Stream.of(listScarichi).map(x -> {
|
||||
HashMap<String, Object> dto = new HashMap<>();
|
||||
List<RetrieveArtsInGiacenzaByArtRequestDTO> mvwToSearch = listScarichi.stream()
|
||||
.map(x -> new RetrieveArtsInGiacenzaByArtRequestDTO()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setPartitaMag(x.getPartitaMag())
|
||||
.setCodMdep(x.getCodMdep())
|
||||
.setBarcodeUl(x.getSourceUl() != null ? x.getSourceUl().getBarcodeUl() : null)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
dto.put("cod_mart", x.getCodMart());
|
||||
dto.put("cod_mdep", x.getCodMdep());
|
||||
dto.put("partita_mag", x.getPartitaMag());
|
||||
dto.put("data_collo", x.getSourceUl() != null ? x.getSourceUl().getDataCollo() : null);
|
||||
dto.put("ser_collo", x.getSourceUl() != null ? x.getSourceUl().getSerCollo() : null);
|
||||
dto.put("num_collo", x.getSourceUl() != null ? x.getSourceUl().getNumCollo() : null);
|
||||
dto.put("gestione", x.getSourceUl() != null ? x.getSourceUl().getGestione() : null);
|
||||
dto.put("posizione", x.getSourceUl() != null ? x.getSourceUl().getPosizione() : null);
|
||||
final List<MvwSitArtUdcDetInventarioDTO> giacenze = wmsGiacenzaULService.retrieveArtsInGiacenzaByArticoli(multiDBTransactionManager.getPrimaryConnection(), mvwToSearch);
|
||||
|
||||
return dto;
|
||||
}).toList();
|
||||
String query = UtilityQuery.convertHashMapListToTableValuesSQL(mvwToSearch, "giacenze");
|
||||
|
||||
String queryGiacenze = "WITH giacenze as (" + query + ")" +
|
||||
"select inv.*\n" +
|
||||
"from giacenze\n" +
|
||||
" left outer join mvw_sitart_udc_det_inventario inv on\n" +
|
||||
" inv.cod_mart = giacenze.cod_mart and inv.cod_mdep = giacenze.cod_mdep\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"WHERE (giacenze.num_collo IS NULL OR inv.num_collo = giacenze.num_collo)\n" +
|
||||
" and (giacenze.gestione IS NULL OR inv.gestione = giacenze.gestione)\n" +
|
||||
" and (giacenze.data_collo IS NULL OR inv.data_collo = giacenze.data_collo)\n" +
|
||||
" and (giacenze.ser_collo IS NULL OR inv.ser_collo = giacenze.ser_collo)\n" +
|
||||
" and (giacenze.partita_mag IS NULL OR inv.partita_mag = giacenze.partita_mag)\n" +
|
||||
" and (giacenze.posizione IS NULL OR inv.posizione = giacenze.posizione)";
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> giacenze = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), queryGiacenze, MvwSitArtUdcDetInventarioDTO.class);
|
||||
if (giacenze == null || giacenze.isEmpty()) {
|
||||
anomalieList.add(AnomalieDTO.error("Non è stato trovato alcun articolo in giacenza"));
|
||||
return anomalieList;
|
||||
@@ -2706,7 +2685,7 @@ public class WMSGenericService {
|
||||
String codMdep = scarico.getCodMdep();
|
||||
String partitaMag = scarico.getPartitaMag();
|
||||
String codMart = scarico.getCodMart();
|
||||
MtbColt sourceUl = scarico.getSourceUl();
|
||||
String sourceBarcodeUl = scarico.getSourceUl() != null ? scarico.getSourceUl().getBarcodeUl() : null;
|
||||
DtbOrdr order = scarico.getOrder();
|
||||
|
||||
if (UtilityString.isNullOrEmpty(codMart)) {
|
||||
@@ -2719,12 +2698,7 @@ public class WMSGenericService {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sourceUl != null && (
|
||||
sourceUl.getDataCollo() == null ||
|
||||
sourceUl.getNumCollo() == null ||
|
||||
sourceUl.getSerCollo() == null ||
|
||||
sourceUl.getGestione() == null
|
||||
)) {
|
||||
if (scarico.getSourceUl() != null && sourceBarcodeUl == null) {
|
||||
anomalieList.add(AnomalieDTO.error("Non è stato possibile scaricare la quantita per l'articolo " + codMart + ": i dati del collo di origine non cono completi"));
|
||||
continue;
|
||||
}
|
||||
@@ -2742,14 +2716,14 @@ public class WMSGenericService {
|
||||
}
|
||||
}
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> availableQty = Stream.of(giacenze).filter(x ->
|
||||
x.getCodMart().equalsIgnoreCase(scarico.getCodMart()) && (sourceUl == null || (
|
||||
sourceUl.getDataCollo().isEqual(x.getDataCollo()) &&
|
||||
sourceUl.getGestione().compareTo(x.getGestione()) == 0 &&
|
||||
sourceUl.getNumCollo().compareTo(x.getNumCollo()) == 0 &&
|
||||
sourceUl.getSerCollo().compareTo(x.getSerCollo()) == 0 &&
|
||||
((partitaMag == null || x.getPartitaMag() == null) || (!UtilityString.isNullOrEmpty(partitaMag) && partitaMag.compareTo(x.getPartitaMag()) == 0))
|
||||
))).toList();
|
||||
List<MvwSitArtUdcDetInventarioDTO> availableQty = giacenze.stream()
|
||||
.filter(x ->
|
||||
x.getCodMart().equalsIgnoreCase(scarico.getCodMart()) && (sourceBarcodeUl == null || (
|
||||
StringUtils.equals(sourceBarcodeUl, x.getBarcodeUl()) &&
|
||||
((partitaMag == null || x.getPartitaMag() == null) ||
|
||||
(!UtilityString.isNullOrEmpty(partitaMag) && StringUtils.equalsIgnoreCase(partitaMag, x.getPartitaMag())))
|
||||
)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (availableQty.isEmpty()) {
|
||||
anomalieList.add(AnomalieDTO.warning("Non è stato possibile scaricare la quantita di materia prima dell'articolo " + codMart + ": giacenza non disponibile "));
|
||||
@@ -2767,13 +2741,15 @@ public class WMSGenericService {
|
||||
MtbColt mtbColt = null;
|
||||
|
||||
if (order != null) {
|
||||
mtbColt = mtbColtsToInsert.stream().filter(x -> UtilityLocalDate.localDateFromDate(order.getDataOrd()).equals(x.getDataOrd()) &&
|
||||
order.getNumOrd().equals(x.getNumOrd()) &&
|
||||
order.getGestione().equals(x.getGestione()) &&
|
||||
(
|
||||
(giacenza.getPosizione() == null && x.getPosizione() == null) ||
|
||||
(giacenza.getPosizione() != null && giacenza.getPosizione().equals(x.getPosizione()))) &&
|
||||
(order.getCodJfas() != null && order.getCodJfas().equalsIgnoreCase(x.getCodJfas()))).findFirst().orElse(null);
|
||||
mtbColt = mtbColtsToInsert.stream()
|
||||
.filter(x -> UtilityLocalDate.localDateFromDate(order.getDataOrd()).equals(x.getDataOrd()) &&
|
||||
order.getNumOrd().equals(x.getNumOrd()) &&
|
||||
order.getGestione().equals(x.getGestione()) &&
|
||||
|
||||
StringUtils.equalsIgnoreCase(giacenza.getPosizione(), x.getPosizione()) &&
|
||||
StringUtils.equalsIgnoreCase(giacenza.getCodJfas(), x.getCodJfas()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
if (mtbColt == null && order != null && !scarico.isCreateNewUl()) {
|
||||
@@ -2814,18 +2790,14 @@ public class WMSGenericService {
|
||||
maxDataCollo = UtilityLocalDate.localDateFromDate(dateMaxDataCollo);
|
||||
}
|
||||
|
||||
mtbColt = new MtbColt()
|
||||
.setMtbColr(new ArrayList<>())
|
||||
.setGestione("L")
|
||||
.setSegno(-1)
|
||||
.setCodMdep(codMdep)
|
||||
.setCodJfas(order != null ? order.getCodJfas() : null)
|
||||
.setPosizione(giacenza.getPosizione())
|
||||
mtbColt = WMSUtility.createInternalMovement(codMdep)
|
||||
.setDataOrd(order != null ? UtilityLocalDate.localDateFromDate(order.getDataOrd()) : null)
|
||||
.setNumOrd((order != null ? order.getNumOrd() : null))
|
||||
.setNumOrd(order != null ? order.getNumOrd() : null)
|
||||
.setCodJfas(order != null ? order.getCodJfas() : null)
|
||||
.setIdLotto(scarico.getIdLotto())
|
||||
.setCodAnag(codAnag)
|
||||
.setDataCollo(maxDataCollo);
|
||||
.setSegno(-1);
|
||||
|
||||
|
||||
mtbColt.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
mtbColtsToInsert.add(mtbColt);
|
||||
@@ -2851,7 +2823,8 @@ public class WMSGenericService {
|
||||
.setDataColloRif(UtilityLocalDate.localDateToDate(giacenza.getDataCollo()))
|
||||
.setSerColloRif(giacenza.getSerCollo())
|
||||
.setGestioneRif(giacenza.getGestione())
|
||||
.setDatetimeRow(UtilityLocalDate.localDateTimeFromLocalDate(maxDataCollo));
|
||||
.setDatetimeRow(UtilityLocalDate.localDateTimeFromLocalDate(maxDataCollo))
|
||||
.setBarcodeUlOut(sourceBarcodeUl);
|
||||
|
||||
mtbColr.setOperation(OperationType.INSERT);
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
@@ -2869,15 +2842,6 @@ public class WMSGenericService {
|
||||
|
||||
}
|
||||
|
||||
public List<MvwSitArtUdcDetInventarioDTO> getGiacenzaCollo(MtbColt mtbColt) throws Exception {
|
||||
String sql = Query.format("select * from mvw_sitart_udc_det_inventario \n" +
|
||||
" where data_collo = {} and\n" +
|
||||
" gestione = {} and\n" +
|
||||
" ser_collo = {} and\n" +
|
||||
" num_collo = {}\n", mtbColt.getDataCollo(), mtbColt.getGestione(), mtbColt.getSerCollo(), mtbColt.getNumCollo());
|
||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MvwSitArtUdcDetInventarioDTO.class);
|
||||
}
|
||||
|
||||
public void rientroMerce(RientroMerceRequestDTO rientroMerceRequestDTO) throws Exception {
|
||||
if (rientroMerceRequestDTO.getSourceMtbColt() == null)
|
||||
throw new MissingDataException("UL di origine");
|
||||
@@ -2906,6 +2870,7 @@ public class WMSGenericService {
|
||||
mtbColrRettifica
|
||||
.setQtaCol(rientroMerceRequestDTO.getQtaRientro().negate())
|
||||
.setNumCnf(mtbColrRettifica.getQtaCol().divide(mtbColrRettifica.getQtaCnf(), 5, RoundingMode.HALF_UP))
|
||||
// .setBarcodeUlOut(destinazione.getBarcodeUl())
|
||||
.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
scarico.getMtbColr().add(mtbColrRettifica);
|
||||
|
||||
@@ -2942,15 +2907,23 @@ public class WMSGenericService {
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" mtb_colr.data_ord,\n" +
|
||||
" mtb_colr.num_ord,\n" +
|
||||
" mtb_colr.riga_ord,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" mtb_colr.qta_cnf,\n" +
|
||||
" mtb_colr.gestione_rif,mtb_colr.data_collo_rif,mtb_colr.ser_collo_rif,mtb_colr.num_collo_rif,\n" +
|
||||
" SUM(qta_col) as qta_col,\n" +
|
||||
" SUM(num_cnf) as num_cnf\n" +
|
||||
" IIF(mtb_aart.flag_qta_cnf_fissa = 'S', mtb_aart.qta_cnf, SUM(qta_col) / SUM(num_cnf)) AS qta_cnf,\n" +
|
||||
" SUM(num_cnf) as num_cnf,\n" +
|
||||
" mtb_colr.barcode_ul_in,\n" +
|
||||
" mtb_colr.barcode_ul_out,\n" +
|
||||
" mtb_colr.posizione_in,\n" +
|
||||
" mtb_colr.posizione_out,\n" +
|
||||
" mtb_colr.cod_mdep_in,\n" +
|
||||
" mtb_colr.cod_mdep_out\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" INNER JOIN mtb_colt\n" +
|
||||
" ON mtb_colr.gestione = mtb_colt.gestione AND mtb_colr.data_collo = mtb_colt.data_collo AND\n" +
|
||||
" mtb_colr.ser_collo = mtb_colt.ser_collo AND mtb_colr.num_collo = mtb_colt.num_collo\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" where mtb_colt.data_collo = {}\n" +
|
||||
" and mtb_colt.ser_collo = {}\n" +
|
||||
" and mtb_colt.num_collo = {}\n" +
|
||||
@@ -2959,7 +2932,27 @@ public class WMSGenericService {
|
||||
" and mtb_colt.segno = -1\n" +
|
||||
" and ({} IS NULL OR mtb_colr.partita_mag = {})\n" +
|
||||
"\n" +
|
||||
"GROUP BY mtb_colr.gestione, mtb_colr.data_collo, mtb_colr.num_collo, mtb_colr.ser_collo, mtb_colr.cod_mart,mtb_colr.gestione_rif,mtb_colr.data_collo_rif,mtb_colr.ser_collo_rif,mtb_colr.num_collo_rif,mtb_colr.qta_cnf, mtb_colr.partita_mag,mtb_colr.data_ord,mtb_colr.num_ord",
|
||||
"GROUP BY mtb_colr.gestione,\n" +
|
||||
" mtb_colr.data_collo,\n" +
|
||||
" mtb_colr.num_collo,\n" +
|
||||
" mtb_colr.ser_collo,\n" +
|
||||
" mtb_colr.cod_mart,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" mtb_colr.data_ord,\n" +
|
||||
" mtb_colr.num_ord,\n" +
|
||||
" mtb_colr.riga_ord,\n" +
|
||||
" mtb_colr.gestione_rif,\n" +
|
||||
" mtb_colr.data_collo_rif,\n" +
|
||||
" mtb_colr.ser_collo_rif,\n" +
|
||||
" mtb_colr.num_collo_rif,\n" +
|
||||
" mtb_colr.barcode_ul_in,\n" +
|
||||
" mtb_colr.barcode_ul_out,\n" +
|
||||
" mtb_colr.posizione_in,\n" +
|
||||
" mtb_colr.posizione_out,\n" +
|
||||
" mtb_colr.cod_mdep_in,\n" +
|
||||
" mtb_colr.cod_mdep_out, \n" +
|
||||
" mtb_aart.flag_qta_cnf_fissa, \n" +
|
||||
" mtb_aart.qta_cnf",
|
||||
scarico.getDataCollo(), scarico.getSerCollo(), scarico.getNumCollo(), scarico.getGestione(), codMart, partitaMag, partitaMag);
|
||||
MtbColr versamento = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbColr.class);
|
||||
return versamento;
|
||||
|
||||
@@ -46,6 +46,7 @@ public class WMSGiacenzaULService {
|
||||
" sit_art.peso_netto_kg,\n" +
|
||||
" sit_art.peso_lordo_kg,\n" +
|
||||
" sit_art.cod_jfas,\n" +
|
||||
" sit_art.barcode_ul,\n" +
|
||||
(withTestataCollo ? "mtb_colt.num_ord,\n" : "") +
|
||||
(withTestataCollo ? "mtb_colt.data_ord,\n" : "") +
|
||||
(withTestataCollo ? "mtb_colt.barcode_ul,\n" : "") +
|
||||
@@ -287,6 +288,9 @@ public class WMSGiacenzaULService {
|
||||
if (!UtilityString.isNullOrEmpty(x.getCodMdep()))
|
||||
map.put("sit_art.cod_mdep", x.getCodMdep());
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(x.getBarcodeUl()))
|
||||
map.put("sit_art.barcode_ul", x.getBarcodeUl());
|
||||
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class WMSInventarioService {
|
||||
|
||||
if (loadDailyInv) {
|
||||
Date today =
|
||||
UtilityDate.StringToDate(new SimpleDateFormat(CommonConstants.DATE_FORMAT_YMD).format(new Date()), CommonConstants.DATE_FORMAT_YMD);
|
||||
UtilityDate.StringToDate(new SimpleDateFormat(CommonConstants.DATE_FORMAT_YMD).format(new Date()), CommonConstants.DATE_FORMAT_YMD);
|
||||
if (!mtbInvent.getDataInventario().equals(today))
|
||||
throw new Exception("Impossibile scaricare un inventario con data diversa da oggi");
|
||||
}
|
||||
@@ -82,15 +82,15 @@ public class WMSInventarioService {
|
||||
public List<MtbInvent> retrieveInventario(String codMdep) throws Exception {
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT *\n" +
|
||||
"FROM mtb_invent\n" +
|
||||
"WHERE mtb_invent.cod_mdep = %s\n" +
|
||||
" AND flag_stato = 0\n" +
|
||||
" AND data_inventario >= Cast(getDate() as date) \n" +
|
||||
" AND NOT EXISTS(SELECT *\n" +
|
||||
" FROM mtb_invenr\n" +
|
||||
" WHERE mtb_invent.id_inventario = mtb_invenr.id_inventario\n" +
|
||||
" AND mtb_invent.cod_mdep = mtb_invenr.cod_mdep) ", codMdep );
|
||||
"SELECT *\n" +
|
||||
"FROM mtb_invent\n" +
|
||||
"WHERE mtb_invent.cod_mdep = %s\n" +
|
||||
" AND flag_stato = 0\n" +
|
||||
" AND data_inventario >= Cast(getDate() as date) \n" +
|
||||
" AND NOT EXISTS(SELECT *\n" +
|
||||
" FROM mtb_invenr\n" +
|
||||
" WHERE mtb_invent.id_inventario = mtb_invenr.id_inventario\n" +
|
||||
" AND mtb_invent.cod_mdep = mtb_invenr.cod_mdep) ", codMdep);
|
||||
|
||||
List<MtbInvent> mtbInvents = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbInvent.class);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class WMSInventarioService {
|
||||
|
||||
|
||||
public List<InventarioArtDTO> retrieveInventarioArts(Integer inventoryId, String codMdep, boolean stampaReport) throws Exception {
|
||||
if ( !stampaReport )
|
||||
if (!stampaReport)
|
||||
loadInventarioIfExists(inventoryId, codMdep);
|
||||
|
||||
final PvmArticoliDTO elencoArticoli = pvmService.getElencoArticoli(GestioneEnum.INVENTARIO, inventoryId, null, null, null, null, false, false, codMdep);
|
||||
@@ -136,7 +136,7 @@ public class WMSInventarioService {
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
final List<MtbUntMis> untMisFromCod = WMSUtility.getUntMisFromCod(untMiss,multiDBTransactionManager);
|
||||
final List<MtbUntMis> untMisFromCod = WMSUtility.getUntMisFromCod(untMiss, multiDBTransactionManager.getPrimaryConnection());
|
||||
|
||||
for (InventarioArtDTO art : arts) {
|
||||
final MtbUntMis mtbUntMis = untMisFromCod.stream().filter(x -> x.getUntMis().equalsIgnoreCase(art.getUntMis()))
|
||||
|
||||
@@ -261,10 +261,10 @@ public class WMSLavorazioneService {
|
||||
.setSerCollo(insertUDSRowRequestDTO.getTargetMtbColt().getSerCollo())
|
||||
.setGestione(insertUDSRowRequestDTO.getTargetMtbColt().getGestione());
|
||||
targetMtbColt.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(targetMtbColt,true, multiDBTransactionManager);
|
||||
entityProcessor.processEntity(targetMtbColt, true, multiDBTransactionManager);
|
||||
|
||||
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(insertUDSRowRequestDTO.getCodMart(),multiDBTransactionManager);
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(insertUDSRowRequestDTO.getCodMart(), multiDBTransactionManager.getPrimaryConnection());
|
||||
if (mtbAart == null)
|
||||
throw new InvalidArticoloException(insertUDSRowRequestDTO.getCodMart());
|
||||
|
||||
@@ -605,7 +605,7 @@ public class WMSLavorazioneService {
|
||||
|
||||
final MtbColr originalMtbColrRow = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbColr.class);
|
||||
|
||||
if(originalMtbColrRow != null &&
|
||||
if (originalMtbColrRow != null &&
|
||||
Objects.equals(originalMtbColrRow.getQtaCol(), mtbColrToDelete.getQtaCol()) &&
|
||||
Objects.equals(originalMtbColrRow.getNumCnf(), mtbColrToDelete.getNumCnf())) {
|
||||
mtbColrToDelete.setOperation(OperationType.DELETE);
|
||||
@@ -781,7 +781,7 @@ public class WMSLavorazioneService {
|
||||
insertRowDto.setPartitaMag(dto.getPartitaMag());
|
||||
insertRowDto.setFullName(userSession.getFullname());
|
||||
|
||||
WMSUtility.insertUDCRow(insertRowDto,entityProcessor,multiDBTransactionManager);
|
||||
WMSUtility.insertUDCRow(insertRowDto, entityProcessor, multiDBTransactionManager);
|
||||
return udc;
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class WMSMaterialiService {
|
||||
final boolean versamentoDirettoEnabled = setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "PRODUZIONE", "FLAG_VERSAMENTO_DIRETTO");
|
||||
final boolean forceAllToColli = setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "SETUP", "FLAG_FORCE_ALL_TO_COLLI");
|
||||
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(request.getCodMart(),multiDBTransactionManager);
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(request.getCodMart(), multiDBTransactionManager.getPrimaryConnection());
|
||||
if (mtbAart == null)
|
||||
throw new InvalidArticoloException(request.getCodMart());
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public class WMSSpedizioneService {
|
||||
entityProcessor.processEntity(targetMtbColt, multiDBTransactionManager);
|
||||
|
||||
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(insertUDSRowRequestDTO.getCodMart(), multiDBTransactionManager);
|
||||
MtbAart mtbAart = WMSUtility.getArticoloByCodMart(insertUDSRowRequestDTO.getCodMart(), multiDBTransactionManager.getPrimaryConnection());
|
||||
if (mtbAart == null)
|
||||
throw new InvalidArticoloException(insertUDSRowRequestDTO.getCodMart());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user