|
|
@@ -3,6 +3,7 @@ package com.uas.platform.b2b.openapi.model;
|
|
|
import com.uas.platform.b2b.model.PurchaseAcceptItem;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrder;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrderItem;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.HashSet;
|
|
|
@@ -100,8 +101,10 @@ public class FxPurOrder {
|
|
|
public FxPurOrder(PurchaseOrder order,PurchaseOrderItem orderItem,PurchaseAcceptItem needAcceptItem) {
|
|
|
this.id = order.getId();
|
|
|
this.orderCode = order.getCode();
|
|
|
- this.custName = order.getReceiveName();
|
|
|
- this.custUU = order.getVendUU();
|
|
|
+ if (!StringUtils.isEmpty(order.getEnterprise())) {
|
|
|
+ this.custName = order.getEnterprise().getEnName();
|
|
|
+ }
|
|
|
+ this.custUU = order.getEnUU();
|
|
|
this.total = orderItem.getAmount();
|
|
|
this.date = order.getDate();
|
|
|
this.orderItems.add(new FxPurcOrderItem(orderItem,needAcceptItem));
|
|
|
@@ -110,8 +113,10 @@ public class FxPurOrder {
|
|
|
public FxPurOrder convert(PurchaseOrder order,Double total){
|
|
|
this.id = order.getId();
|
|
|
this.orderCode = order.getCode();
|
|
|
- this.custName = order.getReceiveName();
|
|
|
- this.custUU = order.getVendUU();
|
|
|
+ if (!StringUtils.isEmpty(order.getEnterprise())) {
|
|
|
+ this.custName = order.getEnterprise().getEnName();
|
|
|
+ }
|
|
|
+ this.custUU = order.getEnUU();
|
|
|
this.total = total;
|
|
|
this.date = order.getDate();
|
|
|
return this;
|