From ba6b781b146b2e941489149fb23594067cb2fa43 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 30 九月 2025 13:35:03 +0800 Subject: [PATCH] 添加抽奖次数调整 --- framework/src/main/java/cn/lili/modules/lmk/service/impl/ActionRecordServiceImpl.java | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActionRecordServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActionRecordServiceImpl.java index 73c3139..36ea39d 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActionRecordServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActionRecordServiceImpl.java @@ -19,6 +19,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.util.Assert; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -42,7 +45,16 @@ @Override public Result add(ActionRecordForm form) { ActionRecord entity = ActionRecordForm.getEntityByForm(form, null); - baseMapper.insert(entity); + + AuthUser currentUser = UserContext.getCurrentUser(); + if (currentUser == null) { + return Result.ok(); + }else { + entity.setUserId(currentUser.getId()); + entity.setStartTime(LocalDateTime.now()); + baseMapper.insert(entity); + + } return Result.ok("娣诲姞鎴愬姛"); } @@ -129,4 +141,9 @@ } return Result.ok().data(IdWorker.getIdStr()); } + + @Override + public BigDecimal getToDayStayTime(String userId, LocalDateTime begin , LocalDateTime end) { + return baseMapper.getToDayStayTime(userId,begin,end); + } } \ No newline at end of file -- Gitblit v1.8.0