master
wangning 7 years ago
commit 25e2467438

@ -542,6 +542,10 @@ public class TradeLogServiceImpl implements TradeLogService {
.filter(log -> log.getBigDecimal("settle_amount") != null) .filter(log -> log.getBigDecimal("settle_amount") != null)
.map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount")))) .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount"))))
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
analysis.put("tax_amount", logs.parallelStream()
.filter(log -> log.getBigDecimal("settle_amount") != null)
.map(log -> getSymbol(log).multiply(log.getBigDecimal("tax_amount")))
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
analysis.put("wechat_fee", logs.parallelStream() analysis.put("wechat_fee", logs.parallelStream()
.filter(log -> log.getBigDecimal("settle_amount") != null) .filter(log -> log.getBigDecimal("settle_amount") != null)
.filter(log -> "WechatSettlement".contains(log.getString("channel"))) .filter(log -> "WechatSettlement".contains(log.getString("channel")))
@ -604,11 +608,8 @@ public class TradeLogServiceImpl implements TradeLogService {
parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO));
parmerters.put("bestpay_fee", takeDecimalOrDefault(analysis, "bestpay_fee", BigDecimal.ZERO)); parmerters.put("bestpay_fee", takeDecimalOrDefault(analysis, "bestpay_fee", BigDecimal.ZERO));
parmerters.put("jd_fee", takeDecimalOrDefault(analysis, "jd_fee", BigDecimal.ZERO)); parmerters.put("jd_fee", takeDecimalOrDefault(analysis, "jd_fee", BigDecimal.ZERO));
parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); // parmerters.put("gst", analysis.containsKey("clearing_fee") ? parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO));
// analysis.getBigDecimal("clearing_fee").multiply(new BigDecimal(0.11)).setScale(2, parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO));
// BigDecimal.ROUND_DOWN) : 0);
// parmerters.put("gst",
// analysis.containsKey("total_royal_surcharge") ? analysis.getBigDecimal("total_royal_surcharge").divide(new BigDecimal(11), 2, BigDecimal.ROUND_DOWN) : 0);
dataList.parallelStream().forEach(item -> { dataList.parallelStream().forEach(item -> {
scaleDecimalVal(item, "display_amount", item.getString("currency")); scaleDecimalVal(item, "display_amount", item.getString("currency"));
String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency();

Loading…
Cancel
Save