|
@@ -915,7 +915,6 @@ 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.getPscode() == null
|
|
|
|
|
|| purcProofingapproval.getVend() == null || purcProofingapproval.getVend().getUu() == null
|
|
|| purcProofingapproval.getVend() == null || purcProofingapproval.getVend().getUu() == null
|
|
|
|| StringUtils.isEmpty(purcProofingapproval.getVend().getEnName())
|
|
|| StringUtils.isEmpty(purcProofingapproval.getVend().getEnName())
|
|
|
|| purcProofingapproval.getEnterprise() == null || purcProofingapproval.getEnterprise().getUu() == null
|
|
|| purcProofingapproval.getEnterprise() == null || purcProofingapproval.getEnterprise().getUu() == null
|
|
@@ -953,9 +952,11 @@ public class ObjectToDocumentUtils {
|
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD),
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD),
|
|
|
purcProofingapproval.getProdSpec(), Store.YES));
|
|
purcProofingapproval.getProdSpec(), Store.YES));
|
|
|
}
|
|
}
|
|
|
- document.add(new TextField(
|
|
|
|
|
- ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD),
|
|
|
|
|
- purcProofingapproval.getPscode(), Store.YES));
|
|
|
|
|
|
|
+ if (purcProofingapproval.getPscode() != null) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD),
|
|
|
|
|
+ purcProofingapproval.getPscode(), Store.YES));
|
|
|
|
|
+ }
|
|
|
if (purcProofingapproval.getSscode() != null) {
|
|
if (purcProofingapproval.getSscode() != null) {
|
|
|
document.add(new TextField(
|
|
document.add(new TextField(
|
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD),
|
|
ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD),
|
|
@@ -978,9 +979,7 @@ public class ObjectToDocumentUtils {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public static Document toDocument(PurcProofingsendSimpleInfo purcProofingsend) {
|
|
public static Document toDocument(PurcProofingsendSimpleInfo purcProofingsend) {
|
|
|
- if (purcProofingsend == null || purcProofingsend.getId() == null
|
|
|
|
|
- || StringUtils.isEmpty(purcProofingsend.getBrand())
|
|
|
|
|
- || StringUtils.isEmpty(purcProofingsend.getCode())) {
|
|
|
|
|
|
|
+ if (purcProofingsend == null || purcProofingsend.getId() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingsendSimpleInfo.class);
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(PurcProofingsendSimpleInfo.class);
|
|
@@ -990,17 +989,21 @@ public class ObjectToDocumentUtils {
|
|
|
document.add(
|
|
document.add(
|
|
|
new StringField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ID_FIELD),
|
|
new StringField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ID_FIELD),
|
|
|
String.valueOf(purcProofingsend.getId()), Store.YES));
|
|
String.valueOf(purcProofingsend.getId()), Store.YES));
|
|
|
- document.add(
|
|
|
|
|
- new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD),
|
|
|
|
|
- purcProofingsend.getBrand(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purcProofingsend.getBrand())) {
|
|
|
|
|
+ document.add(new TextField(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD),
|
|
|
|
|
+ purcProofingsend.getBrand(), Store.YES));
|
|
|
|
|
+ }
|
|
|
if (!StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
if (!StringUtils.isEmpty(purcProofingsend.getDate())) {
|
|
|
document.add(
|
|
document.add(
|
|
|
new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD),
|
|
new LongField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD),
|
|
|
purcProofingsend.getDate().getTime(), Store.YES));
|
|
purcProofingsend.getDate().getTime(), Store.YES));
|
|
|
}
|
|
}
|
|
|
- document.add(
|
|
|
|
|
- new TextField(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.CODE_FIELD),
|
|
|
|
|
- purcProofingsend.getCode(), Store.YES));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(purcProofingsend.getCode())) {
|
|
|
|
|
+ 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(
|
|
document.add(new TextField(
|