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:
@@ -163,16 +163,18 @@ public class CrmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (createContact.getActivityRequest() != null) {
|
if (createContact.getActivityRequest() != null) {
|
||||||
response.setStbActivity(
|
StbActivity newActivity = createNewActivity(
|
||||||
createNewActivity(
|
createContact
|
||||||
createContact
|
.getActivityRequest()
|
||||||
.getActivityRequest()
|
.setCodJcom(codJcom),
|
||||||
.setCodJcom(codJcom),
|
new CRMCreateNewCommessaRequestDTO()
|
||||||
new CRMCreateNewCommessaRequestDTO()
|
.setCommessa(createContact.getCommessa()),
|
||||||
.setCommessa(createContact.getCommessa()),
|
createContact.getCliente()
|
||||||
createContact.getCliente()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
entityProcessor.processEntity(newActivity, true, multiDBTransactionManager);
|
||||||
|
|
||||||
|
response.setStbActivity(newActivity);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Dati dell'attività da creare inesistenti");
|
throw new Exception("Dati dell'attività da creare inesistenti");
|
||||||
}
|
}
|
||||||
@@ -362,11 +364,13 @@ public class CrmService {
|
|||||||
completeOrder.setCodJcom(jtbComt.getCodJcom());
|
completeOrder.setCodJcom(jtbComt.getCodJcom());
|
||||||
|
|
||||||
if (completeOrder.getActivity() != null) {
|
if (completeOrder.getActivity() != null) {
|
||||||
createNewActivity(
|
StbActivity newActivity = createNewActivity(
|
||||||
completeOrder.getActivity(),
|
completeOrder.getActivity(),
|
||||||
new CRMCreateNewCommessaRequestDTO()
|
new CRMCreateNewCommessaRequestDTO()
|
||||||
.setCommessa(completeOrder.getCommessa())
|
.setCommessa(completeOrder.getCommessa())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
entityProcessor.processEntity(newActivity, true, multiDBTransactionManager);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Dati dell'attività da creare inesistenti");
|
throw new Exception("Dati dell'attività da creare inesistenti");
|
||||||
}
|
}
|
||||||
@@ -621,10 +625,9 @@ public class CrmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private StbActivity createNewActivity(CRMActivityDTO activityRequest, CRMCreateNewCommessaRequestDTO commessaRequest, CRMClienteDTO clienteDTO) throws Exception {
|
private StbActivity createNewActivity(CRMActivityDTO activityRequest, CRMCreateNewCommessaRequestDTO commessaRequest, CRMClienteDTO clienteDTO) throws Exception {
|
||||||
StbActivity stbActivity = CRMUtility.buildStbActivity(activityRequest);
|
String parentActivityId = activityRequest.getParentActivityId();
|
||||||
stbActivity.setOperation(OperationType.INSERT);
|
|
||||||
|
|
||||||
if (UtilityString.isNullOrEmpty(activityRequest.getParentActivityId()) && commessaRequest != null) {
|
if (UtilityString.isNullOrEmpty(parentActivityId) && commessaRequest != null) {
|
||||||
String userName = requestDataDTO.getUsername();
|
String userName = requestDataDTO.getUsername();
|
||||||
String activityTypeId, activityDescription;
|
String activityTypeId, activityDescription;
|
||||||
|
|
||||||
@@ -655,10 +658,12 @@ public class CrmService {
|
|||||||
parentActivity.setOperation(OperationType.INSERT);
|
parentActivity.setOperation(OperationType.INSERT);
|
||||||
entityProcessor.processEntity(parentActivity, true, multiDBTransactionManager);
|
entityProcessor.processEntity(parentActivity, true, multiDBTransactionManager);
|
||||||
|
|
||||||
stbActivity.setParentActivityId(parentActivity.getActivityId());
|
parentActivityId = parentActivity.getActivityId();
|
||||||
entityProcessor.processEntity(stbActivity, true, multiDBTransactionManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StbActivity stbActivity = CRMUtility.buildStbActivity(activityRequest).setParentActivityId(parentActivityId);
|
||||||
|
stbActivity.setOperation(OperationType.INSERT);
|
||||||
|
|
||||||
return stbActivity;
|
return stbActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user