[Controllo giacenze]
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
- stampa sscc da distinta in stampa etichetta ul
This commit is contained in:
2
.idea/runConfigurations/Tomcat__FAST_.xml
generated
2
.idea/runConfigurations/Tomcat__FAST_.xml
generated
@@ -17,7 +17,7 @@
|
||||
<predefined_log_file enabled="true" id="Tomcat" />
|
||||
<predefined_log_file enabled="true" id="Tomcat Catalina" />
|
||||
<RunnerSettings RunnerId="AppServerDebuggerRunner">
|
||||
<option name="DEBUG_PORT" value="javadebug" />
|
||||
<option name="DEBUG_PORT" value="63868" />
|
||||
</RunnerSettings>
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="javadebug" />
|
||||
|
||||
@@ -112,6 +112,13 @@ public class UtilityEntity {
|
||||
return StringUtils.join(fieldsPK, "~");
|
||||
}
|
||||
|
||||
public static boolean anyNull(Object... fieldsToCheck) {
|
||||
for (Object field : fieldsToCheck) {
|
||||
if (isNull(field)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public <T extends EntityBase> String calculateWhereCond(T entity, boolean onlyPK) {
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import it.integry.ems_model.types.ApplicationName;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -481,6 +482,13 @@ public class DtbOrdt extends DtbDocOrdT implements EquatableEntityInterface<DtbO
|
||||
super(logger);
|
||||
}
|
||||
|
||||
public DtbOrdt(String gestione, LocalDate dataOrd,Integer numOrd) {
|
||||
super(logger);
|
||||
this.gestione = gestione;
|
||||
this.dataOrd = UtilityLocalDate.localDateToDate(dataOrd);
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems_model.entity;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
@@ -765,4 +766,12 @@ public class MtbColt extends EntityBase implements EquatableEntityInterface<MtbC
|
||||
public static MtbColt fromMtbColr(MtbColr mtbColr){
|
||||
return new MtbColt(mtbColr.getGestione(),mtbColr.getDataCollo(),mtbColr.getNumCollo(),mtbColr.getSerCollo());
|
||||
}
|
||||
|
||||
public DtbOrdt getOrdine(){
|
||||
if (UtilityEntity.anyNull(this.getGestione(),this.getDataOrd(),this.getNumOrd())){
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DtbOrdt(this.getGestione(),this.getDataOrd(),this.getNumOrd());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -826,23 +826,12 @@ public class MesProductionServiceV2 {
|
||||
if (UtilityString.isNullOrEmpty(reportName)) {
|
||||
if (firstChildCodMart != null) {
|
||||
|
||||
query = "SELECT jrl_cicl_disegni.cod_disegno, jtb_disegni_files.file_name " +
|
||||
"FROM jrl_cicl_disegni, " +
|
||||
" jtb_disegni_files " +
|
||||
"WHERE " +
|
||||
" jrl_cicl_disegni.cod_disegno = jtb_disegni_files.cod_disegno AND " +
|
||||
" cod_prod = " + UtilityDB.valueToString(firstChildCodMart) + " AND " +
|
||||
" file_type = 'ETICHETTA_UL'";
|
||||
|
||||
HashMap<String, Object> disegno = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
if (disegno != null) {
|
||||
reportName = UtilityHashMap.getValueIfExists(disegno, "file_name");
|
||||
reportName = reportName.substring(0, reportName.lastIndexOf("."));
|
||||
reportName = reportName.replaceAll("_", "");
|
||||
logger.debug("Eseguita stampa SSCC del report " + reportName);
|
||||
} else {
|
||||
logger.error("Nessun disegno trovato con il cod_prod " + firstChildCodMart);
|
||||
}
|
||||
reportName = wmsLavorazioneService.getEtichettaSSCCArticolo(firstChildCodMart);
|
||||
if (UtilityString.hasContent(reportName)) {
|
||||
logger.debug("Eseguita stampa SSCC del report " + reportName);
|
||||
}else {
|
||||
logger.error("Nessun disegno trovato con il cod_prod " + firstChildCodMart);
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.error("Il collo " + mtbColtToPrint.getNumCollo() + " del " + CommonConstants.DATETIME_DMY_SLASHED_FORMATTER.format(mtbColtToPrint.getDataCollo()) + " non ha una riga prodotto al suo interno");
|
||||
|
||||
@@ -703,4 +703,9 @@ public class WMSGenericController {
|
||||
ServiceRestResponse retrieveBarcodesInPosizione(@RequestParam String posizione) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(WMSUtility.retrieveBarcodesInPosizione(multiDBTransactionManager.getPrimaryConnection(), posizione));
|
||||
}
|
||||
|
||||
@GetMapping("wms/getEtichettaUL")
|
||||
ServiceRestResponse getEtichettaUL(@RequestBody MtbColt ul) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(wmsGenericService.getEtichettaUL(ul));
|
||||
}
|
||||
}
|
||||
@@ -3118,4 +3118,27 @@ public class WMSGenericService {
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public String getEtichettaUL(MtbColt ul) throws Exception {
|
||||
ul.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(ul,true,multiDBTransactionManager);
|
||||
|
||||
//<editor-fold desc="Etichetta SSCC per le ul create da ordine di lavorazione">
|
||||
if (ul.getGestione().equalsIgnoreCase("L")&& ul.getSegno() == 1 && ul.getOrdine() != null){
|
||||
String reportName = wmsLavorazioneService.getEtichettaSSCCOrdine(ul.getOrdine());
|
||||
if (UtilityString.hasContent(reportName))
|
||||
return reportName;
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="Etichetta anonima per colli con serie UL">
|
||||
if (ul.getSerCollo().equalsIgnoreCase("UL")){
|
||||
String reportName = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(),"PICKING","SETUP","REPORT_NAME_ETICHETTA_ANONIMA");
|
||||
if (UtilityString.hasContent(reportName))
|
||||
return reportName;
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ public class WMSLavorazioneService {
|
||||
throw new UsernameNotFoundException("Utente " + userSession.getUsername() + " non riconosciuto!");
|
||||
}
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(createUDCRequestDTO.getBarcodeUl()) &&
|
||||
if (!UtilityString.isNullOrEmpty(createUDCRequestDTO.getBarcodeUl()) &&
|
||||
WMSUtility.checkIfBarcodeUlIsAlreadyDeclared(multiDBTransactionManager.getPrimaryConnection(), createUDCRequestDTO.getBarcodeUl())) {
|
||||
throw new Exception("Il barcode " + createUDCRequestDTO.getBarcodeUl() + " è già stato dichiarato in un collo di carico");
|
||||
}
|
||||
@@ -644,7 +644,7 @@ public class WMSLavorazioneService {
|
||||
|
||||
String codMdep = UtilityString.isNull(createUDCRequestDTO.getCodMdep(), userSession.getDefaultDepo() != null ? userSession.getDefaultDepo().getCodMdep() : null);
|
||||
|
||||
if(UtilityString.isNullOrEmpty(codMdep))
|
||||
if (UtilityString.isNullOrEmpty(codMdep))
|
||||
throw new Exception("Per poter procedere con il salvataggio è necessario specificare un deposito!");
|
||||
|
||||
MtbColt udcMtbColt = new MtbColt()
|
||||
@@ -877,10 +877,10 @@ public class WMSLavorazioneService {
|
||||
//<editor-fold desc="per ogni articolo ripartisco gli scarichi">
|
||||
for (ScarichiArticoloDTO scarichiMp : scarichiArticoli.values()) {
|
||||
String codMart = scarichiMp.getCodMart();
|
||||
BigDecimal cifreDec = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn( multiDBTransactionManager.getPrimaryConnection(),
|
||||
BigDecimal cifreDec = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(),
|
||||
Query.format("select mtb_unt_mis.cifre_dec from mtb_unt_mis inner join mtb_aart on mtb_unt_mis.unt_mis = mtb_aart.unt_mis and cod_mart = {}", codMart)
|
||||
);
|
||||
BigDecimal qtaDaScaricare = UtilityBigDecimal.calculatePercentage(scarichiMp.getQtaScaricata(), produzione.getPesoProduzione().doubleValue(),cifreDec.intValue());
|
||||
BigDecimal qtaDaScaricare = UtilityBigDecimal.calculatePercentage(scarichiMp.getQtaScaricata(), produzione.getPesoProduzione().doubleValue(), cifreDec.intValue());
|
||||
if (UtilityBigDecimal.equalsTo(qtaDaScaricare, BigDecimal.ZERO)) {
|
||||
continue;
|
||||
}
|
||||
@@ -916,4 +916,33 @@ public class WMSLavorazioneService {
|
||||
|
||||
return produzioniOrdine;
|
||||
}
|
||||
|
||||
public String getEtichettaSSCCOrdine(DtbOrdt ordine) throws Exception {
|
||||
ordine.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(ordine,true,multiDBTransactionManager);
|
||||
if (UtilityString.isNullOrEmpty(ordine.getCodProd())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getEtichettaSSCCArticolo(ordine.getCodProd());
|
||||
}
|
||||
|
||||
public String getEtichettaSSCCArticolo(String codProd) throws Exception {
|
||||
String query = "SELECT jrl_cicl_disegni.cod_disegno, jtb_disegni_files.file_name " +
|
||||
"FROM jrl_cicl_disegni, " +
|
||||
" jtb_disegni_files " +
|
||||
"WHERE " +
|
||||
" jrl_cicl_disegni.cod_disegno = jtb_disegni_files.cod_disegno AND " +
|
||||
" cod_prod = " + UtilityDB.valueToString(codProd) + " AND " +
|
||||
" file_type = 'ETICHETTA_UL'";
|
||||
|
||||
HashMap<String, Object> disegno = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
if (disegno != null) {
|
||||
String reportName = UtilityHashMap.getValueIfExists(disegno, "file_name");
|
||||
reportName = reportName.substring(0, reportName.lastIndexOf("."));
|
||||
reportName = reportName.replaceAll("_", "");
|
||||
return reportName;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user