|
@@ -44,7 +44,7 @@ public class PcQuestionWrongController extends BaseController {
|
|
|
QuestionWrongListDTO dto = new QuestionWrongListDTO();
|
|
|
dto.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
|
|
|
List<QuestionWrong> list = questionWrongService.selectQuestionWrongList(dto);
|
|
|
- long count = list.stream().filter(o -> questionWrongDTO.getQuestionId().equals(o.getQuestionId()) && questionWrongDTO.getKm().equals(o.getKm())).count();
|
|
|
+ long count = list.stream().filter(o -> questionWrongDTO.getQuestionId().equals(o.getQuestionId()) && questionWrongDTO.getKm().equals(o.getKm()) && o.getDeviceType()==2 ).count();
|
|
|
if (count > 0) {
|
|
|
//throw new CustomException("该错已加入错题集");
|
|
|
Response response = new Response(200, "该错已加入错题集");
|
|
@@ -64,11 +64,11 @@ public class PcQuestionWrongController extends BaseController {
|
|
|
QuestionWrongListDTO dto = new QuestionWrongListDTO();
|
|
|
dto.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
|
|
|
List<QuestionWrong> dblist = questionWrongService.selectQuestionWrongList(dto);
|
|
|
- List<String> questionIdsStr = dblist.stream().map(o -> o.getQuestionId() + "," + o.getKm()).collect(Collectors.toList());
|
|
|
+ List<String> questionIdsStr = dblist.stream().map(o -> o.getQuestionId() + "," + o.getKm() + "," + o.getDeviceType()).collect(Collectors.toList());
|
|
|
|
|
|
List<QuestionWrong> qlist = new ArrayList<QuestionWrong>();
|
|
|
for (QuestionWgYunDTO wgYunDTO : wrong.getWrongs()) {
|
|
|
- if (questionIdsStr.contains(wgYunDTO.getId() + "," + wrong.getKm())) {
|
|
|
+ if (questionIdsStr.contains(wgYunDTO.getId() + "," + wrong.getKm() + "," + "2")) {
|
|
|
continue;
|
|
|
}
|
|
|
QuestionWrong questionWrong = new QuestionWrong();
|
|
@@ -96,6 +96,7 @@ public class PcQuestionWrongController extends BaseController {
|
|
|
QueryWrapper<QuestionWrong> queryWrapper = new QueryWrapper<QuestionWrong>();
|
|
|
queryWrapper.eq("user_id", userId);
|
|
|
queryWrapper.eq("km", wrong.getKm());
|
|
|
+ queryWrapper.eq("device_type", 2);
|
|
|
questionWrongService.remove(queryWrapper);
|
|
|
|
|
|
//保存上传的错题
|