|
@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.search.b2b.exception.SearchException;
|
|
import com.uas.search.b2b.exception.SearchException;
|
|
|
import com.uas.search.b2b.service.SearchService.Table_name;
|
|
import com.uas.search.b2b.service.SearchService.Table_name;
|
|
|
import com.uas.search.console.b2b.model.BrandSimpleInfo;
|
|
import com.uas.search.console.b2b.model.BrandSimpleInfo;
|
|
|
-import com.uas.search.console.b2b.model.DeputyOrderItemSimpleInfo;
|
|
|
|
|
import com.uas.search.console.b2b.model.DeputyOrderSimpleInfo;
|
|
import com.uas.search.console.b2b.model.DeputyOrderSimpleInfo;
|
|
|
import com.uas.search.console.b2b.model.EnterpriseSearchSimpleInfo;
|
|
import com.uas.search.console.b2b.model.EnterpriseSearchSimpleInfo;
|
|
|
import com.uas.search.console.b2b.model.EnterpriseSimpleInfo;
|
|
import com.uas.search.console.b2b.model.EnterpriseSimpleInfo;
|
|
@@ -172,40 +171,36 @@ public class DocumentToObjectUtils {
|
|
|
depOrder.setVenduseruu(Long.valueOf(document
|
|
depOrder.setVenduseruu(Long.valueOf(document
|
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSERUU_FIELD))));
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSERUU_FIELD))));
|
|
|
}
|
|
}
|
|
|
- if (null != document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CODE_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CODE_FIELD)))) {
|
|
|
depOrder.setCode(
|
|
depOrder.setCode(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CODE_FIELD)));
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CODE_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document
|
|
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.COMPANYNAME_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.COMPANYNAME_FIELD)))) {
|
|
|
depOrder.setCompanyname(document
|
|
depOrder.setCompanyname(document
|
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.COMPANYNAME_FIELD)));
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.COMPANYNAME_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document
|
|
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CUSTOMER_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CUSTOMER_FIELD)))) {
|
|
|
depOrder.setCustomer(
|
|
depOrder.setCustomer(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CUSTOMER_FIELD)));
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.CUSTOMER_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document
|
|
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.LEGALREPRESENT_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.LEGALREPRESENT_FIELD)))) {
|
|
|
depOrder.setLegalrepresent(document
|
|
depOrder.setLegalrepresent(document
|
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.LEGALREPRESENT_FIELD)));
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.LEGALREPRESENT_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document
|
|
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.TERVENDOR_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.TERVENDOR_FIELD)))) {
|
|
|
depOrder.setTervendor(document
|
|
depOrder.setTervendor(document
|
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.TERVENDOR_FIELD)));
|
|
.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.TERVENDOR_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document
|
|
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSER_FIELD))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSER_FIELD)))) {
|
|
|
depOrder.setVenduser(
|
|
depOrder.setVenduser(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSER_FIELD)));
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.VENDUSER_FIELD)));
|
|
|
}
|
|
}
|
|
|
- if (null != document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.ITEMS_FIELD))) {
|
|
|
|
|
- depOrder.setDeputyOrderItems(toSet(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, DeputyOrderSimpleInfo.ITEMS_FIELD)),
|
|
|
|
|
- DeputyOrderItemSimpleInfo.class));
|
|
|
|
|
- }
|
|
|
|
|
return depOrder;
|
|
return depOrder;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -215,17 +210,32 @@ public class DocumentToObjectUtils {
|
|
|
}
|
|
}
|
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(ProductComponentSimpleInfo.class);
|
|
Table_name tableName = ClassAndTableNameUtils.toTableName(ProductComponentSimpleInfo.class);
|
|
|
ProductComponentSimpleInfo prodComp = new ProductComponentSimpleInfo();
|
|
ProductComponentSimpleInfo prodComp = new ProductComponentSimpleInfo();
|
|
|
- prodComp.setId(Long.valueOf(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.ID_FIELD))));
|
|
|
|
|
- prodComp.setKindid(Long.valueOf(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.KINDID_FIELD))));
|
|
|
|
|
- prodComp.setCode(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.CODE_FIELD)));
|
|
|
|
|
- prodComp.setUuid(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.UUID_FIELD)));
|
|
|
|
|
- prodComp.setBrand(JSONObject.parseObject(
|
|
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.BRAND_FIELD)),
|
|
|
|
|
- BrandSimpleInfo.class));
|
|
|
|
|
|
|
+ if (null != document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.ID_FIELD))) {
|
|
|
|
|
+ prodComp.setId(Long.valueOf(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.ID_FIELD))));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (null != document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.KINDID_FIELD))) {
|
|
|
|
|
+ prodComp.setKindid(Long.valueOf(document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.KINDID_FIELD))));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.CODE_FIELD)))) {
|
|
|
|
|
+ prodComp.setCode(document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.CODE_FIELD)));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.UUID_FIELD)))) {
|
|
|
|
|
+ prodComp.setUuid(document
|
|
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.UUID_FIELD)));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!StringUtils.isEmpty(
|
|
|
|
|
+ document.get(ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.BRAND_FIELD)))) {
|
|
|
|
|
+ prodComp.setBrand(JSONObject.parseObject(
|
|
|
|
|
+ document.get(
|
|
|
|
|
+ ClassAndTableNameUtils.combineField(tableName, ProductComponentSimpleInfo.BRAND_FIELD)),
|
|
|
|
|
+ BrandSimpleInfo.class));
|
|
|
|
|
+ }
|
|
|
return prodComp;
|
|
return prodComp;
|
|
|
}
|
|
}
|
|
|
|
|
|