Aggiunto il cliente o prospect nella risposta di createContact
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:
@@ -1,13 +1,36 @@
|
||||
package it.integry.ems.order.crm.dto.createContact;
|
||||
|
||||
import it.integry.ems.order.crm.dto.AnagClieDTO;
|
||||
import it.integry.ems_model.entity.JtbComt;
|
||||
import it.integry.ems_model.entity.PtbPros;
|
||||
import it.integry.ems_model.entity.StbActivity;
|
||||
|
||||
public class CRMCreateContactResponseDTO {
|
||||
|
||||
private AnagClieDTO anagClie;
|
||||
private PtbPros ptbPros;
|
||||
|
||||
private JtbComt jtbComt;
|
||||
private StbActivity stbActivity;
|
||||
|
||||
public AnagClieDTO getAnagClie() {
|
||||
return anagClie;
|
||||
}
|
||||
|
||||
public CRMCreateContactResponseDTO setAnagClie(AnagClieDTO anagClie) {
|
||||
this.anagClie = anagClie;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PtbPros getPtbPros() {
|
||||
return ptbPros;
|
||||
}
|
||||
|
||||
public CRMCreateContactResponseDTO setPtbPros(PtbPros ptbPros) {
|
||||
this.ptbPros = ptbPros;
|
||||
return this;
|
||||
}
|
||||
|
||||
public JtbComt getJtbComt() {
|
||||
return jtbComt;
|
||||
}
|
||||
|
||||
@@ -174,6 +174,48 @@ public class CrmService {
|
||||
|
||||
response.setStbActivity(newActivity);
|
||||
}
|
||||
|
||||
//Recupero il cliente o il prospect appena creato da inviare nella risposta
|
||||
if ("C".equals(createContact.getTipoAnag())) {
|
||||
String sql = Query.format(
|
||||
"SELECT gtb_anag.cod_anag,\n" +
|
||||
" vtb_clie.cod_vtip,\n" +
|
||||
" vtb_clie.cod_vage,\n" +
|
||||
" vtb_clie.flag_stato,\n" +
|
||||
" rag_soc,\n" +
|
||||
" indirizzo,\n" +
|
||||
" cap,\n" +
|
||||
" citta,\n" +
|
||||
" prov,\n" +
|
||||
" nazione,\n" +
|
||||
" telefono,\n" +
|
||||
" fax,\n" +
|
||||
" part_iva,\n" +
|
||||
" cod_fisc,\n" +
|
||||
" gtb_anag.note,\n" +
|
||||
" persona_rif,\n" +
|
||||
" e_mail,\n" +
|
||||
" nome,\n" +
|
||||
" data_ins,\n" +
|
||||
" num_cell,\n" +
|
||||
" e_mail_pec,\n" +
|
||||
" cognome,\n" +
|
||||
" diacod,\n" +
|
||||
" lat,\n" +
|
||||
" lng,\n" +
|
||||
" data_mod\n" +
|
||||
"FROM gtb_anag\n" +
|
||||
" INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
||||
"where gtb_anag.cod_anag = %s",
|
||||
codAnag
|
||||
);
|
||||
|
||||
response.setAnagClie(UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, AnagClieDTO.class));
|
||||
} else if ("P".equals(createContact.getTipoAnag())) {
|
||||
String sql = Query.format("SELECT * FROM ptb_pros WHERE cod_ppro = %s", codAnag);
|
||||
|
||||
response.setPtbPros(UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, PtbPros.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Rollback in caso di errore
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
|
||||
Reference in New Issue
Block a user