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
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public ResponseEntity<String> 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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private String allocateMotherRecordsAssociates(RequestCallAllocationDTO callAllo
int callCountPointer = 0;

if (callAllocationDto.getPreferredLanguage() != null) {
List<Long> motherIds = new ArrayList<>();
Page<OutboundCalls> page = outboundCallsRepo.getMotherRecordsForAssociate(
PageRequest.of(0, totalRecordToAllocate),
"unallocated",
Expand All @@ -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<MotherRecord> motherRecords = motherRecordRepo.getMotherRecordForAllocation(
fromDate, toDate, callAllocationDto.getPhoneNoType(), totalRecordToAllocate);
Expand Down Expand Up @@ -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<Long> childIds = new ArrayList<>();
if (!outBoundCallList.isEmpty()) {
for (OutboundCalls outboundCall : outBoundCallList) {
try {
Expand All @@ -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");
Expand Down
Loading