学制树
This commit is contained in:
@@ -25,6 +25,10 @@ public class SchBinSchsystem extends BaseEntity {
|
|||||||
@Column(name = "sch_system_id", nullable = false)
|
@Column(name = "sch_system_id", nullable = false)
|
||||||
private Integer schSystemId;
|
private Integer schSystemId;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "group_id")
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新校验分组
|
* 更新校验分组
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TreeSelectVO {
|
public class TreeSelectVO {
|
||||||
private String title;
|
private String label;
|
||||||
private Integer value;
|
private Integer id;
|
||||||
private List<TreeSelectVO> children;
|
private List<TreeSelectVO> children;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.yunhai.bschclassmanage.Repository.SchBinSchsystemRepository;
|
|||||||
import com.yunhai.bschclassmanage.entity.BaseSchsystem;
|
import com.yunhai.bschclassmanage.entity.BaseSchsystem;
|
||||||
import com.yunhai.bschclassmanage.entity.SchBinSchsystem;
|
import com.yunhai.bschclassmanage.entity.SchBinSchsystem;
|
||||||
import com.yunhai.bschclassmanage.enums.AcademicStage;
|
import com.yunhai.bschclassmanage.enums.AcademicStage;
|
||||||
|
import com.yunhai.bschclassmanage.enums.NodeType;
|
||||||
import com.yunhai.bschclassmanage.enums.SchType;
|
import com.yunhai.bschclassmanage.enums.SchType;
|
||||||
import com.yunhai.bschclassmanage.model.entityField.EntityFieldNames;
|
import com.yunhai.bschclassmanage.model.entityField.EntityFieldNames;
|
||||||
import com.yunhai.bschclassmanage.model.vo.AcademicStageSchsystemVO;
|
import com.yunhai.bschclassmanage.model.vo.AcademicStageSchsystemVO;
|
||||||
@@ -16,6 +17,7 @@ import com.yunhai.bschclassmanage.service.ISchBinSchsystemService;
|
|||||||
import com.yunhai.bschclassmanage.utils.RedisConstants;
|
import com.yunhai.bschclassmanage.utils.RedisConstants;
|
||||||
import com.yunhai.bschclassmanage.utils.RedisUtil;
|
import com.yunhai.bschclassmanage.utils.RedisUtil;
|
||||||
import com.yunhai.platform.utils.exception.DException;
|
import com.yunhai.platform.utils.exception.DException;
|
||||||
|
import com.yunhai.platform.utils.model.BoaGroup;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.jpa.domain.Specification;
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.persistence.criteria.Predicate;
|
import javax.persistence.criteria.Predicate;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -131,6 +134,8 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
|
|||||||
}
|
}
|
||||||
String cacheKey = RedisConstants.SCHOOL_GRAGE+"_"+schId;
|
String cacheKey = RedisConstants.SCHOOL_GRAGE+"_"+schId;
|
||||||
redisUtil.del(cacheKey);
|
redisUtil.del(cacheKey);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -233,4 +238,45 @@ public class SchBinSchsystemService implements ISchBinSchsystemService {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SchGroupInitialization(Integer schId)
|
||||||
|
{
|
||||||
|
//添加学生组
|
||||||
|
BoaGroup teaGroup= CreateGroup(NodeType.TEACHER.getId(),"教师组",schId,1);
|
||||||
|
BoaGroup stuGroup= CreateGroup(NodeType.STUDENT.getId(),"学生组",schId,2);
|
||||||
|
|
||||||
|
{
|
||||||
|
Integer scort=1;
|
||||||
|
List<String> deptNameSet = Arrays.asList("校长室","办公室","行政","信息");
|
||||||
|
for (String name : deptNameSet) {
|
||||||
|
CreateGroup(NodeType.NORMAL.getId(), name, teaGroup.getId(),scort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取学制
|
||||||
|
List<SchBinSchsystem> schsystemBinList=getSchBinSchsystemList(schId);
|
||||||
|
Map<Integer, String> schsystemMap=getSchBinSchsystemMap(schId);
|
||||||
|
if(schsystemBinList.size()==1)
|
||||||
|
{
|
||||||
|
|
||||||
|
}else if(schsystemBinList.size()>1)
|
||||||
|
{
|
||||||
|
Integer scort=1;
|
||||||
|
for (SchBinSchsystem schsystem:schsystemBinList) {
|
||||||
|
//添加学段组
|
||||||
|
BoaGroup sectionGroup= CreateGroup(NodeType.SECTION.getId(),schsystemMap.get(schsystem.getId()),stuGroup.getId(),scort);
|
||||||
|
schsystem.setGroupId(sectionGroup.getId());
|
||||||
|
scort++;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new DException("请选择学制!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoaGroup CreateGroup(Integer NodeType,String name,Integer parentId,Integer scort)
|
||||||
|
{
|
||||||
|
return new BoaGroup();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user