|
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.ChargeTypeDao;
|
|
@@ -40,6 +41,7 @@ import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicCardDto;
|
|
|
import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
|
|
|
import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
|
|
|
+import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
|
|
|
import com.ym.mec.biz.dal.entity.ApprovalStatus;
|
|
|
import com.ym.mec.biz.dal.entity.ChargeType;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
@@ -226,6 +228,42 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void updateSubjectInfo(SubFeeSettingDto subFeeSettingDto) throws Exception {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ throw new Exception("身份校验失败");
|
|
|
+ }
|
|
|
+ String musicGroupId = subFeeSettingDto.getMusicGroupId();
|
|
|
+
|
|
|
+ //乐团状态是否正确
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ if(musicGroup != null){
|
|
|
+ if(musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT || musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT){
|
|
|
+ throw new Exception("乐团状态异常");
|
|
|
+ }
|
|
|
+
|
|
|
+ //记录日志信息
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"修改乐团计划声部、乐器",sysUser.getId(), JSONObject.toJSONString(subFeeSettingDto)));
|
|
|
+ //删除原有的乐团声部规划
|
|
|
+ musicGroupSubjectPlanDao.delByMusicGroupId(musicGroupId);
|
|
|
+ //删除原有的声部商品组合
|
|
|
+ musicGroupSubjectGoodsGroupDao.delByMusicGroupId(subFeeSettingDto.getMusicGroupId());
|
|
|
+
|
|
|
+ musicGroupSubjectPlanDao.batchAdd(subFeeSettingDto.getMusicGroupSubjectPlans(),musicGroupId);
|
|
|
+ musicGroupSubjectGoodsGroupDao.batchInsert(subFeeSettingDto.getMusicGroupSubjectGoodsGroups(),musicGroupId);
|
|
|
+ }else {
|
|
|
+ throw new Exception("乐团信息不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public int updateExpectedStudentNum(List<UpdateExpectedNumDto> updateExpectedNumDtos) {
|
|
|
+ return musicGroupSubjectPlanDao.updateExpectedStudentNum(updateExpectedNumDtos);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
|
|
|
List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
|
|
|
Set<String> musicGroupIds = musicCardDtos.stream().map(MusicCardDto::getMusicGroupId).collect(Collectors.toSet());
|
|
@@ -714,6 +752,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public SubFeeSettingDto findMusicGroupSubjectInfo(String musicGroupId) {
|
|
|
+ SubFeeSettingDto subFeeSettingDto = new SubFeeSettingDto();
|
|
|
+ //获取乐团声部规划列表
|
|
|
+ subFeeSettingDto.setMusicGroupSubjectPlans(musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId));
|
|
|
+ //获取乐团声部商品组
|
|
|
+ subFeeSettingDto.setMusicGroupSubjectGoodsGroups(musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId,null));
|
|
|
+ return subFeeSettingDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<MusicGroup> queryListByIds(Set<String> musicGroupIds) {
|
|
|
return musicGroupDao.queryListByIds(StringUtils.join(musicGroupIds,","));
|
|
|
}
|
|
@@ -785,9 +833,4 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
// String content = sysConfigDao.findConfigValue(MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE.getCode());
|
|
|
// sysMessageService.batchSendMessage(MessageSender.YIMEI,"",content,parentsPhones,date,0,"");
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public SubFeeSettingDto findMusicGroupSubjectInfo(String musicGroupId) {
|
|
|
- return null;
|
|
|
- }
|
|
|
}
|