浏览代码

修改bug

cy 3 年之前
父节点
当前提交
1caae6df67

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherFreeTimeServiceImpl.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.entity.TeacherFreeTime;
 import com.yonge.cooleshow.biz.dal.entity.TeacherSubjectPrice;
 import com.yonge.cooleshow.biz.dal.service.TeacherFreeTimeService;
 import com.yonge.cooleshow.biz.dal.vo.TeacherFreeTimeVo;
+import com.yonge.cooleshow.common.exception.BizException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -61,6 +62,9 @@ public class TeacherFreeTimeServiceImpl extends ServiceImpl<TeacherFreeTimeDao,
     @Override
     public TeacherFreeTimeVo getDetail(PracticeTimesSetting practiceTimesSetting) {
         TeacherFreeTimeVo getDetail=baseMapper.getDetail(practiceTimesSetting);
+        if (getDetail==null){
+            throw new BizException("陪练课设置不存在");
+        }
         List<TeacherSubjectPrice> priceList=baseMapper.getPrice(getDetail.getId());
         getDetail.setSubjectPrice(priceList);
         return getDetail;