yonge 4 vuotta sitten
vanhempi
commit
4888dec862

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java

@@ -317,7 +317,7 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	void musicGroupAuditFailed(String musicGroupId, String memo) throws Exception;
 
 	/**
-	 * 审核通过(审核中 -> 报名
+	 * 审核通过(审核中 -> 报名)
 	 * @param musicGroupId
 	 */
 	void musicGroupAuditSuccess(String musicGroupId) throws Exception;

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1097,7 +1097,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
 			if(count == 0){
 				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
+				musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
 				musicGroup.setUpdateTime(date);
 				musicGroupDao.update(musicGroup);
 				SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -1105,7 +1105,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					throw new BizException("请重新登录");
 				}
 				//记录操作日志
-				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(草稿 -> 审核中)", sysUser.getId(), ""));
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
 				Set<Integer> roleIds = new HashSet<>(1);
 				roleIds.add(SysUserRole.SECTION_MANAGER);
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
@@ -1155,11 +1155,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
 		if (calender.getPaymentType() == MUSIC_APPLY) {
 			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-			musicGroup.setStatus(MusicGroupStatusEnum.AUDIT_FAILED);
+			musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
 			//记录操作日志
-			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 草稿)", sysUser.getId(), ""));
+			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
 		}
 		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 	}

+ 31 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -131,6 +131,7 @@ import com.ym.mec.biz.service.ClassGroupStudentMapperService;
 import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
 import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.ImGroupMemberService;
+import com.ym.mec.biz.service.ImGroupService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
@@ -276,6 +277,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Autowired
     private ImGroupMemberService imGroupMemberService;
     @Autowired
+    private ImGroupService imGroupService;
+    @Autowired
     private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
     @Autowired
     private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
@@ -470,6 +473,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 		studentPreRegistration.setUserId(user.getId());
 
 		studentPreRegistrationDao.insert(studentPreRegistration);
+		
+		// 添加成员
+		imGroupMemberService.join(Long.parseLong(musicGroupId), user.getId(), null, false);
 
 		return true;
 	}
@@ -493,7 +499,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 		musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
 		musicGroup.setUpdateTime(new Date());
 		musicGroupDao.update(musicGroup);
-
+		
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if(sysUser == null || sysUser.getId() == null){
+			throw new BizException("请重新登录");
+		}
+		
+		//记录操作日志
+		musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(预报名 -> 准备创建缴费)", sysUser.getId(), ""));
+		
 		return true;
 	}
 
@@ -1304,13 +1318,23 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
         musicGroupDao.update(musicGroup);
-        //获取报名缴费项目
-        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
-        if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
-            regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
-            regCalender.setUpdateTime(new Date());
-            musicGroupPaymentCalenderDao.update(regCalender);
+        
+        // 创建群
+        imGroupService.create(Long.parseLong(musicGroupId), null, "乐团预报名", null, musicGroup.getName(), null, null, GroupType.MUSIC.getCode());
+        
+        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(), "乐队指导");
         }
+        // 添加成员
+        imGroupMemberService.join(Long.parseLong(musicGroupId), userRoleMap);
 
         Set<Integer> roleIds = new HashSet<>(3);
         roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);