Merge branch 'master' into develop
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:
@@ -38,35 +38,36 @@ public class MovimentiContabiliServices {
|
||||
List<EntityBase> entitiesToSave = new ArrayList<>();
|
||||
|
||||
if (ctbMovt.getNumCmov() != null && ctbMovt.getOperation() != OperationType.DELETE) {
|
||||
String sql =
|
||||
Query.format( "SELECT cod_anag FROM ctb_movt WHERE num_cmov = %s", ctbMovt.getNumCmov() );
|
||||
if(ctbMovt.getCodAnag()!= null) {
|
||||
String sql =
|
||||
Query.format("SELECT cod_anag FROM ctb_movt WHERE num_cmov = %s", ctbMovt.getNumCmov());
|
||||
|
||||
String codAnagOld = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
String codAnagOld = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
if (codAnagOld != null && !codAnagOld.equalsIgnoreCase(ctbMovt.getCodAnag())) {
|
||||
sql = Query.format(
|
||||
"SELECT DISTINCT ctb_part.*\n" +
|
||||
"FROM ctb_part\n" +
|
||||
" INNER JOIN ctb_parr ON ctb_part.tipo_anag = ctb_parr.tipo_anag AND ctb_part.cod_anag = ctb_parr.cod_anag AND\n" +
|
||||
" ctb_part.anno_part = ctb_parr.anno_part AND ctb_part.ser_doc = ctb_parr.ser_doc AND\n" +
|
||||
" ctb_part.num_doc = ctb_parr.num_doc\n" +
|
||||
" INNER JOIN ctb_caus ON ctb_parr.cod_ccau = ctb_caus.cod_ccau\n" +
|
||||
"WHERE ctb_parr.num_cmov = %s",
|
||||
ctbMovt.getNumCmov());
|
||||
if (codAnagOld != null && !codAnagOld.equalsIgnoreCase(ctbMovt.getCodAnag())) {
|
||||
sql = Query.format(
|
||||
"SELECT DISTINCT ctb_part.*\n" +
|
||||
"FROM ctb_part\n" +
|
||||
" INNER JOIN ctb_parr ON ctb_part.tipo_anag = ctb_parr.tipo_anag AND ctb_part.cod_anag = ctb_parr.cod_anag AND\n" +
|
||||
" ctb_part.anno_part = ctb_parr.anno_part AND ctb_part.ser_doc = ctb_parr.ser_doc AND\n" +
|
||||
" ctb_part.num_doc = ctb_parr.num_doc\n" +
|
||||
" INNER JOIN ctb_caus ON ctb_parr.cod_ccau = ctb_caus.cod_ccau\n" +
|
||||
"WHERE ctb_parr.num_cmov = %s",
|
||||
ctbMovt.getNumCmov());
|
||||
|
||||
CtbPart ctbPart = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CtbPart.class);
|
||||
CtbPart ctbPart = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CtbPart.class);
|
||||
|
||||
if ( ctbPart != null) {
|
||||
if ( ctbPart.getTipoPartita() == 1 && !UtilityBigDecimal.isNullOrZero(ctbPart.getAverePart())) {
|
||||
throw new Exception("Impossibile modificare il movimento! Documento già incassato");
|
||||
} else if (ctbPart.getTipoPartita() == 0 && !UtilityBigDecimal.isNullOrZero(ctbPart.getDarePart())) {
|
||||
throw new Exception("Impossibile modificare il movimento! Documento già incassato");
|
||||
if (ctbPart != null) {
|
||||
if (ctbPart.getTipoPartita() == 1 && !UtilityBigDecimal.isNullOrZero(ctbPart.getAverePart())) {
|
||||
throw new Exception("Impossibile modificare il movimento! Documento già incassato");
|
||||
} else if (ctbPart.getTipoPartita() == 0 && !UtilityBigDecimal.isNullOrZero(ctbPart.getDarePart())) {
|
||||
throw new Exception("Impossibile modificare il movimento! Documento già incassato");
|
||||
}
|
||||
ctbPart.setOperation(OperationType.DELETE);
|
||||
entitiesToSave.add(ctbPart);
|
||||
}
|
||||
ctbPart.setOperation(OperationType.DELETE);
|
||||
entitiesToSave.add(ctbPart);
|
||||
}
|
||||
}
|
||||
|
||||
entitiesToSave.add(ctbMovt);
|
||||
} else {
|
||||
entitiesToSave = Collections.singletonList(ctbMovt);
|
||||
|
||||
@@ -797,24 +797,24 @@ public class SystemController {
|
||||
}
|
||||
}
|
||||
|
||||
if (!activity.getActivityTypeId().equalsIgnoreCase("TICKET")) {
|
||||
String query =
|
||||
Query.format(
|
||||
"select stb_user.e_mail\n" +
|
||||
"from jtb_comt \n" +
|
||||
"inner join jrl_flav_users on jtb_comt.cod_jflav_tec = jrl_flav_users.cod_jflav and jrl_flav_users.flag_jflav_default = 's'\n" +
|
||||
"inner join stb_user on jrl_flav_users.user_name =stb_user.user_name " +
|
||||
"where cod_jcom = %S ", activity.getCodJcom());
|
||||
String emailResponsabile = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(emailResponsabile) && !listEmailCcn.contains(emailResponsabile))
|
||||
listEmailCcn.add(emailResponsabile);
|
||||
}
|
||||
String query =
|
||||
Query.format(
|
||||
"select stb_user.e_mail\n" +
|
||||
"from jtb_comt \n" +
|
||||
"inner join jrl_flav_users on jtb_comt.cod_jflav_tec = jrl_flav_users.cod_jflav and jrl_flav_users.flag_jflav_default = 's'\n" +
|
||||
"inner join stb_user on jrl_flav_users.user_name =stb_user.user_name " +
|
||||
"where cod_jcom = %S ", activity.getCodJcom());
|
||||
String emailResponsabile = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(emailResponsabile) && !listEmailCcn.contains(emailResponsabile))
|
||||
listEmailCcn.add(emailResponsabile);
|
||||
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(emailTo)) {
|
||||
String ccn = StringUtils.join(listEmailCcn, ";");
|
||||
notifica(stbActivity.getActivityId(), personaRif, emailTo, activity.getUserCreator(), ccn, notificationType, null, multiDBTransactionManager);
|
||||
notifica(stbActivity.getActivityId(), personaRif, emailTo, activity.getUserCreator(), ccn, notificationType, null, stbActivity.getActivityTypeId(),
|
||||
multiDBTransactionManager);
|
||||
}
|
||||
activity.setActivityId(stbActivity.getActivityId());
|
||||
return ServiceRestResponse.createPositiveResponse(activity);
|
||||
@@ -950,7 +950,7 @@ public class SystemController {
|
||||
ccn = emailAssegnatoA;
|
||||
}
|
||||
}
|
||||
notifica(activity.getActivityId(), personaRif, emailPersRif, activity.getUserCreator(), ccn, notificationType, null, multiDBTransactionManager);
|
||||
notifica(activity.getActivityId(), personaRif, emailPersRif, activity.getUserCreator(), ccn, notificationType, null, activity.getActivityTypeId(), multiDBTransactionManager);
|
||||
}
|
||||
response = new ServiceRestResponse(EsitoType.OK, activity, configuration);
|
||||
|
||||
@@ -962,7 +962,8 @@ public class SystemController {
|
||||
}
|
||||
|
||||
public void notifica(String activityID, String personaRif, String emailPersRif, String inseritoDa,
|
||||
String ccn, String azione, String note, MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
String ccn, String azione, String note, String activityTypeId,
|
||||
MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
/**
|
||||
* IL PARAMETRO 'azione' PUO' ASSUMERE I SEGUENTI VALORI:
|
||||
* 'A' - Apertura,
|
||||
@@ -978,21 +979,27 @@ public class SystemController {
|
||||
String emailHelpdesk = "helpdesk@integry.it";
|
||||
|
||||
|
||||
String subject = "Integry - Ticket n. " + activityID;
|
||||
String subject = "Integry - Ticket n. [activity_id]";
|
||||
if ("A".equals(azione)) {
|
||||
subject = "Integry - Apertura attivita n. " + activityID;
|
||||
subject = "Integry - Apertura [activity_type_id] n. [activity_id] ";
|
||||
} else if ("B".equals(azione)) {
|
||||
subject = "Integry - Nuova attivita da " + personaRif + " ticket n. " + activityID;
|
||||
subject = "Integry - Nuova attivita da [persona_rif] ticket n. [activity_id]";
|
||||
} else if ("F".equals(azione)) {
|
||||
subject = "Integry - Feedback negativo da " + personaRif + " ticket n. " + activityID;
|
||||
subject = "Integry - Feedback negativo da [persona_rif] ticket n. [activity_id]";
|
||||
} else if ("S".equals(azione)) {
|
||||
subject = "Integry - Sollecito da " + personaRif + " per ticket n. " + activityID;
|
||||
subject = "Integry - Sollecito da [persona_rif] per ticket n. [activity_id]";
|
||||
} else if ("U".equals(azione)) {
|
||||
subject = "Integry - Aggiornamento attivita n. " + activityID;
|
||||
subject = "Integry - Aggiornamento attivita n. [activity_id]";
|
||||
} else if ("C".equals(azione)) {
|
||||
subject = "Integry - Chiusura attivita n. " + activityID;
|
||||
subject = "Integry - Chiusura attivita n. [activity_id]";
|
||||
}
|
||||
|
||||
subject = subject
|
||||
.replace("[activity_id]", activityID)
|
||||
.replace("[persona_rif]", UtilityString.streNull(personaRif))
|
||||
.replace("[inserito_da]", inseritoDa)
|
||||
.replace("[activity_type_id]", activityTypeId.toLowerCase());
|
||||
|
||||
String emailTo;
|
||||
|
||||
if ("B".equals(azione)) {
|
||||
|
||||
Reference in New Issue
Block a user