|
@@ -1,6 +1,14 @@
|
|
package com.ym.mec.web.service.impl;
|
|
package com.ym.mec.web.service.impl;
|
|
|
|
|
|
|
|
+import com.ym.mec.web.dal.dao.MusicGroupSubjectGoodsGroupDao;
|
|
|
|
+import com.ym.mec.web.dal.dao.MusicGroupSubjectPlanDao;
|
|
|
|
+import com.ym.mec.web.dal.dao.SubjectDao;
|
|
|
|
+import com.ym.mec.web.dal.entity.MusicGroupSubjectGoodsGroup;
|
|
|
|
+import com.ym.mec.web.dal.entity.MusicGroupSubjectPlan;
|
|
|
|
+import com.ym.mec.web.dal.entity.Subject;
|
|
|
|
+import com.ym.mec.web.dal.utilEntity.SubSettingUtilEntity;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -8,16 +16,53 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.web.dal.dao.MusicGroupDao;
|
|
import com.ym.mec.web.dal.dao.MusicGroupDao;
|
|
import com.ym.mec.web.dal.entity.MusicGroup;
|
|
import com.ym.mec.web.dal.entity.MusicGroup;
|
|
import com.ym.mec.web.service.MusicGroupService;
|
|
import com.ym.mec.web.service.MusicGroupService;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
|
|
public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupDao musicGroupDao;
|
|
private MusicGroupDao musicGroupDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SubjectDao subjectDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<String, MusicGroup> getDAO() {
|
|
public BaseDAO<String, MusicGroup> getDAO() {
|
|
return musicGroupDao;
|
|
return musicGroupDao;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public void subSetting(List<SubSettingUtilEntity> subSettingUtilEntitys) {
|
|
|
|
+ Subject subject = null;
|
|
|
|
+ MusicGroupSubjectPlan musicGroupSubjectPlan;
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ for (SubSettingUtilEntity e:subSettingUtilEntitys) {
|
|
|
|
+ subject = subjectDao.get(e.getSubId());
|
|
|
|
+ //保存乐团科目规划
|
|
|
|
+ if(subject != null){
|
|
|
|
+ musicGroupSubjectPlan = new MusicGroupSubjectPlan();
|
|
|
|
+ musicGroupSubjectPlan.setMusicGroupId(e.getMusicGroupId());
|
|
|
|
+ musicGroupSubjectPlan.setSubjectId(e.getSubId());
|
|
|
|
+ musicGroupSubjectPlan.setExpectedStudentNum(e.getExpectedStudentNum());
|
|
|
|
+ musicGroupSubjectPlan.setCreateTime(date);
|
|
|
|
+ musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
|
+ musicGroupSubjectPlanDao.insert(musicGroupSubjectPlan);
|
|
|
|
+ //保存乐团科目乐器范围,以及打包商品
|
|
|
|
+ musicGroupSubjectGoodsGroupDao.batchInsert(e.getMusicGroupSubjectGoodsGroups());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getSubSetting(Integer musicGroupId) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|