Просмотр исходного кода

消息转docement时加入排序字段

dongbw 9 лет назад
Родитель
Сommit
e50d4de055

+ 98 - 88
search-console-b2b/src/main/java/com/uas/search/console/b2b/util/ObjectToDocumentUtils.java

@@ -182,9 +182,9 @@ public class ObjectToDocumentUtils {
 		document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseOrderSimpleInfo.DATE_FIELD),
 				purchaseOrder.getDate().getTime(), Store.YES));
 		// enterprise、vend和orderItems以json的格式存储
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseOrderSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purchaseOrder.getEnterprise()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseOrderSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purchaseOrder.getEnterprise()), Store.YES));
 		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseOrderSimpleInfo.VEND_FIELD),
 				JSONObject.toJSONString(purchaseOrder.getVend()), Store.YES));
 		if (!CollectionUtils.isEmpty(purchaseOrder.getOrderItems())) {
@@ -241,8 +241,9 @@ public class ObjectToDocumentUtils {
 		document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.DATE_FIELD),
 				makeOrder.getDate().getTime(), Store.YES));
 		// enterprise、vend和orderItems以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.ENTERPRISE_FIELD),
-				JSONObject.toJSONString(makeOrder.getEnterprise()), Store.YES));
+		document.add(
+				new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.ENTERPRISE_FIELD),
+						JSONObject.toJSONString(makeOrder.getEnterprise()), Store.YES));
 		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.VEND_FIELD),
 				JSONObject.toJSONString(makeOrder.getVend()), Store.YES));
 		if (makeOrder.getProduct() != null) {
@@ -292,11 +293,12 @@ public class ObjectToDocumentUtils {
 							purcAccept.getDate().getTime(), Store.YES));
 		}
 		// vend和items以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.VEND_FIELD),
-				JSONObject.toJSONString(purcAccept.getVend()), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purcAccept.getEnterprise()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.VEND_FIELD),
+						JSONObject.toJSONString(purcAccept.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purcAccept.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(purcAccept.getAcceptItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ITEMS_FIELD),
@@ -345,9 +347,9 @@ public class ObjectToDocumentUtils {
 		// vend和items以json的格式存储
 		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.VEND_FIELD),
 				JSONObject.toJSONString(saleQuotation.getVend()), Store.YES));
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(saleQuotation.getEnterprise()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(saleQuotation.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(saleQuotation.getSaleQuotationItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ITEMS_FIELD),
@@ -386,11 +388,12 @@ public class ObjectToDocumentUtils {
 		document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.DATE_FIELD),
 				purchapbill.getDate().getTime(), Store.YES));
 		// vend和items以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.VEND_FIELD),
-				JSONObject.toJSONString(purchapbill.getVend()), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purchapbill.getEnterprise()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.VEND_FIELD),
+						JSONObject.toJSONString(purchapbill.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purchapbill.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(purchapbill.getItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ITEMS_FIELD),
@@ -442,9 +445,9 @@ public class ObjectToDocumentUtils {
 		// vend和items以json的格式存储
 		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.VEND_FIELD),
 				JSONObject.toJSONString(purchBadin.getVend()), Store.YES));
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purchBadin.getEnterprise()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purchBadin.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(purchBadin.getBadInItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ITEMS_FIELD),
@@ -494,11 +497,12 @@ public class ObjectToDocumentUtils {
 					String.valueOf(purchaseBadout.getSendCode()), Store.YES));
 		}
 		// vend和items以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.VEND_FIELD),
-				JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purchaseBadout.getEnterprise()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.VEND_FIELD),
+						JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purchaseBadout.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(purchaseBadout.getBadOutItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ITEMS_FIELD),
@@ -561,8 +565,6 @@ public class ObjectToDocumentUtils {
 		return document;
 	}
 
