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

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

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

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

@ -245,10 +245,12 @@ public class WxClockLogServiceImpl implements IWxClockLogService {
} }
@Override @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); List<WxClockStatistics> list = wxClockStatisticsMapper.selectWxClockStatisticsList(query);
if (list != null && list.size() > 0 && pageNum == 1) { if (list != null && list.size() > 0 && year == LocalDate.now().getYear()) {
/* 当前月则需要从redis中获取排名计算比例 */ /* 当前月则需要从redis中获取排名计算比例 */
WxClockStatistics isCurrent = list.get(0); WxClockStatistics isCurrent = list.get(0);
// 获取排名 // 获取排名

Loading…
Cancel
Save