打卡记录查询改为按照年来查询

master
382696293@qq.com 2 years ago
parent b8256727bb
commit fbb42d5fbf

@ -97,10 +97,8 @@ public class WxClockLogController extends BaseController {
*
*/
@GetMapping("/clockStatistics")
public TableDataInfo clockStatistics(WxClockStatistics wxClockStatistics) {
Integer pageNum = startPage();
List<WxClockStatistics> list = wxClockLogService.clockStatistics(wxClockStatistics, pageNum);
return getDataTable(list);
public R clockStatistics(@RequestParam(value = "year") Integer year) {
return R.ok(wxClockLogService.clockStatistics(year));
}

@ -17,7 +17,7 @@ public interface IWxClockLogService {
List<WxClockLogRet> selectWxClockLogList();
List<WxClockStatistics> clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum);
List<WxClockStatistics> clockStatistics(Integer year);
void clockStatisticsTimedTask(List<Long> userIdList, Integer year, Integer month);
}

@ -245,10 +245,12 @@ public class WxClockLogServiceImpl implements IWxClockLogService {
}
@Override
public List<WxClockStatistics> clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum) {
public List<WxClockStatistics> clockStatistics(Integer year) {
WxClockStatistics query = new WxClockStatistics();
query.setYear(year);
// 获取历史统计信息,数据在数据库
List<WxClockStatistics> list = wxClockStatisticsMapper.selectWxClockStatisticsList(wxClockStatistics);
if (list != null && list.size() > 0 && pageNum == 1) {
List<WxClockStatistics> list = wxClockStatisticsMapper.selectWxClockStatisticsList(query);
if (list != null && list.size() > 0 && year == LocalDate.now().getYear()) {
/* 当前月则需要从redis中获取排名计算比例 */
WxClockStatistics isCurrent = list.get(0);
// 获取排名

Loading…
Cancel
Save