|
@@ -188,25 +188,39 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(makeOrder.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(makeOrder.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(MakeOrderSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(MakeOrderSimpleInfo.ID_FIELD, String.valueOf(makeOrder.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeOrderSimpleInfo.CODE_FIELD, makeOrder.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(MakeOrderSimpleInfo.DATE_FIELD, makeOrder.getDate().getTime(), Store.YES));
|
|
|
|
|
- if (!StringUtils.isEmpty(makeOrder.getEnd())) {
|
|
|
|
|
- document.add(new StringField(MakeOrderSimpleInfo.END_FIELD, String.valueOf(makeOrder.getEnd()), Store.YES));
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(makeOrder.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ makeOrder.getCode(), Store.YES));
|
|
|
|
|
+ // TODO 暂时将未结案的设为0,以后在数据源头进行处理
|
|
|
|
|
+ if (makeOrder.getEnd() != null) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.END_FIELD),
|
|
|
|
|
+ String.valueOf(makeOrder.getEnd()), Store.YES));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.END_FIELD),
|
|
|
|
|
+ String.valueOf(0), Store.YES));
|
|
|
}
|
|
}
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(MakeOrderSimpleInfo.STATUS_FIELD, String.valueOf(makeOrder.getStatus()), Store.YES));
|
|
|
|
|
- // vend和product以json的格式存储
|
|
|
|
|
- document.add(new TextField(MakeOrderSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(makeOrder.getEnterprise()), Store.YES));
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.STATUS_FIELD),
|
|
|
|
|
+ String.valueOf(makeOrder.getStatus()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ makeOrder.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // enterprise、vend和orderItems以json的格式存储
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(MakeOrderSimpleInfo.VEND_FIELD, JSONObject.toJSONString(makeOrder.getVend()), Store.YES));
|
|
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.ENTERPRISE_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeOrder.getEnterprise()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeOrder.getVend()), Store.YES));
|
|
|
if (makeOrder.getProduct() != null) {
|
|
if (makeOrder.getProduct() != null) {
|
|
|
- document.add(new TextField(MakeOrderSimpleInfo.PRODUCT_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(makeOrder.getProduct()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderSimpleInfo.PRODUCT_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeOrder.getProduct()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -225,20 +239,26 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcAccept.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purcAccept.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseAcceptSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseAcceptSimpleInfo.ID_FIELD, String.valueOf(purcAccept.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseAcceptSimpleInfo.CODE_FIELD, purcAccept.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseAcceptSimpleInfo.DATE_FIELD, purcAccept.getDate().getTime(), Store.YES));
|
|
|
|
|
- // vend和product以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseAcceptSimpleInfo.VEND_FIELD, JSONObject.toJSONString(purcAccept.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseAcceptSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcAccept.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcAccept.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcAccept.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcAccept.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(purcAccept.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(purcAccept.getEnterprise()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purcAccept.getAcceptItems())) {
|
|
if (!CollectionUtils.isEmpty(purcAccept.getAcceptItems())) {
|
|
|
- document.add(new TextField(PurchaseAcceptSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purcAccept.getAcceptItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcAccept.getAcceptItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -259,23 +279,29 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(saleQuotation.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(saleQuotation.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(SaleQuotationSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(saleQuotation.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(saleQuotation.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ saleQuotation.getDate().getTime(), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(SaleQuotationSimpleInfo.ID_FIELD, String.valueOf(saleQuotation.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleQuotationSimpleInfo.CODE_FIELD, saleQuotation.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(SaleQuotationSimpleInfo.DATE_FIELD, saleQuotation.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new StringField(SaleQuotationSimpleInfo.STATUS_FIELD, String.valueOf(saleQuotation.getStatus()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleQuotationSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.STATUS_FIELD),
|
|
|
|
|
+ String.valueOf(saleQuotation.getStatus()), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(saleQuotation.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(saleQuotation.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(saleQuotation.getEnterprise()), Store.YES));
|
|
|
- // vend和product以json的格式存储
|
|
|
|
|
- document.add(new TextField(SaleQuotationSimpleInfo.VEND_FIELD, JSONObject.toJSONString(saleQuotation.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
if (!CollectionUtils.isEmpty(saleQuotation.getSaleQuotationItems())) {
|
|
if (!CollectionUtils.isEmpty(saleQuotation.getSaleQuotationItems())) {
|
|
|
- document.add(new TextField(SaleQuotationSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(saleQuotation.getSaleQuotationItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, SaleQuotationSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(saleQuotation.getSaleQuotationItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -294,21 +320,24 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purchapbill.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purchapbill.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseApbillSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
- // 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
|
|
- // doc)无法根据id进行更新
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purchapbill.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchapbill.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purchapbill.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purchapbill.getVend()), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(PurchaseApbillSimpleInfo.ID_FIELD, String.valueOf(purchapbill.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseApbillSimpleInfo.CODE_FIELD, purchapbill.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseApbillSimpleInfo.DATE_FIELD, purchapbill.getDate().getTime(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseApbillSimpleInfo.VEND_FIELD, JSONObject.toJSONString(purchapbill.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseApbillSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(purchapbill.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(purchapbill.getEnterprise()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purchapbill.getItems())) {
|
|
if (!CollectionUtils.isEmpty(purchapbill.getItems())) {
|
|
|
- document.add(new TextField(PurchaseApbillSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purchapbill.getItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseApbillSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purchapbill.getItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -328,21 +357,29 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purchBadin.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purchBadin.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseBadinSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseBadinSimpleInfo.ID_FIELD, String.valueOf(purchBadin.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseBadinSimpleInfo.CODE_FIELD, purchBadin.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseBadinSimpleInfo.DATE_FIELD, purchBadin.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseBadinSimpleInfo.SENDCODE_FIELD, purchBadin.getSendCode(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseBadinSimpleInfo.VEND_FIELD, JSONObject.toJSONString(purchBadin.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseBadinSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purchBadin.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchBadin.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purchBadin.getDate().getTime(), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchBadin.getSendCode()), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purchBadin.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(purchBadin.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(purchBadin.getEnterprise()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purchBadin.getBadInItems())) {
|
|
if (!CollectionUtils.isEmpty(purchBadin.getBadInItems())) {
|
|
|
- document.add(new TextField(PurchaseBadinSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purchBadin.getBadInItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purchBadin.getBadInItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -362,22 +399,29 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purchaseBadout.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purchaseBadout.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseBadoutSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseBadout.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseBadout.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purchaseBadout.getDate().getTime(), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(PurchaseBadoutSimpleInfo.ID_FIELD, String.valueOf(purchaseBadout.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseBadoutSimpleInfo.CODE_FIELD, purchaseBadout.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseBadoutSimpleInfo.DATE_FIELD, purchaseBadout.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseBadoutSimpleInfo.SENDCODE_FIELD, purchaseBadout.getSendCode(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseBadoutSimpleInfo.VEND_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseBadout.getSendCode()), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.VEND_FIELD),
|
|
|
JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
|
|
JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
|
|
|
- document.add(new TextField(PurchaseBadoutSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(purchaseBadout.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(purchaseBadout.getEnterprise()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purchaseBadout.getBadOutItems())) {
|
|
if (!CollectionUtils.isEmpty(purchaseBadout.getBadOutItems())) {
|
|
|
- document.add(new TextField(PurchaseBadoutSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purchaseBadout.getBadOutItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purchaseBadout.getBadOutItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -395,19 +439,26 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purchaseForecast.getVend().getEnName())) {
|
|
|| StringUtils.isEmpty(purchaseForecast.getVend().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseForecastSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseForecastSimpleInfo.ID_FIELD, String.valueOf(purchaseForecast.getId()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseForecastSimpleInfo.CODE_FIELD, purchaseForecast.getCode(), Store.YES));
|
|
|
|
|
document.add(
|
|
document.add(
|
|
|
- new LongField(PurchaseForecastSimpleInfo.DATE_FIELD, purchaseForecast.getDate().getTime(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseForecastSimpleInfo.VEND_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseForecastSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseForecast.getId()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseForecastSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseForecast.getCode()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseForecastSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purchaseForecast.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseForecastSimpleInfo.VEND_FIELD),
|
|
|
JSONObject.toJSONString(purchaseForecast.getVend()), Store.YES));
|
|
JSONObject.toJSONString(purchaseForecast.getVend()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purchaseForecast.getForecastItems())) {
|
|
if (!CollectionUtils.isEmpty(purchaseForecast.getForecastItems())) {
|
|
|
- document.add(new TextField(PurchaseForecastSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurchaseForecastSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(purchaseForecast.getForecastItems()), Store.YES));
|
|
JSONObject.toJSONString(purchaseForecast.getForecastItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -426,18 +477,23 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcInquiry.getDate())) {
|
|
|| StringUtils.isEmpty(purcInquiry.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseInquirySimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(PurchaseInquirySimpleInfo.ID_FIELD, String.valueOf(purcInquiry.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseInquirySimpleInfo.CODE_FIELD, purcInquiry.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseInquirySimpleInfo.DATE_FIELD, purcInquiry.getDate().getTime(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- document.add(new TextField(PurchaseInquirySimpleInfo.VEND_FIELD, JSONObject.toJSONString(purcInquiry.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquirySimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcInquiry.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquirySimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcInquiry.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquirySimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcInquiry.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquirySimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcInquiry.getVend()), Store.YES));
|
|
|
if (!CollectionUtils.isEmpty(purcInquiry.getInquiryItems())) {
|
|
if (!CollectionUtils.isEmpty(purcInquiry.getInquiryItems())) {
|
|
|
- document.add(new TextField(PurchaseForecastSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseInquirySimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(purcInquiry.getInquiryItems()), Store.YES));
|
|
JSONObject.toJSONString(purcInquiry.getInquiryItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -457,26 +513,34 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcMrb.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purcMrb.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseMrbSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseMrbSimpleInfo.ID_FIELD, String.valueOf(purcMrb.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseMrbSimpleInfo.CODE_FIELD, purcMrb.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseMrbSimpleInfo.DATE_FIELD, purcMrb.getDate().getTime(), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(PurchaseMrbSimpleInfo.VEND_FIELD, JSONObject.toJSONString(purcMrb.getVend()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseMrbSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcMrb.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcMrb.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcMrb.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcMrb.getVend()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSONObject.toJSONString(purcMrb.getEnterprise()), Store.YES));
|
|
JSONObject.toJSONString(purcMrb.getEnterprise()), Store.YES));
|
|
|
- if (purcMrb.getBadIn() != null) {
|
|
|
|
|
- document.add(new TextField(PurchaseMrbSimpleInfo.ITEMS_FIELD, JSONObject.toJSONString(purcMrb.getBadIn()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- }
|
|
|
|
|
if (purcMrb.getOrderItem() != null) {
|
|
if (purcMrb.getOrderItem() != null) {
|
|
|
- document.add(new TextField(PurchaseMrbSimpleInfo.BADITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(purcMrb.getOrderItem()), Store.YES));
|
|
JSONObject.toJSONString(purcMrb.getOrderItem()), Store.YES));
|
|
|
}
|
|
}
|
|
|
|
|
+ if (purcMrb.getBadIn() != null) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseMrbSimpleInfo.BADITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcMrb.getBadIn()), Store.YES));
|
|
|
|
|
+ }
|
|
|
return document;
|
|
return document;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -493,24 +557,33 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcChanges.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purcChanges.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseChangesSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(PurchaseChangesSimpleInfo.ID_FIELD, String.valueOf(purcChanges.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseChangesSimpleInfo.CODE_FIELD, purcChanges.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseChangesSimpleInfo.DATE_FIELD, purcChanges.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseChangesSimpleInfo.ORDERCODE_FIELD, purcChanges.getOrderCode(), Store.YES));
|
|
|
|
|
- document.add(new StringField(PurchaseChangesSimpleInfo.STATUS_FIELD, String.valueOf(purcChanges.getStatus()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseChangesSimpleInfo.VEND_FIELD, JSON.toJSONString(purcChanges.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseChangesSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
- JSON.toJSONString(purcChanges.getEnterprise()), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (purcChanges.getOrderChangeItems() != null) {
|
|
|
|
|
- document.add(new TextField(PurchaseChangesSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purcChanges.getOrderChangeItems()), Store.YES));
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcChanges.getId()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.STATUS_FIELD),
|
|
|
|
|
+ String.valueOf(purcChanges.getStatus()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcChanges.getCode()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.ORDERCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcChanges.getOrderCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcChanges.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcChanges.getVend()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.ENTERPRISE_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcChanges.getEnterprise()), Store.YES));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(purcChanges.getOrderChangeItems())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseChangesSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcChanges.getOrderChangeItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -528,24 +601,29 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcProofing.getDate())) {
|
|
|| StringUtils.isEmpty(purcProofing.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseProofingSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
document.add(
|
|
document.add(
|
|
|
- new StringField(PurchaseProofingSimpleInfo.ID_FIELD, String.valueOf(purcProofing.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseProofingSimpleInfo.CODE_FIELD, purcProofing.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseProofingSimpleInfo.DATE_FIELD, purcProofing.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseProofingSimpleInfo.VEND_FIELD, JSON.toJSONString(purcProofing.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (purcProofing.getProofingItems() != null) {
|
|
|
|
|
- document.add(new TextField(PurchaseProofingSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purcProofing.getProofingItems()), Store.YES));
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcProofing.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcProofing.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcProofing.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcProofing.getVend()), Store.YES));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(purcProofing.getProofingItems())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.ITEMS_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcProofing.getProofingItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (purcProofing.getProduct() != null) {
|
|
|
|
|
- document.add(new TextField(PurchaseProofingSimpleInfo.PRODUCT_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purcProofing.getProduct()), Store.YES));
|
|
|
|
|
|
|
+ if (null != purcProofing.getProduct()) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseProofingSimpleInfo.PRODUCT_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcProofing.getProduct()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -565,21 +643,30 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|| StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseReturnSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseReturnSimpleInfo.ID_FIELD, String.valueOf(purcReturn.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseReturnSimpleInfo.CODE_FIELD, purcReturn.getCode(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseReturnSimpleInfo.SENDCODE_FIELD, purcReturn.getSendCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseReturnSimpleInfo.DATE_FIELD, purcReturn.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseReturnSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
- JSON.toJSONString(purcReturn.getEnterprise()), Store.YES));
|
|
|
|
|
- document.add(
|
|
|
|
|
- new TextField(PurchaseReturnSimpleInfo.VEND_FIELD, JSON.toJSONString(purcReturn.getVend()), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (purcReturn.getReturnItems() != null) {
|
|
|
|
|
- document.add(new TextField(PurchaseReturnSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
- JSONObject.toJSONString(purcReturn.getReturnItems()), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcReturn.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcReturn.getCode()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcReturn.getSendCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcReturn.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(purcReturn.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(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),
|
|
|
|
|
+ JSONObject.toJSONString(purcReturn.getReturnItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -599,22 +686,27 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(makeAccept.getDate())) {
|
|
|| StringUtils.isEmpty(makeAccept.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(MakeAcceptSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(MakeAcceptSimpleInfo.ID_FIELD, String.valueOf(makeAccept.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeAcceptSimpleInfo.CODE_FIELD, makeAccept.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(MakeAcceptSimpleInfo.DATE_FIELD, makeAccept.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeAcceptSimpleInfo.ENTERPRISE_FIELD, JSON.toJSONString(makeAccept.getEnterprise()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- if (!StringUtils.isEmpty(makeAccept.getSendCode())) {
|
|
|
|
|
- document.add(new TextField(MakeAcceptSimpleInfo.SENDCODE_FIELD, makeAccept.getSendCode(), Store.YES));
|
|
|
|
|
- }
|
|
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(MakeAcceptSimpleInfo.VEND_FIELD, JSON.toJSONString(makeAccept.getVend()), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (makeAccept.getAcceptItems() != null) {
|
|
|
|
|
- document.add(new TextField(MakeAcceptSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(makeAccept.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(makeAccept.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(makeAccept.getSendCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ makeAccept.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeAccept.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.ENTERPRISE_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeAccept.getEnterprise()), Store.YES));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(makeAccept.getAcceptItems())) {
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeAcceptSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(makeAccept.getAcceptItems()), Store.YES));
|
|
JSONObject.toJSONString(makeAccept.getAcceptItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -628,22 +720,28 @@ public class ObjectToDocumentUtils {
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(MakeChangesSimpleInfo makeChanges) {
|
|
public static Document toDocument(MakeChangesSimpleInfo makeChanges) {
|
|
|
if (makeChanges == null || makeChanges.getId() == null || StringUtils.isEmpty(makeChanges.getCode())
|
|
if (makeChanges == null || makeChanges.getId() == null || StringUtils.isEmpty(makeChanges.getCode())
|
|
|
- || makeChanges.getVend() == null || makeChanges.getVend().getUu() == null
|
|
|
|
|
- || StringUtils.isEmpty(makeChanges.getVend().getEnName())
|
|
|
|
|
|
|
+ || makeChanges.getEnterprise() == null || makeChanges.getEnterprise().getUu() == null
|
|
|
|
|
+ || StringUtils.isEmpty(makeChanges.getEnterprise().getEnName())
|
|
|
|| StringUtils.isEmpty(makeChanges.getDate())) {
|
|
|| StringUtils.isEmpty(makeChanges.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(MakeChangesSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(MakeChangesSimpleInfo.ID_FIELD, String.valueOf(makeChanges.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeChangesSimpleInfo.CODE_FIELD, makeChanges.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(MakeChangesSimpleInfo.DATE_FIELD, makeChanges.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeChangesSimpleInfo.ENTERPRISE_FIELD, JSON.toJSONString(makeChanges.getVend()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (makeChanges.getOrderChangeItems() != null) {
|
|
|
|
|
- document.add(new TextField(MakeChangesSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, MakeChangesSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(makeChanges.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeChangesSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(makeChanges.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, MakeChangesSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ makeChanges.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeChangesSimpleInfo.ENTERPRISE_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeChanges.getEnterprise()), Store.YES));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(makeChanges.getOrderChangeItems())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeChangesSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(makeChanges.getOrderChangeItems()), Store.YES));
|
|
JSONObject.toJSONString(makeChanges.getOrderChangeItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -664,22 +762,27 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(makeRetrun.getDate())) {
|
|
|| StringUtils.isEmpty(makeRetrun.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(MakeReturnSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(MakeReturnSimpleInfo.ID_FIELD, String.valueOf(makeRetrun.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(MakeReturnSimpleInfo.CODE_FIELD, makeRetrun.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(MakeReturnSimpleInfo.DATE_FIELD, makeRetrun.getDate().getTime(), Store.YES));
|
|
|
|
|
- if (!StringUtils.isEmpty(makeRetrun.getSendCode())) {
|
|
|
|
|
- document.add(new TextField(MakeReturnSimpleInfo.SENDCODE_FIELD, makeRetrun.getSendCode(), Store.YES));
|
|
|
|
|
- }
|
|
|
|
|
- document.add(new TextField(MakeReturnSimpleInfo.ENTERPRISE_FIELD, JSON.toJSONString(makeRetrun.getEnterprise()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(MakeReturnSimpleInfo.VEND_FIELD, JSON.toJSONString(makeRetrun.getVend()), Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (makeRetrun.getReturnItems() != null) {
|
|
|
|
|
- document.add(new TextField(MakeReturnSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(makeRetrun.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(makeRetrun.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(makeRetrun.getSendCode()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ makeRetrun.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeRetrun.getVend()), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.ENTERPRISE_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(makeRetrun.getEnterprise()), Store.YES));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(makeRetrun.getReturnItems())) {
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, MakeReturnSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(makeRetrun.getReturnItems()), Store.YES));
|
|
JSONObject.toJSONString(makeRetrun.getReturnItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -700,21 +803,26 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(saleSend.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(saleSend.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(SaleSendSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(SaleSendSimpleInfo.ID_FIELD, String.valueOf(saleSend.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleSendSimpleInfo.CODE_FIELD, saleSend.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(SaleSendSimpleInfo.DATE_FIELD, saleSend.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleSendSimpleInfo.ENTERPRISE_FIELD, JSON.toJSONString(saleSend.getEnterprise()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleSendSimpleInfo.VEND_FIELD, JSON.toJSONString(saleSend.getVend()), Store.YES));
|
|
|
|
|
- document.add(new StringField(SaleSendSimpleInfo.STATUS_FIELD, String.valueOf(saleSend.getVerifystatus()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- // vend和orderItems以json的格式存储
|
|
|
|
|
- if (saleSend.getSendItems() != null) {
|
|
|
|
|
- document.add(new TextField(SaleSendSimpleInfo.ITEMS_FIELD, JSONObject.toJSONString(saleSend.getSendItems()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(saleSend.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ String.valueOf(saleSend.getCode()), Store.YES));
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.STATUS_FIELD),
|
|
|
|
|
+ String.valueOf(saleSend.getVerifystatus()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ saleSend.getDate().getTime(), Store.YES));
|
|
|
|
|
+ // vend和items以json的格式存储
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSONObject.toJSONString(saleSend.getVend()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(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));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
|
}
|
|
}
|
|
@@ -734,29 +842,34 @@ public class ObjectToDocumentUtils {
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseNoticeSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurchaseNoticeSimpleInfo.ID_FIELD, String.valueOf(purcNotice.getId()), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurchaseNoticeSimpleInfo.DATE_FIELD, purcNotice.getDate().getTime(), Store.YES));
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcNotice.getId()), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.DATE_FIELD), purcNotice.getDate().getTime(), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(PurchaseNoticeSimpleInfo.VEND_FIELD, JSON.toJSONString(purcNotice.getVend()), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurchaseNoticeSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.VEND_FIELD), JSON.toJSONString(purcNotice.getVend()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSON.toJSONString(purcNotice.getEnterprise()), Store.YES));
|
|
JSON.toJSONString(purcNotice.getEnterprise()), Store.YES));
|
|
|
- document.add(new StringField(PurchaseNoticeSimpleInfo.STATUS_FIELD, String.valueOf(purcNotice.getStatus()),
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.STATUS_FIELD), String.valueOf(purcNotice.getStatus()),
|
|
|
Store.YES));
|
|
Store.YES));
|
|
|
- document.add(new StringField(PurchaseNoticeSimpleInfo.ISWAITING_FIELD, String.valueOf(purcNotice.getWaiting()),
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ISWAITING_FIELD), String.valueOf(purcNotice.getWaiting()),
|
|
|
Store.YES));
|
|
Store.YES));
|
|
|
// 是否结案,如果为空录入为未结案
|
|
// 是否结案,如果为空录入为未结案
|
|
|
if (purcNotice.getEnd() != null) {
|
|
if (purcNotice.getEnd() != null) {
|
|
|
- document.add(new StringField(PurchaseNoticeSimpleInfo.END_FIELD, String.valueOf(purcNotice.getEnd()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.END_FIELD),
|
|
|
|
|
+ String.valueOf(purcNotice.getEnd()), Store.YES));
|
|
|
} else {
|
|
} else {
|
|
|
- document.add(new StringField(PurchaseNoticeSimpleInfo.END_FIELD, String.valueOf(0), Store.YES));
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.END_FIELD),
|
|
|
|
|
+ String.valueOf(0), Store.YES));
|
|
|
}
|
|
}
|
|
|
// vend和orderItems以json的格式存储
|
|
// vend和orderItems以json的格式存储
|
|
|
if (purcNotice.getOrderItem() != null) {
|
|
if (purcNotice.getOrderItem() != null) {
|
|
|
- document.add(new TextField(PurchaseNoticeSimpleInfo.ORDERITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseNoticeSimpleInfo.ORDERITEMS_FIELD),
|
|
|
JSONObject.toJSONString(purcNotice.getOrderItem()), Store.YES));
|
|
JSONObject.toJSONString(purcNotice.getOrderItem()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -779,28 +892,39 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcProofingapproval.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purcProofingapproval.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingapprovalSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurcProofingapprovalSimpleInfo.ID_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.ID_FIELD),
|
|
|
String.valueOf(purcProofingapproval.getId()), Store.YES));
|
|
String.valueOf(purcProofingapproval.getId()), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(PurcProofingapprovalSimpleInfo.CODE_FIELD, purcProofingapproval.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(PurcProofingapprovalSimpleInfo.DATE_FIELD, purcProofingapproval.getDate().getTime(),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.PRODCODE_FIELD, purcProofingapproval.getProdCode(),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.PRODDETAIL_FIELD,
|
|
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getCode(), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getDate().getTime(), Store.YES));
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getProdCode(), Store.YES));
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODDETAIL_FIELD),
|
|
|
purcProofingapproval.getProdDetail(), Store.YES));
|
|
purcProofingapproval.getProdDetail(), Store.YES));
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD, purcProofingapproval.getProdSpec(),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.PSCODE_FIELD, purcProofingapproval.getPscode(),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.SSCODE_FIELD, purcProofingapproval.getSscode(),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.VEND_FIELD,
|
|
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD),
|
|
|
|
|
+ purcProofingapproval.getProdSpec(), Store.YES));
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getPscode(), Store.YES));
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getSscode(), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.VEND_FIELD),
|
|
|
JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
|
|
JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
|
|
|
- document.add(new TextField(PurcProofingapprovalSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSON.toJSONString(purcProofingapproval.getEnterprise().getEnName()), Store.YES));
|
|
JSON.toJSONString(purcProofingapproval.getEnterprise().getEnName()), Store.YES));
|
|
|
// vend和orderItems以json的格式存储
|
|
// vend和orderItems以json的格式存储
|
|
|
return document;
|
|
return document;
|
|
@@ -818,18 +942,20 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
|| StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingsendSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(PurcProofingsendSimpleInfo.ID_FIELD, String.valueOf(purcProofingsend.getId()),
|
|
|
|
|
- Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingsendSimpleInfo.BRAND_FIELD, purcProofingsend.getBrand(), Store.YES));
|
|
|
|
|
document.add(
|
|
document.add(
|
|
|
- new LongField(PurcProofingsendSimpleInfo.DATE_FIELD, purcProofingsend.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(new TextField(PurcProofingsendSimpleInfo.CODE_FIELD, purcProofingsend.getCode(), Store.YES));
|
|
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(purcProofingsend.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD), purcProofingsend.getBrand(), Store.YES));
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD), purcProofingsend.getDate().getTime(), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.CODE_FIELD), purcProofingsend.getCode(), Store.YES));
|
|
|
// vend和orderItems以json的格式存储
|
|
// vend和orderItems以json的格式存储
|
|
|
if (purcProofingsend.getProofingItem() != null) {
|
|
if (purcProofingsend.getProofingItem() != null) {
|
|
|
- document.add(new TextField(PurcProofingsendSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(purcProofingsend.getProofingItem()), Store.YES));
|
|
JSONObject.toJSONString(purcProofingsend.getProofingItem()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|
|
@@ -895,23 +1021,32 @@ public class ObjectToDocumentUtils {
|
|
|
|| StringUtils.isEmpty(saleArcheck.getVendor().getEnName())) {
|
|
|| StringUtils.isEmpty(saleArcheck.getVendor().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ Table_name tableName = ClassAndTableNameUtils.toTableName(SaleArcheckSimpleInfo.class);
|
|
|
Document document = new Document();
|
|
Document document = new Document();
|
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
// 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
- document.add(new StringField(SaleArcheckSimpleInfo.ID_FIELD, String.valueOf(saleArcheck.getId()), Store.YES));
|
|
|
|
|
- document.add(new TextField(SaleArcheckSimpleInfo.CODE_FIELD, saleArcheck.getCode(), Store.YES));
|
|
|
|
|
- document.add(new LongField(SaleArcheckSimpleInfo.DATE_FIELD, saleArcheck.getDate().getTime(), Store.YES));
|
|
|
|
|
|
|
+ document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.ID_FIELD),
|
|
|
|
|
+ String.valueOf(saleArcheck.getId()), Store.YES));
|
|
|
|
|
+ document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.CODE_FIELD),
|
|
|
|
|
+ saleArcheck.getCode(), Store.YES));
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ saleArcheck.getDate().getTime(), Store.YES));
|
|
|
if (null != saleArcheck.getStatus()) {
|
|
if (null != saleArcheck.getStatus()) {
|
|
|
- document.add(new StringField(SaleArcheckSimpleInfo.STATUS_FIELD, String.valueOf(saleArcheck.getStatus()),
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new StringField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.STATUS_FIELD),
|
|
|
|
|
+ String.valueOf(saleArcheck.getStatus()),
|
|
|
Store.YES));
|
|
Store.YES));
|
|
|
}
|
|
}
|
|
|
- document.add(new TextField(SaleArcheckSimpleInfo.ENTERPRISE_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.ENTERPRISE_FIELD),
|
|
|
JSON.toJSONString(saleArcheck.getEnterprise()), Store.YES));
|
|
JSON.toJSONString(saleArcheck.getEnterprise()), Store.YES));
|
|
|
document.add(
|
|
document.add(
|
|
|
- new TextField(SaleArcheckSimpleInfo.VEND_FIELD, JSON.toJSONString(saleArcheck.getVendor()), Store.YES));
|
|
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.VEND_FIELD),
|
|
|
|
|
+ JSON.toJSONString(saleArcheck.getVendor()), Store.YES));
|
|
|
// vend和orderItems以json的格式存储
|
|
// vend和orderItems以json的格式存储
|
|
|
if (saleArcheck.getItems() != null) {
|
|
if (saleArcheck.getItems() != null) {
|
|
|
- document.add(new TextField(SaleArcheckSimpleInfo.ITEMS_FIELD,
|
|
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new TextField(ClassAndTableNameUtils.combineField(tableName, SaleArcheckSimpleInfo.ITEMS_FIELD),
|
|
|
JSONObject.toJSONString(saleArcheck.getItems()), Store.YES));
|
|
JSONObject.toJSONString(saleArcheck.getItems()), Store.YES));
|
|
|
}
|
|
}
|
|
|
return document;
|
|
return document;
|