Browse Source

# HZA100C参数下发bug解决

zhongwei
haungxing 11 months ago
parent
commit
292de22340
  1. 5
      hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java
  2. 2
      pom.xml

5
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())); String realData = JSON.toJSONString(realDataR.getData().getDataMap().get(p.getSignage()));
if("0".equals(JSONObject.parseObject(realData).getString("q"))) { if("0".equals(JSONObject.parseObject(realData).getString("q"))) {
String value = JSONObject.parseObject(realData).getString("v"); 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())) { && StringUtil.isNotBlank(value) && ObjectUtil.isNotEmpty(p.getKeepFigures())) {
value = String.valueOf(new BigDecimal(value).setScale(p.getKeepFigures(), RoundingMode.HALF_UP).doubleValue()); value = String.valueOf(new BigDecimal(value).setScale(p.getKeepFigures(), RoundingMode.HALF_UP).doubleValue());
} }

2
pom.xml

@ -16,7 +16,7 @@
<properties> <properties>
<bladex.project.version>5.0.1.RELEASE</bladex.project.version> <bladex.project.version>5.0.1.RELEASE</bladex.project.version>
<!--数据平台接口版本--> <!--数据平台接口版本-->
<hzinfo.data.sdk.version>5.1.0-SNAPSHOT</hzinfo.data.sdk.version> <hzinfo.data.sdk.version>5.1.0.RELEASE</hzinfo.data.sdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>

Loading…
Cancel
Save