|
|
@@ -128,7 +128,9 @@ public class ObjectToDocumentUtils {
|
|
|
return toDocument((SaleTenderQuestionSimpleInfo) object);
|
|
|
} else if (object instanceof VendorPerformanceAssessSimpleInfo) {
|
|
|
return toDocument((VendorPerformanceAssessSimpleInfo) object);
|
|
|
- }
|
|
|
+ } else if (object instanceof ProductUsersSimpleInfo) {
|
|
|
+ return toDocument((ProductUsersSimpleInfo) object);
|
|
|
+ }
|
|
|
// TODO 其他表
|
|
|
else {
|
|
|
throw new SearchException("不支持将以下类型转换为Document:" + object.getClass().getName());
|
|
|
@@ -2365,7 +2367,7 @@ public class ObjectToDocumentUtils {
|
|
|
/**
|
|
|
* 将SaleTenderQuestionSimpleInfo转换为Document
|
|
|
*
|
|
|
- * @param saleTender
|
|
|
+ * @param saleTenderQuestionSimpleInfo
|
|
|
* @return
|
|
|
*/
|
|
|
public static Document toDocument(SaleTenderQuestionSimpleInfo saleTenderQuestionSimpleInfo) {
|
|
|
@@ -3218,4 +3220,31 @@ public class ObjectToDocumentUtils {
|
|
|
vpaSimpleInfo.getVpaApplydate().getTime()));
|
|
|
return document;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 将ProductUsersSimpleInfo转换成Document
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @param productUsersSimpleInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static Document toDocument(ProductUsersSimpleInfo productUsersSimpleInfo) {
|
|
|
+ if (productUsersSimpleInfo == null || productUsersSimpleInfo.getId() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(ProductUsersSimpleInfo.class);
|
|
|
+ Document document = new Document();
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, ProductUsersSimpleInfo.ID_FIELD),
|
|
|
+ String.valueOf(productUsersSimpleInfo.getId()), Store.YES));
|
|
|
+ if (null != productUsersSimpleInfo.getProduct()) {
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, ProductUsersSimpleInfo.PRODUCT_FIELD),
|
|
|
+ JSON.toJSONString(productUsersSimpleInfo.getProduct()), Store.YES));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 排序字段
|
|
|
+ document.add(new NumericDocValuesField(ClassAndTableNameUtils.combineField(tableName, ProductUsersSimpleInfo.ID_FIELD),
|
|
|
+ productUsersSimpleInfo.getId()));
|
|
|
+ return document;
|
|
|
+ }
|
|
|
+
|
|
|
}
|