Browse Source

Merge branch '20221010' of http://git.dayaedu.com/yonge/mec into master_saas

zouxuan 3 years ago
parent
commit
63dac87d3a

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupCalenderRefundPeriodServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -35,7 +36,7 @@ public class MusicGroupCalenderRefundPeriodServiceImpl extends BaseServiceImpl<I
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void savePeriod(MusicGroupPaymentBaseCalender baseCalender) {
-        if(baseCalender.getPayUserType() != SCHOOL){
+        if(baseCalender.getPayUserType() != SCHOOL || baseCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) == 0){
             return;
         }
         List<MusicGroupCalenderRefundPeriod> refundPeriods = baseCalender.getMusicGroupCalenderRefundPeriods();

+ 12 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -307,6 +307,16 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
             actualTotalAmount = courseActualAmount.add(memberActualAmount)
                     .add(repairActualAmount)
                     .add(activityActualAmount).setScale(0, BigDecimal.ROUND_HALF_UP);
+            //标记是否云教练缴费
+            if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
+                if(musicGroupPaymentCalender.getPaymentType() == ADD_STUDENT){
+                    musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
+                }else if(memberActualAmount.compareTo(BigDecimal.ZERO) > 0 &&
+                        ((courseActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList()))
+                                || (activityActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getCalenderActivityList())))) {
+                    musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
+                }
+            }
         }
 
         PaymentCalenderStatusEnum status;
@@ -353,17 +363,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         // 设置批次号
         String batchNo = idGeneratorService.generatorId() + "";
         musicGroupPaymentCalender.setBatchNo(batchNo);
-        //标记是否云教练缴费
-        if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
-            if(musicGroupPaymentCalender.getPaymentType() == ADD_STUDENT){
-                musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
-            }/*else if(memberActualAmount.compareTo(BigDecimal.ZERO) > 0 &&
-                    ((courseActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList()))
-                            || (activityActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getCalenderActivityList())))) {
-                musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
-            }*/
-        }
+
         musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
+        musicGroupPaymentBaseCalender.setCurrentTotalAmount(musicGroupPaymentCalender.getCurrentTotalAmount());
         musicGroupPaymentBaseCalender.setCalenderId(musicGroupPaymentCalender.getId());
         //如果是学校缴费,需要保存还款周期
         musicGroupCalenderRefundPeriodService.savePeriod(musicGroupPaymentBaseCalender);

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1414,7 +1414,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED) {
-            musicGroup.setStatus(subFeeSettingDto.getMusicGroupStatus());
+            //musicGroup.setStatus(subFeeSettingDto.getMusicGroupStatus());
             musicGroup.setUpdateTime(new Date());
             musicGroupDao.update(musicGroup);
         }
@@ -1561,6 +1561,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //修改乐团报名缴费项目状态
         List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
         
+        if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0) {
+        	throw new BizException("请先创建缴费项目");
+        }
+        
         musicGroupPaymentCalenderList.forEach(t -> {
         	t.setStatus(PaymentCalenderStatusEnum.AUDITING);
         	t.setUpdateTime(date);