|
@@ -202,6 +202,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
|
|
|
@Autowired
|
|
|
+ private SysTenantConfigDao sysTenantConfigDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
|
|
|
@Autowired
|
|
@@ -511,19 +514,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean finishPreApply(String musicGroupId, boolean isCheckStudentNum) {
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
if (musicGroup == null) {
|
|
|
throw new BizException("乐团信息查询失败");
|
|
|
}
|
|
|
+ if (musicGroup.getTenantId() == null) {
|
|
|
+ throw new BizException("乐团机构信息异常,请联系管理员");
|
|
|
+ }
|
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
|
|
|
throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
|
|
|
}
|
|
|
if (isCheckStudentNum) {
|
|
|
- // 查询乐团已报名人数
|
|
|
- List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
|
|
|
- if (studentPreRegistrationList == null || studentPreRegistrationList.size() < 80) {
|
|
|
- throw new BizException("操作失败:报名人数没有达到80人");
|
|
|
+ String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.MUSIC_MIN_STUDENT_NUM, musicGroup.getTenantId());
|
|
|
+ if(StringUtils.isNotEmpty(configValue)){
|
|
|
+ Integer minStudentNum = Integer.parseInt(configValue);
|
|
|
+ // 查询乐团已报名人数
|
|
|
+ List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
|
|
|
+ if (studentPreRegistrationList == null || studentPreRegistrationList.size() < minStudentNum) {
|
|
|
+ throw new BizException("操作失败:报名人数没有达到{}人",minStudentNum);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
@@ -1446,39 +1457,51 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
MusicGroup musicGroup = saveLog(musicGroupId, MusicGroupStatusEnum.AUDIT);
|
|
|
- //记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
+ if(musicGroup.getTenantId() == null){
|
|
|
+ throw new BizException("乐团机构信息异常,请联系管理员");
|
|
|
+ }
|
|
|
+ //预报名开关
|
|
|
+ String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.MUSIC_PRE_APPLY_OPEN_FLAG, musicGroup.getTenantId());
|
|
|
+ if(StringUtils.isNotEmpty(configValue) && configValue.equals(1)){
|
|
|
+ //记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
|
|
|
- // 创建群
|
|
|
- imGroupService.create(Long.parseLong(musicGroupId), null, "乐团预报名", null, musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode());
|
|
|
+ // 创建群
|
|
|
+ imGroupService.create(Long.parseLong(musicGroupId), null, "乐团预报名", null, musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode());
|
|
|
|
|
|
- Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
|
|
|
+ Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
|
|
|
|
|
|
- if (musicGroup.getTeamTeacherId() != null) {
|
|
|
- userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
|
|
|
- }
|
|
|
- if (musicGroup.getEducationalTeacherId() != null) {
|
|
|
- userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
|
|
|
- }
|
|
|
- if (musicGroup.getDirectorUserId() != null) {
|
|
|
- userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
|
|
|
- }
|
|
|
- if (musicGroup.getTransactionTeacherId() != null) {
|
|
|
- userRoleMap.put(musicGroup.getTransactionTeacherId(), "衔接老师");
|
|
|
- }
|
|
|
- // 添加成员
|
|
|
- imGroupMemberService.join(Long.parseLong(musicGroupId), userRoleMap);
|
|
|
- Set<Integer> roleIds = new HashSet<>(1);
|
|
|
- roleIds.add(musicGroup.getEducationalTeacherId());
|
|
|
- sysMessageService.batchSeoMessage(roleIds,
|
|
|
- MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS, "", musicGroup.getName());
|
|
|
- Map<Integer, String> map = new HashMap<>(1);
|
|
|
- map.put(musicGroup.getEducationalTeacherId(), musicGroup.getEducationalTeacherId().toString());
|
|
|
- if (map != null && map.size() > 0) {
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS,
|
|
|
- map, null, 0, null, "SYSTEM", musicGroup.getName());
|
|
|
+ if (musicGroup.getTeamTeacherId() != null) {
|
|
|
+ userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
|
|
|
+ }
|
|
|
+ if (musicGroup.getEducationalTeacherId() != null) {
|
|
|
+ userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
|
|
|
+ }
|
|
|
+ if (musicGroup.getDirectorUserId() != null) {
|
|
|
+ userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
|
|
|
+ }
|
|
|
+ if (musicGroup.getTransactionTeacherId() != null) {
|
|
|
+ userRoleMap.put(musicGroup.getTransactionTeacherId(), "衔接老师");
|
|
|
+ }
|
|
|
+ // 添加成员
|
|
|
+ imGroupMemberService.join(Long.parseLong(musicGroupId), userRoleMap);
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(musicGroup.getEducationalTeacherId());
|
|
|
+ sysMessageService.batchSeoMessage(roleIds,
|
|
|
+ MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS, "", musicGroup.getName());
|
|
|
+ Map<Integer, String> map = new HashMap<>(1);
|
|
|
+ map.put(musicGroup.getEducationalTeacherId(), musicGroup.getEducationalTeacherId().toString());
|
|
|
+ if (map != null && map.size() > 0) {
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS,
|
|
|
+ map, null, 0, null, "SYSTEM", musicGroup.getName());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 创建缴费中)", sysUser.getId(), ""));
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3618,6 +3641,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (musicGroup == null) {
|
|
|
throw new BizException("乐团信息不存在");
|
|
|
}
|
|
|
+ if (musicGroup.getTenantId() == null) {
|
|
|
+ throw new BizException("乐团机构信息异常,请联系管理员");
|
|
|
+ }
|
|
|
//记录操作日志
|
|
|
String event;
|
|
|
if (musicGroup.getStatus() == MusicGroupStatusEnum.APPLY) {
|
|
@@ -3634,15 +3660,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
//新建团:(乐团合作单位没有进行中 、暂停、关闭 的乐团)
|
|
|
- //若乐团新建团,则操作【确认开团】时,若【已缴费】学员达到98人,则无需对【未缴费】学员新增回访
|
|
|
- //若乐团不是新建团,则操作【确认开团】时,若【已缴费】学员达到58人,则无需对【未缴费】学员新增回访
|
|
|
+
|
|
|
//报名未交费的学生,完成回访才能到下一步
|
|
|
|
|
|
//获取乐团合作单位乐团数量
|
|
|
Integer cooperationMusicGroupNum = musicGroupDao.getCooperationMusicGroupNum(musicGroup.getCooperationOrganId(), musicGroupId);
|
|
|
Integer paymentStudentNum = studentRegistrationDao.getPaymentStudentNum(musicGroupId);
|
|
|
|
|
|
- if ((cooperationMusicGroupNum <= 0 && paymentStudentNum < 98) || (cooperationMusicGroupNum > 0 && paymentStudentNum < 58)) {
|
|
|
+ //若乐团新建团,则操作【确认开团】时,若【已缴费】学员达到98人,则无需对【未缴费】学员新增回访
|
|
|
+ String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.NEW_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
|
|
|
+ //若乐团不是新建团,则操作【确认开团】时,若【已缴费】学员达到58人,则无需对【未缴费】学员新增回访
|
|
|
+ String configValue1 = sysTenantConfigDao.getConfigValue(SysConfigService.OLD_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
|
|
|
+ if ((StringUtils.isNotEmpty(configValue) && cooperationMusicGroupNum <= 0 && paymentStudentNum < Integer.parseInt(configValue)) ||
|
|
|
+ (StringUtils.isNotEmpty(configValue1) && cooperationMusicGroupNum > 0 && paymentStudentNum < Integer.parseInt(configValue1))) {
|
|
|
checkStudentVisit(musicGroupId);
|
|
|
}
|
|
|
|