|
|
@@ -276,10 +276,16 @@ public class DocumentToObjectUtils {
|
|
|
PurcProofingsendSimpleInfo purcProofingsend = new PurcProofingsendSimpleInfo();
|
|
|
purcProofingsend.setId(Long.valueOf(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ID_FIELD))));
|
|
|
- purcProofingsend.setBrand(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD)));
|
|
|
- purcProofingsend.setDate(new Date(Long.valueOf(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD)))));
|
|
|
+ String brand = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.BRAND_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(brand)) {
|
|
|
+ purcProofingsend.setBrand(brand);
|
|
|
+ }
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purcProofingsend.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purcProofingsend.setProofingItem(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingsendSimpleInfo.ITEMS_FIELD)),
|
|
|
PurchaseProofingItemSimpleInfo.class));
|
|
|
@@ -305,18 +311,35 @@ public class DocumentToObjectUtils {
|
|
|
EnterpriseSimpleInfo.class));
|
|
|
purcProofingapproval.setCode(document
|
|
|
.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.CODE_FIELD)));
|
|
|
- purcProofingapproval.setProdCode(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODCODE_FIELD)));
|
|
|
- purcProofingapproval.setProdDetail(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODDETAIL_FIELD)));
|
|
|
- purcProofingapproval.setPscode(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD)));
|
|
|
- purcProofingapproval.setSscode(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD)));
|
|
|
- purcProofingapproval.setProdSpec(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD)));
|
|
|
- purcProofingapproval.setDate(new Date(Long.valueOf(document
|
|
|
- .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.DATE_FIELD)))));
|
|
|
+ String prodcode = document.get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(prodcode)) {
|
|
|
+ purcProofingapproval.setProdCode(prodcode);
|
|
|
+ }
|
|
|
+ String proddetail = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODDETAIL_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(proddetail)) {
|
|
|
+ purcProofingapproval.setProdDetail(proddetail);
|
|
|
+ }
|
|
|
+ String pscode = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PSCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(pscode)) {
|
|
|
+ purcProofingapproval.setPscode(pscode);
|
|
|
+ }
|
|
|
+ String sscode = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.SSCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(sscode)) {
|
|
|
+ purcProofingapproval.setSscode(sscode);
|
|
|
+ }
|
|
|
+ String prodspec = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.PRODSPEC_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(prodspec)) {
|
|
|
+ purcProofingapproval.setProdSpec(prodspec);
|
|
|
+ }
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurcProofingapprovalSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purcProofingapproval.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purcProofingapproval
|
|
|
.setEnterprise(
|
|
|
JSONObject
|
|
|
@@ -376,8 +399,10 @@ public class DocumentToObjectUtils {
|
|
|
saleSend.setId(Long
|
|
|
.valueOf(document.get(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ID_FIELD))));
|
|
|
saleSend.setCode(document.get(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.CODE_FIELD)));
|
|
|
- saleSend.setDate(new Date(Long
|
|
|
- .valueOf(document.get(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.DATE_FIELD)))));
|
|
|
+ String dateString = document.get(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ saleSend.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
saleSend.setEnterprise(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, SaleSendSimpleInfo.ENTERPRISE_FIELD)),
|
|
|
EnterpriseSimpleInfo.class));
|
|
|
@@ -503,10 +528,16 @@ public class DocumentToObjectUtils {
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ID_FIELD))));
|
|
|
purcReturn.setCode(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.CODE_FIELD)));
|
|
|
- purcReturn.setSendCode(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.SENDCODE_FIELD)));
|
|
|
- purcReturn.setDate(new Date(Long.valueOf(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD)))));
|
|
|
+ String sendcode = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.SENDCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(sendcode)) {
|
|
|
+ purcReturn.setSendCode(sendcode);
|
|
|
+ }
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purcReturn.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purcReturn.setEnterprise(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseReturnSimpleInfo.ENTERPRISE_FIELD)),
|
|
|
EnterpriseSimpleInfo.class));
|
|
|
@@ -704,8 +735,11 @@ public class DocumentToObjectUtils {
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ID_FIELD))));
|
|
|
purchaseAccept.setCode(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.CODE_FIELD)));
|
|
|
- purchaseAccept.setDate(new Date(Long.valueOf(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.DATE_FIELD)))));
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purchaseAccept.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purchaseAccept.setEnterprise(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseAcceptSimpleInfo.ENTERPRISE_FIELD)),
|
|
|
EnterpriseSimpleInfo.class));
|
|
|
@@ -764,10 +798,16 @@ public class DocumentToObjectUtils {
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ID_FIELD))));
|
|
|
purchBadin.setCode(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.CODE_FIELD)));
|
|
|
- purchBadin.setSendCode(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.SENDCODE_FIELD)));
|
|
|
- purchBadin.setDate(new Date(Long.valueOf(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.DATE_FIELD)))));
|
|
|
+ String sendcode = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.SENDCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(sendcode)) {
|
|
|
+ purchBadin.setSendCode(sendcode);
|
|
|
+ }
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purchBadin.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purchBadin.setEnterprise(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadinSimpleInfo.ENTERPRISE_FIELD)),
|
|
|
EnterpriseSimpleInfo.class));
|
|
|
@@ -796,10 +836,17 @@ public class DocumentToObjectUtils {
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ID_FIELD))));
|
|
|
purchaseBadout.setCode(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.CODE_FIELD)));
|
|
|
- purchaseBadout.setSendCode(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.SENDCODE_FIELD)));
|
|
|
- purchaseBadout.setDate(new Date(Long.valueOf(
|
|
|
- document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.DATE_FIELD)))));
|
|
|
+ String sendcode = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.SENDCODE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(sendcode)) {
|
|
|
+ purchaseBadout.setSendCode(sendcode);
|
|
|
+
|
|
|
+ }
|
|
|
+ String dateString = document
|
|
|
+ .get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.DATE_FIELD));
|
|
|
+ if (!StringUtils.isEmpty(dateString)) {
|
|
|
+ purchaseBadout.setDate(new Date(Long.valueOf(dateString)));
|
|
|
+ }
|
|
|
purchaseBadout.setEnterprise(JSONObject.parseObject(
|
|
|
document.get(ClassAndTableNameUtils.combineField(tableName, PurchaseBadoutSimpleInfo.ENTERPRISE_FIELD)),
|
|
|
EnterpriseSimpleInfo.class));
|