|
@@ -35,6 +35,7 @@ import com.zhongzheng.modules.exam.domain.ExamKnowledge;
|
|
import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
|
|
import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
|
|
import com.zhongzheng.modules.goods.bo.BankGoodsExamAddBo;
|
|
import com.zhongzheng.modules.goods.bo.BankGoodsExamAddBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
|
+import com.zhongzheng.modules.goods.bo.TodayExamTobVo;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.GoodsExamTime;
|
|
import com.zhongzheng.modules.goods.domain.GoodsExamTime;
|
|
import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
|
|
@@ -45,10 +46,12 @@ import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
|
|
|
|
|
|
import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
|
|
import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
|
|
import com.zhongzheng.modules.user.bo.UserSpecialExamRecord;
|
|
import com.zhongzheng.modules.user.bo.UserSpecialExamRecord;
|
|
|
|
+import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.domain.UserExamRecord;
|
|
import com.zhongzheng.modules.user.domain.UserExamRecord;
|
|
import com.zhongzheng.modules.user.domain.UserExamSubscription;
|
|
import com.zhongzheng.modules.user.domain.UserExamSubscription;
|
|
import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserExamSubscriptionService;
|
|
import com.zhongzheng.modules.user.service.IUserExamSubscriptionService;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserSpecialExamRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserSpecialExamRecordService;
|
|
import org.apache.poi.openxml4j.opc.PackagePart;
|
|
import org.apache.poi.openxml4j.opc.PackagePart;
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
@@ -122,6 +125,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
@Autowired
|
|
@Autowired
|
|
private IUserExamSubscriptionService iUserExamSubscriptionService;
|
|
private IUserExamSubscriptionService iUserExamSubscriptionService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserService iUserService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IExamService iExamService;
|
|
private IExamService iExamService;
|
|
|
|
|
|
@@ -1870,6 +1876,26 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
return vo;
|
|
return vo;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<TodayExamTobVo> getTodayExamTob(Long goodsId, Long userId) {
|
|
|
|
+ //获取商品的打卡记录
|
|
|
|
+ List<UserSpecialExamRecord> recordList = userSpecialExamRecordService
|
|
|
|
+ .list(new LambdaQueryWrapper<UserSpecialExamRecord>()
|
|
|
|
+ .eq(UserSpecialExamRecord::getGoodsId, goodsId));
|
|
|
|
+ if (CollectionUtils.isEmpty(recordList)){
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ List<TodayExamTobVo> voList = new ArrayList<>();
|
|
|
|
+ recordList.stream().collect(Collectors.groupingBy(UserSpecialExamRecord::getUserId)).forEach((k,v) -> {
|
|
|
|
+ TodayExamTobVo vo = new TodayExamTobVo();
|
|
|
|
+ vo.setUserId(k);
|
|
|
|
+ vo.setRecordCount(v.size());
|
|
|
|
+ User user = iUserService.getById(k);
|
|
|
|
+ vo.setUserName(user.getNickname());
|
|
|
|
+ });
|
|
|
|
+ return voList.stream().sorted(Comparator.comparing(TodayExamTobVo::getRecordCount).reversed()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
private String getPercent(Integer x,Integer y){
|
|
private String getPercent(Integer x,Integer y){
|
|
Double d1 = x * 1.0;
|
|
Double d1 = x * 1.0;
|
|
Double d2 = y * 1.0;
|
|
Double d2 = y * 1.0;
|