|
|
@@ -21,6 +21,7 @@ import com.zhongzheng.modules.bank.bo.*;
|
|
|
import com.zhongzheng.modules.bank.domain.*;
|
|
|
import com.zhongzheng.modules.bank.mapper.QuestionMapper;
|
|
|
import com.zhongzheng.modules.bank.service.IExamQuestionService;
|
|
|
+import com.zhongzheng.modules.bank.service.IExamService;
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
|
|
|
import com.zhongzheng.modules.bank.service.IQuestionService;
|
|
|
import com.zhongzheng.modules.bank.vo.*;
|
|
|
@@ -116,6 +117,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
@Autowired
|
|
|
private IUserSpecialExamRecordService userSpecialExamRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IExamService iExamService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IGoodsService iGoodsService;
|
|
|
|
|
|
@@ -1813,6 +1817,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return null;
|
|
|
}
|
|
|
GoodsExamTimeVo vo = BeanUtil.toBean(goodsExamTime, GoodsExamTimeVo.class);
|
|
|
+ Exam exam = iExamService.getById(vo.getExamId());
|
|
|
+ vo.setExamName(exam.getExamName());
|
|
|
//获取打卡记录
|
|
|
List<UserSpecialExamRecord> list = userSpecialExamRecordService.list(new LambdaQueryWrapper<UserSpecialExamRecord>()
|
|
|
.eq(UserSpecialExamRecord::getGoodsId, vo.getGoodsId()));
|
|
|
@@ -1826,9 +1832,16 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
Long countAll = collect.keySet().stream().filter(x -> !x.equals(userId)).count();
|
|
|
String percent = getPercent(count.intValue(), countAll.intValue());
|
|
|
vo.setRecordPercentage(percent);
|
|
|
+ //当天是否打卡
|
|
|
+ Long record = list.stream().filter(item -> item.getUserId().equals(userId)
|
|
|
+ && item.getGoodsId().equals(vo.getGoodsId()) && item.getModuleExamId().equals(vo.getModuleExamId())
|
|
|
+ && item.getChapterExamId().equals(vo.getChapterExamId()) && item.getExamId().equals(vo.getExamId())
|
|
|
+ && item.getRecordTime().equals(DateUtils.getTodayZeroTime())).count();
|
|
|
+ vo.setExamRecord(record > 0 ? 1:0);
|
|
|
}else {
|
|
|
vo.setRecordCount(0);
|
|
|
vo.setRecordPercentage("0.00%");
|
|
|
+ vo.setExamRecord(0);
|
|
|
}
|
|
|
return vo;
|
|
|
}
|