Ver Fonte

Merge remote-tracking branch 'origin/transaction_teacher' into transaction_teacher

Joburgess há 4 anos atrás
pai
commit
5c2d2c89ad

+ 24 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2567,28 +2567,32 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (classGroups != null || classGroups.size() == 0) {
             return;
         }
-        Integer teamTeacherId = newMusicGroup.getTeamTeacherId();
-        Integer educationalTeacherId = newMusicGroup.getEducationalTeacherId();
-
-        Integer oldDirectorUserId = oldMusicGroup.getDirectorUserId();
-        if (oldDirectorUserId == null) {
-            oldDirectorUserId = teamTeacherId;
+        List<Integer> quitUserIdList = new ArrayList<>();
+        if(oldMusicGroup.getTeamTeacherId() != null){
+            quitUserIdList.add(oldMusicGroup.getTeamTeacherId());
         }
-        Integer directorUserId = newMusicGroup.getDirectorUserId();
-        if (directorUserId == null) {
-            directorUserId = teamTeacherId;
+        if(oldMusicGroup.getEducationalTeacherId() != null){
+            quitUserIdList.add(oldMusicGroup.getEducationalTeacherId());
+        }
+        if(oldMusicGroup.getDirectorUserId() != null){
+            quitUserIdList.add(oldMusicGroup.getDirectorUserId());
+        }
+        if(oldMusicGroup.getTransactionTeacherId() != null){
+            quitUserIdList.add(oldMusicGroup.getTransactionTeacherId());
+        }
+        Map<Integer, String> userRoleMap = new HashMap<>(4);
+        if(newMusicGroup.getTeamTeacherId() != null){
+            userRoleMap.put(newMusicGroup.getTeamTeacherId(), "运营主管");
+        }
+        if(newMusicGroup.getEducationalTeacherId() != null){
+            userRoleMap.put(newMusicGroup.getEducationalTeacherId(), "乐团主管");
+        }
+        if(newMusicGroup.getDirectorUserId() != null){
+            userRoleMap.put(newMusicGroup.getDirectorUserId(), "乐队指导");
+        }
+        if(newMusicGroup.getTransactionTeacherId() != null){
+            userRoleMap.put(newMusicGroup.getTransactionTeacherId(), "衔接老师");
         }
-
-        List<Integer> quitUserIdList = new ArrayList<Integer>();
-        quitUserIdList.add(oldMusicGroup.getTeamTeacherId());
-        quitUserIdList.add(oldMusicGroup.getEducationalTeacherId());
-        quitUserIdList.add(oldDirectorUserId);
-
-        Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
-        userRoleMap.put(directorUserId, "乐队指导");
-        userRoleMap.put(educationalTeacherId, "乐团主管");
-        userRoleMap.put(teamTeacherId, "运营主管");
-
         classGroups.forEach(e -> {
             imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
             imGroupMemberService.join(e.getId().longValue(), userRoleMap);