From bd187b2725aa4eab41c8510495497ae7a0778317 Mon Sep 17 00:00:00 2001 From: Ravi Shanigarapu Date: Wed, 28 May 2025 15:53:25 +0530 Subject: [PATCH 1/4] role added --- .../ecd/controller/callallocation/CallAllocationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/iemr/ecd/controller/callallocation/CallAllocationController.java b/src/main/java/com/iemr/ecd/controller/callallocation/CallAllocationController.java index b9699b8..0ff7b98 100644 --- a/src/main/java/com/iemr/ecd/controller/callallocation/CallAllocationController.java +++ b/src/main/java/com/iemr/ecd/controller/callallocation/CallAllocationController.java @@ -142,7 +142,7 @@ public ResponseEntity insertRecordsInOutboundCalls(@RequestBody Outbound } - @GetMapping(value = "/getEligibleRecordsLanguageInfo/{psmId}/{phoneNoType}/{recordType}/{fDate}/{tDate}/{preferredLanguage}", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "/getEligibleRecordsLanguageInfo/{psmId}/{phoneNoType}/{recordType}/{fDate}/{tDate}/{preferredLanguage}/{role}", produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Fetch eligible Language records for allocation", description = "Desc - Fetch eligible records for allocation") @ApiResponses(value = { @ApiResponse(responseCode = CustomExceptionResponse.SUCCESS_SC_V, description = CustomExceptionResponse.SUCCESS_SC, content = { From abd507b0d7cb10b9ac60f8b21c3368737204c19b Mon Sep 17 00:00:00 2001 From: Ravi Shanigarapu Date: Wed, 28 May 2025 17:51:42 +0530 Subject: [PATCH 2/4] Introductory Call Allocation Changes --- .../call_conf_allocation/CallAllocationImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java b/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java index 219cee0..f008a26 100644 --- a/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java +++ b/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java @@ -123,6 +123,7 @@ private String allocateMotherRecordsAssociates(RequestCallAllocationDTO callAllo int callCountPointer = 0; if (callAllocationDto.getPreferredLanguage() != null) { + List motherIds = new ArrayList<>(); Page page = outboundCallsRepo.getMotherRecordsForAssociate( PageRequest.of(0, totalRecordToAllocate), "unallocated", @@ -143,11 +144,13 @@ private String allocateMotherRecordsAssociates(RequestCallAllocationDTO callAllo call.setAllocatedUserId(callAllocationDto.getToUserIds()[callCountPointer / callAllocationDto.getNoOfCalls()]); call.setCallAttemptNo(0); callCountPointer++; + motherIds.add(call.getMotherId()); } catch (Exception e) { callCountPointer++; } } outboundCallsRepo.saveAll(outBoundCallList); + motherRecordRepo.updateIsAllocatedStatus(motherIds); } else { List motherRecords = motherRecordRepo.getMotherRecordForAllocation( fromDate, toDate, callAllocationDto.getPhoneNoType(), totalRecordToAllocate); @@ -278,11 +281,11 @@ private String allocateChildRecordsAssociates(RequestCallAllocationDTO callAlloc } } outboundCallsRepo.saveAll(outBoundCallList); - int i = childRecordRepo.updateIsAllocatedStatus(childIds); + childRecordRepo.updateIsAllocatedStatus(childIds); } else if (null != childRecordsForAssociate && !childRecordsForAssociate.isEmpty()) { outBoundCallList = childRecordsForAssociate.getContent(); - + List childIds = new ArrayList<>(); if (!outBoundCallList.isEmpty()) { for (OutboundCalls outboundCall : outBoundCallList) { try { @@ -291,13 +294,14 @@ private String allocateChildRecordsAssociates(RequestCallAllocationDTO callAlloc / callAllocationDto.getNoOfCalls()]); outboundCall.setCallAttemptNo(0); - callCountPointer++; + childIds.add(outboundCall.getChildId()); } catch (Exception e) { callCountPointer++; } } outboundCallsRepo.saveAll(outBoundCallList); + childRecordRepo.updateIsAllocatedStatus(childIds); } } else { throw new ECDException("no eligible record available to allocate, please contact administrator"); From ca91a8998fdf041b8895a56876327a235044331a Mon Sep 17 00:00:00 2001 From: Ravi Shanigarapu Date: Wed, 28 May 2025 21:36:26 +0530 Subject: [PATCH 3/4] fix(bug) :Isfurthercallrequired update fix --- .../service/associate/CallClosureImpl.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java b/src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java index 27462c8..e1719b0 100644 --- a/src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java +++ b/src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java @@ -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 { @@ -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); @@ -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(), From 58a9826837cd25443f2fe68a6b5850e42554098c Mon Sep 17 00:00:00 2001 From: Ravi Shanigarapu Date: Fri, 30 May 2025 11:08:44 +0530 Subject: [PATCH 4/4] Unallocate Change --- .../call_conf_allocation/CallAllocationImpl.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java b/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java index f008a26..3be17fa 100644 --- a/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java +++ b/src/main/java/com/iemr/ecd/service/call_conf_allocation/CallAllocationImpl.java @@ -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(), @@ -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);