Browse Source

缴费项目优化

zouxuan 3 years ago
parent
commit
4f8c0c23f9

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -2452,6 +2452,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             //校验剩余时长是否一致
             //校验剩余时长是否一致
             Integer checkCourseTimes = musicGroupPaymentStudentCourseDetailDao.checkCourseTimes(musicGroupId, courseTypes, studentIds);
             Integer checkCourseTimes = musicGroupPaymentStudentCourseDetailDao.checkCourseTimes(musicGroupId, courseTypes, studentIds);
             if(checkCourseTimes == null || checkCourseTimes == 0){
             if(checkCourseTimes == null || checkCourseTimes == 0){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return BaseController.failed(HttpStatus.MULTI_STATUS,"班级剩余排课时长不一致,请再次确认");
                 return BaseController.failed(HttpStatus.MULTI_STATUS,"班级剩余排课时长不一致,请再次确认");
             }
             }
         }
         }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -32,7 +32,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.TransactionAnnotationParser;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.ui.ModelMap;
 import org.springframework.ui.ModelMap;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -248,6 +250,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         // 所有缴费项目已完成排课才能创建下一个缴费项目
         // 所有缴费项目已完成排课才能创建下一个缴费项目
         String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null, null);
         String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null, null);
         if (!musicGroupPaymentBaseCalender.getConfirmCreate() && StringUtils.isNoneBlank(orignBatchNo)) {
         if (!musicGroupPaymentBaseCalender.getConfirmCreate() && StringUtils.isNoneBlank(orignBatchNo)) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return BaseController.failed(HttpStatus.MULTI_STATUS,"当前乐团存在未排课的缴费项目,请再次确认操作");
             return BaseController.failed(HttpStatus.MULTI_STATUS,"当前乐团存在未排课的缴费项目,请再次确认操作");
         }
         }