From e96b0d2ac2d14a1035e91cf221f5ecd764980e16 Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期日, 08 十月 2023 11:41:37 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/java/com/hx/util/MapUtil.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/util/MapUtil.java b/src/main/java/com/hx/util/MapUtil.java index 22ae85c..2bdd0cd 100644 --- a/src/main/java/com/hx/util/MapUtil.java +++ b/src/main/java/com/hx/util/MapUtil.java @@ -1,5 +1,6 @@ package com.hx.util; +import java.math.BigDecimal; import java.util.Map; /** @@ -57,4 +58,20 @@ return null == map.get(key) ? 0 : Integer.parseInt(map.get(key).toString()); } + + /** + * 浠巑ap涓幏鍙栨暟瀛楃被鍨嬪璞� + * @param map + * @param key + * @return + */ + public static BigDecimal getBigDecimal(Map<String, Object> map, String key) + { + if(map == null || StringUtils.isEmpty(key)) + { + return BigDecimal.ZERO; + } + + return null == map.get(key) ? BigDecimal.ZERO : new BigDecimal(map.get(key).toString()); + } } -- Gitblit v1.8.0