-
-
 	/**
 	 * PurchaseMrbSimpleInfo对象转为Document
 	 * 
@@ -645,8 +647,9 @@ public class ObjectToDocumentUtils {
 		document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.DATE_FIELD),
 				purcChanges.getDate().getTime(), Store.YES));
 		// vend和items以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.VEND_FIELD),
-				JSONObject.toJSONString(purcChanges.getVend()), Store.YES));
+		document.add(
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.VEND_FIELD),
+						JSONObject.toJSONString(purcChanges.getVend()), Store.YES));
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.ENTERPRISE_FIELD),
 				JSONObject.toJSONString(purcChanges.getEnterprise()), Store.YES));
@@ -688,9 +691,9 @@ public class ObjectToDocumentUtils {
 				ClassAndTableNameUtils.combineField(tableName, PurchaseProofingItemSimpleInfo.STATUS_FIELD),
 				String.valueOf(purcProofingItem.getStatus()), Store.YES));
 		// vend和items以json的格式存储
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingItemSimpleInfo.VEND_FIELD),
-						JSONObject.toJSONString(purcProofingItem.getEnterprise()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseProofingItemSimpleInfo.VEND_FIELD),
+				JSONObject.toJSONString(purcProofingItem.getEnterprise()), Store.YES));
 		if (purcProofingItem.getProofing() != null) {
 			document.add(new TextField(
 					ClassAndTableNameUtils.combineField(tableName, PurchaseProofingItemSimpleInfo.PROOFING_FIELD),
@@ -736,11 +739,12 @@ public class ObjectToDocumentUtils {
 							purcReturn.getDate().getTime(), Store.YES));
 		}
 		// vend和items以json的格式存储
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.VEND_FIELD),
-				JSONObject.toJSONString(purcReturn.getVend()), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ENTERPRISE_FIELD),
-						JSONObject.toJSONString(purcReturn.getEnterprise()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.VEND_FIELD),
+						JSONObject.toJSONString(purcReturn.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ENTERPRISE_FIELD),
+				JSONObject.toJSONString(purcReturn.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(purcReturn.getReturnItems())) {
 			document.add(
 					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ITEMS_FIELD),
@@ -827,9 +831,9 @@ public class ObjectToDocumentUtils {
 				new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.CODE_FIELD),
 						String.valueOf(makeChangeItems.getOrderCode()), Store.YES));
 		// vend和items以json的格式存储
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.VEND_FIELD),
-						JSONObject.toJSONString(makeChangeItems.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.VEND_FIELD),
+				JSONObject.toJSONString(makeChangeItems.getVend()), Store.YES));
 		if (!StringUtils.isEmpty(makeChangeItems.getProduct())) {
 			document.add(new TextField(
 					ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.PRODUCT_FIELD),
@@ -927,8 +931,9 @@ public class ObjectToDocumentUtils {
 		// vend和items以json的格式存储
 		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.VEND_FIELD),
 				JSONObject.toJSONString(saleSend.getVend()), Store.YES));
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ENTERPRISE_FIELD),
-				JSONObject.toJSONString(saleSend.getEnterprise()), Store.YES));
+		document.add(
+				new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ENTERPRISE_FIELD),
+						JSONObject.toJSONString(saleSend.getEnterprise()), Store.YES));
 		if (!CollectionUtils.isEmpty(saleSend.getSendItems())) {
 			document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ITEMS_FIELD),
 					JSONObject.toJSONString(saleSend.getSendItems()), Store.YES));
@@ -967,11 +972,12 @@ public class ObjectToDocumentUtils {
 				String.valueOf(purcNotice.getId()), Store.YES));
 		document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.DATE_FIELD),
 				purcNotice.getDate().getTime(), Store.YES));
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.VEND_FIELD),
-				JSON.toJSONString(purcNotice.getVend()), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ENTERPRISE_FIELD),
-						JSON.toJSONString(purcNotice.getEnterprise()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.VEND_FIELD),
+						JSON.toJSONString(purcNotice.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ENTERPRISE_FIELD),
+				JSON.toJSONString(purcNotice.getEnterprise()), Store.YES));
 		document.add(
 				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.STATUS_FIELD),
 						String.valueOf(purcNotice.getStatus()), Store.YES));
@@ -1059,9 +1065,9 @@ public class ObjectToDocumentUtils {
 					purcProofingapproval.getSscode(), Store.YES));
 		}
 		// vend和orderItems以json的格式存储
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.VEND_FIELD),
-						JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.VEND_FIELD),
+				JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.ENTERPRISE_FIELD),
 				JSON.toJSONString(purcProofingapproval.getEnterprise().getEnName()), Store.YES));
@@ -1164,8 +1170,9 @@ public class ObjectToDocumentUtils {
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurchaseApCheckSimpleInfo.ENTERPRISE_FIELD),
 				JSON.toJSONString(purcApcheck.getEnterprise()), Store.YES));
-		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApCheckSimpleInfo.VEND_FIELD),
-				JSON.toJSONString(purcApcheck.getVendor()), Store.YES));
+		document.add(
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApCheckSimpleInfo.VEND_FIELD),
+						JSON.toJSONString(purcApcheck.getVendor()), Store.YES));
 		// vend和orderItems以json的格式存储
 		if (purcApcheck.getItems() != null) {
 			document.add(
@@ -1263,9 +1270,9 @@ public class ObjectToDocumentUtils {
 					ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryItemSimpleInfo.OVERDUE_FIELD),
 					String.valueOf(inquiryItem.getOverdue()), Store.YES));
 		}
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryItemSimpleInfo.VEND_FIELD),
-						JSON.toJSONString(inquiryItem.getEnterprise()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryItemSimpleInfo.VEND_FIELD),
+				JSON.toJSONString(inquiryItem.getEnterprise()), Store.YES));
 		if (inquiryItem.getInquiry() != null) {
 			document.add(new TextField(
 					ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryItemSimpleInfo.INQUIRY_FIELD),
@@ -1342,12 +1349,12 @@ public class ObjectToDocumentUtils {
 					ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.VALID_FIELD),
 					String.valueOf(inquiryMould.getValid()), Store.YES));
 		}
-		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.VEND_FIELD),
-						JSON.toJSONString(inquiryMould.getVend()), Store.YES));
+		document.add(new StringField(
+				ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.VEND_FIELD),
+				JSON.toJSONString(inquiryMould.getVend()), Store.YES));
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.ENTERPRISE_FIELD),
-						JSON.toJSONString(inquiryMould.getEnterprise()), Store.YES));
+				JSON.toJSONString(inquiryMould.getEnterprise()), Store.YES));
 		if (inquiryMould.getMouldItems() != null) {
 			document.add(new TextField(
 					ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.ITEMS_FIELD),
@@ -1422,8 +1429,9 @@ public class ObjectToDocumentUtils {
 						enterprise.getEnName(), Store.YES));
 		if (null != enterprise.getEnShortname()) {
 			document.add(new StringField(
-				ClassAndTableNameUtils.combineField(tableName, EnterpriseSearchSimpleInfo.SHORTNAME_FIELD),
-				enterprise.getEnShortname(), Store.YES));}
+					ClassAndTableNameUtils.combineField(tableName, EnterpriseSearchSimpleInfo.SHORTNAME_FIELD),
+					enterprise.getEnShortname(), Store.YES));
+		}
 		if (null != enterprise.getEnAdminuu()) {
 			document.add(new StringField(
 					ClassAndTableNameUtils.combineField(tableName, EnterpriseSearchSimpleInfo.ADMINUU_FIELD),
@@ -1530,8 +1538,7 @@ public class ObjectToDocumentUtils {
 				enterprise.getEnuu()));
 		return document;
 	}
-	
-	
+
 	public static Document toDocument(ProductComponentSimpleInfo prodComp) {
 		if (prodComp == null || prodComp.getId() == null) {
 			return null;
@@ -1641,7 +1648,7 @@ public class ObjectToDocumentUtils {
 				ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.ID_FIELD), depOrder.getId()));
 		return document;
 	}
-	
+
 	/**
 	 * 将PurcahseTenderSimplInfo转换为Document
 	 * 
@@ -1649,36 +1656,35 @@ public class ObjectToDocumentUtils {
 	 * @return
 	 */
 	public static Document toDocument(PurchaseTenderSimpleInfo tender) {
-		if (tender == null || tender.getId() == null || tender.getCode() == null ||tender.getProdCode() == null
-				|| tender.getProdTitle() == null || tender.getStatus() == null || tender.getIfOpen() == null  || tender.getIsPublish() == null) {
+		if (tender == null || tender.getId() == null || tender.getCode() == null || tender.getProdCode() == null
+				|| tender.getProdTitle() == null || tender.getStatus() == null || tender.getIfOpen() == null
+				|| tender.getIsPublish() == null) {
 			return null;
 		}
 		Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseTenderSimpleInfo.class);
 		Document document = new Document();
 		// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
 		// doc)无法根据id进行更新
+		document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ID_FIELD),
+				String.valueOf(tender.getId()), Store.YES));
+		document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.CODE_FIELD),
+				tender.getCode(), Store.YES));
 		document.add(
-				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ID_FIELD),
-						String.valueOf(tender.getId()), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.CURRENCY_FIELD),
+						tender.getCurrency(), Store.YES));
 		document.add(
-				new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.CODE_FIELD),
-						tender.getCode(), Store.YES));
-		document.add(new StringField(
-				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.CURRENCY_FIELD),
-				tender.getCurrency(), Store.YES));
-		document.add(new StringField(
-				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.STATUS_FIELD),
-				tender.getStatus(), Store.YES));
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.STATUS_FIELD),
+						tender.getStatus(), Store.YES));
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ISPUBLISH_FIELD),
 				String.valueOf(tender.getIsPublish()), Store.YES));
