Skip to content

Commit

Permalink
Merge pull request #184 from project-sunbird/fixes-for-open-batch
Browse files Browse the repository at this point in the history
Issues #SB--2204 fix: changes for dashboard for unenroll user course …
  • Loading branch information
bvinayakumar authored Oct 11, 2018
2 parents dd96af5 + bf594fd commit 50d8c87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.sunbird.common.models.util.ProjectUtil.isNotNull;
import static org.sunbird.common.models.util.ProjectUtil.isNull;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -15,6 +14,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.sunbird.actor.router.ActorConfig;
Expand All @@ -36,6 +36,8 @@
import org.sunbird.helper.ServiceFactory;
import org.sunbird.learner.util.Util;

import com.fasterxml.jackson.databind.ObjectMapper;

@ActorConfig(
tasks = {
"courseProgressMetrics",
Expand Down Expand Up @@ -232,6 +234,7 @@ private void courseProgressMetrics(Request actorMessage) {
requestMap.put(JsonKey.PERIOD, periodStr);
Map<String, Object> filter = new HashMap<>();
filter.put(JsonKey.BATCH_ID, batchId);
filter.put(JsonKey.ACTIVE, true) ;
if (!("fromBegining".equalsIgnoreCase(periodStr))) {
Map<String, String> dateRange = getDateRange(periodStr);
dateRangeFilter.put(GTE, (String) dateRange.get(STARTDATE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import static org.sunbird.common.models.util.ProjectUtil.isNotNull;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -14,6 +12,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.sunbird.actor.router.ActorConfig;
import org.sunbird.cassandra.CassandraOperation;
import org.sunbird.common.ElasticSearchUtil;
Expand All @@ -32,6 +31,9 @@
import org.sunbird.helper.ServiceFactory;
import org.sunbird.learner.util.Util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

@ActorConfig(
tasks = {},
asyncTasks = {"courseProgressMetricsData"}
Expand Down Expand Up @@ -94,7 +96,7 @@ public void courseProgressMetricsData(Request actorMessage) {
requestMap.put(JsonKey.PERIOD, periodStr);
Map<String, Object> filter = new HashMap<>();
filter.put(JsonKey.BATCH_ID, batchId);

filter.put(JsonKey.ACTIVE, true);
if (!("fromBegining".equalsIgnoreCase(periodStr))) {
Map<String, Object> dateRange = getStartAndEndDate(periodStr);
dateRangeFilter.put(GTE, (String) dateRange.get(STARTDATE));
Expand Down

0 comments on commit 50d8c87

Please sign in to comment.