Files
aca-class-assign-service/src/main/java/com/yunhai/acaclassassign/entity/AssignPush.java
T
wanghu 9e83208f35
build / build-push (push) Successful in 1m29s
commit
2026-10-21 15:00:26 +08:00

61 lines
2.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.yunhai.acaclassassign.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.time.LocalDateTime;
/**
* 分班结果推送记录:每项目一条(提交分班结果 → 推送班级管理)。
* <p>推送与提交解耦:推送异常不回滚提交锁定,只影响本表状态;
* 状态机 0未推送 → 4推送中 → 1已推送 / 2部分失败 / 3失败(推送中拒绝重复 Push)。
* 重推幂等依赖被推方按 code/account 查重,本表只收敛状态与失败明细。</p>
*/
@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name = "aca_assign_push",
uniqueConstraints = @UniqueConstraint(name = "uk_apush_project", columnNames = "project_id"))
public class AssignPush extends BaseEntity {
public static final int STATUS_NONE = 0;
public static final int STATUS_OK = 1;
public static final int STATUS_PARTIAL = 2;
public static final int STATUS_FAIL = 3;
public static final int STATUS_PUSHING = 4;
/** 所属分班项目(唯一) */
@Column(name = "project_id", nullable = false)
private Integer projectId;
/** 状态:0未推送 1已推送 2部分失败 3失败 4推送中 */
@Column(name = "status", nullable = false, columnDefinition = "TINYINT DEFAULT 0")
private Integer status;
/** 最近一次推送完成时间 */
@Column(name = "push_time")
private LocalDateTime pushTime;
/** 本地班级id → 平台班级id(班级组id)映射 JSON:{"12":9901,...} */
@Column(name = "class_map_json", columnDefinition = "TEXT")
private String classMapJson;
/** 未成功学生明细 JSON:[{"studentId":1,"name":"张三","reason":"..."}](跨多次推送合并收敛) */
@Column(name = "fail_json", columnDefinition = "TEXT")
private String failJson;
/** 摘要信息(成功 N 班 M 人 / 失败原因) */
@Column(name = "msg", length = 512)
private String msg;
}