From 3481a8fe7f890e2c3b01970112d159ad35e7e883 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 10 Jan 2024 19:32:38 +0800 Subject: [PATCH] =?UTF-8?q?#=20HZA100C=E5=8F=82=E6=95=B0=E4=B8=8B=E5=8F=91?= =?UTF-8?q?bug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 bf8dc05..ffd108b 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 @@ -97,7 +97,10 @@ 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()) && "int".equals(p.getDbType()) && StringUtil.isNotBlank(value)) { + value = String.valueOf(new BigDecimal(value).setScale(0, RoundingMode.HALF_UP).doubleValue()); + } + else 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()); }