根据年月获取打卡记录

master
382696293@qq.com 2 years ago
parent 8f375d77e3
commit 43c092d6d0

@ -3,12 +3,14 @@ package com.flossom.miniProgram.controller;
import com.flossom.common.core.constant.Constants;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.SysFile;
import com.flossom.common.core.domain.entity.WxClockLog;
import com.flossom.common.core.domain.entity.WxClockStatistics;
import com.flossom.common.core.domain.req.WxClockLogReq;
import com.flossom.common.core.domain.ret.WxClockLogRet;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.miniProgram.service.IWxClockLogService;
import com.flossom.system.api.RemoteFileService;
import org.apache.commons.lang3.StringUtils;
@ -18,8 +20,13 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -58,10 +65,13 @@ public class WxClockLogController extends BaseController {
*
*/
@GetMapping("/list")
public TableDataInfo list() {
startPage();
List<WxClockLogRet> list = wxClockLogService.selectWxClockLogList();
return getDataTable(list);
public R list(@RequestParam(value = "year") Integer year, @RequestParam(value = "month") Integer month) {
WxClockLog queryClockLog = new WxClockLog();
queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
YearMonth targetYearMonth = YearMonth.of(year, month);
queryClockLog.getParams().put("beginTime", targetYearMonth.atDay(1).atStartOfDay());
queryClockLog.getParams().put("endTime", targetYearMonth.atEndOfMonth().atTime(LocalTime.MAX));
return R.ok(wxClockLogService.selectWxClockLogList(queryClockLog));
}
/**

@ -15,7 +15,7 @@ public interface IWxClockLogService {
WxClockLogRet latestClockRecord();
List<WxClockLogRet> selectWxClockLogList();
List<WxClockLogRet> selectWxClockLogList(WxClockLog queryClockLog);
List<WxClockStatistics> clockStatistics(Integer year);

@ -226,9 +226,7 @@ public class WxClockLogServiceImpl implements IWxClockLogService {
}
@Override
public List<WxClockLogRet> selectWxClockLogList() {
WxClockLog queryClockLog = new WxClockLog();
queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
public List<WxClockLogRet> selectWxClockLogList(WxClockLog queryClockLog) {
List<WxClockLogRet> list = wxClockLogMapper.selectWxClockImgRetList(queryClockLog);
if (list != null && list.size() > 0) {
for (WxClockLogRet wxClockLogRet : list) {

Loading…
Cancel
Save