根据年月获取打卡记录

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.constant.Constants;
import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.SysFile; 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.entity.WxClockStatistics;
import com.flossom.common.core.domain.req.WxClockLogReq; import com.flossom.common.core.domain.req.WxClockLogReq;
import com.flossom.common.core.domain.ret.WxClockLogRet; import com.flossom.common.core.domain.ret.WxClockLogRet;
import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.page.TableDataInfo; import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.miniProgram.service.IWxClockLogService; import com.flossom.miniProgram.service.IWxClockLogService;
import com.flossom.system.api.RemoteFileService; import com.flossom.system.api.RemoteFileService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -18,8 +20,13 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull; 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.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Controller * Controller
@ -58,10 +65,13 @@ public class WxClockLogController extends BaseController {
* *
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list() { public R list(@RequestParam(value = "year") Integer year, @RequestParam(value = "month") Integer month) {
startPage(); WxClockLog queryClockLog = new WxClockLog();
List<WxClockLogRet> list = wxClockLogService.selectWxClockLogList(); queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
return getDataTable(list); 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(); WxClockLogRet latestClockRecord();
List<WxClockLogRet> selectWxClockLogList(); List<WxClockLogRet> selectWxClockLogList(WxClockLog queryClockLog);
List<WxClockStatistics> clockStatistics(Integer year); List<WxClockStatistics> clockStatistics(Integer year);

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

Loading…
Cancel
Save