From 0241afe94d6ce59c19410d1f0edf596092d82ef9 Mon Sep 17 00:00:00 2001 From: fhx <308050795@qq.com> Date: 星期一, 25 九月 2023 16:52:14 +0800 Subject: [PATCH] 1.新增方法 --- 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