|
@@ -34,16 +34,13 @@ public class ReadRateMonthServiceImpl extends AbstractReadRateService {
|
|
|
|
|
|
@Override
|
|
|
public List<ReadRateVo> listReadRate(ReadRateDto dto, UserCondition userCondition) {
|
|
|
- LocalDate localDate = DateUtil.parseLocalDate(new Date());
|
|
|
- localDate = localDate.plusMonths(-1);
|
|
|
- String month = (localDate.getMonthValue() +"").length() == 1 ? "0" + localDate.getMonthValue() : localDate.getMonthValue() +"";
|
|
|
- int queryDate = Integer.parseInt(localDate.getYear() + "" + month);
|
|
|
- return readRateMonthMapper.listReadRate(dto, queryDate, userCondition);
|
|
|
+ return readRateMonthMapper.listReadRate(dto, queryDate(), userCondition);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public StatisticsReadRateVo countReadRate(ReadRateDto dto, UserCondition userCondition) {
|
|
|
- return readRateMonthMapper.countReadRate(dto, userCondition);
|
|
|
+
|
|
|
+ return readRateMonthMapper.countReadRate(dto, queryDate(), userCondition);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -51,4 +48,12 @@ public class ReadRateMonthServiceImpl extends AbstractReadRateService {
|
|
|
return ReadRateEnum.MONTH;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private int queryDate(){
|
|
|
+ LocalDate localDate = DateUtil.parseLocalDate(new Date());
|
|
|
+ localDate = localDate.plusMonths(-1);
|
|
|
+ String month = (localDate.getMonthValue() +"").length() == 1 ? "0" + localDate.getMonthValue() : localDate.getMonthValue() +"";
|
|
|
+ return Integer.parseInt(localDate.getYear() + "" + month);
|
|
|
+ }
|
|
|
+
|
|
|
}
|