Commit 7587a56d0578324f5e2e8e06e7a41e861af83adb

Authored by huanggang
1 parent d123ce1a

upgrade after testing

cashier-boss/src/main/java/com/diligrp/cashier/boss/domain/CashierOrderVO.java
... ... @@ -7,13 +7,20 @@ import java.util.List;
7 7 public class CashierOrderVO {
8 8 // 业务系统用户标识
9 9 private final String userId;
  10 + // 商品描述
  11 + private final String goods;
  12 + // 付款金额-元
  13 + private final String amount;
10 14 // 页面回调地址
11 15 private final String redirectUrl;
12 16 // 支付通道
13 17 private final List<PaymentPipeline> pipelines;
14 18  
15   - public CashierOrderVO(String userId, String redirectUrl, List<PaymentPipeline> pipelines) {
  19 + public CashierOrderVO(String userId, String goods, String amount,
  20 + String redirectUrl, List<PaymentPipeline> pipelines) {
16 21 this.userId = userId;
  22 + this.goods = goods;
  23 + this.amount = amount;
17 24 this.redirectUrl = redirectUrl;
18 25 this.pipelines = pipelines;
19 26 }
... ... @@ -22,6 +29,14 @@ public class CashierOrderVO {
22 29 return userId;
23 30 }
24 31  
  32 + public String getGoods() {
  33 + return goods;
  34 + }
  35 +
  36 + public String getAmount() {
  37 + return amount;
  38 + }
  39 +
25 40 public String getRedirectUrl() {
26 41 return redirectUrl;
27 42 }
... ...
cashier-boss/src/main/java/com/diligrp/cashier/boss/service/impl/CashierDeskServiceImpl.java
... ... @@ -12,6 +12,7 @@ import com.diligrp.cashier.pipeline.domain.OnlinePaymentStatus;
12 12 import com.diligrp.cashier.pipeline.service.IPaymentPipelineManager;
13 13 import com.diligrp.cashier.pipeline.type.PaymentState;
14 14 import com.diligrp.cashier.shared.ErrorCode;
  15 +import com.diligrp.cashier.shared.util.CurrencyUtils;
15 16 import com.diligrp.cashier.shared.util.ObjectUtils;
16 17 import com.diligrp.cashier.trade.domain.*;
17 18 import com.diligrp.cashier.trade.model.TradeOrder;
... ... @@ -86,7 +87,8 @@ public class CashierDeskServiceImpl implements ICashierDeskService {
86 87 List<PaymentPipeline> pipelines = paymentPipelineManager.listPipelines(orderToken.getMchId(), PaymentPipeline.class);
87 88 List<CashierOrderVO.PaymentPipeline> pipelineList = pipelines.stream().map(pipeline ->
88 89 new CashierOrderVO.PaymentPipeline(pipeline.pipelineId(), pipeline.supportedChannel())).toList();
89   - return new CashierOrderVO(orderToken.getUserId(), orderToken.getRedirectUrl(), pipelineList);
  90 + String amount = CurrencyUtils.toNoSymbolCurrency(trade.getMaxAmount());
  91 + return new CashierOrderVO(orderToken.getUserId(), trade.getGoods(), amount, orderToken.getRedirectUrl(), pipelineList);
90 92 }
91 93  
92 94 /**
... ...
cashier-shared/src/main/java/com/diligrp/cashier/shared/util/CurrencyUtils.java
... ... @@ -98,4 +98,10 @@ public class CurrencyUtils {
98 98 currency.setCharAt(0, currencySymbol);
99 99 currency.setCharAt(1, negativeSymbol);
100 100 }
  101 +
  102 + public static void main(String[] args) {
  103 + System.out.println(toNoSymbolCurrency(-1L));
  104 + System.out.println(toCurrency(-1L));
  105 + System.out.println(cent2TenNoSymbol(-1L));
  106 + }
101 107 }
... ...