|
@@ -93,8 +93,6 @@ public class ObjectToDocumentUtils {
|
|
|
return toDocument((PurcProofingapprovalSimpleInfo) object);
|
|
return toDocument((PurcProofingapprovalSimpleInfo) object);
|
|
|
} else if (object instanceof PurcProofingsendSimpleInfo) {
|
|
} else if (object instanceof PurcProofingsendSimpleInfo) {
|
|
|
return toDocument((PurcProofingsendSimpleInfo) object);
|
|
return toDocument((PurcProofingsendSimpleInfo) object);
|
|
|
- } else if (object instanceof PurcProofingsendSimpleInfo) {
|
|
|
|
|
- return toDocument((PurcProofingsendSimpleInfo) object);
|
|
|
|
|
} else if (object instanceof SaleArcheckSimpleInfo) {
|
|
} else if (object instanceof SaleArcheckSimpleInfo) {
|
|
|
return toDocument((SaleArcheckSimpleInfo) object);
|
|
return toDocument((SaleArcheckSimpleInfo) object);
|
|
|
} else if (object instanceof PurchaseApCheckSimpleInfo) {
|
|
} else if (object instanceof PurchaseApCheckSimpleInfo) {
|
|
@@ -643,9 +641,9 @@ public class ObjectToDocumentUtils {
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(PurchaseReturnSimpleInfo purcReturn) {
|
|
public static Document toDocument(PurchaseReturnSimpleInfo purcReturn) {
|
|
|
if (purcReturn == null || purcReturn.getId() == null || StringUtils.isEmpty(purcReturn.getCode())
|
|
if (purcReturn == null || purcReturn.getId() == null || StringUtils.isEmpty(purcReturn.getCode())
|
|
|
- || StringUtils.isEmpty(purcReturn.getSendCode()) || purcReturn.getVend() == null
|
|
|
|
|
- || purcReturn.getVend().getUu() == null || StringUtils.isEmpty(purcReturn.getVend().getEnName())
|
|
|
|
|
- || purcReturn.getEnterprise() == null || purcReturn.getEnterprise().getUu() == null
|
|
|
|
|
|
|
+ || purcReturn.getVend() == null || purcReturn.getVend().getUu() == null
|
|
|
|
|
+ || StringUtils.isEmpty(purcReturn.getVend().getEnName()) || purcReturn.getEnterprise() == null
|
|
|
|
|
+ || purcReturn.getEnterprise().getUu() == null
|
|
|
|| StringUtils.isEmpty(purcReturn.getEnterprise().getEnName())
|
|
|| StringUtils.isEmpty(purcReturn.getEnterprise().getEnName())
|
|
|
|| StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|| StringUtils.isEmpty(purcReturn.getDate())) {
|
|
|
return null;
|
|
return null;
|
|
@@ -656,11 +654,13 @@ public class ObjectToDocumentUtils {
|
|
|
// doc)无法根据id进行更新
|
|
// doc)无法根据id进行更新
|
|
|
document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ID_FIELD),
|
|
document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ID_FIELD),
|
|
|
String.valueOf(purcReturn.getId()), Store.YES));
|
|
String.valueOf(purcReturn.getId()), Store.YES));
|
|
|
|
|
+ if (purcReturn.getSendCode() != null) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
+ String.valueOf(purcReturn.getSendCode()), Store.YES));
|
|
|
|
|
+ }
|
|
|
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 TextField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.SENDCODE_FIELD),
|
|
|
|
|
- String.valueOf(purcReturn.getSendCode()), Store.YES));
|
|
|
|
|
document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD),
|
|
document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD),
|
|
|
purcReturn.getDate().getTime(), Store.YES));
|
|
purcReturn.getDate().getTime(), Store.YES));
|
|
|
// vend和items以json的格式存储
|
|
// vend和items以json的格式存储
|
|
@@ -801,9 +801,8 @@ public class ObjectToDocumentUtils {
|
|
|
public static Document toDocument(SaleSendSimpleInfo saleSend) {
|
|
public static Document toDocument(SaleSendSimpleInfo saleSend) {
|
|
|
if (saleSend == null || saleSend.getId() == null || StringUtils.isEmpty(saleSend.getCode())
|
|
if (saleSend == null || saleSend.getId() == null || StringUtils.isEmpty(saleSend.getCode())
|
|
|
|| saleSend.getVend() == null || saleSend.getVend().getUu() == null
|
|
|| saleSend.getVend() == null || saleSend.getVend().getUu() == null
|
|
|
- || StringUtils.isEmpty(saleSend.getDate()) || saleSend.getVerifystatus() == null
|
|
|
|
|
- || StringUtils.isEmpty(saleSend.getVend().getEnName()) || saleSend.getEnterprise() == null
|
|
|
|
|
- || saleSend.getEnterprise().getUu() == null
|
|
|
|
|
|
|
+ || saleSend.getVerifystatus() == null || StringUtils.isEmpty(saleSend.getVend().getEnName())
|
|
|
|
|
+ || saleSend.getEnterprise() == null || saleSend.getEnterprise().getUu() == null
|
|
|
|| StringUtils.isEmpty(saleSend.getEnterprise().getEnName())) {
|
|
|| StringUtils.isEmpty(saleSend.getEnterprise().getEnName())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -817,8 +816,10 @@ public class ObjectToDocumentUtils {
|
|
|
String.valueOf(saleSend.getCode()), Store.YES));
|
|
String.valueOf(saleSend.getCode()), Store.YES));
|
|
|
document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.STATUS_FIELD),
|
|
document.add(new StringField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.STATUS_FIELD),
|
|
|
String.valueOf(saleSend.getVerifystatus()), Store.YES));
|
|
String.valueOf(saleSend.getVerifystatus()), Store.YES));
|
|
|
- document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.DATE_FIELD),
|
|
|
|
|
- saleSend.getDate().getTime(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(saleSend.getDate())) {
|
|
|
|
|
+ document.add(new LongField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ saleSend.getDate().getTime(), Store.YES));
|
|
|
|
|
+ }
|
|
|
// vend和items以json的格式存储
|
|
// vend和items以json的格式存储
|
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.VEND_FIELD),
|
|
document.add(new TextField(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.VEND_FIELD),
|
|
|
JSONObject.toJSONString(saleSend.getVend()), Store.YES));
|
|
JSONObject.toJSONString(saleSend.getVend()), Store.YES));
|
|
@@ -894,8 +895,8 @@ public class ObjectToDocumentUtils {
|
|
|
if (purcProofingapproval == null || purcProofingapproval.getId() == null
|
|
if (purcProofingapproval == null || purcProofingapproval.getId() == null
|
|
|
|| purcProofingapproval.getProdCode() == null || purcProofingapproval.getProdDetail() == null
|
|
|| purcProofingapproval.getProdCode() == null || purcProofingapproval.getProdDetail() == null
|
|
|
|| purcProofingapproval.getProdSpec() == null || purcProofingapproval.getPscode() == null
|
|
|| purcProofingapproval.getProdSpec() == null || purcProofingapproval.getPscode() == null
|
|
|
- || purcProofingapproval.getSscode() == null || purcProofingapproval.getVend() == null
|
|
|
|
|
- || purcProofingapproval.getVend().getUu() == null || StringUtils.isEmpty(purcProofingapproval.getDate())
|
|
|
|
|
|
|
+ || 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())) {
|
|
@@ -926,9 +927,11 @@ public class ObjectToDocumentUtils {
|
|
|
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));
|
|
|
- document.add(new TextField(
|
|
|
|
|
- ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD),
|
|
|
|
|
- purcProofingapproval.getSscode(), Store.YES));
|
|
|
|
|
|
|
+ if (purcProofingapproval.getSscode() != null) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getSscode(), Store.YES));
|
|
|
|
|
+ }
|
|
|
document.add(
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.VEND_FIELD),
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.VEND_FIELD),
|
|
|
JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
|
|
JSON.toJSONString(purcProofingapproval.getVend().getEnName()), Store.YES));
|
|
@@ -947,8 +950,8 @@ public class ObjectToDocumentUtils {
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(PurcProofingsendSimpleInfo purcProofingsend) {
|
|
public static Document toDocument(PurcProofingsendSimpleInfo purcProofingsend) {
|
|
|
if (purcProofingsend == null || purcProofingsend.getId() == null
|
|
if (purcProofingsend == null || purcProofingsend.getId() == null
|
|
|
- || StringUtils.isEmpty(purcProofingsend.getBrand()) || StringUtils.isEmpty(purcProofingsend.getCode())
|
|
|
|
|
- || StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
|
|
|
|
|
+ || StringUtils.isEmpty(purcProofingsend.getBrand())
|
|
|
|
|
+ || StringUtils.isEmpty(purcProofingsend.getCode())) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingsendSimpleInfo.class);
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingsendSimpleInfo.class);
|
|
@@ -961,9 +964,11 @@ public class ObjectToDocumentUtils {
|
|
|
document.add(
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD),
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD),
|
|
|
purcProofingsend.getBrand(), Store.YES));
|
|
purcProofingsend.getBrand(), Store.YES));
|
|
|
- document.add(
|
|
|
|
|
- new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD),
|
|
|
|
|
- purcProofingsend.getDate().getTime(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
|
|
|
+ document.add(
|
|
|
|
|
+ new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD),
|
|
|
|
|
+ purcProofingsend.getDate().getTime(), Store.YES));
|
|
|
|
|
+ }
|
|
|
document.add(
|
|
document.add(
|
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.CODE_FIELD),
|
|
new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.CODE_FIELD),
|
|
|
purcProofingsend.getCode(), Store.YES));
|
|
purcProofingsend.getCode(), Store.YES));
|