|
@@ -4,6 +4,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_P
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
@@ -20,6 +21,7 @@ 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.MusicGroupStudentFeeDao;
|
|
@@ -29,8 +31,10 @@ import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
@@ -47,6 +51,10 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
|
@Autowired
|
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
@Autowired
|
|
@@ -245,6 +253,45 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public void batchAdd(Long musicGroupPaymentCalenderId, List<Integer> userIdList) {
|
|
|
+
|
|
|
+ MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalenderId);
|
|
|
+ if(musicGroupPaymentCalender == null){
|
|
|
+ throw new BizException("查询缴费信息失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
|
|
|
+
|
|
|
+ BigDecimal totalPrice = new BigDecimal(0);
|
|
|
+ for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
|
|
|
+ totalPrice.add(courseSettings.getCourseCurrentPrice());
|
|
|
+ }
|
|
|
+
|
|
|
+ Date date = new Date();
|
|
|
+ MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
|
|
|
+
|
|
|
+ List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
|
|
|
+ //创建缴费明细
|
|
|
+ for(Integer studentId : userIdList){
|
|
|
+ musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
+ musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
|
|
|
+ musicGroupPaymentCalenderDetail.setCreateTime(date);
|
|
|
+ musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
|
|
|
+ musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
+ musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
+ musicGroupPaymentCalenderDetail.setUserId(studentId);
|
|
|
+ musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
|
|
|
+ musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
|
|
|
+
|
|
|
+ musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (musicGroupPaymentCalenderDetailList.size() > 0) {
|
|
|
+ musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<FeeStudentDto> queryFeeStudents(String musicGroupId,String search,Integer subjectId) {
|
|
|
return musicGroupStudentFeeDao.queryFeeStudents(musicGroupId,search,subjectId);
|
|
|
}
|