|
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
|
+
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -17,7 +18,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -44,6 +47,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
|
|
public boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
|
+ List<MusicGroupStudentFee> list = null;
|
|
|
|
+
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
@@ -52,7 +57,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
|
|
musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
|
|
//统计缴费人数
|
|
//统计缴费人数
|
|
- List<MusicGroupStudentFee> list = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupPaymentCalender.getMusicGroupId());
|
|
|
|
|
|
+ list = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupPaymentCalender.getMusicGroupId());
|
|
if(list == null){
|
|
if(list == null){
|
|
list = new ArrayList<MusicGroupStudentFee>();
|
|
list = new ArrayList<MusicGroupStudentFee>();
|
|
}
|
|
}
|
|
@@ -63,7 +68,21 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
this.insert(musicGroupPaymentCalender);
|
|
this.insert(musicGroupPaymentCalender);
|
|
|
|
|
|
- //创建缴费明细
|
|
|
|
|
|
+ if(musicGroupPaymentCalender.getPaymentStatus() == PaymentStatusEnum.OPEN){
|
|
|
|
+ if(list != null && list.size() > 0){
|
|
|
|
+ MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
|
|
|
|
+ //创建缴费明细
|
|
|
|
+ for(MusicGroupStudentFee mgsf : list){
|
|
|
|
+ musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
|
+ musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
+ musicGroupPaymentCalenderDetail.setCreateTime(date);
|
|
|
|
+ musicGroupPaymentCalenderDetail.setExpectAmount(mgsf.getCourseFee());
|
|
|
|
+ musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
|
+ musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
|
+ musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|