|
|
|
@ -59,13 +59,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean getReceptionBrowse(ReportDTO reportDTO) { |
|
|
|
|
if (reportDTO.getCreateTime() == null || reportDTO.getPageView() == null){ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
boolean todayBrowse = reportMapper.addTodayBrowse(reportDTO); |
|
|
|
|
if (todayBrowse == false){ |
|
|
|
|
return false; |
|
|
|
|
public boolean getReceptionBrowse() { |
|
|
|
|
//查询今日有无记录
|
|
|
|
|
List<Report> list = lambdaQuery().eq(Report::getCreateTime, LocalDate.now()).list(); |
|
|
|
|
|
|
|
|
|
if (list.size() > 0){ |
|
|
|
|
//有,给记录加一
|
|
|
|
|
update().setSql("page_view = page_view + 1").eq("create_time",LocalDate.now()).update(); |
|
|
|
|
}else { |
|
|
|
|
//无,创建一个记录
|
|
|
|
|
Report report = new Report(); |
|
|
|
|
report.setCreateTime(LocalDate.now()); |
|
|
|
|
report.setPageView("1"); |
|
|
|
|
save(report); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|