From 292de22340f6d04563dfb8ada1d2a3342888c486 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 ++++- pom.xml | 2 +- 2 files changed, 5 insertions(+), 2 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 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()); } diff --git a/pom.xml b/pom.xml index 8593c9c..edc678b 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 5.0.1.RELEASE - 5.1.0-SNAPSHOT + 5.1.0.RELEASE UTF-8 1.8