Commits (34)
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.statestreet.model.Lob;
import com.statestreet.model.SubLob;
import com.statestreet.model.UserMaster;
import com.statestreet.service.LobService;
import lombok.extern.slf4j.Slf4j;
......@@ -39,7 +40,16 @@ public class LobController {
ResponseEntity<List<Lob>> responseEntity = lobService.getAllLob();
log.debug("Response returned from LobController -- getAllLob method, responseEntity={}",responseEntity);
return responseEntity;
}
}
@RequestMapping(
value="/api/admin/getActiveLob", method=RequestMethod.GET)
public ResponseEntity<List<Lob>> getActiveLob() throws Exception{
log.debug("Inside LobController called getAllLob method ");
ResponseEntity<List<Lob>> responseEntity = lobService.getActiveLob();
log.debug("Response returned from LobController -- getAllLob method, responseEntity={}",responseEntity);
return responseEntity;
}
@RequestMapping(
value="/api/admin/getSubLob", method=RequestMethod.GET)
......@@ -50,6 +60,15 @@ public class LobController {
return subResponseEntity;
}
@RequestMapping(
value="/api/admin/getAllSubLob", method=RequestMethod.GET)
public ResponseEntity<List<SubLob>> getAllSubLob(@RequestParam String lobName) throws Exception{
log.debug("Inside LobController called getActiveSubLob method with parameter, lobName={}",lobName);
ResponseEntity<List<SubLob>> subResponseEntity = lobService.getAllSubLob(lobName.toUpperCase());
log.debug("Response returned from LobController -- getAllSubLob method, subResponseEntity={}",subResponseEntity);
return subResponseEntity;
}
@RequestMapping(
value = "/api/admin/saveLob" ,method = RequestMethod.POST)
......@@ -70,6 +89,43 @@ public class LobController {
return respEntity;
}
@RequestMapping(
value = "/api/admin/editSubLob" ,method = RequestMethod.POST)
public ResponseEntity<String> editSubLob(@RequestBody @Valid SubLob subLob) throws Exception {
log.debug("Inside LobController called editSubLob method with parameter, subLob={}",subLob);
ResponseEntity<String> respEntity=lobService.editSubLobDetails(subLob);
log.debug("Response returned from LobController -- editSubLob method, respEntity={}",respEntity);
return respEntity;
}
@RequestMapping(
value = "/api/admin/editLob" ,method = RequestMethod.POST)
public ResponseEntity<String> editLob(@RequestBody @Valid Lob lob) throws Exception {
log.debug("Inside LobController called saveSubLob method with parameter, lob={}",lob);
ResponseEntity<String> respEntity=lobService.editLobDetails(lob);
log.debug("Response returned from LobController -- saveUserDetails method, respEntity={}",respEntity);
return respEntity;
}
/**
*
* @param userId
* @return
* @throws Exception
*/
@RequestMapping(
value = "/api/admin/checkUserListByLobSubLob" ,method = RequestMethod.GET)
public ResponseEntity<List<UserMaster>> checkUserListByLobSubLob(@RequestParam(value="lobId", required = true) long lobId,@RequestParam(value="subLobId", required = true) long subLobId) throws Exception {
log.debug("Inside LobController called checkUserListByLobSubLob method with parameter, lobId={},subLobId={}",lobId,subLobId);
ResponseEntity<List<UserMaster>> respEntity=lobService.getUserListByLobSubLob(lobId, subLobId);
log.debug("Response returned from LobController -- checkUserListByLobSubLob method, respEntity={}",respEntity);
return respEntity;
}
/**
* This method is used by SSHS chatbot
......
......@@ -20,6 +20,7 @@ import com.statestreet.model.CountSummaryReport;
import com.statestreet.model.QuestionWiseAlReport;
import com.statestreet.model.RawDataReport;
import com.statestreet.model.ScoreWiseAlReport;
import com.statestreet.model.UserAssessmentInfographicReport;
import com.statestreet.model.UserMaster;
import com.statestreet.service.ReportService;
......@@ -110,6 +111,7 @@ public class ReportController {
log.debug("Inside ReportController called method getCountSummaryReport with parameter,startDate={},endDate={}",startDate,endDate);
return reportService.getCountSummaryReport(startDate,endDate);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getQuestionWiseAlReport")
public ResponseEntity<List<QuestionWiseAlReport>> getQuestionWiseAlReport (
@RequestParam(value = "startDate", required = true) String startDate,
......@@ -162,12 +164,78 @@ public class ReportController {
return reportService.getUserScoreCard(userId);
}
@RequestMapping(method=RequestMethod.GET,value="/api-docs/getInfographicJVReport")
public ResponseEntity<Map<String,List<DBObject>>> getInfoGraphicReport(
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getDesignationAssessmentInfographicReport")
public ResponseEntity<List<UserAssessmentInfographicReport>> getDesignationAssessInfographicReport(
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception {
log.debug("Inside ReportController called method getDesignationAssessInfographicReport with parameter,"
+ "startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getDesignationAssessInfographicReport(startDate, endDate, assessmentId,subLobId);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getGenderAssessmentInfographicReport")
public ResponseEntity<List<UserAssessmentInfographicReport>> getGenderAssessInfographicReport(
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception {
log.debug("Inside ReportController called method getGenderAssessInfographicReport with parameter,"
+ "startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getGenderAssessInfographicReport(startDate, endDate, assessmentId,subLobId);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getTenureAssessmentInfographicReport")
public ResponseEntity<List<UserAssessmentInfographicReport>> getTenureAssessmentInfographicReport(
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception {
log.debug("Inside ReportController called method getTenureAssessmentInfographicReport with parameter,"
+ "startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getTenureAssessmentInfographicReport(startDate, endDate, assessmentId,subLobId);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getCategoryAssessmentInfographicReport")
public ResponseEntity<List<DBObject>> getCategoryAssessmentInfographicReport(
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate) throws Exception {
log.debug("Inside ReportController called method getInfoGraphicReport with parameter,startDate={},endDate={}",startDate,endDate);
return reportService.getInfoGraphicReport(startDate, endDate);
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception {
log.debug("Inside ReportController called method getCategoryAssessmentInfographicReport with parameter,"
+ "startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getCategoryAssessmentInfographicReport(startDate, endDate, assessmentId,subLobId);
}
@RequestMapping(method=RequestMethod.GET,value="/api/user/getUserAssessmentReport")
public ResponseEntity<List<DBObject>> getUserAssessmentReport (
@RequestParam(value="userId", required = true) String userId,
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate) throws Exception{
log.debug("Inside ReportController called method getUserAssessmentReport with parameter,userId={},"
+ "startDate={},endDate={}",userId,startDate,endDate);
return reportService.getUserAssessmentReport(userId,startDate,endDate);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getPercentageWiseInfographicReport")
public ResponseEntity<Map<String, Integer>> getPercentageWiseInfographicReport (
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception{
log.debug("Inside ReportController called method getPercentageWiseInfographicReport with parameter,startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getPercentageWiseInfographicReport(startDate, endDate, assessmentId,subLobId);
}
@RequestMapping(method=RequestMethod.GET,value="/api/admin/getQuizResultWiseAssesmentInfographicReport")
public ResponseEntity<Map<String, Integer>> getQuizResultWiseAssesmentInfographicReport (
@RequestParam(value = "startDate", required = true) String startDate,
@RequestParam(value = "endDate", required = true) String endDate,
@RequestParam(value = "assessmentId", required = true) long assessmentId,
@RequestParam(value = "subLobId") long subLobId) throws Exception{
log.debug("Inside ReportController called method getQuizResultWiseAssesmentInfographicReport with parameter,startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
return reportService.getQuizResultWiseAssesmentInfographicReport(startDate, endDate, assessmentId,subLobId);
}
}
......@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.mongodb.DBObject;
import com.statestreet.model.Designation;
import com.statestreet.model.Role;
import com.statestreet.model.User;
import com.statestreet.model.UserMaster;
......@@ -214,4 +215,21 @@ public class UserController {
log.debug("Inside UserController called getUserListByRole method with parameter, role={}",role);
return userService.getUserListByRole(role);
}
@RequestMapping(
value="/api-docs/addDesignationMaster", method=RequestMethod.POST)
public ResponseEntity<String> addDesignationMaster(@RequestBody List<String> designationList) throws Exception{
log.debug("Inside UserController called addDesignationMaster method with parameter, designationList={}",designationList);
ResponseEntity<String> result=userService.addDesignationMaster(designationList);
log.debug("Response returned from UserController -- addDesignationMaster method, respEntity={}",result);
return result;
}
@RequestMapping(
value="/api/admin/getDesignationList", method=RequestMethod.GET)
public ResponseEntity<List<Designation>> getDesignationList() throws Exception
{
log.debug("Inside UserController called getDesignationList method.");
return userService.getDesignationList();
}
}
......@@ -125,7 +125,7 @@ public class AssessmentRepositoryImpl implements AssessmentRepositoryCustom {
return result;
}
@Override
/*@Override
public List<DBObject> getAssessmentName(Date startDate, Date endDate, long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("inside AssessmentRepositoryImpl called getAssessmentName method with parameter, startDate={},endDate={},subLobId={}",
......@@ -161,6 +161,49 @@ public class AssessmentRepositoryImpl implements AssessmentRepositoryCustom {
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from AssessmentRepositoryImpl -- getAssessmentName method, result={}",result);
return result.getMappedResults();
}*/
@Override
public List<DBObject> getAssessmentName(Date startDate, Date endDate, long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("inside AssessmentRepositoryImpl called getAssessmentName method with parameter, startDate={},endDate={},subLobId={}",
startDate,endDate,subLobId);
AggregationOperation match = Aggregation.match(new Criteria().andOperator(Criteria.where("createdDate").gte(startDate),
Criteria.where("createdDate").lt(endDate),Criteria.where("subLob._id").is(subLobId),
new Criteria().orOperator(Criteria.where("status").is(CommonUtils.Assessment_Status.Assessment_Generated),
Criteria.where("status").is(CommonUtils.Assessment_Status.Assessment_Inprogress))));
AggregationOperation lookup = Aggregation.lookup("Question_Set","_id","assessmentId","questionSet");
AggregationOperation unwind=Aggregation.unwind("questionSet",true);
Cond condOperation1 = ConditionalOperators.when(Criteria.where("questionSet.isAttempted").is(true)).then(1).otherwise(0);
Cond condOperation2 = ConditionalOperators.when(new Criteria()
.orOperator(Criteria.where("questionSet.isAttempted").is(true),Criteria.where("questionSet.isAttempted").is(false)))
.then(1).otherwise(0);
AggregationOperation project=Aggregation.project("_id","requestorName","requestorEcode","assessmentName","duration","location","createdDate",
"wrongUserId","misMatchUserId","completionDate","subLob","assessmentType").and("questionSet._id").as("setId")
.and(condOperation1).as("completedAssessment").and(condOperation2).as("totalAssessment");
AggregationOperation group = Aggregation.group("_id","requestorName","requestorEcode","assessmentName","duration","location",
"createdDate","wrongUserId","misMatchUserId","completionDate","subLob","assessmentType").sum("completedAssessment").as("completedAssessment")
.sum("totalAssessment").as("totalAssessment");
AggregationOperation lookup1 = Aggregation.lookup("Quiz_Result","_id._id","questionSet.assessmentId","quizResult");
AggregationOperation unwind1=Aggregation.unwind("quizResult",true);
Cond condOperation3 = ConditionalOperators.when(Criteria.where("quizResult.quizOutcome")
.is(CommonUtils.Quiz_Status.Pass)).then(1).otherwise(0);
Cond condOperation4 = ConditionalOperators.when(Criteria.where("quizResult.quizOutcome")
.is(CommonUtils.Quiz_Status.Fail)).then(1).otherwise(0);
Cond condOperation5 = ConditionalOperators.when(Criteria.where("quizResult.quizOutcome")
.is(CommonUtils.Quiz_Status.Pending)).then(1).otherwise(0);
AggregationOperation project1=Aggregation.project("requestorName","requestorEcode","assessmentName","duration","location",
"createdDate","wrongUserId","misMatchUserId","completionDate","completedAssessment","subLob","totalAssessment","assessmentType")
.and(condOperation3).as("passCount").and(condOperation4).as("failCount").and(condOperation5).as("pendingCount")
.and("_id._id").as("assessmentId");
AggregationOperation group1 = Aggregation.group("assessmentId","requestorName","requestorEcode","assessmentName","duration","location",
"createdDate","wrongUserId","misMatchUserId","completionDate","subLob","completedAssessment","totalAssessment","assessmentType")
.sum("passCount").as("passCount").sum("failCount").as("failCount").sum("pendingCount").as("pendingCount");
Aggregation agg = Aggregation.newAggregation(match,lookup,unwind,project,group,lookup1,unwind1,project1,group1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from AssessmentRepositoryImpl -- getAssessmentName method, result={}",result);
return result.getMappedResults();
}
public List<DatabaseAssessmentDetails> getAssessmentForEdit(Date startDate, Date endDate, long subLobId) throws Exception {
......
package com.statestreet.dao;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.statestreet.model.Designation;
@Repository
public interface DesignationRepository extends MongoRepository<Designation, String>{
Designation findByDesignationId(long designationId);
}
......@@ -8,6 +8,7 @@ import java.util.List;
import com.mongodb.DBObject;
import com.statestreet.model.BotQuizResult;
import com.statestreet.model.PendingUserCount;
import com.statestreet.model.QuestionSet;
/**
......@@ -40,5 +41,9 @@ public interface QuestionSetRepositoryCustom {
public List<BotQuizResult> getUserQuestionList(String userId) throws Exception;
List<DBObject> getUnattemptedUsers(Date startDate,Date endDate,String filterCriteria,String filterValue) throws Exception;
List<PendingUserCount> getUnattemptedUsers(Date startDate,Date endDate,long assessmentId,long subLobId,List<String> userId, String criteria) throws Exception;
List<PendingUserCount> getPendingUsers(Date startDate,Date endDate,long assessmentId,long subLobId,List<String> userId, Date currentDate) throws Exception;
List<DBObject> getUnattemptedQuestionSetCount(long assessmentId,List<String> userIdList) throws Exception;
}
......@@ -12,14 +12,13 @@ import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.aggregation.Aggregation;
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
import org.springframework.data.mongodb.core.aggregation.AggregationResults;
import org.springframework.data.mongodb.core.aggregation.ConditionalOperators;
import org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import com.mongodb.DBObject;
import com.statestreet.model.BotQuizResult;
import com.statestreet.model.PendingUserCount;
import com.statestreet.model.QuestionSet;
import com.statestreet.utils.CommonUtils;
......@@ -227,24 +226,89 @@ public class QuestionSetRepositoryImpl implements QuestionSetRepositoryCustom{
}
@Override
public List<DBObject> getUnattemptedUsers(Date startDate, Date endDate,String filterCriteria,String filterValue) throws Exception {
public List<PendingUserCount> getUnattemptedUsers(Date startDate, Date endDate,long assessmentId,long subLobId,List<String> userId, String criteria) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuestionSetRepositoryImpl called getUnattemptedUsers method with parameter, "
+ "startDate={},endDate={},filterCriteria={},filterValue={}",startDate,endDate,filterCriteria,filterValue);
AggregationOperation match =null;
if(filterCriteria=="")
+ "startDate={},endDate={},assessmentId={},subLobId={},criteria={}",startDate,endDate,
assessmentId,subLobId,criteria);
AggregationOperation match = Aggregation.match(new Criteria().andOperator(
Criteria.where("isActive").is(true),
Criteria.where("isAttempted").is(false),
Criteria.where("questionSetCreatedOn").gte(startDate).lte(endDate),
Criteria.where("subLob._id").is(subLobId),
Criteria.where("assessmentId").is(assessmentId),
Criteria.where("userId").nin(userId)));
AggregationOperation project = Aggregation.project("userId");
AggregationOperation group = Aggregation.group("userId");
AggregationOperation lookup = Aggregation.lookup("User_Master","_id","_id","userList");
AggregationOperation unwind=Aggregation.unwind("userList");
AggregationOperation project1;
if(criteria.equals("Designation"))
{
match = Aggregation.match(new Criteria().andOperator(Criteria.where("isActive").is(true),
Criteria.where("questionSetCreatedOn").gte(startDate).lte(endDate)));
project1 = Aggregation.project("userId").and("userList.designationId").as("criteria");
}
Cond validateAttempt =ConditionalOperators.when(Criteria.where("isAttempted").is(true)).then(1).otherwise(0);
AggregationOperation project = Aggregation.project("userId").and(validateAttempt).as("attempt");
AggregationOperation group = Aggregation.group("userId").sum("attempt").as("attemptCount");
AggregationOperation match1 = Aggregation.match(Criteria.where("attemptCount").is(0));
Aggregation agg = Aggregation.newAggregation(match,project,group,match1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuestionSetRepositoryImpl -- getUserQuestionList , result={}",result.getMappedResults().size());
else
{
project1 = Aggregation.project("userId").and("userList.gender").as("criteria");
}
AggregationOperation group1 = Aggregation.group("criteria").count().as("pendingCount");
AggregationOperation project2 = Aggregation.project("pendingCount").and("_id").as("criteria");
AggregationOperation sort = Aggregation.sort(Sort.Direction.ASC,"criteria");
Aggregation agg = Aggregation.newAggregation(match,project,group,lookup,unwind,project1,group1,project2,sort);
AggregationResults<PendingUserCount> result = template.aggregate(agg,COLLECTION,PendingUserCount.class);
log.debug("Response returned from QuestionSetRepositoryImpl -- getUnattemptedUsers , result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<PendingUserCount> getPendingUsers(Date startDate, Date endDate, long assessmentId, long subLobId,
List<String> userId , Date currentDate) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuestionSetRepositoryImpl called getPendingUsers method with parameter, "
+ "startDate={},endDate={},assessmentId={},subLobId={},currentDate={}",startDate,endDate,
assessmentId,subLobId,currentDate);
AggregationOperation match = Aggregation.match(new Criteria().andOperator(
Criteria.where("isActive").is(true),
Criteria.where("isAttempted").is(false),
Criteria.where("subLob._id").is(subLobId),
Criteria.where("assessmentId").is(assessmentId),
Criteria.where("userId").nin(userId)));
AggregationOperation project = Aggregation.project("userId");
AggregationOperation group = Aggregation.group("userId").addToSet(currentDate).as("currentDate");
AggregationOperation unwind=Aggregation.unwind("currentDate");
AggregationOperation lookup = Aggregation.lookup("User_Master","_id","_id","userList");
AggregationOperation unwind1=Aggregation.unwind("userList");
AggregationOperation project1 = Aggregation.project("userId","currentDate").and("userList.joiningDateSSBJV").as("criteria");
AggregationOperation group1 = Aggregation.group("criteria","currentDate").count().as("pendingCount");
AggregationOperation project2 = Aggregation.project("pendingCount")
.andExpression("(currentDate - criteria)/(1000*60*60*24*30)").as("duration").and("_id").as("criteria");
AggregationOperation sort = Aggregation.sort(Sort.Direction.ASC,"criteria");
//Aggregation agg = Aggregation.newAggregation(match,project,group);
Aggregation agg = Aggregation.newAggregation(match,project,group,unwind,lookup,unwind1,project1,group1,project2,sort);
AggregationResults<PendingUserCount> result = template.aggregate(agg,COLLECTION,PendingUserCount.class);
log.debug("Response returned from QuestionSetRepositoryImpl -- getPendingUsers , result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getUnattemptedQuestionSetCount(long assessmentId,List<String> userIdList) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuestionSetRepositoryImpl called getUnattemptedQuestionSetUsers method");
//AggregationOperation match = Aggregation.match(Criteria.where("isAttempted").is(false).and(Criteria.where("")));
AggregationOperation match = Aggregation.match(new Criteria().andOperator(
Criteria.where("isActive").is(true),
Criteria.where("isAttempted").is(false),
Criteria.where("assessmentId").is(assessmentId),
Criteria.where("userId").nin(userIdList)));
AggregationOperation project = Aggregation.project("userId");
AggregationOperation group = Aggregation.group("userId");
AggregationOperation group1 = Aggregation.group().count().as("pendingCount");
Aggregation agg = Aggregation.newAggregation(match,project,group,group1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuestionSetRepositoryImpl -- getUnattemptedQuestionSetUsers , result={}",result.getMappedResults());
return result.getMappedResults();
}
}
......@@ -3,9 +3,15 @@
*/
package com.statestreet.dao;
import java.util.Date;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.mongodb.DBObject;
import com.statestreet.model.QuizResult;
/**
......@@ -16,10 +22,6 @@ import com.statestreet.model.QuizResult;
@Repository
public interface QuizResultRepository extends MongoRepository<QuizResult, String>,QuizResultRepositoryCustom{
List<QuizResult> findByQuestionSet_QuestionSetId(long questionSetId);
}
......@@ -70,6 +70,16 @@ public interface QuizResultRepositoryCustom {
List<DBObject> getUserScoreCard(String userId) throws Exception;
public List<DBObject> getGDUInfoGraphicReport(Date startDate, Date endDate,List<DBObject> dbObjList) throws Exception;
List<DBObject> getCriteriaWiseAssessInfographicReport(Date startDate, Date endDate, long assessmentId, long subLobId, String criteria) throws Exception;
List<DBObject> getTenureWiseAssessInfographicReport(Date startDate, Date endDate, long assessmentId, long subLobId, Date currentDate) throws Exception;
List<DBObject> getCategoryAssessmentInfographicReport(Date startDate, Date endDate, long assessmentId, long subLobId) throws Exception;
List<DBObject> getUserAssessmentReport(Date stDate, Date enDate, String userId)throws Exception;
List<DBObject> getPercentageWiseAssessmentReport(Date stDate, Date enDate, long assessmentId, long subLobId) throws Exception;
List<DBObject> getQuizResultWiseAssesmentInfographicReport(Date stDate, Date enDate, long assessmentId,
long subLobId)throws Exception;
}
......@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.aggregation.Aggregation;
import org.springframework.data.mongodb.core.aggregation.AggregationExpression;
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
import org.springframework.data.mongodb.core.aggregation.AggregationResults;
import org.springframework.data.mongodb.core.aggregation.ConditionalOperators;
......@@ -512,17 +511,6 @@ AggregationOperation match = Aggregation.match(new Criteria().andOperator(Crite
.as("questionSetId").first("userId").as("userId").first("assessmentId").as("assessmentId").first("subLob").as("subLob")
.first("questionCategory").as("questionCategory");
AggregationOperation sort1 = Aggregation.sort(Sort.Direction.ASC,"quizResultId");
AggregationOperation lookup1 = Aggregation.lookup("BOT_QUIZ_MASTER","quizResultId","quizResultId","quesList");
AggregationOperation unwind1=Aggregation.unwind("quesList",false);
AggregationOperation project1 = Aggregation.project("questionId","questionType","questionText","choiceNumber","correctAnswer",
"questionStatus","matchTypeAnsList","optionList","totalMarks","quizResultId","questionSetId","userId","assessmentId","subLob",
"questionCategory").and("quesList.questionId").as("quesId");
AggregationOperation group1 = Aggregation.group("questionId","questionType","questionText","choiceNumber","correctAnswer",
"questionStatus","matchTypeAnsList","optionList","totalMarks","quizResultId","questionSetId","userId","assessmentId","subLob",
"questionCategory").push("quesId").as("quesIdList");
AggregationOperation group2 = Aggregation.group("questionType","questionText","choiceNumber","correctAnswer",
"questionStatus","matchTypeAnsList","optionList","totalMarks","quesIdList","quizResultId","questionSetId","userId","assessmentId",
"subLob","questionCategory").push("questionId").as("questionId");
AggregationOperation project2 = Aggregation.project("questionId","questionType","questionText","choiceNumber","correctAnswer",
"questionStatus","matchTypeAnsList","optionList","totalMarks","quizResultId","questionSetId","userId","assessmentId","subLob",
"questionCategory","quesIdList").and("questionId").subsetOfArray("quesIdList").as("output");
......@@ -754,55 +742,178 @@ AggregationOperation match = Aggregation.match(new Criteria().andOperator(Crite
}
@Override
public List<DBObject> getGDUInfoGraphicReport(Date startDate, Date endDate,List<DBObject> dbObjList) throws Exception {
public List<DBObject> getCriteriaWiseAssessInfographicReport(Date startDate, Date endDate, long assessmentId, long subLobId, String criteria) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuizResultRepositoryImpl called getGDUInfoGraphicReport method, with parameter startDate={},endDate={}",startDate,endDate);
/*AggregationOperation match =null;
String filterCriteria="";
if(filterCriteria=="")
{
match = Aggregation.match(new Criteria().andOperator(Criteria.where("isActive").is(true),
Criteria.where("questionSetCreatedOn").gte(startDate).lte(endDate)));
}
Cond validateAttempt =ConditionalOperators.when(Criteria.where("isAttempted").is(true)).then(1).otherwise(0);
AggregationOperation project = Aggregation.project("userId").and(validateAttempt).as("attempt");
AggregationOperation group = Aggregation.group("userId").sum("attempt").as("attemptCount");
AggregationOperation match1 = Aggregation.match(Criteria.where("attemptCount").is(0));
Aggregation agg1 = Aggregation.newAggregation(match,project,group,match1);*/
AggregationOperation matchQ = Aggregation.match(Criteria.where("quizDate").gte(startDate).lte(endDate));
log.debug("Inside QuizResultRepositoryImpl called getCriteriaWiseAssessInfographicReport method, with parameter"
+ " startDate={},endDate={},assessmentId={},subLobId={},criteria={}",startDate,endDate,assessmentId,subLobId,criteria);
AggregationOperation matchQ = Aggregation.match(new Criteria().andOperator(Criteria.where("quizDate")
.gte(startDate).lte(endDate),Criteria.where("questionSet.subLob._id").is(subLobId)
, Criteria.where("questionSet.assessmentId").is(assessmentId)));
Cond passQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pass.name())).then(1).otherwise(0);
Cond failQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Fail.name())).then(1).otherwise(0);
Cond evalPendingQuiz = ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pending.name())).then(1).otherwise(0);
AggregationOperation projectQ = Aggregation.project("_id").and("questionSet.userId").as("userId")
.and(passQuiz).as("pass").and(failQuiz).as("fail").and(evalPendingQuiz).as("evalPending")
;
AggregationOperation groupQ=Aggregation.group("userId").sum("pass").as("pass").sum("fail").as("fail")
.sum("evalPending").as("evalPending");
/*AggregationOperation lookup = Aggregation.lookup("User_Master","questionSet.userId","_id","userList");
.and(passQuiz).as("pass").and(failQuiz).as("fail").and(evalPendingQuiz).as("evalPending");
AggregationOperation sort= Aggregation.sort(Sort.Direction.ASC,"_id");
AggregationOperation groupQ=Aggregation.group("userId").last("pass").as("pass").last("fail").as("fail")
.last("evalPending").as("evalPending");
AggregationOperation lookup = Aggregation.lookup("User_Master","_id","_id","userList");
AggregationOperation unwind=Aggregation.unwind("userList");
AggregationOperation project;
if(criteria.equals("Designation"))
{
project = Aggregation.project("pass","fail","evalPending")
.and("userList.designationId").as("criteria").and("_id").as("userId");
}
else
{
project = Aggregation.project("pass","fail","evalPending")
.and("userList.gender").as("criteria").and("_id").as("userId");
}
AggregationOperation group=Aggregation.group("criteria").sum("pass").as("pass").sum("fail").as("fail")
.sum("evalPending").as("evalPending").push("userId").as("userId");;
AggregationOperation project1=Aggregation.project("criteria","pass","fail","evalPending","userId")
.andExpression("add(pass,fail,evalPending)").as("total");
AggregationOperation sort1 = Aggregation.sort(Sort.Direction.ASC,"criteria");
Aggregation agg = Aggregation.newAggregation(matchQ,projectQ,sort,groupQ,lookup,unwind,project,group,
project1,sort1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getCriteriaWiseAssessInfographicReport method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getTenureWiseAssessInfographicReport(Date startDate, Date endDate, long assessmentId,
long subLobId, Date currentDate) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuizResultRepositoryImpl called getTenureWiseAssessInfographicReport method, with parameter"
+ " startDate={},endDate={},assessmentId={},subLobId={},currentDate={}",startDate,endDate,
assessmentId,subLobId,currentDate);
AggregationOperation matchQ = Aggregation.match(new Criteria().andOperator(Criteria.where("quizDate")
.gte(startDate).lte(endDate),Criteria.where("questionSet.subLob._id").is(subLobId)
, Criteria.where("questionSet.assessmentId").is(assessmentId)));
Cond passQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pass.name())).then(1).otherwise(0);
Cond failQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Fail.name())).then(1).otherwise(0);
Cond evalPendingQuiz = ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pending.name())).then(1).otherwise(0);
Cond failQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Fail.name())).then(1).otherwise(0);
Cond evalPendingQuiz = ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pending.name())).then(1).otherwise(0);
AggregationOperation projectQ = Aggregation.project("_id").and("questionSet.userId").as("userId")
.and(passQuiz).as("pass").and(failQuiz).as("fail").and(evalPendingQuiz).as("evalPending");
AggregationOperation sort= Aggregation.sort(Sort.Direction.ASC,"_id");
AggregationOperation groupQ=Aggregation.group("userId").last("pass").as("pass").last("fail").as("fail")
.last("evalPending").as("evalPending").addToSet(currentDate).as("currentDate");
AggregationOperation unwind=Aggregation.unwind("currentDate");
AggregationOperation lookup = Aggregation.lookup("User_Master","_id","_id","userList");
AggregationOperation unwind1=Aggregation.unwind("userList");
AggregationOperation project = Aggregation.project("pass","fail","evalPending","currentDate")
.and("userList.joiningDateSSBJV").as("criteria").and("_id").as("userId");
AggregationOperation group=Aggregation.group("criteria","currentDate").sum("pass").as("pass").sum("fail").as("fail")
.sum("evalPending").as("evalPending").push("userId").as("userId");
AggregationOperation project2 = Aggregation.project("pass","fail","evalPending","userId","criteria")
.andExpression("(currentDate - criteria)/(1000*60*60*24*30)").as("duration");
AggregationOperation project1=Aggregation.project("criteria","pass","fail","evalPending","userId","duration")
.andExpression("add(pass,fail,evalPending)").as("total");
AggregationOperation sort1 = Aggregation.sort(Sort.Direction.ASC,"criteria");
Aggregation agg = Aggregation.newAggregation(matchQ,projectQ,sort,groupQ,unwind,lookup,unwind1,project,
group,project2,project1,sort1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getTenureWiseAssessInfographicReport method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getCategoryAssessmentInfographicReport(Date startDate, Date endDate, long assessmentId,
long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuizResultRepositoryImpl called getCategoryAssessmentInfographicReport method, with parameter"
+ " startDate={},endDate={},assessmentId={},subLobId={}",startDate,endDate,assessmentId,subLobId);
AggregationOperation match = Aggregation.match(new Criteria().andOperator(Criteria.where("quizDate")
.gte(startDate).lte(endDate),Criteria.where("questionSet.subLob._id").is(subLobId)
, Criteria.where("questionSet.assessmentId").is(assessmentId)));
AggregationOperation project = Aggregation.project("_id").and("questionSet.userId").as("userId")
.and("userList.gdu").as("gdu").and(passQuiz).as("pass").and(failQuiz).as("fail")
.and(evalPendingQuiz).as("evalPending");
AggregationOperation group=Aggregation.group("gdu").sum("pass").as("pass").sum("fail").as("fail")
.sum("evalPending").as("evalPending");
AggregationOperation project1=Aggregation.project("gdu","pass","fail","evalPending").andExpression("add(pass,fail,evalPending)").as("total");
Map<String, String> fieldMapping = new HashMap<>();
fieldMapping.put("gdu", "$_id");
fieldMapping.put("pass", "$pass");
fieldMapping.put("fail", "$fail");
fieldMapping.put("evalPending", "$evalPending");
fieldMapping.put("total", "$total");
AggregationOperation group1=Aggregation.group().sum("total").as("overAlltotal").sum("pass").as("overAllPass")
.sum("fail").as("overAllFail").sum("evalPending").as("overAllEvalPending").addToSet(new BasicDBObject(fieldMapping)).as("details");
Aggregation agg = Aggregation.newAggregation(match,lookup,unwind,project,group,project1,group1);*/
Aggregation agg = Aggregation.newAggregation(matchQ,projectQ,groupQ);
.and("questionSet.questionList").as("questionList");
AggregationOperation sort= Aggregation.sort(Sort.Direction.ASC,"_id");
AggregationOperation group=Aggregation.group("userId").last("questionList").as("questionList");
AggregationOperation unwind=Aggregation.unwind("questionList");
Cond correctQuestionOperation =ConditionalOperators.when(Criteria.where("questionList.questionResult").is(CommonUtils.Question_Result_Status.Correct.name())).then(1).otherwise(0);
Cond incorrectQuestionOperation =ConditionalOperators.when(Criteria.where("questionList.questionResult").is(CommonUtils.Question_Result_Status.Incorrect.name())).then(1).otherwise(0);
AggregationOperation project1 = Aggregation.project("userId").and("questionList.category").as("category")
.and(correctQuestionOperation).as("correctQues").and(incorrectQuestionOperation).as("inCorrectQues");
AggregationOperation group1=Aggregation.group("category").sum("correctQues").as("correctQues").sum("inCorrectQues").as("inCorrectQues");
Aggregation agg = Aggregation.newAggregation(match,project,sort,group,unwind,project1,group1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getCategoryAssessmentInfographicReport method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getUserAssessmentReport(Date stDate, Date enDate, String userId) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuizResultRepositoryImpl called getUserAssessmentReport method, with parameter "
+ "stDate={},enDate={},userId={}",stDate,enDate,userId);
AggregationOperation match = Aggregation.match(new Criteria().andOperator(
Criteria.where("quizDate").gte(stDate).lte(enDate),Criteria.where("questionSet.userId").is(userId)));
AggregationOperation project = Aggregation.project("_id").and("questionSet.userId").as("userId")
.and("obtainedMarks").as("marksScored").and("totalMarks").as("maxMarks")
.and("questionSet.passingPercent").as("passingPercent").and("quizScore").as("obtainedPercent")
.and("questionSet.assessmentName").as("assessmentName").and("quizOutcome").as("quizOutcome");
AggregationOperation lookup = Aggregation.lookup( "User_Master","userId","_id","user");
AggregationOperation unwind=Aggregation.unwind("user",true);
AggregationOperation project1 = Aggregation.project("_id","userId","marksScored","maxMarks","passingPercent",
"obtainedPercent","assessmentName","quizOutcome").and("user.employeeName").as("employeeName");
AggregationOperation sort= Aggregation.sort(Sort.Direction.ASC,"_id");
Aggregation agg = Aggregation.newAggregation(match,project,lookup,unwind,project1,sort);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getGDUInfoGraphicReport method,result={}",result.getMappedResults().size());
log.debug("Response returned from QuizResultRepositoryImpl--getUserScoreCard method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getPercentageWiseAssessmentReport(Date stDate, Date enDate, long assessmentId, long subLobId)
throws Exception {
log.debug("Inside QuizResultRepositoryImpl called getPercentageWiseAssessmentReport method, with parameter "
+ "stDate={},enDate={},assessmentId={},subLobId={}",stDate,enDate,assessmentId,subLobId);
AggregationOperation match = null;
if(subLobId>0)
{
match = Aggregation.match(new Criteria().andOperator(Criteria.where("quizDate").gte(stDate).lte(enDate),Criteria.where("questionSet.subLob._id").is(subLobId)
, Criteria.where("questionSet.assessmentId").is(assessmentId)));
}
AggregationOperation project = Aggregation.project("_id").and("quizScore").as("quizScore").and("questionSet.userId").as("userId");
AggregationOperation sort = Aggregation.sort(Sort.Direction.ASC,"_id");
AggregationOperation group=Aggregation.group("userId").last("quizScore").as("quizScore");
Aggregation agg = Aggregation.newAggregation(match,project,sort,group);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getPercentageWiseAssessmentReport method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
@Override
public List<DBObject> getQuizResultWiseAssesmentInfographicReport(Date stDate, Date enDate, long assessmentId,
long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("Inside QuizResultRepositoryImpl called getQuizResultWiseAssesmentInfographicReport method, with parameter "
+ "stDate={},enDate={},assessmentId={},subLobId={}",stDate,enDate,assessmentId,subLobId);
AggregationOperation match = null;
if(subLobId>0)
{
match = Aggregation.match(new Criteria().andOperator(Criteria.where("quizDate").gte(stDate).lte(enDate),Criteria.where("questionSet.subLob._id").is(subLobId)
, Criteria.where("questionSet.assessmentId").is(assessmentId)));
}
Cond passQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pass.name())).then(1).otherwise(0);
Cond failQuiz =ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Fail.name())).then(1).otherwise(0);
Cond evalPendingQuiz = ConditionalOperators.when(Criteria.where("quizOutcome").is(CommonUtils.Quiz_Status.Pending.name())).then(1).otherwise(0);
AggregationOperation project = Aggregation.project("_id").and("questionSet.assessmentId")
.as("assessmentId").and(passQuiz).as("pass").and(failQuiz).as("fail").and(evalPendingQuiz)
.as("evalPending").and("questionSet.userId").as("userId");
AggregationOperation sort= Aggregation.sort(Sort.Direction.ASC,"_id");
AggregationOperation group=Aggregation.group("userId").last("pass").as("pass").last("fail").as("fail")
.last("evalPending").as("evalPending");
AggregationOperation group1=Aggregation.group().sum("pass").as("pass").sum("fail").as("fail")
.sum("evalPending").as("evalPending").push("_id").as("userId");
Aggregation agg = Aggregation.newAggregation(match,project,sort,group,group1);
AggregationResults<DBObject> result = template.aggregate(agg,COLLECTION,DBObject.class);
log.debug("Response returned from QuizResultRepositoryImpl--getQuizResultWiseAssesmentInfographicReport method,result={}",result.getMappedResults().size());
return result.getMappedResults();
}
}
......@@ -11,4 +11,6 @@ public interface SubLobRepositoryCustom {
public List<SubLob> findBySubLobName(String subLobName) throws Exception;
public Long getMaxId() throws Exception;
public SubLob findById(long subLobId) throws Exception;
public SubLob findBySubLobId(long subLobId) throws Exception;
List<SubLob> findSubLobbyLob(String lobName) throws Exception;
}
......@@ -43,6 +43,17 @@ public class SubLobRepositoryImpl implements SubLobRepositoryCustom {
log.debug("Response returned from SubLobRepositoryImpl -- findbyLob method, subLob={}");
return mongoTemplate.find(query,SubLob.class);
}
@Override
public List<SubLob> findSubLobbyLob(String lobName) throws Exception {
// TODO Auto-generated method stub
log.debug("inside SubLobRepositoryImpl called findbyLob method with parameter, lobName={}",lobName);
Query query = new Query();
query.addCriteria(new Criteria().andOperator(Criteria.where("lob.LobName").is(lobName)));
log.debug("Response returned from SubLobRepositoryImpl -- findbyLob method, subLob={}");
return mongoTemplate.find(query,SubLob.class);
}
@Override
public List<SubLob> findBySubLobName(String subLobName) throws Exception {
......@@ -53,7 +64,8 @@ public class SubLobRepositoryImpl implements SubLobRepositoryCustom {
log.debug("Response returned from SubLobRepositoryImpl -- findBySubLobName method, subLob={}");
return mongoTemplate.find(query,SubLob.class);
}
@Override
public Long getMaxId() throws Exception {
// TODO Auto-generated method stub
......@@ -79,5 +91,19 @@ public class SubLobRepositoryImpl implements SubLobRepositoryCustom {
else
return mongoTemplate.find(query,SubLob.class).get(0);
}
@Override
public SubLob findBySubLobId(long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("inside SubLobRepositoryImpl called findBySubLobId method with parameter, subLobId={}",subLobId);
Query query = new Query();
query.addCriteria(new Criteria().andOperator(Criteria.where("subLobId").is(subLobId)));
log.debug("Response returned from SubLobRepositoryImpl -- findBySubLobId method, subLob={}");
List<SubLob> subLobList =mongoTemplate.find(query,SubLob.class);
if(subLobList.isEmpty())
return null;
else
return mongoTemplate.find(query,SubLob.class).get(0);
}
}
......@@ -33,4 +33,6 @@ public interface UserRepositoryCustom {
public List<UserMaster> checkUserListByLobSubLob(SubLob subLob,List<String> userIdList) throws Exception;
public List<DBObject> getUserListByRole(String role) throws Exception;
List<UserMaster> getUserByLobSubLob(long lobId, long subLobId) throws Exception;
}
......@@ -74,7 +74,7 @@ public class UserRepositoryImpl implements UserRepositoryCustom{
Update update = new Update();
update.set("psid",user.getPsid());
update.set("joiningDateSSBJV",user.getJoiningDateSSBJV());
update.set("designationName",user.getDesignationName());
update.set("designationId",user.getDesignationId());
update.set("locationName",user.getLocationName());
update.set("lob",user.getLob());
update.set("subLob",user.getSubLob());
......@@ -133,6 +133,23 @@ public class UserRepositoryImpl implements UserRepositoryCustom{
Query query = new Query();
query.addCriteria(new Criteria().orOperator(criteriaForAgent,criteriaForManager));
log.debug("Response returned from UserRepositoryImpl -- updateUser method");
return mongoTemplate.find(query,UserMaster.class);
}
@Override
public List<UserMaster> getUserByLobSubLob(long lobId, long subLobId) throws Exception {
// TODO Auto-generated method stub
log.debug("inside UserRepositoryImpl called getUserDetails method with parameter lobId={},subLobId={}",lobId,subLobId);
Criteria criteriaForAgent ;
if(subLobId==0)
criteriaForAgent = new Criteria().andOperator(Criteria.where("lob._id").is(lobId));
else
criteriaForAgent = new Criteria().andOperator(Criteria.where("lob._id").is(lobId),Criteria.where("subLob._id").is(subLobId));
Query query = new Query();
query.addCriteria(criteriaForAgent);
log.debug("Response returned from UserRepositoryImpl -- updateUser method");
return mongoTemplate.find(query,UserMaster.class);
}
......
package com.statestreet.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author manisha.t
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "Designation_Master")
public class Designation {
@Id
private long designationId;
private String designationName;
private String status;
}
......@@ -22,4 +22,10 @@ public class Lob {
@Size(max=50)
private String lobName;
private String status;
@Override
public String toString() {
return "Lob [lobId=" + lobId + ", lobName=" + lobName + ", status=" + status + "]";
}
}
package com.statestreet.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PendingUserCount {
private long pendingCount;
private double duration;
private String criteria;
}
......@@ -5,6 +5,8 @@ package com.statestreet.model;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
......@@ -20,6 +22,7 @@ public class QuestionBankMaster {
@Id
private long questionBankId;
@NotEmpty
private String questionBankName;
private String status;
private SubLob subLob;
......
package com.statestreet.model;
import lombok.*;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAssessmentInfographicReport {
private String criteria;
private long passCount;
private long failCount;
private long evalPendingCount;
private long pendingCount;
private long total;
}
......@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.Set;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
......@@ -43,8 +44,8 @@ public class UserMaster {
@NotNull
@JsonFormat(pattern ="yyyy-MMM-dd")
private Date joiningDateSSBJV;
@Pattern(regexp ="^[a-zA-Z ]*$")
private String designationName;
@Min(value = 1)
private long designationId;
@NotBlank
@Pattern(regexp ="^[a-zA-Z ]*$")
private String locationName;
......