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