parent
38f5bf39ef
commit
aa582361f8
@ -1,36 +0,0 @@
|
||||
package cn.teammodel.model.entity;
|
||||
|
||||
import com.azure.spring.data.cosmos.core.mapping.Container;
|
||||
import com.azure.spring.data.cosmos.core.mapping.GeneratedValue;
|
||||
import com.azure.spring.data.cosmos.core.mapping.PartitionKey;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2023-11-27 11:02
|
||||
*/
|
||||
@Container(containerName = "Student")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AppraiseRecord {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private String id;
|
||||
/**
|
||||
* 分区键: AppraiseRecord-{schoolId}
|
||||
*/
|
||||
@PartitionKey
|
||||
private String code;
|
||||
/**
|
||||
* 学校 Id
|
||||
*/
|
||||
private String schoolId;
|
||||
/**
|
||||
* 学段 id
|
||||
*/
|
||||
private String periodId;
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.teammodel.model.entity;
|
||||
package cn.teammodel.model.entity.appraise;
|
||||
|
||||
import cn.teammodel.model.entity.BaseItem;
|
||||
import com.azure.spring.data.cosmos.core.mapping.Container;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
@ -0,0 +1,28 @@
|
||||
package cn.teammodel.model.entity.appraise;
|
||||
|
||||
import cn.teammodel.model.entity.BaseItem;
|
||||
import com.azure.spring.data.cosmos.core.mapping.Container;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 一个学生在一个学年(学校+学年 = 分区键)的所有评价记录
|
||||
* @author winter
|
||||
* @create 2023-11-27 11:02
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Container(containerName = "Student")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AppraiseRecord extends BaseItem {
|
||||
/**
|
||||
* 学段 id
|
||||
*/
|
||||
private String periodId;
|
||||
private String studentId;
|
||||
private List<AppraiseRecordItem> nodes;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.teammodel.model.entity.appraise;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 评价项
|
||||
* @author winter
|
||||
* @create 2023-11-27 16:47
|
||||
*/
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AppraiseRecordItem {
|
||||
private String id;
|
||||
private String appraiseNodeId;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.teammodel.model.entity;
|
||||
package cn.teammodel.model.entity.appraise;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
@ -0,0 +1,26 @@
|
||||
package cn.teammodel.model.entity.school;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 学期(标记了学期的开始与结束)
|
||||
* @author winter
|
||||
* @create 2023-11-28 10:39
|
||||
*/
|
||||
@Data
|
||||
public class Semester {
|
||||
private String id;
|
||||
private String name;
|
||||
/**
|
||||
* start = 1 则代表一年开始的学期
|
||||
*/
|
||||
private Integer start;
|
||||
/**
|
||||
* 开始的月份
|
||||
*/
|
||||
private Integer month;
|
||||
/**
|
||||
* 开始的日
|
||||
*/
|
||||
private Integer day;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.teammodel.utils;
|
||||
|
||||
import cn.teammodel.model.entity.school.Semester;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学校中年级,学年,日期相关的工具类
|
||||
* @author winter
|
||||
* @create 2023-11-28 10:15
|
||||
*/
|
||||
public class SchoolDateUtil {
|
||||
|
||||
/**
|
||||
* 通过当前时间与学校的学期安排获取当前的学年
|
||||
* 学校学期:
|
||||
* <pre>
|
||||
* "semesters": [
|
||||
* {
|
||||
* "name": "下学期",
|
||||
* "start": 0,
|
||||
* "month": 3,
|
||||
* "day": 1,
|
||||
* "id": "2"
|
||||
* },
|
||||
* {
|
||||
* "name": "上学期",
|
||||
* "start": 1,
|
||||
* "month": 9,
|
||||
* "day": 1,
|
||||
* "id": "1"
|
||||
* }
|
||||
* <pre/>
|
||||
*/
|
||||
public static String getSemesterByNow(List<Semester> semesters, LocalDate date) {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue