Long projectId = (Long) context.get("projectId");
User user = (User) context.get("user");
Project project = projectService.getProject(projectId);
if(user==null || NumberUtils
.compare(project.getEnteredBy().getId(), user.getId())!=0) {
Statistic statistic = statisticService.getStatistic(
Statistic.TYPE_VIEW, project.getProfile().getId(), Profile.NAME);
if(statistic==null) {
statistic = new Statistic(Statistic.TYPE_VIEW, project.getProfile().getId(), Profile.NAME);
}
statistic.countAdd();
statistic.setProjectId(project.getId());
statisticService.createStatistic(statistic);
}
}