Bladeren bron

Merge branch 'master' of http://git.dayaedu.com/yonge/mec into test

zouxuan 4 jaren geleden
bovenliggende
commit
5d52f8085f

+ 20 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -4,13 +4,16 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.ST
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
+import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -21,13 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
@@ -66,6 +62,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+	@Autowired
 	private SysMessageService sysMessageService;
 
 	@Override
@@ -108,6 +106,21 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			}else {
 				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
 				e.setPaymentStatus(PAID_COMPLETED);
+				if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(e.getUserId(), calender.getMusicGroupId());
+					if (musicGroupStudentFee != null) {
+						musicGroupStudentFee.setUpdateTime(date);
+						musicGroupStudentFee.setLatestPaidTime(date);
+						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+						musicGroupStudentFeeDao.update(musicGroupStudentFee);
+					}
+					//如果是进行中加学员
+					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(e.getUserId(), calender.getMusicGroupId());
+					studentRegistration.setPaymentStatus(YES);
+					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
+					studentRegistrationDao.update(studentRegistration);
+				}
 			}
 		});
 		musicGroupPaymentCalenderDao.update(calender);

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

@@ -857,7 +857,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
 				//如果是0元那么更新fee表和studentRegistration表
 				if(totalPrice.doubleValue() == 0d){
-					MusicGroupStudentFee musicGroupStudentFee = updateCalender(musicGroupPaymentCalenderDetail.getId(), Integer.parseInt(studentId));
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
 					if (musicGroupStudentFee != null) {
 						musicGroupStudentFee.setUpdateTime(date);
 						musicGroupStudentFee.setLatestPaidTime(date);
@@ -1177,7 +1177,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	//推送待续费通知
 	public void pushWaitRenewMessage(Long calenderId,MusicGroup musicGroup,Set<Integer> studentIds){
-		if(studentIds == null){
+		/*if(studentIds == null){
 			studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentStudentIds(calenderId);
 		}
 		if (studentIds.size() > 0) {
@@ -1197,7 +1197,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
 						null, 0, memo, null, musicGroup.getName());
 			}
-		}
+		}*/
 	}
 
     @Override