Merge branch 'develop' into feature/RefactoringGestioneColli
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250409170559 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getDocuPrint", "CREATE FUNCTION [dbo].[getDocuPrint]\n" +
|
||||
"( \n" +
|
||||
" @codAnag varchar(5), @codDtip varchar(5), @dataDoc datetime, @serDoc varchar(2), @numDoc int\n" +
|
||||
") RETURNS TABLE AS\n" +
|
||||
"\n" +
|
||||
"RETURN \n" +
|
||||
"select docu.cod_anag,\n" +
|
||||
" cod_dtip,\n" +
|
||||
" data_doc,\n" +
|
||||
" ser_doc,\n" +
|
||||
" num_doc,\n" +
|
||||
" tipo_cessione, \n" +
|
||||
" id_riga,\n" +
|
||||
" docu.cod_mart,\n" +
|
||||
" descrizione,\n" +
|
||||
" ISNULL(dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'CODICEARTICOLO_EAN_TIPO')), tipo_codice_ean) as tipo_codice_ean, \n" +
|
||||
" valore_codice_ean,\n" +
|
||||
" ISNULL(dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'CODICEARTICOLO_FORN_TIPO')), tipo_codice_forn) as tipo_codice_forn, \n" +
|
||||
" valore_codice_forn,\n" +
|
||||
" ISNULL(dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'CODICEARTICOLO_CLIE_TIPO')), tipo_codice_clie) as tipo_codice_clie,\n" +
|
||||
" CASE docu.cod_anag WHEN 'C1275' THEN mtb_aart_anag.cod_mart_anag ELSE valore_codice_clie END as valore_codice_clie,\n" +
|
||||
" ISNULL(dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'ALTRIDATI_CT_ART_TIPO')), tipodato_ct_art) as tipodato_ct_art,\n" +
|
||||
" CASE WHEN docu.cod_anag in ('C1217', 'C1606', 'C1944', 'C0966', 'C1799', 'C1587') THEN num_cnf ELSE rifNumero_ct_art END as rifNumero_ct_art,\n" +
|
||||
" rifTesto_ct_art,\n" +
|
||||
" ISNULL(dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'ALTRIDATI_PZ_ART_TIPO')), tipodato_pz_art) as tipodato_pz_art,\n" +
|
||||
" CASE WHEN docu.cod_anag in ('C1217', 'C1606', 'C1944', 'C0966', 'C1799', 'C1587') THEN qta_cnf ELSE rifNumero_pz_art END as rifNumero_pz_art, \n" +
|
||||
" rifTesto_pz_art,\n" +
|
||||
" case when dbo.getGestSetup('FATTURA_ELETTRONICA_CUSTOM', 'COD_ANAG_' + docu.cod_anag, 'UNITA_MISURA_EDI') = 'S' THEN dbo.GetDocuPrint_getUMEDI(unt_doc) ELSE unt_doc END as unt_doc , \n" +
|
||||
" qta_doc,\n" +
|
||||
" val_unt,\n" +
|
||||
" sconto5,\n" +
|
||||
" sconto6,\n" +
|
||||
" sconto7,\n" +
|
||||
" sconto8,\n" +
|
||||
" importo_riga,\n" +
|
||||
" docu.cod_aliq,\n" +
|
||||
" perc_aliq, \n" +
|
||||
" natura, \n" +
|
||||
" data_iniz_comp,\n" +
|
||||
" data_fine_comp,\n" +
|
||||
" cod_kit,\n" +
|
||||
" descr_kit,\n" +
|
||||
" tipodato_lotto,\n" +
|
||||
" rifTesto_lotto,\n" +
|
||||
" ISNULL(case when docu.cod_anag = 'C0966' then 'DP' + '|' else '' end + dbo.f_emptyStr2Null((select value from stb_gest_setup where gest_name = 'FATTURA_ELETTRONICA_CUSTOM' and section = 'COD_ANAG_' + docu.cod_anag and key_section = 'ALTRIDATI_DEST_TIPO')), tipodato_dest) as tipodato_dest,\n" +
|
||||
" CASE docu.cod_anag \n" +
|
||||
" WHEN 'C0326' THEN null \n" +
|
||||
" WHEN 'C0731' THEN null \n" +
|
||||
" WHEN 'C0328' THEN null \n" +
|
||||
" WHEN 'C0432' THEN null\n" +
|
||||
" WHEN 'C1830' THEN null ELSE rifNumero_dest END as rifNumero_dest,\n" +
|
||||
" LEFT(CASE docu.cod_anag \n" +
|
||||
" WHEN 'C2499' then SPACE(1) /*Necessario per nom visualizzare l'indirizzo come richiesto dal cliente*/\n" +
|
||||
" WHEN 'C1765' THEN vtb_dest.destinatario \n" +
|
||||
" WHEN 'C1275' THEN vtb_dest.cod_ean\n" +
|
||||
" WHEN 'C0432' THEN vtb_dest.cod_affiliazione\n" +
|
||||
" WHEN 'C1830' THEN vtb_dest.cod_ean\n" +
|
||||
" WHEN 'C0328' THEN vtb_dest.cod_affiliazione\n" +
|
||||
" WHEN 'C0731' THEN vtb_dest.cod_ean\n" +
|
||||
" WHEN 'C0326' THEN vtb_dest.cod_affiliazione ELSE\n" +
|
||||
" CASE WHEN docu.cod_anag in ('C1217', 'C1606', 'C1944', 'C1799', 'C1587') THEN vtb_dest.cod_ean +';'+vtb_dest.destinatario ELSE case when docu.cod_anag in ('C0966') then vtb_dest.cod_ean +'|'+vtb_dest.destinatario else rifTesto_dest END END END, 60) as rifTesto_dest, \n" +
|
||||
" data_ddt, \n" +
|
||||
" CASE docu.cod_anag WHEN 'C0731' THEN \n" +
|
||||
" CASE WHEN isNull(num_doc_ddt, '') = '' THEN null ELSE ser_doc_ddt + ' ' + Cast(num_doc_ddt as varchar) END \n" +
|
||||
" ELSE num_ddt END as num_ddt, \n" +
|
||||
" rif_data_ord, \n" +
|
||||
" rif_num_ord, \n" +
|
||||
" rifTesto_numDocCli, \n" +
|
||||
" tipoDato_numDocCli\n" +
|
||||
"from dbo.getDocuPrint_generica(@codAnag, @CodDtip, @dataDoc, @serDoc, @numDoc) docu left outer join vtb_dest on docu.cod_anag = vtb_dest.cod_anag and\n" +
|
||||
" docu.cod_vdes = vtb_dest.cod_vdes\n" +
|
||||
" left outer join mtb_aart_anag on docu.cod_anag = mtb_aart_anag.cod_anag and \n" +
|
||||
" docu.cod_mart = mtb_aart_anag.cod_mart\n" +
|
||||
"where docu.cod_anag <> 'C0326' OR (docu.cod_anag = 'C0326' AND docu.qta_doc <> 0 AND docu.val_unt <> 0 AND isnull(natura,'') <>'N2.2')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250410130654 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("W_VLISTDATA_RC", "SETUP", "SUGGESTCODE_PROMO", null,
|
||||
"Se non specificato nulla viene passato alla suggestcode il partial_code = cod_vlis, altrimenti viene passato il partial_code = codice_promo specificato dall'utente", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250410130713 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
updateSetupValue("W_VLISTDATA_RC", "SETUP", "SUGGESTCODE_PROMO", "COD_PROMO",
|
||||
"Se non specificato nulla viene passato alla suggestcode il partial_code = cod_vlis, altrimenti viene passato il partial_code = codice_promo specificato dall'utente", false, null, false, false, false,
|
||||
false, false, null, false, null);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM stb_gest_setup_depo\n" +
|
||||
"WHERE gest_name = 'W_VLISTDATA_RC'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'SUGGESTCODE_PROMO'"
|
||||
);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM wtb_gest_setup_user\n" +
|
||||
"WHERE gest_name = 'W_VLISTDATA_RC'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'SUGGESTCODE_PROMO'"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250410131614 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
enableSaveToRest("dtipi");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -601,24 +601,37 @@ public class DocumentRules extends QueryRules {
|
||||
public static void completeDatiDocMtbColt(Connection connection, DtbDoct testata) throws SQLException {
|
||||
List<MtbColt> colli = testata.getMtbColt().stream().filter(x -> x.getNativeSql() == null).collect(Collectors.toList());
|
||||
for (MtbColt mtbColt: colli) {
|
||||
boolean isDelete = mtbColt.getOperation() == OperationType.DELETE;
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT CAST(IIF(flag_collo_anonimo='N',0,1) as bit) FROM mtb_colt WHERE gestione = %s AND data_collo = %s AND ser_collo = %s AND num_collo = %s",
|
||||
mtbColt.getGestione(),
|
||||
mtbColt.getDataCollo(),
|
||||
mtbColt.getSerCollo(),
|
||||
mtbColt.getNumCollo());
|
||||
boolean cancellaRifDoc;
|
||||
if ( mtbColt.getCancellaRifDoc()==null) {
|
||||
if ( mtbColt.getOperation() == OperationType.DELETE) {
|
||||
cancellaRifDoc = true;
|
||||
mtbColt.setOperation(OperationType.UPDATE);
|
||||
} else {
|
||||
cancellaRifDoc = false;
|
||||
}
|
||||
} else {
|
||||
cancellaRifDoc = mtbColt.getCancellaRifDoc();
|
||||
}
|
||||
if (mtbColt.getOperation() != OperationType.DELETE) {
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT CAST(IIF(flag_collo_anonimo='N',0,1) as bit) FROM mtb_colt WHERE gestione = %s AND data_collo = %s AND ser_collo = %s AND num_collo = %s",
|
||||
mtbColt.getGestione(),
|
||||
mtbColt.getDataCollo(),
|
||||
mtbColt.getSerCollo(),
|
||||
mtbColt.getNumCollo());
|
||||
|
||||
boolean colloAnonimo = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
boolean colloAnonimo = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
mtbColt
|
||||
.setCodAnag(cancellaRifDoc && colloAnonimo ? EmsRestConstants.NULL : testata.getCodAnag())
|
||||
.setCodDtip(cancellaRifDoc ? EmsRestConstants.NULL : testata.getCodDtip())
|
||||
.setDataDoc(cancellaRifDoc ? EmsRestConstants.DATE_NULL : testata.getDataDoc())
|
||||
.setSerDoc(cancellaRifDoc ? EmsRestConstants.NULL : testata.getSerDoc())
|
||||
.setNumDoc(cancellaRifDoc ? EmsRestConstants.INTEGER_NULL : testata.getNumDoc())
|
||||
.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
|
||||
mtbColt
|
||||
.setCodAnag(isDelete && colloAnonimo?EmsRestConstants.NULL:testata.getCodAnag())
|
||||
.setCodDtip(isDelete?EmsRestConstants.NULL:testata.getCodDtip())
|
||||
.setDataDoc(isDelete?EmsRestConstants.DATE_NULL:testata.getDataDoc())
|
||||
.setSerDoc(isDelete?EmsRestConstants.NULL:testata.getSerDoc())
|
||||
.setNumDoc(isDelete?EmsRestConstants.INTEGER_NULL:testata.getNumDoc());
|
||||
mtbColt.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1686,12 +1686,10 @@ public class DtbDoct extends DtbBaseDocT implements EquatableEntityInterface<Dtb
|
||||
String sql = "UPDATE mtb_invent SET cod_anag = null, cod_dtip = null, data_doc = null, ser_doc = null, num_doc = null, flag_stato = 1 ";
|
||||
sql = UtilityDB.addwhereCond(sql, this.getWhereCondOldPk(null), false);
|
||||
connection.createStatement().executeUpdate(sql);
|
||||
/*for (MtbColt mtbColt : getMtbColt()) {
|
||||
mtbColt.manageWithParentConnection(connection, mtbColt.getOperation(), dataCompleting, entityHolder);
|
||||
} */
|
||||
sql = "UPDATE mtb_colt SET cod_anag = null, cod_dtip = null, data_doc = null, ser_doc = null, num_doc = null ";
|
||||
sql = UtilityDB.addwhereCond(sql, this.getWhereCondOldPk(null), false);
|
||||
connection.createStatement().executeUpdate(sql);
|
||||
|
||||
if ("S".equals(getGeneraMovCont())) {
|
||||
if (getWhereCond() == null) {
|
||||
setWhereCond(getPkWhereCond());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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_model.annotation.*;
|
||||
@@ -183,6 +184,8 @@ public class MtbColt extends EntityBase implements EquatableEntityInterface<MtbC
|
||||
|
||||
private boolean updateColliFromDoc = false;
|
||||
|
||||
private Boolean cancellaRifDoc;
|
||||
|
||||
@EntityChild
|
||||
@ReloadRow
|
||||
private List<MtbColr> mtbColr = new ArrayList<>();
|
||||
@@ -544,6 +547,15 @@ public class MtbColt extends EntityBase implements EquatableEntityInterface<MtbC
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getCancellaRifDoc() {
|
||||
return cancellaRifDoc;
|
||||
}
|
||||
|
||||
public MtbColt setCancellaRifDoc(Boolean cancellaRifDoc) {
|
||||
this.cancellaRifDoc = cancellaRifDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataDistribuzione() {
|
||||
return dataDistribuzione;
|
||||
}
|
||||
|
||||
@@ -30,15 +30,17 @@ public class DocumentExtEntityRules {
|
||||
colt.getSerCollo().equalsIgnoreCase(mtbColt.getSerCollo()) &&
|
||||
colt.getNumCollo().equals(mtbColt.getNumCollo()))
|
||||
.findFirst();
|
||||
if (first.isPresent()) {
|
||||
first.get().setCodDtip(EmsRestConstants.NULL)
|
||||
.setCodAnag(EmsRestConstants.NULL)
|
||||
.setDataDoc(EmsRestConstants.DATE_NULL)
|
||||
.setSerDoc(EmsRestConstants.NULL)
|
||||
.setNumDoc(EmsRestConstants.INTEGER_NULL)
|
||||
.setCodAnag(mtbColt.getFlagColloAnonimo().equalsIgnoreCase("S")?EmsRestConstants.NULL:mtbColt.getCodAnag())
|
||||
.setCodVdes(mtbColt.getFlagColloAnonimo().equalsIgnoreCase("S")?EmsRestConstants.NULL:mtbColt.getCodVdes());
|
||||
first.get().setOperation(OperationType.UPDATE);
|
||||
if (first.isPresent() ) {
|
||||
if (first.get().getOperation() != OperationType.DELETE) {
|
||||
first.get().setCodDtip(EmsRestConstants.NULL)
|
||||
.setCodAnag(EmsRestConstants.NULL)
|
||||
.setDataDoc(EmsRestConstants.DATE_NULL)
|
||||
.setSerDoc(EmsRestConstants.NULL)
|
||||
.setNumDoc(EmsRestConstants.INTEGER_NULL)
|
||||
.setCodAnag(mtbColt.getFlagColloAnonimo().equalsIgnoreCase("S") ? EmsRestConstants.NULL : mtbColt.getCodAnag())
|
||||
.setCodVdes(mtbColt.getFlagColloAnonimo().equalsIgnoreCase("S") ? EmsRestConstants.NULL : mtbColt.getCodVdes());
|
||||
first.get().setOperation(OperationType.UPDATE);
|
||||
}
|
||||
} else {
|
||||
mtbColt.setCodDtip(EmsRestConstants.NULL)
|
||||
.setCodAnag(EmsRestConstants.NULL)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.document.controller;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.document.dto.CreateUDCFromDocumentsDTO;
|
||||
import it.integry.ems.document.dto.CreateULFromDocumentsDTO;
|
||||
import it.integry.ems.document.service.DocumentiDirettiService;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems_model.entity.DtbDoct;
|
||||
@@ -49,8 +49,19 @@ public class DocumentiDirettiController {
|
||||
public @ResponseBody
|
||||
ServiceRestResponse createUDCFromDocuments(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody CreateUDCFromDocumentsDTO CreateUDCFromDocuments) throws Exception {
|
||||
@RequestBody CreateULFromDocumentsDTO CreateULFromDocuments) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(documentiDirettiService.createUDCFromDocuments(CreateUDCFromDocuments));
|
||||
return ServiceRestResponse.createPositiveResponse(documentiDirettiService.createUDCFromDocuments(CreateULFromDocuments));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "createUDSFromDocuments", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse createUDSFromDocuments(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody CreateULFromDocumentsDTO CreateULFromDocuments) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(documentiDirettiService.createUDSFromDocuments(CreateULFromDocuments));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,21 +3,22 @@ package it.integry.ems.document.dto;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
public class CreateUDCFromDocumentsDTO {
|
||||
public class CreateULFromDocumentsDTO {
|
||||
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private String codMdep;
|
||||
private LocalDate dataCollo;
|
||||
private String gestione;
|
||||
private boolean monoUl;
|
||||
|
||||
private List<UDCRowDTO> udcRows;
|
||||
private List<ULRowDTO> ulRows;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setCodAnag(String codAnag) {
|
||||
public CreateULFromDocumentsDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
@@ -26,7 +27,7 @@ public class CreateUDCFromDocumentsDTO {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setCodVdes(String codVdes) {
|
||||
public CreateULFromDocumentsDTO setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
@@ -35,7 +36,7 @@ public class CreateUDCFromDocumentsDTO {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setCodMdep(String codMdep) {
|
||||
public CreateULFromDocumentsDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
@@ -44,7 +45,7 @@ public class CreateUDCFromDocumentsDTO {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setDataCollo(LocalDate dataCollo) {
|
||||
public CreateULFromDocumentsDTO setDataCollo(LocalDate dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
@@ -53,17 +54,26 @@ public class CreateUDCFromDocumentsDTO {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setGestione(String gestione) {
|
||||
public CreateULFromDocumentsDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<UDCRowDTO> getUdcRows() {
|
||||
return udcRows;
|
||||
public List<ULRowDTO> getUlRows() {
|
||||
return ulRows;
|
||||
}
|
||||
|
||||
public CreateUDCFromDocumentsDTO setUdcRows(List<UDCRowDTO> udcRow) {
|
||||
this.udcRows = udcRow;
|
||||
public boolean isMonoUl() {
|
||||
return monoUl;
|
||||
}
|
||||
|
||||
public CreateULFromDocumentsDTO setMonoUl(boolean monoUl) {
|
||||
this.monoUl = monoUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreateULFromDocumentsDTO setUlRows(List<ULRowDTO> ulRows) {
|
||||
this.ulRows = ulRows;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package it.integry.ems.document.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class UDCRowDTO {
|
||||
public class ULRowDTO {
|
||||
|
||||
private String barcodeUl;
|
||||
private String codMart;
|
||||
@@ -18,7 +18,7 @@ public class UDCRowDTO {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public UDCRowDTO setBarcodeUl(String barcodeUl) {
|
||||
public ULRowDTO setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
return this;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class UDCRowDTO {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public UDCRowDTO setCodMart(String codMart) {
|
||||
public ULRowDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class UDCRowDTO {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public UDCRowDTO setPartitaMag(String partitaMag) {
|
||||
public ULRowDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class UDCRowDTO {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public UDCRowDTO setDataScad(LocalDate dataScad) {
|
||||
public ULRowDTO setDataScad(LocalDate dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class UDCRowDTO {
|
||||
return qtaCol;
|
||||
}
|
||||
|
||||
public UDCRowDTO setQtaCol(BigDecimal qtaCol) {
|
||||
public ULRowDTO setQtaCol(BigDecimal qtaCol) {
|
||||
this.qtaCol = qtaCol;
|
||||
return this;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class UDCRowDTO {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public UDCRowDTO setDataOrd(LocalDate dataOrd) {
|
||||
public ULRowDTO setDataOrd(LocalDate dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class UDCRowDTO {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public UDCRowDTO setNumOrd(Integer numOrd) {
|
||||
public ULRowDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class UDCRowDTO {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public UDCRowDTO setRigaOrd(Integer rigaOrd) {
|
||||
public ULRowDTO setRigaOrd(Integer rigaOrd) {
|
||||
this.rigaOrd = rigaOrd;
|
||||
return this;
|
||||
}
|
||||
@@ -1057,10 +1057,10 @@ public class DigitalInvoiceBodyFactory {
|
||||
if (setup.getSetupBoolean("FATTURA_ELETTRONICA_CUSTOM", "ALTRI_DATI_GESTIONALI_DEST", "ATTIVO")) {
|
||||
//DESTINATARIO
|
||||
/*Gestito il carattere | per creare più istanze del tag AltriDatiGestionali per i dati del destinatario*/
|
||||
if (!UtilityString.isNullOrEmpty(dettaglioLinea.getRifTestoDest())) {
|
||||
/* if (!UtilityString.isNullOrEmpty(dettaglioLinea.getRifTestoDest())) {*/
|
||||
List<String> listTipoDato = Arrays.asList(StringUtils.split(UtilityString.streNull(dettaglioLinea.getTipoDatoDest()), "|"));
|
||||
List<String> listRifTesto = Arrays.asList(StringUtils.split(UtilityString.streNull(dettaglioLinea.getRifTestoDest()), "|"));
|
||||
if (listTipoDato.size() == listRifTesto.size()) {
|
||||
if (listTipoDato.size() == listRifTesto.size() && listTipoDato != null && listRifTesto != null) {
|
||||
for (int j = 0; j < listTipoDato.size(); j++) {
|
||||
AltriDatiGestionaliType altriDatiDest = new AltriDatiGestionaliType();
|
||||
altriDatiDest.setTipoDato(listTipoDato.get(j));
|
||||
@@ -1074,9 +1074,11 @@ public class DigitalInvoiceBodyFactory {
|
||||
dettaglio.getAltriDatiGestionali().add(altriDatiDest);
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Configurazione personalizzata non corretta del tag <AltriDatiGertionali> per la visulizzazione del destinatario.");
|
||||
if (!UtilityString.isNullOrEmpty(dettaglioLinea.getRifTestoDest())){
|
||||
throw new Exception("Configurazione personalizzata non corretta del tag <AltriDatiGertionali> per la visulizzazione del destinatario.");
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }*/
|
||||
}
|
||||
|
||||
return dettaglio;
|
||||
|
||||
@@ -2,12 +2,15 @@ package it.integry.ems.document.service;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.document.dto.ArticoloPartitaDTO;
|
||||
import it.integry.ems.document.dto.CreateUDCFromDocumentsDTO;
|
||||
import it.integry.ems.document.dto.UDCRowDTO;
|
||||
import it.integry.ems.document.dto.CreateULFromDocumentsDTO;
|
||||
import it.integry.ems.document.dto.ULRowDTO;
|
||||
import it.integry.ems.document.dto.UlVenditaDTO;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.retail.wms.accettazione.service.WMSAccettazioneService;
|
||||
import it.integry.ems.retail.wms.dto.*;
|
||||
import it.integry.ems.retail.wms.generic.dto.MvwSitArtUdcDetInventarioDTO;
|
||||
import it.integry.ems.retail.wms.generic.service.WMSGiacenzaULService;
|
||||
import it.integry.ems.retail.wms.vendita.service.WMSSpedizioneService;
|
||||
import it.integry.ems.rules.businessLogic.enums.TipoEmissione;
|
||||
import it.integry.ems.rules.completing.ConfigActivityRules;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
@@ -19,6 +22,7 @@ import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,6 +50,10 @@ public class DocumentiDirettiService {
|
||||
private DocumentService documentService;
|
||||
@Autowired
|
||||
private WMSAccettazioneService wmsAccettazioneService;
|
||||
@Autowired
|
||||
private WMSSpedizioneService wmsSpedizioneService;
|
||||
@Autowired
|
||||
private WMSGiacenzaULService wmsGiacenzaULService;
|
||||
|
||||
public List<EntityBase> save(DtbDoct dtbDoct, boolean isInsert) throws Exception {
|
||||
List<EntityBase> entityList = new ArrayList<>();
|
||||
@@ -197,9 +205,9 @@ public class DocumentiDirettiService {
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
List<DtbDoct> docTrasfList = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(),Query.format("SELECT cod_anag,data_doc,ser_doc,num_doc,cod_dtip,cod_mdep from dtb_doct where activity_id = {} and cod_dtip = {} ", activityId, codDtipTrasf), DtbDoct.class);
|
||||
List<DtbDoct> docTrasfList = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), Query.format("SELECT cod_anag,data_doc,ser_doc,num_doc,cod_dtip,cod_mdep from dtb_doct where activity_id = {} and cod_dtip = {} ", activityId, codDtipTrasf), DtbDoct.class);
|
||||
if (docTrasfList == null) docTrasfList = new ArrayList<>();
|
||||
docTrasfList =docTrasfList.stream().peek(x->x.setOperation(OperationType.DELETE)).collect(Collectors.toList());
|
||||
docTrasfList = docTrasfList.stream().peek(x -> x.setOperation(OperationType.DELETE)).collect(Collectors.toList());
|
||||
|
||||
List<String> depositiPartenza = artsToTransfer.stream().map(UlVenditaDTO::getCodMdep).distinct().collect(Collectors.toList());
|
||||
for (String codMdep : depositiPartenza) {
|
||||
@@ -207,7 +215,7 @@ public class DocumentiDirettiService {
|
||||
DtbDoct docTrasf = null;
|
||||
|
||||
if (!isNewDoc) {
|
||||
docTrasf = docTrasfList.stream().filter(x->x.getCodMdep().equals(codMdep)).findFirst().orElse(null);
|
||||
docTrasf = docTrasfList.stream().filter(x -> x.getCodMdep().equals(codMdep)).findFirst().orElse(null);
|
||||
if (docTrasf != null) {
|
||||
docTrasf.setOperation(OperationType.UPDATE);
|
||||
List<DtbDocr> oldDocRows = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), "SELECT * from dtb_docr where " + docTrasf.getPkWhereCond(), DtbDocr.class);
|
||||
@@ -285,7 +293,7 @@ public class DocumentiDirettiService {
|
||||
//</editor-fold>
|
||||
|
||||
}
|
||||
entityList.addAll(docTrasfList);
|
||||
entityList.addAll(docTrasfList);
|
||||
|
||||
|
||||
return dtbDoct;
|
||||
@@ -629,16 +637,16 @@ public class DocumentiDirettiService {
|
||||
return dtbDoct;
|
||||
}
|
||||
|
||||
public List<MtbColt> createUDCFromDocuments(CreateUDCFromDocumentsDTO createUDCFromDocuments) throws Exception {
|
||||
public List<MtbColt> createUDCFromDocuments(CreateULFromDocumentsDTO createUDCFromDocuments) throws Exception {
|
||||
List<MtbColt> generatedMtbColt = new ArrayList<>();
|
||||
|
||||
List<UDCRowDTO> udcRows = createUDCFromDocuments.getUdcRows();
|
||||
Map<String, List<UDCRowDTO>> groupedByBarcode = udcRows.stream()
|
||||
.collect(Collectors.groupingBy(UDCRowDTO::getBarcodeUl));
|
||||
List<ULRowDTO> udcRows = createUDCFromDocuments.getUlRows();
|
||||
Map<String, List<ULRowDTO>> groupedByBarcode = udcRows.stream()
|
||||
.collect(groupingBy(ULRowDTO::getBarcodeUl));
|
||||
|
||||
for (Map.Entry<String, List<UDCRowDTO>> entry : groupedByBarcode.entrySet()) {
|
||||
for (Map.Entry<String, List<ULRowDTO>> entry : groupedByBarcode.entrySet()) {
|
||||
String barcodeUl = entry.getKey();
|
||||
List<UDCRowDTO> groupedRequests = entry.getValue();
|
||||
List<ULRowDTO> groupedRequests = entry.getValue();
|
||||
|
||||
MtbColt udc = wmsAccettazioneService.createUDC(
|
||||
new CreateUDCRequestDTO()
|
||||
@@ -651,7 +659,7 @@ public class DocumentiDirettiService {
|
||||
|
||||
udc.getMtbCols().forEach(x -> x.setOperation(OperationType.NO_OP));
|
||||
|
||||
for (UDCRowDTO request : groupedRequests) {
|
||||
for (ULRowDTO request : groupedRequests) {
|
||||
wmsAccettazioneService.insertUDCRow(
|
||||
new InsertUDCRowRequestDTO()
|
||||
.setCodMart(request.getCodMart())
|
||||
@@ -672,4 +680,88 @@ public class DocumentiDirettiService {
|
||||
|
||||
return generatedMtbColt;
|
||||
}
|
||||
|
||||
public List<MtbColt> createUDSFromDocuments(CreateULFromDocumentsDTO createUDSFromDocuments) throws Exception {
|
||||
List<MtbColt> generatedMtbColt = new ArrayList<>();
|
||||
MtbColt uds = null;
|
||||
|
||||
List<CreateUDSRequestOrderDTO> createUDSRequestOrderDTO = Collections.emptyList();
|
||||
|
||||
if (createUDSFromDocuments.isMonoUl()){
|
||||
createUDSRequestOrderDTO = createUDSFromDocuments.getUlRows().stream()
|
||||
.map(
|
||||
x -> {
|
||||
CreateUDSRequestOrderDTO ord = new CreateUDSRequestOrderDTO()
|
||||
.setDataOrd(x.getDataOrd())
|
||||
.setNumOrd(x.getNumOrd())
|
||||
.setGestione(createUDSFromDocuments.getGestione());
|
||||
return ord;
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
for (ULRowDTO ulRowDTO : createUDSFromDocuments.getUlRows()) {
|
||||
if ((createUDSFromDocuments.isMonoUl() && uds == null) || !createUDSFromDocuments.isMonoUl()) {
|
||||
if (!createUDSFromDocuments.isMonoUl()) {
|
||||
CreateUDSRequestOrderDTO ord = new CreateUDSRequestOrderDTO()
|
||||
.setDataOrd(ulRowDTO.getDataOrd())
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setGestione(createUDSFromDocuments.getGestione());
|
||||
createUDSRequestOrderDTO = new ArrayList<>();
|
||||
createUDSRequestOrderDTO.add(ord);
|
||||
}
|
||||
uds = wmsSpedizioneService.createUDS(
|
||||
new CreateUDSRequestDTO()
|
||||
.setCodAnag(createUDSFromDocuments.getCodAnag())
|
||||
.setCodMdep(createUDSFromDocuments.getCodMdep())
|
||||
.setCodVdes(createUDSFromDocuments.getCodVdes())
|
||||
.setOrders(createUDSRequestOrderDTO));
|
||||
}
|
||||
uds.getMtbCols().forEach(x -> x.setOperation(OperationType.NO_OP));
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> mvwSitArtUdcDetInventarioDTOS = wmsGiacenzaULService.retrieveArtsInGiacenzaByBarcodeUl(multiDBTransactionManager.getPrimaryConnection(), ulRowDTO.getBarcodeUl());
|
||||
|
||||
MvwSitArtUdcDetInventarioDTO mvwSitArtUdcDetInventarioDTO = mvwSitArtUdcDetInventarioDTOS.stream()
|
||||
.filter(x ->
|
||||
x.getCodMart().equalsIgnoreCase(ulRowDTO.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getPartitaMag(), ulRowDTO.getPartitaMag()))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
MtbColr sourceMtbColr = null;
|
||||
if (mvwSitArtUdcDetInventarioDTO != null) {
|
||||
sourceMtbColr =
|
||||
new MtbColr()
|
||||
.setGestione(mvwSitArtUdcDetInventarioDTO.getGestione())
|
||||
.setDataCollo(mvwSitArtUdcDetInventarioDTO.getDataCollo())
|
||||
.setSerCollo(mvwSitArtUdcDetInventarioDTO.getSerCollo())
|
||||
.setNumCollo(mvwSitArtUdcDetInventarioDTO.getNumCollo());
|
||||
}
|
||||
|
||||
wmsSpedizioneService.insertUDSRow(
|
||||
new InsertUDSRowRequestDTO()
|
||||
.setCodMart(ulRowDTO.getCodMart())
|
||||
.setPartitaMag(ulRowDTO.getPartitaMag())
|
||||
.setQtaTot(ulRowDTO.getQtaCol())
|
||||
.setDataOrd(UtilityLocalDate.localDateToDate(ulRowDTO.getDataOrd()))
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setRigaOrd(ulRowDTO.getRigaOrd())
|
||||
.setTargetMtbColt(uds)
|
||||
.setSourceMtbColr(sourceMtbColr)
|
||||
);
|
||||
|
||||
if (!createUDSFromDocuments.isMonoUl()) {
|
||||
wmsSpedizioneService.closeUDS(new CloseUDSRequestDTO().setMtbColt(uds));
|
||||
|
||||
generatedMtbColt.add(uds);
|
||||
}
|
||||
}
|
||||
if (createUDSFromDocuments.isMonoUl()) {
|
||||
wmsSpedizioneService.closeUDS(new CloseUDSRequestDTO().setMtbColt(uds));
|
||||
|
||||
generatedMtbColt.add(uds);
|
||||
}
|
||||
|
||||
return generatedMtbColt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,23 +1186,22 @@ public class VariazioniPvService {
|
||||
// .append(" avvenuta con successo\n\r");
|
||||
// }
|
||||
|
||||
if (!generatedErrors.isEmpty())
|
||||
if (!generatedErrors.isEmpty()) {
|
||||
sb.append("\n\r\n\rErrori\n\r");
|
||||
|
||||
for (Exception generatedError : generatedErrors) {
|
||||
sb.append("Messaggio errore: ")
|
||||
.append(generatedError.getMessage())
|
||||
.append("\n\r");
|
||||
}
|
||||
|
||||
for (Exception generatedError : generatedErrors) {
|
||||
sb.append("Messaggio errore: ")
|
||||
.append(generatedError.getMessage())
|
||||
.append("\n\r");
|
||||
mailService.sendMailPrimary(multiDBTransactionManager,
|
||||
null, null,
|
||||
emailForLog, null, null,
|
||||
"Esportazione variazioni", sb.toString(), false, false,
|
||||
null, null, null,
|
||||
false, null);
|
||||
}
|
||||
|
||||
|
||||
mailService.sendMailPrimary(multiDBTransactionManager,
|
||||
null, null,
|
||||
emailForLog, null, null,
|
||||
"Esportazione variazioni", sb.toString(), false, false,
|
||||
null, null, null,
|
||||
false, null);
|
||||
}
|
||||
}catch (Exception e ){
|
||||
if (!UtilityString.isNullOrEmpty(emailForLog)) {
|
||||
|
||||
@@ -70,27 +70,33 @@ public class ScontriniZucchettiExportServices {
|
||||
}
|
||||
|
||||
sql =
|
||||
"SELECT ntb_doct.cod_mdep,\n" +
|
||||
" ntb_doct.date_only_doc AS data,\n" +
|
||||
" CONVERT(VARCHAR(5), MIN(ntb_doct.data_doc), 108) AS ora_iniz,\n" +
|
||||
" CONVERT(VARCHAR(5), MAX(ntb_doct.data_doc), 108) AS ora_fine,\n" +
|
||||
" mtb_aart.cod_mgrp,\n" +
|
||||
" CAST(\n" +
|
||||
" CAST(DATEDIFF(MINUTE, ntb_doct.date_only_doc, ntb_doct.data_doc) AS FLOAT) / 30 AS INT) AS gruppo_ore,\n" +
|
||||
" SUM(ntb_docr.qta_doc) AS qta,\n" +
|
||||
" SUM((ntb_docr.qta_doc * ntb_docr.prz_unt_iva) - ntb_docr.val_sco) AS valore,\n" +
|
||||
" COUNT(DISTINCT ntb_doct.id_scontr) AS count_scontrini,\n" +
|
||||
" COUNT(*) AS count_battute\n" +
|
||||
"FROM ntb_doct\n" +
|
||||
" INNER JOIN ntb_docr ON ntb_doct.cod_mdep = ntb_docr.cod_mdep\n" +
|
||||
" AND ntb_doct.cod_cassa = ntb_docr.cod_cassa\n" +
|
||||
" AND ntb_doct.data_doc = ntb_docr.data_doc\n" +
|
||||
" INNER JOIN mtb_aart ON ntb_docr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
"GROUP BY ntb_doct.cod_mdep, ntb_doct.date_only_doc,\n" +
|
||||
" CAST(\n" +
|
||||
" CAST(DATEDIFF(MINUTE, ntb_doct.date_only_doc, ntb_doct.data_doc) AS FLOAT) / 30 AS INT),\n" +
|
||||
" mtb_aart.cod_mgrp\n" +
|
||||
"ORDER BY ntb_doct.cod_mdep, ntb_doct.date_only_doc, 3";
|
||||
Query.format(
|
||||
"SELECT ntb_doct.cod_mdep,\n" +
|
||||
" ntb_doct.date_only_doc AS data,\n" +
|
||||
" CONVERT(VARCHAR(5), MIN(ntb_doct.data_doc), 108) AS ora_iniz,\n" +
|
||||
" CONVERT(VARCHAR(5), MAX(ntb_doct.data_doc), 108) AS ora_fine,\n" +
|
||||
" stb_gest_setup_det.value as cod_mgrp,\n" +
|
||||
" CAST(\n" +
|
||||
" CAST(DATEDIFF(MINUTE, ntb_doct.date_only_doc, ntb_doct.data_doc) AS FLOAT) / 30 AS INT) AS gruppo_ore,\n" +
|
||||
" SUM(ntb_docr.qta_doc) AS qta,\n" +
|
||||
" SUM((ntb_docr.qta_doc * ntb_docr.prz_unt_iva) - ntb_docr.val_sco) AS valore,\n" +
|
||||
" COUNT(DISTINCT ntb_doct.id_scontr) AS count_scontrini,\n" +
|
||||
" COUNT(*) AS count_battute\n" +
|
||||
"FROM ntb_doct\n" +
|
||||
" INNER JOIN ntb_docr ON ntb_doct.cod_mdep = ntb_docr.cod_mdep\n" +
|
||||
" AND ntb_doct.cod_cassa = ntb_docr.cod_cassa\n" +
|
||||
" AND ntb_doct.data_doc = ntb_docr.data_doc\n" +
|
||||
" INNER JOIN mtb_aart ON ntb_docr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" INNER JOIN stb_gest_setup_det ON mtb_aart.cod_mgrp = stb_gest_setup_det.val_col_rif \n" +
|
||||
" AND stb_gest_setup_det.gest_name = %s \n" +
|
||||
" AND stb_gest_setup_det.section = %s \n" +
|
||||
" AND stb_gest_setup_det.key_section = %s\n" +
|
||||
"GROUP BY ntb_doct.cod_mdep, ntb_doct.date_only_doc,\n" +
|
||||
" CAST(\n" +
|
||||
" CAST(DATEDIFF(MINUTE, ntb_doct.date_only_doc, ntb_doct.data_doc) AS FLOAT) / 30 AS INT),\n" +
|
||||
" stb_gest_setup_det.value\n" +
|
||||
"ORDER BY ntb_doct.cod_mdep, ntb_doct.date_only_doc, 3",
|
||||
"EXPORT_" + type, format, "INTERCODE_REPARTO");
|
||||
|
||||
sql = UtilityDB.addwhereCond(sql, whereCond, false );
|
||||
List<HashMap<String, Object>> scontrini = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
@@ -106,19 +112,13 @@ public class ScontriniZucchettiExportServices {
|
||||
getIntercodePV(setupDepo, codMdep, anomalie);
|
||||
}
|
||||
|
||||
//verifica intercode reparti
|
||||
List<String> reparti = scontrini.stream().map(x -> ((String) x.get("cod_mgrp"))).distinct().collect(Collectors.toList());
|
||||
for (String codMgrp : reparti) {
|
||||
getIntecodeReparti(setupReparti, codMgrp, anomalie);
|
||||
}
|
||||
|
||||
if ( !anomalie.isEmpty() && anomalie.stream().anyMatch(x->x.isError())) {
|
||||
return entityExportResponse;
|
||||
}
|
||||
List<ZucchettiHrDTO> dati = new ArrayList<>();
|
||||
for(HashMap<String, Object> row : scontrini) {
|
||||
String intercodePv = getIntercodePV(setupDepo, (String) row.get("cod_mdep"), anomalie);
|
||||
String intercodeReparto = getIntecodeReparti(setupReparti, (String) row.get("cod_mgrp"), anomalie);
|
||||
String intercodeReparto = (String) row.get("cod_mgrp");
|
||||
|
||||
BigDecimal oraInizio = new BigDecimal(row.get("ora_iniz").toString().replace(":", "."));
|
||||
BigDecimal oraFine = new BigDecimal(row.get("ora_fine").toString().replace(":", "."));
|
||||
@@ -184,16 +184,5 @@ public class ScontriniZucchettiExportServices {
|
||||
|
||||
}
|
||||
|
||||
private String getIntecodeReparti(List<HashMap<String, Object>> setupReparti, String codMgrp, List<AnomalieDTO> anomalie) throws Exception {
|
||||
String intercodeReparto = setupReparti.stream()
|
||||
.filter(x->((String) x.get("cod_mgrp")).equalsIgnoreCase(codMgrp)).findFirst().map(x->(String)x.get("intercode")).orElse(null);
|
||||
if ( intercodeReparto == null) {
|
||||
String errore = String.format("Intercode non trovato per il reparto %s", codMgrp);
|
||||
logger.error(errore);
|
||||
anomalie.add(AnomalieDTO.error(errore));
|
||||
}
|
||||
return intercodeReparto;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class PvmAccettazioneService {
|
||||
}
|
||||
|
||||
if (UtilityBigDecimal.greaterThan(articolo.getQtaDoc(), BigDecimal.ZERO) &&
|
||||
(newDoc || (!newDoc && ("S".equals(articolo.getRigaMod()) || !UtilityString.isNullOrEmpty(articolo.getLotti()) || qtaOrd.compareTo(BigDecimal.ZERO) > 0)))) {
|
||||
(newDoc || (!newDoc && ("S".equals(articolo.getRigaMod()) || qtaOrd.compareTo(BigDecimal.ZERO) > 0)))) {
|
||||
List<WdtbDocr> righeNew = insertRowBolla(articolo, wdtbDoct, rowColli);
|
||||
if (righeNew != null && !righeNew.isEmpty()) {
|
||||
wdtbDoct.getWdtbDocr().addAll(righeNew);
|
||||
|
||||
@@ -14,10 +14,20 @@ public class CloseUDSRequestDTO {
|
||||
return orderCodMdep;
|
||||
}
|
||||
|
||||
public CloseUDSRequestDTO setOrderCodMdep(String orderCodMdep) {
|
||||
this.orderCodMdep = orderCodMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public CloseUDSRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FiltroDistribuzioneColloDTO.CriterioDistribuzioneEnum getCriterioDistribuzione() {
|
||||
return criterioDistribuzione;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ 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" : "") +
|
||||
@@ -258,7 +257,7 @@ public class WMSGiacenzaULService {
|
||||
public List<MvwSitArtUdcDetInventarioDTO> retrieveArtsInGiacenzaByBarcodeUl(Connection connection, String barcodeUl) throws Exception {
|
||||
|
||||
String sql = createBaseQuery(true) +
|
||||
" AND sit_art.barcode_ul = " + UtilityDB.valueToString(barcodeUl);
|
||||
" AND mtb_colt.barcode_ul = " + UtilityDB.valueToString(barcodeUl);
|
||||
|
||||
return UtilityDB.executeSimpleQueryDTO(connection, sql, MvwSitArtUdcDetInventarioDTO.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user