Browse Source

形式发票支付方式字典转换

zhangchenm 1 month ago
parent
commit
e2d28704c6

+ 8 - 1
trade-client/src/main/java/com/trade/client/trade/salesorder/service/impl/SalesOrderCServiceImpl.java

@@ -17,6 +17,7 @@ import com.trade.service.enterprise.customer.domain.Enterprise;
 import com.trade.service.enterprise.customer.domain.EnterpriseRelatedPerson;
 import com.trade.service.enterprise.customer.domain.EnterpriseRelatedPerson;
 import com.trade.service.enterprise.customer.service.EnterpriseBaseService;
 import com.trade.service.enterprise.customer.service.EnterpriseBaseService;
 import com.trade.service.enterprise.customer.service.EnterpriseRelatedPersonBaseService;
 import com.trade.service.enterprise.customer.service.EnterpriseRelatedPersonBaseService;
+import com.trade.service.system.service.ISysDictDataService;
 import com.trade.service.trade.purchaseorder.domain.PurchaseOrderCommodity;
 import com.trade.service.trade.purchaseorder.domain.PurchaseOrderCommodity;
 import com.trade.service.trade.purchaseorder.dto.PurchaseOrderDto;
 import com.trade.service.trade.purchaseorder.dto.PurchaseOrderDto;
 import com.trade.service.trade.purchaseorder.service.PurchaseOrderService;
 import com.trade.service.trade.purchaseorder.service.PurchaseOrderService;
@@ -88,6 +89,8 @@ public class SalesOrderCServiceImpl implements SalesOrderCService {
     private PurchaseOrderService purchaseOrderService;
     private PurchaseOrderService purchaseOrderService;
     @Resource
     @Resource
     private SalesCommodityService salesCommodityService;
     private SalesCommodityService salesCommodityService;
+    @Resource
+    private ISysDictDataService iSysDictDataService;
 
 
     public SalesOrderCServiceImpl(ISalesOrderService salesOrderService, ISalesOrderGoodsService salesOrderGoodsService,
     public SalesOrderCServiceImpl(ISalesOrderService salesOrderService, ISalesOrderGoodsService salesOrderGoodsService,
             ISalesOrderInvoiceService salesOrderInvoiceService, ISalesOrderLogisticsService salesOrderLogisticsService,
             ISalesOrderInvoiceService salesOrderInvoiceService, ISalesOrderLogisticsService salesOrderLogisticsService,
@@ -217,6 +220,10 @@ public class SalesOrderCServiceImpl implements SalesOrderCService {
             customerAddress = tradingPlatform.getBusinessAddress();
             customerAddress = tradingPlatform.getBusinessAddress();
             contractTel = tradingPlatform.getContactMobile();
             contractTel = tradingPlatform.getContactMobile();
         }
         }
+        // 支付方式 页面选其他,后台取不到值,默认"" PS: The final interpretation rights belong to the product manager who will never make a mistake
+        String paymentWay = Optional
+                .ofNullable(iSysDictDataService.selectDictLabel("payment_way_en", contractTerms.getPaymentWay()))
+                .orElse("");
         item.setTemplateCode(templateCode);
         item.setTemplateCode(templateCode);
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("customerName", customerName);
         params.put("customerName", customerName);
@@ -227,7 +234,7 @@ public class SalesOrderCServiceImpl implements SalesOrderCService {
         params.put("from", salesContract.getPortDeparture());
         params.put("from", salesContract.getPortDeparture());
         params.put("to", salesContract.getPortDestination());
         params.put("to", salesContract.getPortDestination());
         params.put("incoTerms", salesContract.getTradeTerms());
         params.put("incoTerms", salesContract.getTradeTerms());
-        params.put("payWay", contractTerms.getPaymentWay());
+        params.put("payWay", paymentWay);
         params.put("importerName", importer.getEntityName());
         params.put("importerName", importer.getEntityName());
         params.put("importerAddress", importer.getBusinessAddress());
         params.put("importerAddress", importer.getBusinessAddress());
         params.put("currency", contractTerms.getPaymentCurrency());
         params.put("currency", contractTerms.getPaymentCurrency());