Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
12
.idea/runConfigurations/docker_compose_yml__Compose_Deployment.xml
generated
Normal file
12
.idea/runConfigurations/docker_compose_yml__Compose_Deployment.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="docker-compose.yml: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<deployment type="docker-compose.yml">
|
||||
<settings>
|
||||
<option name="envFilePath" value="" />
|
||||
<option name="commandLineOptions" value="--build" />
|
||||
<option name="sourceFilePath" value="docker-compose.yml" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,5 +1,7 @@
|
||||
FROM tomcat:9-jre8-alpine
|
||||
|
||||
RUN apk add --no-cache fontconfig ttf-dejavu
|
||||
|
||||
ENV TZ="Europe/Rome"
|
||||
ENV JAVA_OPTS="-DDISABLE_DROOLS_COMPILE=TRUE -Xms512M -Xmx1G -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
ENV USERDOMAIN="STUDIO-ML"
|
||||
@@ -9,5 +11,8 @@ COPY docker/tomcat/conf/integry/ems_automated_operations.json /usr/local/tomcat/
|
||||
COPY docker/tomcat/conf/integry/ems_settings.json /usr/local/tomcat/conf/integry/
|
||||
COPY ems-engine/target/ems-api.war /usr/local/tomcat/webapps/
|
||||
|
||||
#COPY docker/FontTest.class .
|
||||
#ENTRYPOINT ["java","FontTest"]
|
||||
|
||||
EXPOSE 8080
|
||||
EXPOSE 5005
|
||||
BIN
docker/FontTest.class
Normal file
BIN
docker/FontTest.class
Normal file
Binary file not shown.
14
docker/FontTest.java
Normal file
14
docker/FontTest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
import java.awt.*;
|
||||
|
||||
public class FontTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String[] names = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
|
||||
|
||||
System.out.println("Found " + names.length + " fonts:");
|
||||
|
||||
for (String name : names) {
|
||||
System.out.println(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250404180134 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("PVM", "MONITORAGGIO_LINEE_V2", "ENABLE_MODIFICA_SCADENZA_LOTTO", "N",
|
||||
"Se abilitato permette la modifica della data di scadenza del lotto proposto in fase di assegnazione all'ordine.",
|
||||
false, "SI_NO", false, false,
|
||||
true, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
createSetup("MES", "SETUP", "COD_MGRP_SCADENZA_MULTIPLA", null,
|
||||
"Setup per identificare i tipi di articoli della quale attivare la logica di generazione dei lotti con scadenza multipla.",
|
||||
false, "SI_NO", false, false,
|
||||
false, false, false, "mtb_grup", false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250408154017 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!existsColumn("stb_user", "flag_password_expiring")) {
|
||||
executeStatement("alter table stb_user add column flag_password_expiring varchar(1)");
|
||||
}
|
||||
|
||||
if (!existsColumn("stb_user", "password_endtime")) {
|
||||
executeStatement("alter table stb_user add column password_endtime datetime");
|
||||
}
|
||||
|
||||
executeStatement("update stb_user set flag_password_expiring ='N' where flag_password_expiring is null");
|
||||
addDefault("stb_user", "flag_password_expiring", "N");
|
||||
executeStatement("alter table stb_user alter column flag_password_expiring varchar(1) not null",
|
||||
"update stb_user set flag_password_expiring = 'S' where password_endtime is not null");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -16,10 +16,7 @@ import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import it.integry.ems_model.rules.util.DroolsUtil;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityBigDecimal;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.ems_model.utility.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -1005,4 +1002,33 @@ public class DocOrdRules extends QueryRules {
|
||||
|
||||
return dtbOrdtProd;
|
||||
}
|
||||
|
||||
public static Integer completeNumOrdProd(Connection connection, DtbOrdt dtbOrdt) throws SQLException {
|
||||
String sql = Query.format(
|
||||
"SELECT num_ord\n" +
|
||||
"FROM dtb_ordt\n" +
|
||||
"WHERE gestione = 'A'\n" +
|
||||
" AND gestione_rif = 'A'\n" +
|
||||
" AND data_ord = %s\n" +
|
||||
" AND cod_anag = %s\n" +
|
||||
" AND cod_jfas = %s",
|
||||
dtbOrdt.getDataOrd(),
|
||||
dtbOrdt.getCodAnag(),
|
||||
dtbOrdt.getCodJfas()
|
||||
);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
// if (numOrd == null) return null;
|
||||
//
|
||||
// HashMap<String, Object> dati = new HashMap<>();
|
||||
//
|
||||
// dati.put("numOrd", numOrd);
|
||||
// dati.put("dataOrd", d);
|
||||
//
|
||||
// dtbOrdt
|
||||
// .setNumOrd(numOrd)
|
||||
// .setDataOrdRif(dtbOrdt.getDataOrd())
|
||||
// .setNumOrdRif(numOrd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.ems.service.dto.production;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class InsertPartitaMagRequestDTO {
|
||||
private String codMart;
|
||||
|
||||
private String partitaMag;
|
||||
|
||||
private Date dataScad;
|
||||
|
||||
private String codJfas;
|
||||
|
||||
private String note;
|
||||
|
||||
private String gestione;
|
||||
|
||||
private Date dataOrd;
|
||||
|
||||
private Integer numOrd;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public InsertPartitaMagRequestDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -88,128 +88,144 @@ public class JtbDistMate extends EntityBase {
|
||||
return codProd;
|
||||
}
|
||||
|
||||
public void setCodProd(String codProd) {
|
||||
public JtbDistMate setCodProd(String codProd) {
|
||||
this.codProd = codProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdRiga() {
|
||||
return idRiga;
|
||||
}
|
||||
|
||||
public void setIdRiga(Integer idRiga) {
|
||||
public JtbDistMate setIdRiga(Integer idRiga) {
|
||||
this.idRiga = idRiga;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(String codMart) {
|
||||
public JtbDistMate setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaStd() {
|
||||
return qtaStd;
|
||||
}
|
||||
|
||||
public void setQtaStd(BigDecimal qtaStd) {
|
||||
public JtbDistMate setQtaStd(BigDecimal qtaStd) {
|
||||
this.qtaStd = qtaStd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
public JtbDistMate setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRifProgetto() {
|
||||
return rifProgetto;
|
||||
}
|
||||
|
||||
public void setRifProgetto(String rifProgetto) {
|
||||
public JtbDistMate setRifProgetto(String rifProgetto) {
|
||||
this.rifProgetto = rifProgetto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
public JtbDistMate setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPercSfrido() {
|
||||
return percSfrido;
|
||||
}
|
||||
|
||||
public void setPercSfrido(BigDecimal percSfrido) {
|
||||
public JtbDistMate setPercSfrido(BigDecimal percSfrido) {
|
||||
this.percSfrido = percSfrido;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneEstesa() {
|
||||
return descrizioneEstesa;
|
||||
}
|
||||
|
||||
public void setDescrizioneEstesa(String descrizioneEstesa) {
|
||||
public JtbDistMate setDescrizioneEstesa(String descrizioneEstesa) {
|
||||
this.descrizioneEstesa = descrizioneEstesa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMisDist() {
|
||||
return untMisDist;
|
||||
}
|
||||
|
||||
public void setUntMisDist(String untMisDist) {
|
||||
public JtbDistMate setUntMisDist(String untMisDist) {
|
||||
this.untMisDist = untMisDist;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getRapConvDist() {
|
||||
return rapConvDist;
|
||||
}
|
||||
|
||||
public void setRapConvDist(BigDecimal rapConvDist) {
|
||||
public JtbDistMate setRapConvDist(BigDecimal rapConvDist) {
|
||||
this.rapConvDist = rapConvDist;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagPri() {
|
||||
return flagPri;
|
||||
}
|
||||
|
||||
public void setFlagPri(String flagPri) {
|
||||
public JtbDistMate setFlagPri(String flagPri) {
|
||||
this.flagPri = flagPri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getCostoUnt() {
|
||||
return costoUnt;
|
||||
}
|
||||
|
||||
public void setCostoUnt(BigDecimal costoUnt) {
|
||||
public JtbDistMate setCostoUnt(BigDecimal costoUnt) {
|
||||
this.costoUnt = costoUnt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumFase() {
|
||||
return numFase;
|
||||
}
|
||||
|
||||
public void setNumFase(Integer numFase) {
|
||||
public JtbDistMate setNumFase(Integer numFase) {
|
||||
this.numFase = numFase;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataUltMod() {
|
||||
return dataUltMod;
|
||||
}
|
||||
|
||||
public void setDataUltMod(Date dataUltMod) {
|
||||
public JtbDistMate setDataUltMod(Date dataUltMod) {
|
||||
this.dataUltMod = dataUltMod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getModificatoDa() {
|
||||
return modificatoDa;
|
||||
}
|
||||
|
||||
public void setModificatoDa(String modificatoDa) {
|
||||
public JtbDistMate setModificatoDa(String modificatoDa) {
|
||||
this.modificatoDa = modificatoDa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodProdPri() {
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.entity.StbGestSetupDet;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.json.JSONArray;
|
||||
@@ -303,6 +305,27 @@ public class SetupGest {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, query);
|
||||
}
|
||||
|
||||
public List<StbGestSetupDet> getSetupDetList(String gestName, String section, String keySection) throws Exception {
|
||||
MultiDBTransactionManager multiDBTransactionManager = ContextLoader.getCurrentWebApplicationContext().getBean(MultiDBTransactionManager.class);
|
||||
|
||||
return getSetupDetList(multiDBTransactionManager.getPrimaryConnection(), gestName, section, keySection);
|
||||
}
|
||||
|
||||
public List<StbGestSetupDet> getSetupDetList(Connection connection, String gestName, String section, String keySection) throws Exception {
|
||||
String sql = Query.format(
|
||||
"SELECT val_col_rif, CONVERT(TEXT, value) AS value\n" +
|
||||
"FROM stb_gest_setup_det\n" +
|
||||
"WHERE gest_name = %s\n" +
|
||||
" AND section = %s\n" +
|
||||
" AND key_section = %s",
|
||||
gestName,
|
||||
section,
|
||||
keySection
|
||||
);
|
||||
|
||||
return UtilityDB.executeSimpleQueryDTO(connection, sql, StbGestSetupDet.class);
|
||||
}
|
||||
|
||||
//UTENTE WEB
|
||||
public boolean getSetupUserBoolean(Connection conn, String gestName, String section, String keySection, String username) throws Exception {
|
||||
return "S".equalsIgnoreCase(getSetupUser(conn, gestName, section, keySection, username));
|
||||
|
||||
@@ -56,3 +56,17 @@ then
|
||||
modify ( $ordR ) { setDataInizProd(dataInizProd) }
|
||||
end
|
||||
|
||||
rule "completeNumOrdProd"
|
||||
no-loop
|
||||
salience 10
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : DtbOrdt(gestione == "A" && gestioneRif == "A" && dataOrd != null && codAnag != null && codJfas != null
|
||||
&& numOrd == null && dataOrdRif == null && numOrdRif == null
|
||||
&& (operation == OperationType.INSERT || operation == OperationType.INSERT_OR_UPDATE))
|
||||
then
|
||||
Integer numOrd = DocOrdRules.completeNumOrdProd(conn, $entity);
|
||||
modify($entity) {
|
||||
setNumOrd(numOrd)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1548,20 +1548,20 @@ public class ActivityService {
|
||||
public List<OldUpdateDTO> getOldUpdate() throws Exception {
|
||||
String sql = "WITH commesse AS (SELECT cod_jcom,\n" +
|
||||
" jtb_comt.cod_anag,\n" +
|
||||
" ROW_NUMBER() OVER (PARTITION BY jtb_comt.cod_anag ORDER BY cod_jcom DESC, servers.updated_at DESC) AS conta,\n" +
|
||||
" ROW_NUMBER() OVER (PARTITION BY jtb_comt.cod_anag ORDER BY cod_jcom DESC, servers.updated_at DESC, , vtb_clie.flag_stato) AS conta,\n" +
|
||||
" servers.last_update,\n" +
|
||||
" gtb_anag.rag_soc\n" +
|
||||
" FROM jtb_comt\n" +
|
||||
" INNER JOIN dbo.wtb_clie ON jtb_comt.cod_anag = wtb_clie.cod_anag\n" +
|
||||
" INNER JOIN dbo.wtb_clie wtb_clie2 ON wtb_clie2.user_name = wtb_clie.user_name\n" +
|
||||
" INNER JOIN gtb_anag ON gtb_anag.cod_anag = wtb_clie2.cod_anag\n" +
|
||||
" INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
||||
" INNER JOIN integry_control_panel.dbo.customers\n" +
|
||||
" ON customers.partita_iva = gtb_anag.part_iva AND customers.active = 1\n" +
|
||||
" INNER JOIN integry_control_panel.dbo.servers ON customers.id = servers.customer_id\n" +
|
||||
" WHERE ISNUMERIC(RIGHT(cod_jcom, 2)) = 1\n" +
|
||||
" AND jtb_comt.stato_commessa IN ('in corso', 'trattativa', 'post vendita')\n" +
|
||||
" AND jtb_comt.cod_jcom NOT LIKE 'inte%'\n" +
|
||||
" AND EXISTS (SELECT * FROM vtb_clie WHERE vtb_clie.cod_anag = gtb_anag.cod_anag AND vtb_clie.flag_stato = 'A'))\n" +
|
||||
" AND jtb_comt.cod_jcom NOT LIKE 'inte%')\n" +
|
||||
"SELECT *\n" +
|
||||
"FROM commesse\n" +
|
||||
"WHERE conta = 1\n";
|
||||
|
||||
@@ -45,6 +45,7 @@ public class CaricoProdFinLavDTO {
|
||||
private String activityID;
|
||||
private Integer idLotto;
|
||||
private boolean escludiArticoliGestitiDaWmsInScarico;
|
||||
private boolean fermaCreaDocs;
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
@@ -401,4 +402,13 @@ public class CaricoProdFinLavDTO {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFermaCreaDocs() {
|
||||
return fermaCreaDocs;
|
||||
}
|
||||
|
||||
public CaricoProdFinLavDTO setFermaCreaDocs(boolean fermaCreaDocs) {
|
||||
this.fermaCreaDocs = fermaCreaDocs;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,9 +650,7 @@ public class DocumentProdService {
|
||||
boolean fermaCreaDocsEnabled = setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "CARICO_SCARICO_PF", "SETUP", "FERMA_CREA_DOCS");
|
||||
|
||||
if (fermaCreaDocsEnabled) {
|
||||
boolean fermaCreaDocs = setupGest.getSetupUserBoolean(multiDBTransactionManager.getPrimaryConnection(), "CARICO_SCARICO_PF", "SETUP", "FERMA_CREA_DOCS", requestDataDTO.getUsername());
|
||||
|
||||
if (fermaCreaDocs) {
|
||||
if (carico.isFermaCreaDocs() || setupGest.getSetupUserBoolean(multiDBTransactionManager.getPrimaryConnection(), "CARICO_SCARICO_PF", "SETUP", "FERMA_CREA_DOCS", requestDataDTO.getUsername())) {
|
||||
DtbOrdt dtbOrdt = new DtbOrdt();
|
||||
|
||||
dtbOrdt
|
||||
|
||||
@@ -3,7 +3,6 @@ package it.integry.ems.production.controller;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.document.dto.ChiusuraLavorazioneDTO;
|
||||
import it.integry.ems.document.service.DocumentProdService;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.production.dto.*;
|
||||
import it.integry.ems.production.service.MesProductionServiceV2;
|
||||
@@ -41,13 +40,13 @@ public class MesProductionControllerV2 {
|
||||
|
||||
@Autowired
|
||||
private MesProductionServiceV2 mesProductionService;
|
||||
|
||||
@Autowired
|
||||
private ProductionLineService productionLineService;
|
||||
|
||||
@Autowired
|
||||
private ProductionOrderDataHandlerService productionOrderDataHandlerService;
|
||||
@Autowired
|
||||
private DocumentProdService documentProdService;
|
||||
|
||||
@Autowired
|
||||
private RequestDataDTO requestDataDTO;
|
||||
|
||||
@@ -426,14 +425,21 @@ public class MesProductionControllerV2 {
|
||||
@RequestMapping(value = "checkMaterialeInBarcode", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse checkMaterialeBarcodeInOrdine(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody CheckMaterialeBarcodeInOrdineDTO dto) throws Exception {
|
||||
@RequestBody CheckMaterialeBarcodeInOrdineDTO dto) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(mesProductionService.checkMaterialeBarcodeInOrdine(dto));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "versaMaterialeSuOrdine", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse versaMaterialeSuOrdine(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody VersamentoMaterialeSuOrdineDTO dto) throws Exception {
|
||||
@RequestBody VersamentoMaterialeSuOrdineDTO dto) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(mesProductionService.versaMaterialeSuOrdine(dto));
|
||||
}
|
||||
|
||||
@PostMapping(value = "duplicaOrdiniGiornoDopo")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse duplicaOrdiniGiornoDopo(@RequestParam String codJfas) throws Exception {
|
||||
mesProductionService.duplicaOrdiniGiornoDopo(codJfas);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import it.integry.ems.production.service.ProductionService;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.rules.businessLogic.dto.LoadColliDTO;
|
||||
import it.integry.ems.service.dto.production.InsertPartitaMagRequestDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.DtbOrdt;
|
||||
@@ -156,11 +157,18 @@ public class ProductionController {
|
||||
try {
|
||||
Date dataOrd = UtilityString.isNullOrEmpty(dataOrdS) ? null : UtilityDate.RecognizeDate(dataOrdS);
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(productionService.getDettaglioCostiProd(codProd, partitaMag, codJcom,dataOrd,numOrd));
|
||||
return ServiceRestResponse.createPositiveResponse(productionService.getDettaglioCostiProd(codProd, partitaMag, codJcom, dataOrd, numOrd));
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return new ServiceRestResponse(EsitoType.KO, profileDB, e);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "insertPartitaMag")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse insertPartitaMag(
|
||||
@RequestParam(required = false, defaultValue = "true") boolean saveEntity,
|
||||
@RequestBody InsertPartitaMagRequestDTO dto) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(productionService.insertPartitaMag(dto, saveEntity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.Import.dto.AnomalieDTO;
|
||||
import it.integry.ems.document.dto.CaricoLavorazioneDTO;
|
||||
import it.integry.ems.document.dto.ChiusuraLavorazioneDTO;
|
||||
import it.integry.ems.document.dto.RientroLavorazioneDTO;
|
||||
import it.integry.ems.document.dto.ScaricoLavorazioneDTO;
|
||||
import it.integry.ems.document.dto.*;
|
||||
import it.integry.ems.document.service.DocumentProdService;
|
||||
import it.integry.ems.exception.MissingDataException;
|
||||
import it.integry.ems.exception.PrimaryDatabaseNotPresentException;
|
||||
@@ -25,8 +22,11 @@ import it.integry.ems.retail.wms.generic.dto.MvwSitArtUdcDetInventarioDTO;
|
||||
import it.integry.ems.retail.wms.generic.service.WMSGenericService;
|
||||
import it.integry.ems.retail.wms.lavorazione.service.WMSLavorazioneService;
|
||||
import it.integry.ems.rules.completing.DocumentRules;
|
||||
import it.integry.ems.rules.completing.PartitaMagRules;
|
||||
import it.integry.ems.rules.completing.dto.DatiPartitaMagDTO;
|
||||
import it.integry.ems.service.*;
|
||||
import it.integry.ems.service.dto.GenericComunicationMailTemplateDataDTO;
|
||||
import it.integry.ems.service.dto.production.InsertPartitaMagRequestDTO;
|
||||
import it.integry.ems.service.dto.production.OrdineLavorazioneDTO;
|
||||
import it.integry.ems.service.exception.EmptyReportException;
|
||||
import it.integry.ems.service.production.ProductionOrderDataHandlerService;
|
||||
@@ -412,6 +412,31 @@ public class MesProductionServiceV2 {
|
||||
entityProcessor.processEntity(dtbOrdtProdToUpdate, skipCommit, multiDBTransactionManager);
|
||||
}
|
||||
|
||||
// Aggiorno la data prod sulla partita mag. se esistente e non gia' impostata
|
||||
sql = Query.format(
|
||||
"SELECT mpm.cod_mart, mpm.partita_mag\n" +
|
||||
"FROM dtb_ordt dot\n" +
|
||||
" INNER JOIN mtb_partita_mag mpm ON dot.cod_prod = mpm.cod_mart AND dot.partita_mag = mpm.partita_mag\n" +
|
||||
" AND mpm.data_prod IS NULL\n" +
|
||||
"WHERE dot.num_ord = %s\n" +
|
||||
" AND dot.data_ord = %s\n" +
|
||||
" AND dot.gestione = %s",
|
||||
numOrd,
|
||||
dataOrd,
|
||||
gestioneOrd
|
||||
);
|
||||
|
||||
MtbPartitaMag mtbPartitaMagToUpdate = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbPartitaMag.class);
|
||||
|
||||
if (mtbPartitaMagToUpdate != null
|
||||
&& !UtilityString.isNullOrEmpty(mtbPartitaMagToUpdate.getCodMart())
|
||||
&& !UtilityString.isNullOrEmpty(mtbPartitaMagToUpdate.getPartitaMag())) {
|
||||
mtbPartitaMagToUpdate.setOperation(OperationType.UPDATE);
|
||||
|
||||
mtbPartitaMagToUpdate.setDataProd(new Date());
|
||||
|
||||
entityProcessor.processEntity(mtbPartitaMagToUpdate, skipCommit, multiDBTransactionManager);
|
||||
}
|
||||
|
||||
String syncOpenOrder = String.format("EXEC [MES_SyncAperturaOrdineLavorazione] %d, %s, %s;",
|
||||
numOrd,
|
||||
@@ -1970,4 +1995,168 @@ public class MesProductionServiceV2 {
|
||||
|
||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, AttachmentDTO.class);
|
||||
}
|
||||
|
||||
public void duplicaOrdiniGiornoDopo(String codJfas) throws Exception {
|
||||
String sql = Query.format(
|
||||
"WITH setup AS (SELECT *\n" +
|
||||
" FROM stb_gest_setup_det\n" +
|
||||
" WHERE gest_name = 'MES'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'COD_MGRP_SCADENZA_MULTIPLA'\n" +
|
||||
" AND value = 'S')\n" +
|
||||
"SELECT ordini.*\n" +
|
||||
"FROM MES_GetWorkOrders(%s, DATEADD(DAY, -30, GETDATE()), NULL, NULL, NULL) ordini\n" +
|
||||
" INNER JOIN mtb_aart ma ON ordini.cod_prod = ma.cod_mart\n" +
|
||||
" INNER JOIN mtb_grup mg ON ma.cod_mgrp = mg.cod_mgrp\n" +
|
||||
" INNER JOIN setup ON val_col_rif = mg.cod_mgrp\n" +
|
||||
"WHERE ordini.stato = 'IN CORSO'\n" +
|
||||
"ORDER BY ordini.sort",
|
||||
codJfas
|
||||
);
|
||||
|
||||
List<OrdineLavorazioneDTO> ordini = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, OrdineLavorazioneDTO.class);
|
||||
|
||||
if (ordini == null || ordini.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
List<DtbOrdt> ordiniSalvati = new ArrayList<>();
|
||||
|
||||
for (OrdineLavorazioneDTO ordine : ordini) {
|
||||
Date dataOrd = UtilityDate.dateAdd(UtilityDate.getTodayWithoutTime(), 1);
|
||||
|
||||
// ORDINE DI PRODUZIONE
|
||||
DtbOrdt ordProd = new DtbOrdt()
|
||||
.setCodAnag(ordine.getCodAnag())
|
||||
.setDataOrd(dataOrd)
|
||||
.setCodJfas(ordine.getCodJfas())
|
||||
.setGestione("A")
|
||||
.setGestioneRif("A")
|
||||
.setCodMdep(ordine.getCodMdep());
|
||||
|
||||
ordProd.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
|
||||
sql = Query.format(
|
||||
"SELECT *\n" +
|
||||
"FROM dtb_ordr\n" +
|
||||
"WHERE gestione = %s\n" +
|
||||
" AND data_ord = %s\n" +
|
||||
" AND num_ord = %s\n",
|
||||
ordine.getGestione(),
|
||||
ordine.getDataOrd(),
|
||||
ordine.getNumOrd()
|
||||
);
|
||||
|
||||
List<DtbOrdr> righeOrdineLav = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbOrdr.class);
|
||||
|
||||
if (righeOrdineLav == null || righeOrdineLav.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DtbOrdr ordLav = new DtbOrdr()
|
||||
.setCodMart(ordine.getCodProd())
|
||||
.setCodJfas(ordine.getCodJfas())
|
||||
.setQtaOrd(ordine.getQtaProd())
|
||||
.setRapConv(ordine.getRapConv())
|
||||
.setUntOrd(ordine.getUntOrd())
|
||||
.setDataCons(dataOrd)
|
||||
.setColliPedana(ordine.getColliPedana())
|
||||
.setDataInizProd(UtilityLocalDate.localDateFromDate(dataOrd))
|
||||
.setCodTcolUl(ordine.getCodTcolUl())
|
||||
.setNote(ordine.getNoteLav())
|
||||
.setDistinta(new ArrayList<>());
|
||||
|
||||
ordLav.setOperation(OperationType.INSERT);
|
||||
|
||||
ordProd.addDtbOrdr(ordLav);
|
||||
|
||||
String partitaMag = PartitaMagRules.suggestCodePartitaMag(multiDBTransactionManager.getPrimaryConnection(),
|
||||
new DatiPartitaMagDTO()
|
||||
.setCodMart(ordLav.getCodMart())
|
||||
.setDataOrd(dataOrd)
|
||||
.setGestione("L")
|
||||
.setCodJfas(ordLav.getCodJfas()));
|
||||
|
||||
List<EntityBase> listPartitaMag = productionService.insertPartitaMag(new InsertPartitaMagRequestDTO()
|
||||
.setCodMart(ordine.getCodProd())
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScad(ordine.getDataScad())
|
||||
.setNote(ordine.getNoteLav()), false);
|
||||
|
||||
if (!listPartitaMag.isEmpty()) {
|
||||
MtbPartitaMag mtbPartitaMag = (MtbPartitaMag) listPartitaMag.get(0);
|
||||
|
||||
mtbPartitaMag.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
|
||||
entityProcessor.processEntity(mtbPartitaMag, true, multiDBTransactionManager);
|
||||
|
||||
ordLav.setPartitaMag(mtbPartitaMag.getPartitaMag());
|
||||
}
|
||||
|
||||
for (DtbOrdr rigaOrdine : righeOrdineLav) {
|
||||
JtbDistMate jtbDistMate = new JtbDistMate()
|
||||
.setCodProd(ordLav.getCodMart())
|
||||
.setCodMart(rigaOrdine.getCodMart())
|
||||
.setQtaStd(rigaOrdine.getQtaOrd())
|
||||
.setNumFase(rigaOrdine.getNumFase());
|
||||
|
||||
jtbDistMate.setOperation(OperationType.INSERT);
|
||||
|
||||
ordLav
|
||||
.getDistinta()
|
||||
.add(jtbDistMate);
|
||||
}
|
||||
|
||||
entityProcessor.processEntity(ordProd, true, multiDBTransactionManager);
|
||||
|
||||
this.closeStep(ordine.getDataOrd(), ordine.getNumOrd(), ordine.getGestione(), ordine.getCodJfas(), null, null);
|
||||
|
||||
CaricoProdFinLavDTO caricoProdFinLavDTO = new CaricoProdFinLavDTO();
|
||||
|
||||
caricoProdFinLavDTO.setGestione("L");
|
||||
caricoProdFinLavDTO.setDataOrd(ordine.getDataOrd());
|
||||
caricoProdFinLavDTO.setNumOrd(ordine.getNumOrd());
|
||||
caricoProdFinLavDTO.setCodJfas(ordine.getCodJfas());
|
||||
caricoProdFinLavDTO.setFermaCreaDocs(true);
|
||||
|
||||
documentProdService.caricoProdFinLav(caricoProdFinLavDTO);
|
||||
|
||||
ordiniSalvati.add(ordProd);
|
||||
}
|
||||
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
if (!ordiniSalvati.isEmpty()) {
|
||||
sql = String.format(
|
||||
"SELECT gestione,\n" +
|
||||
"do.data_ord,\n" +
|
||||
"do.num_ord,\n" +
|
||||
"do.cod_jfas,\n" +
|
||||
"(SELECT MAX(dos.hr_num)\n" +
|
||||
" FROM dtb_ord_steps dos\n" +
|
||||
" WHERE do.gestione = dos.gestione\n" +
|
||||
" AND do.data_ord = dos.data_ord\n" +
|
||||
" AND do.num_ord = dos.num_ord) AS hr_num\n" +
|
||||
"FROM dtb_ordt do\n" +
|
||||
"WHERE do.gestione = 'L'\n" +
|
||||
" AND do.data_ord_rif IN (%s)\n" +
|
||||
" AND do.num_ord_rif IN (%s)\n",
|
||||
UtilityDB.listValueToString(ordiniSalvati.stream().map(DtbOrdt::getDataOrd).distinct().collect(java.util.stream.Collectors.toList())),
|
||||
UtilityDB.listValueToString(ordiniSalvati.stream().map(DtbOrdt::getNumOrd).distinct().collect(java.util.stream.Collectors.toList()))
|
||||
);
|
||||
|
||||
List<DtbOrdSteps> dtbOrdStepsToOpen = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbOrdSteps.class);
|
||||
|
||||
if (dtbOrdStepsToOpen != null && !dtbOrdStepsToOpen.isEmpty()) {
|
||||
for (DtbOrdSteps dtbOrdSteps : dtbOrdStepsToOpen) {
|
||||
this.openStep(dtbOrdSteps.getDataOrd(), dtbOrdSteps.getNumOrd(), dtbOrdSteps.getGestione(), dtbOrdSteps.getCodJfas(), dtbOrdSteps.getHrNum());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import it.integry.ems.rules.businessLogic.LoadColliService;
|
||||
import it.integry.ems.rules.businessLogic.dto.LoadColliDTO;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.service.MailService;
|
||||
import it.integry.ems.service.dto.production.InsertPartitaMagRequestDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
@@ -1615,4 +1616,120 @@ public class ProductionService {
|
||||
entityProcessor.processEntityList(docDaAggiornare, true);
|
||||
}
|
||||
}
|
||||
|
||||
public StbGestSetupDet getConfigCodMgrpScadenzaMultipla(String codMgrp) throws Exception {
|
||||
List<StbGestSetupDet> setupDetList = setupGest.getSetupDetList("MES", "SETUP", "COD_MGRP_SCADENZA_MULTIPLA");
|
||||
|
||||
if (setupDetList == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
java.util.Optional<StbGestSetupDet> stbGestSetupDetOptional = setupDetList.stream()
|
||||
.filter(stbGestSetupDet -> stbGestSetupDet.getValColRif().equalsIgnoreCase(codMgrp))
|
||||
.findFirst();
|
||||
|
||||
return stbGestSetupDetOptional.orElse(null);
|
||||
}
|
||||
|
||||
public List<EntityBase> insertPartitaMag(InsertPartitaMagRequestDTO dto, boolean saveEntity) throws Exception {
|
||||
String codMart = dto.getCodMart();
|
||||
String partitaMag = dto.getPartitaMag();
|
||||
String partitaMagProd = partitaMag;
|
||||
Date dataScad = dto.getDataScad();
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT mg.cod_mgrp\n" +
|
||||
"FROM mtb_grup mg\n" +
|
||||
"INNER JOIN mtb_aart ma ON mg.cod_mgrp = ma.cod_mgrp\n" +
|
||||
"WHERE ma.cod_mart = %s",
|
||||
dto.getCodMart()
|
||||
);
|
||||
|
||||
String codMgrp = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
StbGestSetupDet configCodMgrpScadenzaMultipla = this.getConfigCodMgrpScadenzaMultipla(codMgrp);
|
||||
|
||||
if (configCodMgrpScadenzaMultipla != null && configCodMgrpScadenzaMultipla.getValue().equalsIgnoreCase("S")) {
|
||||
// Controllo se esiste articolo con stesso lotto e scadenze
|
||||
sql = Query.format(
|
||||
"SELECT partita_mag\n" +
|
||||
"FROM mtb_partita_mag\n" +
|
||||
"WHERE cod_mart = %s\n" +
|
||||
"AND partita_mag_prod = %s\n" +
|
||||
"AND data_scad = %s\n",
|
||||
codMart,
|
||||
partitaMag,
|
||||
dataScad
|
||||
);
|
||||
|
||||
String partitaMagQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
if (partitaMagQuery == null) {
|
||||
// La partita per data scad non esiste, leggere l'ultima e creane una nuova
|
||||
sql = Query.format(
|
||||
"SELECT MAX(partita_mag)\n" +
|
||||
"FROM mtb_partita_mag\n" +
|
||||
"WHERE cod_mart = %s\n" +
|
||||
"AND partita_mag_prod = %s\n",
|
||||
codMart,
|
||||
partitaMag
|
||||
);
|
||||
|
||||
String lastPartitaMag = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
if (lastPartitaMag != null) {
|
||||
char lastPartitaChar = lastPartitaMag.charAt(lastPartitaMag.length() - 1);
|
||||
|
||||
if (Character.isDigit(lastPartitaChar)) {
|
||||
lastPartitaChar = 'A';
|
||||
} else {
|
||||
lastPartitaChar++;
|
||||
}
|
||||
|
||||
partitaMag += lastPartitaChar;
|
||||
}
|
||||
} else {
|
||||
partitaMag = partitaMagQuery;
|
||||
}
|
||||
}
|
||||
|
||||
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag()
|
||||
.setPartitaMag(partitaMag)
|
||||
.setPartitaMagProd(partitaMagProd)
|
||||
.setCodMart(codMart)
|
||||
.setDataScad(dataScad);
|
||||
|
||||
boolean setDescrizione = setupGest.getSetupBoolean("MTB_PARTITA_MAG", "SETUP", "SET_DESCRIZIONE_FROM_NOTE_ORDINE");
|
||||
|
||||
if (setDescrizione) {
|
||||
mtbPartitaMag.setDescrizione(dto.getNote());
|
||||
}
|
||||
|
||||
if (!saveEntity) {
|
||||
mtbPartitaMag.setOperation(OperationType.SELECT_OBJECT);
|
||||
|
||||
return Collections.singletonList(mtbPartitaMag);
|
||||
}
|
||||
|
||||
mtbPartitaMag.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
|
||||
DtbOrdt dtbOrdt = new DtbOrdt()
|
||||
.setGestione(dto.getGestione())
|
||||
.setDataOrd(dto.getDataOrd())
|
||||
.setNumOrd(dto.getNumOrd())
|
||||
.setCodJfas(dto.getCodJfas())
|
||||
.setPartitaMag(partitaMag);
|
||||
|
||||
dtbOrdt.setOperation(OperationType.UPDATE);
|
||||
|
||||
List<EntityBase> entityBaseList = new ArrayList<>();
|
||||
|
||||
entityBaseList.add(mtbPartitaMag);
|
||||
entityBaseList.add(dtbOrdt);
|
||||
|
||||
entityProcessor.processEntityList(entityBaseList, true);
|
||||
UtilityEntity.throwEntitiesException(entityBaseList);
|
||||
|
||||
return entityBaseList;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2044,7 +2044,7 @@ public class WMSGenericService {
|
||||
|
||||
short segno = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
if (segno < 0) {
|
||||
if (segno > 0) {
|
||||
codMdepDoc = mtbDepo.getCodMdep();
|
||||
|
||||
MtbDepo mtbDepoPartenza = new MtbDepo();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class WMSGiacenzaService {
|
||||
.setCodMdep(x.getCodMdep()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
final List<MvwSitArtUdcDetInventarioDTO> availableItems = wmsGiacenzaULService.retrieveArtsInGiacenzaByArticoli(multiDBTransactionManager.getPrimaryConnection(),
|
||||
final List<MvwSitArtUdcDetInventarioDTO> availableItems = wmsGiacenzaULService.retrieveArtsInGiacenzaByArticolo(multiDBTransactionManager.getPrimaryConnection(),
|
||||
retrieveArtsInGiacenzaByArtRequestDTOList);
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -49,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" : "") +
|
||||
@@ -252,7 +250,11 @@ public class WMSGiacenzaULService {
|
||||
return UtilityDB.executeSimpleQueryDTO(connection, sql, MvwSitArtUdcDetInventarioDTO.class);
|
||||
}
|
||||
|
||||
public List<MvwSitArtUdcDetInventarioDTO> retrieveArtsInGiacenzaByArticoli(Connection connection, List<RetrieveArtsInGiacenzaByArtRequestDTO> inputData) throws Exception {
|
||||
public List<MvwSitArtUdcDetInventarioDTO> retrieveArtsInGiacenzaByArticolo(Connection connection, RetrieveArtsInGiacenzaByArtRequestDTO inputData) throws Exception {
|
||||
return retrieveArtsInGiacenzaByArticolo(connection, Collections.singletonList(inputData));
|
||||
}
|
||||
|
||||
public List<MvwSitArtUdcDetInventarioDTO> retrieveArtsInGiacenzaByArticolo(Connection connection, List<RetrieveArtsInGiacenzaByArtRequestDTO> inputData) throws Exception {
|
||||
|
||||
List<HashMap<String, Object>> whereCondMaps = inputData.stream()
|
||||
.map(x -> {
|
||||
@@ -269,6 +271,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());
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package it.integry.ems.retail.wms.lavorazione.controller;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiRequestDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiResponseDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.VersaMaterialiRequestDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.service.WMSMaterialiService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@@ -20,13 +20,17 @@ public class WMSMaterialiController {
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "recupera", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse recupera(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody RecuperaMaterialiRequestDTO recuperaMaterialiRequestDTO) throws Exception {
|
||||
RecuperaMaterialiResponseDTO responseDto = new RecuperaMaterialiResponseDTO()
|
||||
.setUpdatedMtbColtScarico(wmsMaterialiService.recupera(recuperaMaterialiRequestDTO));
|
||||
@PostMapping(value = "versa")
|
||||
public @ResponseBody ServiceRestResponse versa(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody VersaMaterialiRequestDTO versaMaterialiRequestDTO) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(wmsMaterialiService.versa(versaMaterialiRequestDTO));
|
||||
}
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(responseDto);
|
||||
|
||||
@PostMapping(value = "recupera")
|
||||
public @ResponseBody ServiceRestResponse recupera(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody RecuperaMaterialiRequestDTO recuperaMaterialiRequestDTO) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(wmsMaterialiService.recupera(recuperaMaterialiRequestDTO));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ import it.integry.ems_model.entity.MtbColt;
|
||||
|
||||
public class RecuperaMaterialiResponseDTO {
|
||||
|
||||
private MtbColt updatedMtbColtScarico;
|
||||
private final MtbColt updatedMtbColtScarico;
|
||||
|
||||
public RecuperaMaterialiResponseDTO(MtbColt updatedMtbColtScarico) {
|
||||
this.updatedMtbColtScarico = updatedMtbColtScarico;
|
||||
}
|
||||
|
||||
public MtbColt getUpdatedMtbColtScarico() {
|
||||
return updatedMtbColtScarico;
|
||||
}
|
||||
|
||||
public RecuperaMaterialiResponseDTO setUpdatedMtbColtScarico(MtbColt updatedMtbColtScarico) {
|
||||
this.updatedMtbColtScarico = updatedMtbColtScarico;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package it.integry.ems.retail.wms.lavorazione.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class VersaMaterialiRequestDTO {
|
||||
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
private BigDecimal numCnf;
|
||||
private BigDecimal qtaCnf;
|
||||
private BigDecimal qtaTot;
|
||||
|
||||
private Integer numCollo;
|
||||
private LocalDate dataCollo;
|
||||
private String gestione;
|
||||
private String serCollo;
|
||||
private String barcodeUl;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaTot() {
|
||||
return qtaTot;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setQtaTot(BigDecimal qtaTot) {
|
||||
this.qtaTot = qtaTot;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setDataCollo(LocalDate dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public VersaMaterialiRequestDTO setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package it.integry.ems.retail.wms.lavorazione.dto;
|
||||
|
||||
public class VersaMaterialiResponseDTO {
|
||||
}
|
||||
@@ -3,7 +3,11 @@ package it.integry.ems.retail.wms.lavorazione.service;
|
||||
import it.integry.ems.product.importaz.service.ProductServices;
|
||||
import it.integry.ems.retail.wms.Utility.WMSUtility;
|
||||
import it.integry.ems.retail.wms.exceptions.InvalidArticoloException;
|
||||
import it.integry.ems.retail.wms.generic.service.WMSGiacenzaULService;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiRequestDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiResponseDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.VersaMaterialiRequestDTO;
|
||||
import it.integry.ems.retail.wms.lavorazione.dto.VersaMaterialiResponseDTO;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
@@ -14,6 +18,7 @@ import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityBigDecimal;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -41,9 +46,47 @@ public class WMSMaterialiService {
|
||||
@Autowired
|
||||
private EntityProcessor entityProcessor;
|
||||
|
||||
@Autowired
|
||||
private WMSGiacenzaULService wmsGiacenzaULService;
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbColt recupera(RecuperaMaterialiRequestDTO request) throws Exception {
|
||||
public VersaMaterialiResponseDTO versa(VersaMaterialiRequestDTO request) throws Exception {
|
||||
throw new NotImplementedException();
|
||||
|
||||
/*
|
||||
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);
|
||||
if (mtbAart == null)
|
||||
throw new InvalidArticoloException(request.getCodMart());
|
||||
|
||||
if (request.getBarcodeUl() == null )
|
||||
throw new Exception("Indicare una UL in cui effettuare il carico del materiale");
|
||||
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> artsInGiacenza =
|
||||
wmsGiacenzaULService.retrieveArtsInGiacenzaByArticolo(multiDBTransactionManager.getPrimaryConnection(), new RetrieveArtsInGiacenzaByArtRequestDTO()
|
||||
.setCodMart(request.getCodMart())
|
||||
.setPartitaMag(request.getPartitaMag())
|
||||
.setBarcodeUl(request.getBarcodeUl()));
|
||||
|
||||
if(artsInGiacenza == null || artsInGiacenza.isEmpty())
|
||||
throw new Exception("L'UL non contiene articoli (" + request.getBarcodeUl() + ")");
|
||||
|
||||
if (!versamentoDirettoEnabled) {
|
||||
// createColloScarico(mtbDepoPosizione);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return new VersaMaterialiResponseDTO();
|
||||
*/
|
||||
}
|
||||
|
||||
public RecuperaMaterialiResponseDTO recupera(RecuperaMaterialiRequestDTO request) throws Exception {
|
||||
|
||||
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");
|
||||
@@ -267,7 +310,7 @@ public class WMSMaterialiService {
|
||||
|
||||
final List<EntityBase> savedEntities = entityProcessor.processEntityList(entitiesToSave, true);
|
||||
UtilityEntity.throwEntitiesException(savedEntities);
|
||||
return mtbColtScarico;
|
||||
return new RecuperaMaterialiResponseDTO(mtbColtScarico);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user