-		document.add(new StringField(
-				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.IFOPEN_FIELD),
-				String.valueOf(tender.getIfOpen()), Store.YES));
+		document.add(
+				new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.IFOPEN_FIELD),
+						String.valueOf(tender.getIfOpen()), Store.YES));
 		if (null != tender.getDate()) {
-			document.add(new LongField(
-					ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.DATE_FIELD),
-					Long.valueOf(tender.getDate().getTime()), Store.YES));
+			document.add(
+					new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.DATE_FIELD),
+							Long.valueOf(tender.getDate().getTime()), Store.YES));
 		}
 		if (null != tender.getEndDate()) {
 			document.add(new LongField(
@@ -1696,9 +1702,9 @@ public class ObjectToDocumentUtils {
 					String.valueOf(tender.getCertificate()), Store.YES));
 		}
 		if (null != tender.getUser()) {
-			document.add(new StringField(
-					ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.USER_FIELD),
-					tender.getUser(), Store.YES));
+			document.add(
+					new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.USER_FIELD),
+							tender.getUser(), Store.YES));
 		}
 		if (null != tender.getUserTel()) {
 			document.add(new StringField(
@@ -1726,13 +1732,13 @@ public class ObjectToDocumentUtils {
 					tender.getShipAddress(), Store.YES));
 		}
 		if (null != tender.getPayment()) {
-			document.add(
-					new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.PAYMENT_FIELD),
-							tender.getPayment(), Store.YES));
+			document.add(new TextField(
+					ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.PAYMENT_FIELD),
+					tender.getPayment(), Store.YES));
 		}
 		document.add(new StringField(
 				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ENTERPRISE_FIELD),
-						JSON.toJSONString(tender.getEnterprise()), Store.YES));
+				JSON.toJSONString(tender.getEnterprise()), Store.YES));
 		if (tender.getTenderItems() != null) {
 			document.add(new StringField(
 					ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ITEMS_FIELD),
@@ -1748,11 +1754,10 @@ public class ObjectToDocumentUtils {
 					ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.RESULT_FIELD),
 					String.valueOf(tender.getResult()), Store.YES));
 		}
-		
+
 		// 排序字段
 		document.add(new NumericDocValuesField(
-				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ID_FIELD),
-				tender.getId()));
+				ClassAndTableNameUtils.combineField(tableName, PurchaseTenderSimpleInfo.ID_FIELD), tender.getId()));
 		return document;
 	}
 
@@ -1814,6 +1819,11 @@ public class ObjectToDocumentUtils {
 					JSONObject.toJSONString(pagingReleaseDetail.getPagingRelease()), Store.YES));
 		}
 
+		// 排序字段
+		document.add(new NumericDocValuesField(
+				ClassAndTableNameUtils.combineField(tableName, PagingReleaseDetailSimpleInfo.ID_FIELD),
+				pagingReleaseDetail.getId()));
+
 		return document;
 	}
 }