Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ public String closeCall(CallClosureDTO request) {
}

}
if (obj.getReceivedRoleName() != null && obj.getReceivedRoleName().equalsIgnoreCase(Constants.ANM)
&& request.getPreferredLanguage() != null && !request.getPreferredLanguage().isEmpty()) {
isLanguageMapped = isLanguageMappedWithUser(request);

if (obj.getReceivedRoleName() != null && (obj.getReceivedRoleName().equalsIgnoreCase(Constants.ANM) || callObj.getEcdCallType().equalsIgnoreCase("introductory"))
&& request.getPreferredLanguage() != null && !request.getPreferredLanguage().isEmpty() && !isLanguageMapped) {
callObj.setAllocationStatus(Constants.UNALLOCATED);
callObj.setCallStatus(Constants.OPEN);
callObj.setAllocatedUserId(null);
callObj.setCallAttemptNo(0);
} else {
Expand All @@ -203,14 +206,7 @@ public String closeCall(CallClosureDTO request) {
if(null != request.getReasonForCallNotAnswered() && Constants.REASONFORCALLNOTANSWERED.contains(request.getReasonForCallNotAnswered()) && !isMaxcallsAttempted) {
callObj.setCallStatus(Constants.OPEN);
}
isLanguageMapped = isLanguageMappedWithUser(request);
if(!isLanguageMapped && (callObj.getEcdCallType().equalsIgnoreCase("introductory") || callObj.getEcdCallType().equalsIgnoreCase("ANM"))) {

callObj.setAllocatedUserId(null);
callObj.setCallStatus(Constants.OPEN);
callObj.setCallAttemptNo(0);
callObj.setAllocationStatus(Constants.UNALLOCATED);
}

if (request.getIsHrp() != null) {
boolean isHrp = request.getIsHrp();
callObj.setIsHighRisk(isHrp);
Expand Down Expand Up @@ -244,9 +240,8 @@ else if (!isHrp && !obj.getIsCallDisconnected()) {
// Mother
outboundCallsRepo.updateHRPForUpcomingCall(callObj.getMotherId(), callObj.getIsHighRisk());
}

}
if (null != obj.getIsFurtherCallRequired() && !obj.getIsFurtherCallRequired()) {
if (null != obj.getIsFurtherCallRequired()) {
if (callObj.getMotherId() != null && callObj.getChildId() != null) {
try {
outboundCallsRepo.updateIsFurtherCallRequiredForUpcomingCallForChild(callObj.getChildId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,6 @@ public String moveAllocatedCallsToBin(RequestCallAllocationDTO callAllocationDto
} else if (callAllocationDto.getRoleName().equalsIgnoreCase("associate")) {
outboundCallsPage = getOutboundCallsForMotherAssociate(pageable, callAllocationDto,
tempFDateStamp, tempTDateStamp);
} else if (callAllocationDto.getRoleName().equalsIgnoreCase("MO")) {
// MO Role logic for Mother
outboundCallsPage = outboundCallsRepo.getAllocatedRecordsUserByRecordTypeAndPhoneTypeMotherMO(
pageable, callAllocationDto.getUserId(), "open", callAllocationDto.getPhoneNoType(),
tempFDateStamp, tempTDateStamp, callAllocationDto.getPreferredLanguage());
} else {
outboundCallsPage = outboundCallsRepo.getAllocatedRecordsUserByRecordTypeAndPhoneTypeMother(
pageable, callAllocationDto.getUserId(), "open", callAllocationDto.getPhoneNoType(),
Expand All @@ -639,12 +634,7 @@ else if (callAllocationDto.getRecordType().equalsIgnoreCase("Child")) {
tempFDateStamp, tempTDateStamp, callAllocationDto.getPreferredLanguage());
} else if (callAllocationDto.getRoleName().equalsIgnoreCase("associate")) {
outboundCallsPage = getOutboundcallsForChildAssociate(pageable, callAllocationDto, tempFDateStamp, tempTDateStamp);
} else if (callAllocationDto.getRoleName().equalsIgnoreCase("MO")) {
// MO Role logic for Child
outboundCallsPage = outboundCallsRepo.getAllocatedRecordsUserByRecordTypeAndPhoneTypeChildMO(
pageable, callAllocationDto.getUserId(), "open", callAllocationDto.getPhoneNoType(),
tempFDateStamp, tempTDateStamp, callAllocationDto.getPreferredLanguage());
} else {
} else {
outboundCallsPage = outboundCallsRepo.getAllocatedRecordsUserByRecordTypeAndPhoneTypeChild(
pageable, callAllocationDto.getUserId(), "open", callAllocationDto.getPhoneNoType(),
tempFDateStamp, tempTDateStamp);
Expand Down
Loading