From a2682234ba2cd25c11ece1aff1a1e3536b30372d Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Thu, 4 Jan 2024 09:35:23 +0800 Subject: [PATCH] =?UTF-8?q?#=20HZA100C=E5=8F=82=E6=95=B0=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=96=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E7=88=86=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java index ffbdb7f..bf8dc05 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java @@ -34,10 +34,7 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.BeanUtil; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.*; import org.springframework.stereotype.Service; import org.springframework.util.Assert; @@ -100,7 +97,8 @@ public class ParamServiceImpl implements IParamService { String realData = JSON.toJSONString(realDataR.getData().getDataMap().get(p.getSignage())); if("0".equals(JSONObject.parseObject(realData).getString("q"))) { String value = JSONObject.parseObject(realData).getString("v"); - if(StringUtil.isNotBlank(p.getDbType()) && "double".equals(p.getDbType())) { + if(StringUtil.isNotBlank(p.getDbType()) && "double".equals(p.getDbType()) + && StringUtil.isNotBlank(value) && ObjectUtil.isNotEmpty(p.getKeepFigures())) { value = String.valueOf(new BigDecimal(value).setScale(p.getKeepFigures(), RoundingMode.HALF_UP).doubleValue()); } p.setValue(value);