mirror of
				https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
				synced 2025-11-01 02:46:19 +08:00 
			
		
		
		
	| @@ -18,10 +18,6 @@ | ||||
| package love.sola.netsupport.pojo; | ||||
|  | ||||
| import com.google.gson.annotations.Expose; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import lombok.ToString; | ||||
|  | ||||
| import javax.persistence.Column; | ||||
| import javax.persistence.Entity; | ||||
| @@ -31,17 +27,16 @@ import javax.persistence.Table; | ||||
| /** | ||||
|  * @author Sola {@literal <dev@sola.love>} | ||||
|  */ | ||||
|  | ||||
| @Data | ||||
| @ToString(exclude = "password") | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| @Entity | ||||
| @Table(name = "operators") | ||||
| public class Operator { | ||||
|  | ||||
| 	public static final String PROPERTY_WECHAT = "wechat"; | ||||
|  | ||||
| 	//System Accounts | ||||
| 	public static Operator USER_SELF; | ||||
| 	public static Operator ADMIN; | ||||
|  | ||||
| 	@Id | ||||
| 	@Column(name = "id", nullable = false, insertable = false, updatable = false) | ||||
| 	private Integer id; | ||||
| @@ -57,9 +52,84 @@ public class Operator { | ||||
| 	@Expose(serialize = false) | ||||
| 	private String password; | ||||
|  | ||||
| 	public Operator(Integer id, String name, Integer access, String wechat, Integer block, Integer week, String password) { | ||||
| 		this.id = id; | ||||
| 		this.name = name; | ||||
| 		this.access = access; | ||||
| 		this.wechat = wechat; | ||||
| 		this.block = block; | ||||
| 		this.week = week; | ||||
| 		this.password = password; | ||||
| 	} | ||||
|  | ||||
| 	//System Accounts | ||||
| 	public static Operator USER_SELF; | ||||
| 	public static Operator ADMIN; | ||||
| 	public Operator() { | ||||
| 	} | ||||
|  | ||||
| 	public Integer getId() { | ||||
| 		return id; | ||||
| 	} | ||||
|  | ||||
| 	public void setId(Integer id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
|  | ||||
| 	public String getName() { | ||||
| 		return name; | ||||
| 	} | ||||
|  | ||||
| 	public void setName(String name) { | ||||
| 		this.name = name; | ||||
| 	} | ||||
|  | ||||
| 	public Integer getAccess() { | ||||
| 		return access; | ||||
| 	} | ||||
|  | ||||
| 	public void setAccess(Integer access) { | ||||
| 		this.access = access; | ||||
| 	} | ||||
|  | ||||
| 	public String getWechat() { | ||||
| 		return wechat; | ||||
| 	} | ||||
|  | ||||
| 	public void setWechat(String wechat) { | ||||
| 		this.wechat = wechat; | ||||
| 	} | ||||
|  | ||||
| 	public Integer getBlock() { | ||||
| 		return block; | ||||
| 	} | ||||
|  | ||||
| 	public void setBlock(Integer block) { | ||||
| 		this.block = block; | ||||
| 	} | ||||
|  | ||||
| 	public Integer getWeek() { | ||||
| 		return week; | ||||
| 	} | ||||
|  | ||||
| 	public void setWeek(Integer week) { | ||||
| 		this.week = week; | ||||
| 	} | ||||
|  | ||||
| 	public String getPassword() { | ||||
| 		return password; | ||||
| 	} | ||||
|  | ||||
| 	public void setPassword(String password) { | ||||
| 		this.password = password; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String toString() { | ||||
| 		return "Operator{" + | ||||
| 				"id=" + id + | ||||
| 				", name='" + name + '\'' + | ||||
| 				", access=" + access + | ||||
| 				", wechat='" + wechat + '\'' + | ||||
| 				", block=" + block + | ||||
| 				", week=" + week + | ||||
| 				'}'; | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -17,9 +17,6 @@ | ||||
|  | ||||
| package love.sola.netsupport.pojo; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import love.sola.netsupport.sql.TableTicket; | ||||
| import org.hibernate.envers.Audited; | ||||
| import org.hibernate.envers.RelationTargetAuditMode; | ||||
| @@ -30,32 +27,119 @@ import java.util.Date; | ||||
| /** | ||||
|  * @author Sola {@literal <dev@sola.love>} | ||||
|  */ | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| @Entity | ||||
| @Table(name = "tickets") | ||||
| @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) | ||||
| public class Ticket { | ||||
|  | ||||
| 	public static final String PROPERTY_USER = "user"; | ||||
| 	public static final String PROPERTY_STATUS = "status"; | ||||
| 	public static final String PROPERTY_SUBMIT_TIME = "submitTime"; | ||||
|     public static final String PROPERTY_USER = "user"; | ||||
|     public static final String PROPERTY_STATUS = "status"; | ||||
|     public static final String PROPERTY_SUBMIT_TIME = "submitTime"; | ||||
|  | ||||
| 	@Id | ||||
| 	@GeneratedValue(strategy = GenerationType.IDENTITY) | ||||
| 	private Integer id; | ||||
| 	@ManyToOne(optional = false) | ||||
| 	@JoinColumn(name = TableTicket.COLUMN_SID) | ||||
| 	private User user; | ||||
| 	private String description; | ||||
| 	@Column(name = TableTicket.COLUMN_SUBMIT_TIME, insertable = false, updatable = false) | ||||
| 	private Date submitTime; | ||||
| 	private String remark; | ||||
| 	private Date updateTime; | ||||
| 	@ManyToOne(optional = true) | ||||
| 	@JoinColumn(name = TableTicket.COLUMN_OPSID) | ||||
| 	private Operator operator; | ||||
| 	private Integer status; | ||||
|     @Id | ||||
|     @GeneratedValue(strategy = GenerationType.IDENTITY) | ||||
|     private Integer id; | ||||
|     @ManyToOne(optional = false) | ||||
|     @JoinColumn(name = TableTicket.COLUMN_SID) | ||||
|     private User user; | ||||
|     private String description; | ||||
|     @Column(name = TableTicket.COLUMN_SUBMIT_TIME, insertable = false, updatable = false) | ||||
|     private Date submitTime; | ||||
|     private String remark; | ||||
|     private Date updateTime; | ||||
|     @ManyToOne(optional = true) | ||||
|     @JoinColumn(name = TableTicket.COLUMN_OPSID) | ||||
|     private Operator operator; | ||||
|     private Integer status; | ||||
|  | ||||
|     public Ticket() { | ||||
|     } | ||||
|  | ||||
|     public Ticket(User user, String description, Date submitTime, String remark, Date updateTime, Operator operator, Integer status) { | ||||
|         this.user = user; | ||||
|         this.description = description; | ||||
|         this.submitTime = submitTime; | ||||
|         this.remark = remark; | ||||
|         this.updateTime = updateTime; | ||||
|         this.operator = operator; | ||||
|         this.status = status; | ||||
|     } | ||||
|  | ||||
|     public Integer getId() { | ||||
|         return id; | ||||
|     } | ||||
|  | ||||
|     public void setId(Integer id) { | ||||
|         this.id = id; | ||||
|     } | ||||
|  | ||||
|     public User getUser() { | ||||
|         return user; | ||||
|     } | ||||
|  | ||||
|     public void setUser(User user) { | ||||
|         this.user = user; | ||||
|     } | ||||
|  | ||||
|     public String getDescription() { | ||||
|         return description; | ||||
|     } | ||||
|  | ||||
|     public void setDescription(String description) { | ||||
|         this.description = description; | ||||
|     } | ||||
|  | ||||
|     public Date getSubmitTime() { | ||||
|         return submitTime; | ||||
|     } | ||||
|  | ||||
|     public void setSubmitTime(Date submitTime) { | ||||
|         this.submitTime = submitTime; | ||||
|     } | ||||
|  | ||||
|     public String getRemark() { | ||||
|         return remark; | ||||
|     } | ||||
|  | ||||
|     public void setRemark(String remark) { | ||||
|         this.remark = remark; | ||||
|     } | ||||
|  | ||||
|     public Date getUpdateTime() { | ||||
|         return updateTime; | ||||
|     } | ||||
|  | ||||
|     public void setUpdateTime(Date updateTime) { | ||||
|         this.updateTime = updateTime; | ||||
|     } | ||||
|  | ||||
|     public Operator getOperator() { | ||||
|         return operator; | ||||
|     } | ||||
|  | ||||
|     public void setOperator(Operator operator) { | ||||
|         this.operator = operator; | ||||
|     } | ||||
|  | ||||
|     public Integer getStatus() { | ||||
|         return status; | ||||
|     } | ||||
|  | ||||
|     public void setStatus(Integer status) { | ||||
|         this.status = status; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return "Ticket{" + | ||||
|                 "id=" + id + | ||||
|                 ", user=" + user + | ||||
|                 ", description='" + description + '\'' + | ||||
|                 ", submitTime=" + submitTime + | ||||
|                 ", remark='" + remark + '\'' + | ||||
|                 ", updateTime=" + updateTime + | ||||
|                 ", operator=" + operator + | ||||
|                 ", status=" + status + | ||||
|                 '}'; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,5 @@ | ||||
| package love.sola.netsupport.pojo; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.annotations.ColumnDefault; | ||||
| import org.hibernate.annotations.DynamicInsert; | ||||
|  | ||||
| @@ -12,29 +9,97 @@ import java.util.Date; | ||||
| /** | ||||
|  * @author Sola {@literal <dev@sola.love>} | ||||
|  */ | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| @Entity | ||||
| @Table(name = "toolschk", indexes = { | ||||
| 		@Index(columnList = "block,chktime,status"), | ||||
| 		@Index(columnList = "chktime,status") | ||||
|         @Index(columnList = "block,chktime,status"), | ||||
|         @Index(columnList = "chktime,status") | ||||
| }) | ||||
| @DynamicInsert | ||||
| public class ToolsCheck { | ||||
|  | ||||
| 	@Id | ||||
| 	@GeneratedValue(strategy = GenerationType.IDENTITY) | ||||
| 	private Integer id; | ||||
| 	@ManyToOne(optional = false) | ||||
| 	@JoinColumn(name = "opsid", nullable = false) | ||||
| 	private Operator operator; | ||||
| 	@Column(nullable = false) | ||||
| 	private Integer block; | ||||
| 	@Column(name = "chktime", nullable = false) | ||||
| 	private Date checkTime = new Date(); | ||||
| 	@ColumnDefault("0") | ||||
| 	private Integer status = 0; | ||||
| 	private String remark; | ||||
|     @Id | ||||
|     @GeneratedValue(strategy = GenerationType.IDENTITY) | ||||
|     private Integer id; | ||||
|     @ManyToOne(optional = false) | ||||
|     @JoinColumn(name = "opsid", nullable = false) | ||||
|     private Operator operator; | ||||
|     @Column(nullable = false) | ||||
|     private Integer block; | ||||
|     @Column(name = "chktime", nullable = false) | ||||
|     private Date checkTime = new Date(); | ||||
|     @ColumnDefault("0") | ||||
|     private Integer status = 0; | ||||
|     private String remark; | ||||
|  | ||||
|  | ||||
|     public ToolsCheck() { | ||||
|     } | ||||
|  | ||||
|     public ToolsCheck(Operator operator, Integer block, Date checkTime, Integer status, String remark) { | ||||
|         this.operator = operator; | ||||
|         this.block = block; | ||||
|         this.checkTime = checkTime; | ||||
|         this.status = status; | ||||
|         this.remark = remark; | ||||
|     } | ||||
|  | ||||
|     public Integer getId() { | ||||
|         return id; | ||||
|     } | ||||
|  | ||||
|     public void setId(Integer id) { | ||||
|         this.id = id; | ||||
|     } | ||||
|  | ||||
|     public Operator getOperator() { | ||||
|         return operator; | ||||
|     } | ||||
|  | ||||
|     public void setOperator(Operator operator) { | ||||
|         this.operator = operator; | ||||
|     } | ||||
|  | ||||
|     public Integer getBlock() { | ||||
|         return block; | ||||
|     } | ||||
|  | ||||
|     public void setBlock(Integer block) { | ||||
|         this.block = block; | ||||
|     } | ||||
|  | ||||
|     public Date getCheckTime() { | ||||
|         return checkTime; | ||||
|     } | ||||
|  | ||||
|     public void setCheckTime(Date checkTime) { | ||||
|         this.checkTime = checkTime; | ||||
|     } | ||||
|  | ||||
|     public Integer getStatus() { | ||||
|         return status; | ||||
|     } | ||||
|  | ||||
|     public void setStatus(Integer status) { | ||||
|         this.status = status; | ||||
|     } | ||||
|  | ||||
|     public String getRemark() { | ||||
|         return remark; | ||||
|     } | ||||
|  | ||||
|     public void setRemark(String remark) { | ||||
|         this.remark = remark; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return "ToolsCheck{" + | ||||
|                 "id=" + id + | ||||
|                 ", operator=" + operator + | ||||
|                 ", block=" + block + | ||||
|                 ", checkTime=" + checkTime + | ||||
|                 ", status=" + status + | ||||
|                 ", remark='" + remark + '\'' + | ||||
|                 '}'; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -18,9 +18,6 @@ | ||||
| package love.sola.netsupport.pojo; | ||||
|  | ||||
| import com.google.gson.annotations.Expose; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import love.sola.netsupport.enums.ISP; | ||||
| import love.sola.netsupport.enums.ISPConverter; | ||||
|  | ||||
| @@ -29,37 +26,124 @@ import javax.persistence.*; | ||||
| /** | ||||
|  * @author Sola {@literal <dev@sola.love>} | ||||
|  */ | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| @Entity | ||||
| @Table(name = "users") | ||||
| public class User { | ||||
|  | ||||
| 	public static final String PROPERTY_NAME = "name"; | ||||
| 	public static final String PROPERTY_WECHAT = "wechatId"; | ||||
| 	public static final String PROPERTY_BLOCK = "block"; | ||||
|     //System Accounts | ||||
|     public static User OFFICIAL_CHINA_UNICOM_XH; | ||||
|     public static User OFFICIAL_CHINA_MOBILE_XH; | ||||
|     public static User OFFICIAL_CHINA_MOBILE_FX; | ||||
|  | ||||
| 	@Id | ||||
| 	@Column(name = "id", updatable = false, nullable = false) | ||||
| 	private Long id; | ||||
| 	@Column(name = "name", updatable = false, nullable = false) | ||||
| 	private String name; | ||||
| 	@Convert(converter = ISPConverter.class) | ||||
| 	private ISP isp; | ||||
| 	@Column(name = "netaccount") | ||||
| 	private String netAccount; | ||||
| 	@Expose(serialize = false) | ||||
| 	@Column(name = "wechat") | ||||
| 	private String wechatId; | ||||
| 	private Integer block; | ||||
| 	private Integer room; | ||||
| 	private Long phone; | ||||
|     public static final String PROPERTY_NAME = "name"; | ||||
|     public static final String PROPERTY_WECHAT = "wechatId"; | ||||
|     public static final String PROPERTY_BLOCK = "block"; | ||||
|  | ||||
|     @Id | ||||
|     @Column(name = "id", updatable = false, nullable = false) | ||||
|     private Long id; | ||||
|     @Column(name = "name", updatable = false, nullable = false) | ||||
|     private String name; | ||||
|     @Convert(converter = ISPConverter.class) | ||||
|     private ISP isp; | ||||
|     @Column(name = "netaccount") | ||||
|     private String netAccount; | ||||
|     @Expose(serialize = false) | ||||
|     @Column(name = "wechat") | ||||
|     private String wechatId; | ||||
|     private Integer block; | ||||
|     private Integer room; | ||||
|     private Long phone; | ||||
|  | ||||
| 	//System Accounts | ||||
| 	public static User OFFICIAL_CHINA_UNICOM_XH; | ||||
| 	public static User OFFICIAL_CHINA_MOBILE_XH; | ||||
| 	public static User OFFICIAL_CHINA_MOBILE_FX; | ||||
|     public User() { | ||||
|     } | ||||
|  | ||||
|     public User(Long id, String name, ISP isp, String netAccount, String wechatId, Integer block, Integer room, Long phone) { | ||||
|         this.id = id; | ||||
|         this.name = name; | ||||
|         this.isp = isp; | ||||
|         this.netAccount = netAccount; | ||||
|         this.wechatId = wechatId; | ||||
|         this.block = block; | ||||
|         this.room = room; | ||||
|         this.phone = phone; | ||||
|     } | ||||
|  | ||||
|     public Long getId() { | ||||
|         return id; | ||||
|     } | ||||
|  | ||||
|     public void setId(Long id) { | ||||
|         this.id = id; | ||||
|     } | ||||
|  | ||||
|     public String getName() { | ||||
|         return name; | ||||
|     } | ||||
|  | ||||
|     public void setName(String name) { | ||||
|         this.name = name; | ||||
|     } | ||||
|  | ||||
|     public ISP getIsp() { | ||||
|         return isp; | ||||
|     } | ||||
|  | ||||
|     public void setIsp(ISP isp) { | ||||
|         this.isp = isp; | ||||
|     } | ||||
|  | ||||
|     public String getNetAccount() { | ||||
|         return netAccount; | ||||
|     } | ||||
|  | ||||
|     public void setNetAccount(String netAccount) { | ||||
|         this.netAccount = netAccount; | ||||
|     } | ||||
|  | ||||
|     public String getWechatId() { | ||||
|         return wechatId; | ||||
|     } | ||||
|  | ||||
|     public void setWechatId(String wechatId) { | ||||
|         this.wechatId = wechatId; | ||||
|     } | ||||
|  | ||||
|     public Integer getBlock() { | ||||
|         return block; | ||||
|     } | ||||
|  | ||||
|     public void setBlock(Integer block) { | ||||
|         this.block = block; | ||||
|     } | ||||
|  | ||||
|     public Integer getRoom() { | ||||
|         return room; | ||||
|     } | ||||
|  | ||||
|     public void setRoom(Integer room) { | ||||
|         this.room = room; | ||||
|     } | ||||
|  | ||||
|     public Long getPhone() { | ||||
|         return phone; | ||||
|     } | ||||
|  | ||||
|     public void setPhone(Long phone) { | ||||
|         this.phone = phone; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return "User{" + | ||||
|                 "id=" + id + | ||||
|                 ", name='" + name + '\'' + | ||||
|                 ", isp=" + isp + | ||||
|                 ", netAccount='" + netAccount + '\'' + | ||||
|                 ", wechatId='" + wechatId + '\'' + | ||||
|                 ", block=" + block + | ||||
|                 ", room=" + room + | ||||
|                 ", phone=" + phone + | ||||
|                 '}'; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sola
					Sola