|
@@ -2,13 +2,9 @@ package com.ym.mec.web.service.impl;
|
|
|
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
-import com.ym.mec.web.dal.dao.MusicGroupDao;
|
|
|
|
-import com.ym.mec.web.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
|
-import com.ym.mec.web.dal.dao.MusicGroupPaymentEntitiesDao;
|
|
|
|
|
|
+import com.ym.mec.web.dal.dao.*;
|
|
import com.ym.mec.web.dal.dto.SubFeeSettingDto;
|
|
import com.ym.mec.web.dal.dto.SubFeeSettingDto;
|
|
-import com.ym.mec.web.dal.entity.MusicGroup;
|
|
|
|
-import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
|
|
|
|
-import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
|
|
|
|
|
|
+import com.ym.mec.web.dal.entity.*;
|
|
import com.ym.mec.web.service.MusicGroupService;
|
|
import com.ym.mec.web.service.MusicGroupService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -25,6 +21,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
|
|
private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<String, MusicGroup> getDAO() {
|
|
public BaseDAO<String, MusicGroup> getDAO() {
|
|
@@ -49,18 +49,38 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void createGroup(SubFeeSettingDto subFeeSettingDto) {
|
|
public void createGroup(SubFeeSettingDto subFeeSettingDto) {
|
|
MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
|
|
MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
|
|
- if(musicGroup != null){
|
|
|
|
|
|
+ List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
|
|
|
|
+ List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
|
|
|
|
+ List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
|
|
|
|
+ if(musicGroup == null || musicGroupPaymentEntities == null || musicGroupSubjectGoodsGroups == null || musicGroupSubjectPlans == null){
|
|
|
|
+ //保存乐团基本信息
|
|
musicGroupDao.insert(musicGroup);
|
|
musicGroupDao.insert(musicGroup);
|
|
- List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
|
|
|
|
- if(musicGroupPaymentEntities != null && musicGroupPaymentEntities.size() > 0){
|
|
|
|
- musicGroupPaymentEntities.forEach(e ->{
|
|
|
|
- e.setMusicGroupId(musicGroup.getId());
|
|
|
|
- musicGroupPaymentEntitiesDao.insert(e);
|
|
|
|
- });
|
|
|
|
|
|
+ //保存乐团付费主体列表
|
|
|
|
+ musicGroupPaymentEntities.forEach(e ->{
|
|
|
|
+ e.setMusicGroupId(musicGroup.getId());
|
|
|
|
+ musicGroupPaymentEntitiesDao.insert(e);
|
|
|
|
+ });
|
|
|
|
+ //保存学员付费周期
|
|
|
|
+ List<Integer> months = subFeeSettingDto.getMonths();
|
|
|
|
+ if(months != null && months.size() > 0){
|
|
|
|
+ MusicGroupPaymentCalender mg;
|
|
|
|
+ for (Integer month:months) {
|
|
|
|
+ mg = new MusicGroupPaymentCalender();
|
|
|
|
+ mg.setMusicGroupId(musicGroup.getId());
|
|
|
|
+ mg.setPaymentMonth(month);
|
|
|
|
+ musicGroupPaymentCalenderDao.insert(mg);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-// if(){
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
|
|
+ //保存乐团声部规划
|
|
|
|
+ musicGroupSubjectPlans.forEach(e ->{
|
|
|
|
+ e.setMusicGroupId(musicGroup.getId());
|
|
|
|
+ musicGroupSubjectPlanDao.insert(e);
|
|
|
|
+ });
|
|
|
|
+ //保存乐团声部商品规划
|
|
|
|
+ musicGroupSubjectGoodsGroups.forEach(e->{
|
|
|
|
+ e.setMusicGroupId(musicGroup.getId());
|
|
|
|
+ musicGroupSubjectGoodsGroupDao.insert(e);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|