mirror of
				https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
				synced 2025-10-31 10:26:19 +08:00 
			
		
		
		
	fix ticket track order
This commit is contained in:
		| @@ -19,8 +19,8 @@ public class Lang { | ||||
| 	public static Map<String, MessageFormat> format_cache = new HashMap<>(32); | ||||
|  | ||||
| 	static { | ||||
| 		//noinspection unchecked | ||||
| 		InputStream in = Lang.class.getClassLoader().getResourceAsStream("lang.yml"); | ||||
| 		//noinspection unchecked | ||||
| 		messages = new Yaml().loadAs(in, Map.class); | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -7,9 +7,12 @@ import com.google.gson.stream.JsonReader; | ||||
| import com.google.gson.stream.JsonWriter; | ||||
| import love.sola.netsupport.enums.ISP; | ||||
| import org.hibernate.Hibernate; | ||||
| import org.hibernate.Session; | ||||
| import org.hibernate.SessionFactory; | ||||
| import org.hibernate.boot.MetadataSources; | ||||
| import org.hibernate.boot.registry.StandardServiceRegistryBuilder; | ||||
| import org.hibernate.envers.AuditReader; | ||||
| import org.hibernate.envers.AuditReaderFactory; | ||||
| import org.hibernate.proxy.HibernateProxy; | ||||
| import org.hibernate.service.ServiceRegistry; | ||||
|  | ||||
| @@ -76,6 +79,10 @@ public class SQLCore { | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public static AuditReader getAuditReader(Session session) { | ||||
| 		return AuditReaderFactory.get(session); | ||||
| 	} | ||||
|  | ||||
| 	public static class HibernateProxyTypeAdapter extends TypeAdapter<HibernateProxy> { | ||||
|  | ||||
| 		public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() { | ||||
|   | ||||
| @@ -8,7 +8,6 @@ import org.hibernate.criterion.Order; | ||||
| import org.hibernate.criterion.Projections; | ||||
| import org.hibernate.criterion.Restrictions; | ||||
| import org.hibernate.envers.AuditReader; | ||||
| import org.hibernate.envers.AuditReaderFactory; | ||||
| import org.hibernate.envers.query.AuditEntity; | ||||
|  | ||||
| import java.util.List; | ||||
| @@ -79,15 +78,11 @@ public class TableTicket extends SQLCore { | ||||
| 			AuditReader reader = getAuditReader(s); | ||||
| 			return reader.createQuery() | ||||
| 					.forRevisionsOfEntity(Ticket.class, false, true) | ||||
| 					.addOrder(AuditEntity.revisionNumber().desc()) | ||||
| 					.addOrder(AuditEntity.revisionNumber().asc()) | ||||
| 					.add(AuditEntity.id().eq(tid)) | ||||
| 					.getResultList() | ||||
| 					; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	protected static AuditReader getAuditReader(Session session) { | ||||
| 		return AuditReaderFactory.get(session); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sola
					Sola