refactor: 根包由 com.bestsch.bschclassmanage 重命名为 com.yunhai.bschclassmanage
- git mv src/main/java/com/bestsch/bschclassmanage -> src/main/java/com/yunhai/bschclassmanage - 255 个 Java 文件的 package/import 同步替换为 com.yunhai.bschclassmanage - pom.xml 项目 groupId 设为 com.yunhai(与外部依赖 com.bestsch:bsch-* 无关,未改动) - IDE 缓存 workspace.xml 路径同步更新(外部依赖坐标 com.bestsch:bsch-* 保持不动)
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public enum StuAbnormalStatus
|
||||
{
|
||||
NORMAL(1,"正常"),
|
||||
SUSPEND_SCHOOLING(2,"休学"),
|
||||
GO_ABROAD(3,"出国"),
|
||||
STUDY_ABROAD(4,"留学"),
|
||||
RESUME_SCHOOLING(5,"复学"),
|
||||
STOP_SCHOOLING(6,"停学"),
|
||||
VOLUNTARY_RETREAT_SCHOOLING(7,"自愿退学"),
|
||||
VOLUNTARY_REPEAT_GRADE(8,"自愿留级"),
|
||||
VOLUNTARY_DROP_GRADE(9,"自愿降级"),
|
||||
ELSE(99,"其他");
|
||||
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
StuAbnormalStatus(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<StuAbnormalStatus> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(StuAbnormalStatus.class));
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
public static Map<Integer, StuAbnormalStatus> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(StuAbnormalStatus::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (StuAbnormalStatus type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (StuAbnormalStatus type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static StuAbnormalStatus getById(int id)
|
||||
{
|
||||
for (StuAbnormalStatus na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user