yonge 5 年之前
父節點
當前提交
cd183ab832

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentFee.java

@@ -81,7 +81,7 @@ public class MusicGroupStudentFee {
 
 	private String subjectName;
 
-	private Integer remainNetworkClassTimes;
+	private Integer remainNetworkClassTimes = 0;
 
 	public MusicGroupStudentFee(String musicGroupId, Integer userId, Integer subjectId,
 								BigDecimal courseFee, Date nextPaymentDate, BigDecimal temporaryCourseFee,PaymentStatus paymentStatus) {

+ 10 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -8,6 +8,7 @@ import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
@@ -939,10 +940,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 //        updateTeamTeacher(musicGroup, musicGroup);
         //生成学员费用表
-        List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
-        if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
-            musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
-        }
+		List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
+		if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
+			if (musicGroup.getFeeType() != FeeType.OFFLINE) {
+				for (MusicGroupStudentFee sf : musicGroupStudentFees) {
+					sf.setRemainNetworkClassTimes(sf.getRemainNetworkClassTimes() + 1);
+				}
+			}
+			musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
+		}
         musicGroupStudentFeeDao.batchUpdateCalenders(musicGroupId);
         //记录操作日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "确认开团(筹备中 -> 进行中)", sysUser.getId(), ""));