|
@@ -1,6 +1,7 @@
|
|
|
package com.zhongzheng.modules.user.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
@@ -9,6 +10,7 @@ import com.zhongzheng.modules.user.bo.UserStudyLogAddBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyLogEditBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyLogQueryBo;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyLog;
|
|
|
+import com.zhongzheng.modules.user.domain.UserVisitLog;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyLogMapper;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyLogService;
|
|
|
import com.zhongzheng.modules.user.vo.UserStudyLogVo;
|
|
@@ -75,6 +77,11 @@ public class UserStudyLogServiceImpl extends ServiceImpl<UserStudyLogMapper, Use
|
|
|
|
|
|
@Override
|
|
|
public Boolean insertByAddBo(UserStudyLogAddBo bo) {
|
|
|
+ Long zeroTime = DateUtils.getTodayZeroTime();
|
|
|
+ if(Validator.isEmpty(bo.getOrderGoodsId())||count(new LambdaQueryWrapper<UserStudyLog>()
|
|
|
+ .eq(UserStudyLog::getUserId,bo.getUserId()).eq(UserStudyLog::getOrderGoodsId,bo.getOrderGoodsId()).ge(UserStudyLog::getCreateTime,zeroTime))>0){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
UserStudyLog add = BeanUtil.toBean(bo, UserStudyLog.class);
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|