|
@@ -3765,18 +3765,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public boolean updateTotalClassTimes(Integer classGroupId, Integer num) {
|
|
public boolean updateTotalClassTimes(Integer classGroupId, Integer num) {
|
|
- ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
|
|
|
|
- if (Objects.isNull(classGroup)) {
|
|
|
|
- throw new BizException("班级不存在");
|
|
|
|
- }
|
|
|
|
- int totalClassTimes = classGroup.getTotalClassTimes() == null ? 0 : classGroup.getTotalClassTimes();
|
|
|
|
- classGroup.setTotalClassTimes(totalClassTimes + num);
|
|
|
|
- classGroup.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- classGroupDao.update(classGroup);
|
|
|
|
-
|
|
|
|
|
|
+ classGroupDao.addClassTimes(classGroupId,num);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|