|
@@ -395,8 +395,7 @@ public class ObjectToDocumentUtils {
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(PurchaseBadoutSimpleInfo purchaseBadout) {
|
|
public static Document toDocument(PurchaseBadoutSimpleInfo purchaseBadout) {
|
|
|
if (purchaseBadout == null || purchaseBadout.getId() == null || StringUtils.isEmpty(purchaseBadout.getCode())
|
|
if (purchaseBadout == null || purchaseBadout.getId() == null || StringUtils.isEmpty(purchaseBadout.getCode())
|
|
|
- || StringUtils.isEmpty(purchaseBadout.getSendCode()) || purchaseBadout.getVend() == null
|
|
|
|
|
- || purchaseBadout.getVend().getUu() == null || StringUtils.isEmpty(purchaseBadout.getDate())
|
|
|
|
|
|
|
+ || purchaseBadout.getVend() == null || purchaseBadout.getVend().getUu() == null
|
|
|
|| StringUtils.isEmpty(purchaseBadout.getVend().getEnName()) || purchaseBadout.getEnterprise() == null
|
|
|| StringUtils.isEmpty(purchaseBadout.getVend().getEnName()) || purchaseBadout.getEnterprise() == null
|
|
|
|| purchaseBadout.getEnterprise().getUu() == null
|
|
|| purchaseBadout.getEnterprise().getUu() == null
|
|
|
|| StringUtils.isEmpty(purchaseBadout.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purchaseBadout.getEnterprise().getEnName())) {
|
|
@@ -410,11 +409,16 @@ public class ObjectToDocumentUtils {
|
|
|
String.valueOf(purchaseBadout.getId()), Store.YES));
|
|
String.valueOf(purchaseBadout.getId()), Store.YES));
|
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.CODE_FIELD),
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.CODE_FIELD),
|
|
|
String.valueOf(purchaseBadout.getCode()), Store.YES));
|
|
String.valueOf(purchaseBadout.getCode()), Store.YES));
|
|
|
- document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.DATE_FIELD),
|
|
|
|
|
- purchaseBadout.getDate().getTime(), Store.YES));
|
|
|
|
|
- document.add(
|
|
|
|
|
- new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
- String.valueOf(purchaseBadout.getSendCode()), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purchaseBadout.getDate())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purchaseBadout.getDate().getTime(), Store.YES));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!StringUtils.isEmpty(purchaseBadout.getSendCode())) {
|
|
|
|
|
+ document.add(new StringField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purchaseBadout.getSendCode()), Store.YES));
|
|
|
|
|
+ }
|
|
|
// vend和items以json的格式存储
|
|
// vend和items以json的格式存储
|
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.VEND_FIELD),
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.VEND_FIELD),
|
|
|
JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
|
|
JSONObject.toJSONString(purchaseBadout.getVend()), Store.YES));
|
|
@@ -653,8 +657,7 @@ public class ObjectToDocumentUtils {
|
|
|
|| purcReturn.getVend() == null || purcReturn.getVend().getUu() == null
|
|
|| purcReturn.getVend() == null || purcReturn.getVend().getUu() == null
|
|
|
|| StringUtils.isEmpty(purcReturn.getVend().getEnName()) || purcReturn.getEnterprise() == null
|
|
|| StringUtils.isEmpty(purcReturn.getVend().getEnName()) || purcReturn.getEnterprise() == null
|
|
|
|| purcReturn.getEnterprise().getUu() == null
|
|
|| purcReturn.getEnterprise().getUu() == null
|
|
|
- || StringUtils.isEmpty(purcReturn.getEnterprise().getEnName())
|
|
|
|
|
- || StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|
|
|
|
|
+ || StringUtils.isEmpty(purcReturn.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseReturnSimpleInfo.class);
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurchaseReturnSimpleInfo.class);
|
|
@@ -670,8 +673,11 @@ public class ObjectToDocumentUtils {
|
|
|
}
|
|
}
|
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.CODE_FIELD),
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.CODE_FIELD),
|
|
|
String.valueOf(purcReturn.getCode()), Store.YES));
|
|
String.valueOf(purcReturn.getCode()), Store.YES));
|
|
|
- document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD),
|
|
|
|
|
- purcReturn.getDate().getTime(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcReturn.getDate().getTime(), Store.YES));
|
|
|
|
|
+ }
|
|
|
// vend和items以json的格式存储
|
|
// vend和items以json的格式存储
|
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.VEND_FIELD),
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.VEND_FIELD),
|
|
|
JSONObject.toJSONString(purcReturn.getVend()), Store.YES));
|
|
JSONObject.toJSONString(purcReturn.getVend()), Store.YES));
|
|
@@ -909,10 +915,8 @@ public class ObjectToDocumentUtils {
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(PurcProofingapprovalSimpleInfo purcProofingapproval) {
|
|
public static Document toDocument(PurcProofingapprovalSimpleInfo purcProofingapproval) {
|
|
|
if (purcProofingapproval == null || purcProofingapproval.getId() == null
|
|
if (purcProofingapproval == null || purcProofingapproval.getId() == null
|
|
|
- || purcProofingapproval.getProdCode() == null || purcProofingapproval.getProdDetail() == null
|
|
|
|
|
- || purcProofingapproval.getProdSpec() == null || purcProofingapproval.getPscode() == null
|
|
|
|
|
|
|
+ || purcProofingapproval.getPscode() == null
|
|
|
|| purcProofingapproval.getVend() == null || purcProofingapproval.getVend().getUu() == null
|
|
|| purcProofingapproval.getVend() == null || purcProofingapproval.getVend().getUu() == null
|
|
|
- || StringUtils.isEmpty(purcProofingapproval.getDate())
|
|
|
|
|
|| StringUtils.isEmpty(purcProofingapproval.getVend().getEnName())
|
|
|| StringUtils.isEmpty(purcProofingapproval.getVend().getEnName())
|
|
|
|| purcProofingapproval.getEnterprise() == null || purcProofingapproval.getEnterprise().getUu() == null
|
|
|| purcProofingapproval.getEnterprise() == null || purcProofingapproval.getEnterprise().getUu() == null
|
|
|
|| StringUtils.isEmpty(purcProofingapproval.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(purcProofingapproval.getEnterprise().getEnName())) {
|
|
@@ -928,18 +932,27 @@ public class ObjectToDocumentUtils {
|
|
|
document.add(
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.CODE_FIELD),
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.CODE_FIELD),
|
|
|
purcProofingapproval.getCode(), Store.YES));
|
|
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));
|
|
|
|
|
- document.add(new TextField(
|
|
|
|
|
- ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD),
|
|
|
|
|
- purcProofingapproval.getProdSpec(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purcProofingapproval.getDate())) {
|
|
|
|
|
+ document.add(new LongField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getDate().getTime(), Store.YES));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (purcProofingapproval.getProdCode() != null) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getProdCode(), Store.YES));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (purcProofingapproval.getProdDetail() != null) {
|
|
|
|
|
+
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODDETAIL_FIELD),
|
|
|
|
|
+ purcProofingapproval.getProdDetail(), Store.YES));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (purcProofingapproval.getProdSpec() != null) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD),
|
|
|
|
|
+ purcProofingapproval.getProdSpec(), Store.YES));
|
|
|
|
|
+ }
|
|
|
document.add(new TextField(
|
|
document.add(new TextField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD),
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD),
|
|
|
purcProofingapproval.getPscode(), Store.YES));
|
|
purcProofingapproval.getPscode(), Store.YES));
|