Browse Source

Merge remote-tracking branch 'origin/master'

liweifan 3 years ago
parent
commit
db16d25160

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

@@ -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);
         }
 
         //查询是否有人购买