use of com.webank.wedatasphere.qualitis.response.IndexApplicationResponse in project Qualitis by WeBankFinTech.
the class IndexServiceImpl method getTodaySubmitApplications.
@Override
public IndexApplicationTodayResponse getTodaySubmitApplications(String username, PageRequest pageRequest) {
// Find applications submitted today
String today = DateFormatUtils.format(new Date(), DATE_FORMAT_PATTERN);
List<Application> applications = getUserApplications(username, today, pageRequest);
if (applications == null || applications.isEmpty()) {
LOGGER.info("[Home overview]user:{},date:{},The user and the task submitted by the specified date were not found.", username, today);
return null;
}
// Get total num of applications today
long totalNum = countUserApplications(username, today);
// Get successful total num of applications today
long totalSuccNum = countUserSuccApplications(username, today);
// Get failed total num of applications today
long totalFailNum = countUserFailApplications(username, today);
// Get not pass total num of applications today
long totalFailCheckNum = countUserFailCheckApplications(username, today);
LOGGER.info("[Home overview]user:{},date:{},Find {} tasks submitted by the user's specified date, for a total of {}.", username, today, applications.size(), totalNum);
List<IndexApplicationResponse> applicationResponses = new ArrayList<>();
for (Application application : applications) {
List<Task> tasks = taskDao.findByApplication(application);
IndexApplicationResponse applicationResponse = new IndexApplicationResponse(application, tasks);
applicationResponses.add(applicationResponse);
}
return new IndexApplicationTodayResponse(applicationResponses, totalNum, totalSuccNum, totalFailNum, totalFailCheckNum);
}
Aggregations