教师学生组初始化

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; private IBaseSchsystemService baseSchsystemService;
@Autowired @Autowired
private ISendUserBaseService syncUserBaseService; private ISendUserBaseService sendUserBaseService;
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
@@ -118,7 +118,7 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
schBinSchsystemRepository.deleteAll(existingList); schBinSchsystemRepository.deleteAll(existingList);
} }
List<SchBinSchsystem> newList = new ArrayList<>(schsystemIds.length); List<SchBinSchsystem> newList = new ArrayList<>();
for (Integer systemId : schsystemIds) { for (Integer systemId : schsystemIds) {
if (systemId == null) { if (systemId == null) {
continue; continue;
@@ -134,8 +134,8 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
schBinSchsystemRepository.saveAll(newList); schBinSchsystemRepository.saveAll(newList);
} }
String cacheKey = RedisConstants.SCHOOL_GRAGE+"_"+schId; String cacheKey = RedisConstants.SCHOOL_GRAGE+"_"+schId;
SchGroupInitialization(schId);
redisUtil.del(cacheKey); redisUtil.del(cacheKey);
SchGroupInitialization(schId,newList);
} }
@@ -239,27 +239,28 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
return list; return list;
} }
private void SchGroupInitialization(Integer schId) private void SchGroupInitialization(Integer schId,List<SchBinSchsystem> newList)
{ {
//添加学生组 //添加学生组
BoaGroup teaGroup= syncUserBaseService.addGroup("教师组",schId,1,NodeType.TEACHER); BoaGroup teaGroup= sendUserBaseService.addGroup("教师组",schId,1,NodeType.TEACHER);
BoaGroup stuGroup= syncUserBaseService.addGroup("学生组",schId,2,NodeType.STUDENT); 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); 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; 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()); schsystem.setGroupId(sectionGroup.getId());
scort++; scort++;
} }
@@ -25,8 +25,6 @@ import java.util.*;
@Service @Service
public class SchClassService implements ISchClassService { public class SchClassService implements ISchClassService {
@Autowired @Autowired
private SchClassQueryService queryService; private SchClassQueryService queryService;
@@ -25,7 +25,7 @@ import java.util.List;
@Service @Service
public class SendUserBaseService implements ISendUserBaseService { 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){ public BoaGroup addGroup(String name, Integer parentId, Integer sort, NodeType type){
SysGroupRequest group=new SysGroupRequest(); SysGroupRequest group=new SysGroupRequest();
group.setName(name); group.setName(name);