"...java/com/ruzhoukj/sms/model/vo/CustomerProjectVO.java" did not exist on "ac5b42642bcdfee5c2737c838db138cf4818b64c"
Commit 893a37bc authored by zhuxiang's avatar zhuxiang
Browse files

当前月只可查看上个月的数据

parent d04dcfd6
......@@ -45,7 +45,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
// 获取当前日期
LocalDate now = LocalDate.now();
// 获取当前月份(1 到 12)
int currentMonth = now.getMonthValue();
int currentMonth = now.getMonthValue() - 1;
reportDataInfoDTO.setMonth(currentMonth);
return baseMapper.queryList(reportDataInfoDTO);
}
......
......@@ -25,11 +25,14 @@ public class UserPerformanceServiceImpl extends ServiceImpl<UserPerformanceDao,
@Override
public List<UserPerformanceVO> queryList(UserPerformanceDTO userPerformanceDTO) {
//获取当前年月
// 获取当前日期
LocalDate now = LocalDate.now();
// 获取上个月的日期
LocalDate lastMonth = now.minusMonths(1);
// 格式化为 "yyyy-MM"
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
String currentYearMonth = now.format(formatter);
userPerformanceDTO.setPerformanceDate(currentYearMonth);
String lastYearMonth = lastMonth.format(formatter);
userPerformanceDTO.setPerformanceDate(lastYearMonth);
return baseMapper.queryList(userPerformanceDTO);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment