Done ticket GEPAFINBE-214
This commit is contained in:
@@ -986,7 +986,7 @@ public class CallDao {
|
|||||||
return callEntity;
|
return callEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,UserEntity user,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
|
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,UserEntity user,Long companyId , Boolean onlyPreferredCall, Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
|
||||||
Integer pageNo = null;
|
Integer pageNo = null;
|
||||||
Integer pageLimit = null;
|
Integer pageLimit = null;
|
||||||
if (callPageableRequestBean.getGlobalFilters() != null) {
|
if (callPageableRequestBean.getGlobalFilters() != null) {
|
||||||
@@ -1006,7 +1006,7 @@ public class CallDao {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
expirePublishedCalls(request);
|
expirePublishedCalls(request);
|
||||||
Specification<CallEntity> spec = search(request,user, callPageableRequestBean);
|
Specification<CallEntity> spec = search(request,user, callPageableRequestBean,onlyConfidiCall);
|
||||||
Page<CallEntity> entityPage;
|
Page<CallEntity> entityPage;
|
||||||
if (Boolean.TRUE.equals(onlyPreferredCall)) {
|
if (Boolean.TRUE.equals(onlyPreferredCall)) {
|
||||||
validator.validateUserWithCompany(request, companyId);
|
validator.validateUserWithCompany(request, companyId);
|
||||||
@@ -1056,10 +1056,10 @@ public class CallDao {
|
|||||||
return pageableResponseBean;
|
return pageableResponseBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Specification<CallEntity> search(HttpServletRequest request,UserEntity userEntity, CallPageableRequestBean callPageableRequestBean) {
|
public Specification<CallEntity> search(HttpServletRequest request,UserEntity userEntity, CallPageableRequestBean callPageableRequestBean,Boolean onlyConfidiCall) {
|
||||||
return (root, query, criteriaBuilder) -> {
|
return (root, query, criteriaBuilder) -> {
|
||||||
|
|
||||||
List<Predicate> predicates = getPredicates(request,callPageableRequestBean, criteriaBuilder, root, userEntity);
|
List<Predicate> predicates = getPredicates(request,callPageableRequestBean, criteriaBuilder, root, userEntity,onlyConfidiCall);
|
||||||
SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
|
SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
|
||||||
|
|
||||||
if (callPageableRequestBean.getGlobalFilters() != null
|
if (callPageableRequestBean.getGlobalFilters() != null
|
||||||
@@ -1083,7 +1083,7 @@ public class CallDao {
|
|||||||
|
|
||||||
|
|
||||||
private List<Predicate> getPredicates(HttpServletRequest request,CallPageableRequestBean callPageableRequestBean,
|
private List<Predicate> getPredicates(HttpServletRequest request,CallPageableRequestBean callPageableRequestBean,
|
||||||
CriteriaBuilder criteriaBuilder, Root<CallEntity> root, UserEntity userEntity) {
|
CriteriaBuilder criteriaBuilder, Root<CallEntity> root, UserEntity userEntity,Boolean onlyConfidiCall) {
|
||||||
Integer year = null;
|
Integer year = null;
|
||||||
String search = null;
|
String search = null;
|
||||||
Map<String, FilterCriteria> filters = new HashMap<>();
|
Map<String, FilterCriteria> filters = new HashMap<>();
|
||||||
@@ -1137,7 +1137,7 @@ public class CallDao {
|
|||||||
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
|
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
|
||||||
}
|
}
|
||||||
applyFilters(root, criteriaBuilder, predicates, filters);
|
applyFilters(root, criteriaBuilder, predicates, filters);
|
||||||
Boolean isConfidi = callPageableRequestBean.getConfidi();
|
Boolean isConfidi =onlyConfidiCall;
|
||||||
|
|
||||||
if (validator.checkIsConfidi()) {
|
if (validator.checkIsConfidi()) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,4 @@ public class CallPageableRequestBean {
|
|||||||
private List<CallStatusEnum> status;
|
private List<CallStatusEnum> status;
|
||||||
|
|
||||||
private Map<String, FilterCriteria> filters;
|
private Map<String, FilterCriteria> filters;
|
||||||
|
|
||||||
private Boolean confidi;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public interface CallService {
|
|||||||
|
|
||||||
byte[] downloadCallDocumentsAsZip(HttpServletRequest request, Long callId);
|
byte[] downloadCallDocumentsAsZip(HttpServletRequest request, Long callId);
|
||||||
|
|
||||||
PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,CallPageableRequestBean callPageableRequestBean);
|
PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall,CallPageableRequestBean callPageableRequestBean);
|
||||||
|
|
||||||
CallResponse createCallStep2EvaluationV2(HttpServletRequest request, Long callId, CreateCallRequestStep2EvaluationV2 createCallRequest);
|
CallResponse createCallStep2EvaluationV2(HttpServletRequest request, Long callId, CreateCallRequestStep2EvaluationV2 createCallRequest);
|
||||||
|
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ public class CallServiceImpl implements CallService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
|
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
|
||||||
UserEntity user = validator.validateUser(request);
|
UserEntity user = validator.validateUser(request);
|
||||||
return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,callPageableRequestBean);
|
return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,onlyConfidiCall,callPageableRequestBean);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public interface CallApi {
|
|||||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
|
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
|
||||||
ErrorConstants.BADREQUEST_ERROR_EXAMPLE))) })
|
ErrorConstants.BADREQUEST_ERROR_EXAMPLE))) })
|
||||||
@PostMapping(value = "/pagination", consumes = "application/json", produces = "application/json")
|
@PostMapping(value = "/pagination", consumes = "application/json", produces = "application/json")
|
||||||
ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestBody CallPageableRequestBean callPageableRequestBean);
|
ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestParam(value = "onlyConfidiCall", required = false) Boolean onlyConfidiCall, @RequestBody CallPageableRequestBean callPageableRequestBean);
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "Api to update call step 2 (Evaluation V2)",
|
@Operation(summary = "Api to update call step 2 (Evaluation V2)",
|
||||||
|
|||||||
@@ -152,12 +152,12 @@ public class CallApiController implements CallApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
|
public ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
|
||||||
|
|
||||||
/** This code is responsible for creating user action logs for the "get all call by pagination" operation. **/
|
/** This code is responsible for creating user action logs for the "get all call by pagination" operation. **/
|
||||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_CALL_BY_PAGINATION).build());
|
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_CALL_BY_PAGINATION).build());
|
||||||
|
|
||||||
PageableResponseBean<List<CallDetailsResponseBean>> callsByPagination=callService.getAllCallsByPagination(request,companyId,onlyPreferredCall,callPageableRequestBean);
|
PageableResponseBean<List<CallDetailsResponseBean>> callsByPagination=callService.getAllCallsByPagination(request,companyId,onlyPreferredCall,onlyConfidiCall,callPageableRequestBean);
|
||||||
return ResponseEntity.status(HttpStatus.OK)
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
.body(new Response<>(callsByPagination, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
|
.body(new Response<>(callsByPagination, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user