|
@@ -3,13 +3,19 @@ package com.zhongzheng.modules.user.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
|
+import com.zhongzheng.modules.collect.domain.CollectBank;
|
|
|
|
+import com.zhongzheng.modules.collect.domain.CollectQuestion;
|
|
|
|
+import com.zhongzheng.modules.collect.service.ICollectBankService;
|
|
|
|
+import com.zhongzheng.modules.collect.service.ICollectQuestionService;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordEditBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordEditBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
|
|
import com.zhongzheng.modules.user.domain.UserExamRecord;
|
|
import com.zhongzheng.modules.user.domain.UserExamRecord;
|
|
|
|
+import com.zhongzheng.modules.user.domain.UserExamWrongRecord;
|
|
import com.zhongzheng.modules.user.mapper.UserExamRecordMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserExamRecordMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserSubscribeMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserSubscribeMapper;
|
|
import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamWrongRecordService;
|
|
import com.zhongzheng.modules.user.vo.UserExamRecordVo;
|
|
import com.zhongzheng.modules.user.vo.UserExamRecordVo;
|
|
import com.zhongzheng.modules.user.vo.UserExamWrongRecordVo;
|
|
import com.zhongzheng.modules.user.vo.UserExamWrongRecordVo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,6 +42,11 @@ public class UserExamRecordServiceImpl extends ServiceImpl<UserExamRecordMapper,
|
|
@Autowired
|
|
@Autowired
|
|
private UserExamRecordMapper userExamRecordMapper;
|
|
private UserExamRecordMapper userExamRecordMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserExamWrongRecordService iUserExamWrongRecordService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICollectQuestionService iCollectQuestionService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public UserExamRecordVo queryById(Long recordId){
|
|
public UserExamRecordVo queryById(Long recordId){
|
|
UserExamRecord db = this.baseMapper.selectById(recordId);
|
|
UserExamRecord db = this.baseMapper.selectById(recordId);
|
|
@@ -67,6 +78,26 @@ public class UserExamRecordServiceImpl extends ServiceImpl<UserExamRecordMapper,
|
|
return this.baseMapper.getUserDoQuestionNum(bo);
|
|
return this.baseMapper.getUserDoQuestionNum(bo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean delUserBankHistory(Long userId, Long goodsId) {
|
|
|
|
+ //删除做题历史
|
|
|
|
+ LambdaQueryWrapper<UserExamRecord> lqw = Wrappers.lambdaQuery();
|
|
|
|
+ lqw.eq(UserExamRecord::getGoodsId, goodsId);
|
|
|
|
+ lqw.eq( UserExamRecord::getUserId, userId);
|
|
|
|
+ remove(lqw);
|
|
|
|
+ //删除错题历史
|
|
|
|
+ LambdaQueryWrapper<UserExamWrongRecord> lqw1 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw1.eq(UserExamWrongRecord::getGoodsId, goodsId);
|
|
|
|
+ lqw1.eq( UserExamWrongRecord::getUserId, userId);
|
|
|
|
+ iUserExamWrongRecordService.remove(lqw1);
|
|
|
|
+ //删除收藏
|
|
|
|
+ LambdaQueryWrapper<CollectQuestion> lqw2 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw2.eq(CollectQuestion::getGoodsId, goodsId);
|
|
|
|
+ lqw2.eq( CollectQuestion::getUserId, userId);
|
|
|
|
+ iCollectQuestionService.remove(lqw2);
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<UserExamRecordVo> queryList(UserExamRecordQueryBo bo) {
|
|
public List<UserExamRecordVo> queryList(UserExamRecordQueryBo bo) {
|
|
LambdaQueryWrapper<UserExamRecord> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<UserExamRecord> lqw = Wrappers.lambdaQuery();
|