|
@@ -1044,7 +1044,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
} catch (InterruptedException e) {
|
|
|
throw new BizException("创建陪练课失败:{}", e.getMessage());
|
|
|
} finally {
|
|
|
- lock.unlock();
|
|
|
+ if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
}
|
|
|
return HttpResponseResult.failed();
|
|
|
}
|
|
@@ -1189,7 +1191,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
Date s = DateUtil.strToDate(DateUtil.dateToString(classDate) + " " + star + ":00");
|
|
|
Date e = DateUtil.strToDate(DateUtil.dateToString(classDate) + " " + end + ":00");
|
|
|
if (startTime.before(s) || endTime.after(e)) {
|
|
|
- throw new BizException("调整时间必须在{}到{}之间",star,end);
|
|
|
+ throw new BizException("调整时间必须在{}到{}之间", star, end);
|
|
|
}
|
|
|
|
|
|
//查询是否有人购买
|