|
|
@@ -543,48 +543,7 @@ public class ObjectToDocumentUtils {
|
|
|
return document;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * PurchaseInquirySimpleInfo对象转为Document
|
|
|
- *
|
|
|
- * @param purcInquiry
|
|
|
- * @return 转换的Document
|
|
|
- */
|
|
|
- // public static Document toDocument(PurchaseInquirySimpleInfo purcInquiry)
|
|
|
- // {
|
|
|
- // if (purcInquiry == null || purcInquiry.getId() == null ||
|
|
|
- // StringUtils.isEmpty(purcInquiry.getCode())
|
|
|
- // || purcInquiry.getVend() == null || purcInquiry.getVend().getUu() == null
|
|
|
- // || StringUtils.isEmpty(purcInquiry.getVend().getEnName())
|
|
|
- // || StringUtils.isEmpty(purcInquiry.getDate())) {
|
|
|
- // return null;
|
|
|
- // }
|
|
|
- // Table_name tableName =
|
|
|
- // ClassAndTableNameUtils.toTableName(PurchaseInquirySimpleInfo.class);
|
|
|
- // Document document = new Document();
|
|
|
- // // 不能用LongField,否则后续实时更新索引时,方法updateDocument(new Term("", ""),
|
|
|
- // // doc)无法根据id进行更新
|
|
|
- // document.add(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())) {
|
|
|
- // document.add(
|
|
|
- // new TextField(ClassAndTableNameUtils.combineField(tableName,
|
|
|
- // PurchaseInquirySimpleInfo.ITEMS_FIELD),
|
|
|
- // JSONObject.toJSONString(purcInquiry.getInquiryItems()), Store.YES));
|
|
|
- // }
|
|
|
- // return document;
|
|
|
- // }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* PurchaseMrbSimpleInfo对象转为Document
|
|
|
@@ -827,15 +786,16 @@ public class ObjectToDocumentUtils {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 将MakeChangesSimpleInfo转换成Document
|
|
|
+ * 将MakeOrderChangeItemSimpleInfo转换成Document
|
|
|
*
|
|
|
- * @param makeChanges
|
|
|
+ * @param makeChangeItems
|
|
|
* @return
|
|
|
*/
|
|
|
- public static Document toDocument(MakeOrderChangeItemSimpleInfo makeChanges) {
|
|
|
- if (makeChanges == null || makeChanges.getId() == null || StringUtils.isEmpty(makeChanges.getOrderCode())
|
|
|
- || makeChanges.getVend() == null || makeChanges.getVend().getUu() == null
|
|
|
- || StringUtils.isEmpty(makeChanges.getVend().getEnName())) {
|
|
|
+ public static Document toDocument(MakeOrderChangeItemSimpleInfo makeChangeItems) {
|
|
|
+ if (makeChangeItems == null || makeChangeItems.getId() == null
|
|
|
+ || StringUtils.isEmpty(makeChangeItems.getOrderCode()) || makeChangeItems.getVend() == null
|
|
|
+ || makeChangeItems.getVend().getUu() == null
|
|
|
+ || StringUtils.isEmpty(makeChangeItems.getVend().getEnName())) {
|
|
|
return null;
|
|
|
}
|
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(MakeOrderChangeItemSimpleInfo.class);
|
|
|
@@ -844,28 +804,28 @@ public class ObjectToDocumentUtils {
|
|
|
// doc)无法根据id进行更新
|
|
|
document.add(
|
|
|
new StringField(ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.ID_FIELD),
|
|
|
- String.valueOf(makeChanges.getId()), Store.YES));
|
|
|
+ String.valueOf(makeChangeItems.getId()), Store.YES));
|
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.CODE_FIELD),
|
|
|
- String.valueOf(makeChanges.getOrderCode()), Store.YES));
|
|
|
+ String.valueOf(makeChangeItems.getOrderCode()), Store.YES));
|
|
|
// vend和items以json的格式存储
|
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.VEND_FIELD),
|
|
|
- JSONObject.toJSONString(makeChanges.getVend()), Store.YES));
|
|
|
- if (!StringUtils.isEmpty(makeChanges.getProduct())) {
|
|
|
+ JSONObject.toJSONString(makeChangeItems.getVend()), Store.YES));
|
|
|
+ if (!StringUtils.isEmpty(makeChangeItems.getProduct())) {
|
|
|
document.add(new TextField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.PRODUCT_FIELD),
|
|
|
- JSONObject.toJSONString(makeChanges.getProduct()), Store.YES));
|
|
|
+ JSONObject.toJSONString(makeChangeItems.getProduct()), Store.YES));
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(makeChanges.getMakeChanges())) {
|
|
|
+ if (!StringUtils.isEmpty(makeChangeItems.getMakeChanges())) {
|
|
|
document.add(new TextField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.MAKE_FIELD),
|
|
|
- JSONObject.toJSONString(makeChanges.getMakeChanges()), Store.YES));
|
|
|
+ JSONObject.toJSONString(makeChangeItems.getMakeChanges()), Store.YES));
|
|
|
}
|
|
|
// 排序字段
|
|
|
document.add(new NumericDocValuesField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, MakeOrderChangeItemSimpleInfo.ID_FIELD),
|
|
|
- makeChanges.getId()));
|
|
|
+ makeChangeItems.getId()));
|
|
|
return document;
|
|
|
}
|
|
|
|
|
|
@@ -1348,6 +1308,7 @@ public class ObjectToDocumentUtils {
|
|
|
ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.OVERDUE_FIELD),
|
|
|
String.valueOf(inquiryMould.getOverdue()), Store.YES));
|
|
|
}
|
|
|
+
|
|
|
if (null != inquiryMould.getValid()) {
|
|
|
document.add(new StringField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, PurchaseInquiryMouldSimpleInfo.VALID_FIELD),
|