Просмотр исходного кода

对账金额保留两位小数

hejq 7 лет назад
Родитель
Сommit
f111381c7a

+ 65 - 0
src/main/java/com/uas/platform/b2b/publicapi/model/ApCheckAmount.java

@@ -0,0 +1,65 @@
+package com.uas.platform.b2b.publicapi.model;
+
+
+/**
+ * 对账金额
+ *
+ * @author hejq
+ * @date 2018-12-14 23:21
+ */
+public class ApCheckAmount {
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 金额(字符串: 防止科学计数法)
+     */
+    private String amount;
+
+    /**
+     * 金额
+     */
+    private Double count;
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getAmount() {
+        return amount;
+    }
+
+    public void setAmount(String amount) {
+        this.amount = amount;
+    }
+
+    public Double getCount() {
+        return count;
+    }
+
+    public void setCount(Double count) {
+        this.count = count;
+    }
+
+    /**
+     * 通过币别,总额获取交易额
+     *
+     * @param currency 币别
+     * @param amount 总额
+     */
+    public ApCheckAmount(String currency, Double amount) {
+        this.currency = currency;
+        java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
+        nf.setGroupingUsed(false);
+        this.amount = nf.format(amount);
+    }
+
+    public ApCheckAmount() {}
+}