he2802 1 year ago
parent
commit
1e6064d231

+ 5 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -902,9 +902,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderGoodsId())){
             throw new CustomException("参数缺失");
         }
-        ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper< ClassGradeUser >().eq(ClassGradeUser::getUserId, bo.getUserId()).eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId()).last("limit 1"));
-        if(Validator.isEmpty(classGradeUser)){
-            throw new CustomException("非法数据",601);
+        if(Validator.isNotEmpty(bo.getGradeId())&&bo.getGradeId()>0L){
+            ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper< ClassGradeUser >().eq(ClassGradeUser::getUserId, bo.getUserId()).eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId()).last("limit 1"));
+            if(Validator.isEmpty(classGradeUser)){
+                throw new CustomException("非法数据",601);
+            }
         }
         //存储整个目录节列表
         List<ClassPeriodVo> sectionList = new ArrayList<>();