Fixing the duplicate issue

merge-requests/7/head
geethkokila 9 years ago
parent efa74030b4
commit 6aea69ae44

@ -355,6 +355,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
int operationId = 0; int operationId = 0;
int enrolmentId = 0; int enrolmentId = 0;
int responceId = 0;
Activity activity = null; Activity activity = null;
ActivityStatus activityStatus = null; ActivityStatus activityStatus = null;
while (rs.next()) { while (rs.next()) {
@ -380,8 +381,9 @@ public class GenericOperationDAOImpl implements OperationDAO {
activityStatus.setStatus(ActivityStatus.Status.valueOf(rs.getString("STATUS"))); activityStatus.setStatus(ActivityStatus.Status.valueOf(rs.getString("STATUS")));
List<OperationResponse> operationResponses = new ArrayList<>(); List<OperationResponse> operationResponses = new ArrayList<>();
if (rs.getInt("UPDATED_TIMESTAMP") != 0) { if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) {
operationResponses.add(this.getOperationResponse(rs)); operationResponses.add(this.getOperationResponse(rs));
responceId = rs.getInt("OP_RES_ID");
} }
activityStatus.setResponses(operationResponses); activityStatus.setResponses(operationResponses);
statusList.add(activityStatus); statusList.add(activityStatus);
@ -407,6 +409,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
List<OperationResponse> operationResponses = new ArrayList<>(); List<OperationResponse> operationResponses = new ArrayList<>();
if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) { if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) {
operationResponses.add(this.getOperationResponse(rs)); operationResponses.add(this.getOperationResponse(rs));
responceId = rs.getInt("OP_RES_ID");
} }
activityStatus.setResponses(operationResponses); activityStatus.setResponses(operationResponses);
activity.getActivityStatus().add(activityStatus); activity.getActivityStatus().add(activityStatus);
@ -414,9 +417,10 @@ public class GenericOperationDAOImpl implements OperationDAO {
enrolmentId = rs.getInt("ENROLMENT_ID"); enrolmentId = rs.getInt("ENROLMENT_ID");
} }
if (operationId == rs.getInt("OPERATION_ID") && enrolmentId == rs.getInt("ENROLMENT_ID")){ if (rs.getInt("OP_RES_ID") != 0 && responceId != rs.getInt("OP_RES_ID")){
if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) { if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) {
activityStatus.getResponses().add(this.getOperationResponse(rs)); activityStatus.getResponses().add(this.getOperationResponse(rs));
responceId = rs.getInt("OP_RES_ID");
} }
} }
} }

Loading…
Cancel
Save