Browse Source

Merge branch 'master' of http://192.168.0.200:3000/wanglang/trade-platform

wanglang 1 month ago
parent
commit
9157fa0c42

+ 10 - 0
trade-service/src/main/java/com/trade/service/trade/salesorder/service/impl/SalesOrderServiceImpl.java

@@ -10,6 +10,8 @@ import com.trade.common.utils.DateUtils;
 import com.trade.service.TransStruct;
 import com.trade.service.enterprise.companyrelated.domain.ImporterEntity;
 import com.trade.service.enterprise.companyrelated.service.IImporterEntityService;
+import com.trade.service.enterprise.customer.domain.Enterprise;
+import com.trade.service.enterprise.customer.service.EnterpriseBaseService;
 import com.trade.service.filestorage.dto.FileAbstractDto;
 import com.trade.service.filestorage.service.TFileStorageService;
 import com.trade.service.trade.salescontract.domain.ContractTerms;
@@ -52,6 +54,8 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
     private IImporterEntityService importerEntityService;
     @Resource
     private TFileStorageService tFileStorageService;
+    @Resource
+    private EnterpriseBaseService enterpriseBaseService;
 
     public SalesOrderServiceImpl(ISalesOrderGoodsService salesOrderGoodsService,
             ISalesOrderInvoiceService salesOrderInvoiceService, ISalesOrderLogisticsService salesOrderLogisticsService,
@@ -120,6 +124,12 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
             salesOrderVO.setPaymentWay(e.getPaymentWay());
             salesOrderVO.setSettlementCycle(e.getSettlementCycle());
         });
+        Optional<Enterprise> enterpriseBaseOpt = Optional
+                .ofNullable(enterpriseBaseService.getEnterpriseByCustomerId(salesOrder.getCustomerUserId()));
+        enterpriseBaseOpt.ifPresent(e -> {
+            salesOrderVO.setCustomerIdentifierNo(e.getCustomerIdentifierNo());
+            salesOrderVO.setEnterpriseName(e.getName());
+        });
         return salesOrderDtlVO;
     }