教师学生组初始化

This commit is contained in:
2026-08-19 22:03:42 +08:00
parent 833d3c6c2c
commit ba845f3b0e
3 changed files with 14 additions and 15 deletions
@@ -38,7 +38,7 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
private IBaseSchsystemService baseSchsystemService;
@Autowired
private ISendUserBaseService syncUserBaseService;
private ISendUserBaseService sendUserBaseService;
@Autowired
private RedisUtil redisUtil;
@@ -118,7 +118,7 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
schBinSchsystemRepository.deleteAll(existingList);
}
List<SchBinSchsystem> newList = new ArrayList<>(schsystemIds.length);
List<SchBinSchsystem> newList = new ArrayList<>();
for (Integer systemId : schsystemIds) {
if (systemId == null) {
continue;
@@ -134,8 +134,8 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
schBinSchsystemRepository.saveAll(newList);
}
String cacheKey = RedisConstants.SCHOOL_GRAGE+"_"+schId;
SchGroupInitialization(schId);
redisUtil.del(cacheKey);
SchGroupInitialization(schId,newList);
}
@@ -239,27 +239,28 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
return list;
}
private void SchGroupInitialization(Integer schId)
private void SchGroupInitialization(Integer schId,List<SchBinSchsystem> newList)
{
//添加学生组
BoaGroup teaGroup= syncUserBaseService.addGroup("教师组",schId,1,NodeType.TEACHER);
BoaGroup stuGroup= syncUserBaseService.addGroup("学生组",schId,2,NodeType.STUDENT);
BoaGroup teaGroup= sendUserBaseService.addGroup("教师组",schId,1,NodeType.TEACHER);
BoaGroup stuGroup= sendUserBaseService.addGroup("学生组",schId,2,NodeType.STUDENT);
//创建校长室
syncUserBaseService.addGroup("校长室", teaGroup.getId(),1,NodeType.NORMAL);
sendUserBaseService.addGroup("校长室", teaGroup.getId(),1,NodeType.NORMAL);
//获取学制
List<SchBinSchsystem> schsystemBinList=getSchBinSchsystemList(schId);
Map<Integer, String> schsystemMap=getSchBinSchsystemMap(schId);
if(schsystemBinList.size()==1)
if(newList.size()==1)
{
}else if(schsystemBinList.size()>1)
}else if(newList.size()>1)
{
Integer scort=1;
for (SchBinSchsystem schsystem:schsystemBinList) {
for (SchBinSchsystem schsystem:newList) {
//添加学段组
BoaGroup sectionGroup= syncUserBaseService.addGroup(schsystemMap.get(schsystem.getId()),stuGroup.getId(),scort,NodeType.SECTION);
BoaGroup sectionGroup= sendUserBaseService.addGroup(schsystemMap.get(schsystem.getId()),stuGroup.getId(),scort,NodeType.SECTION);
schsystem.setGroupId(sectionGroup.getId());
scort++;
}
@@ -25,8 +25,6 @@ import java.util.*;
@Service
public class SchClassService implements ISchClassService {
@Autowired
private SchClassQueryService queryService;
@@ -25,7 +25,7 @@ import java.util.List;
@Service
public class SendUserBaseService implements ISendUserBaseService {
@SyncOpLog(SyncDataType.SEND_EDIT_GROUP)
@SyncOpLog(SyncDataType.SEND_ADD_GROUP)
public BoaGroup addGroup(String name, Integer parentId, Integer sort, NodeType type){
SysGroupRequest group=new SysGroupRequest();
group.setName(name);