瀏覽代碼

B端销售订单详情客户名称反显

zhangchenm 1 月之前
父節點
當前提交
c380170a34

+ 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;
     }