Browse Source

# HZA100C参数下发bug解决

zhongwei
haungxing 1 year ago
parent
commit
3481a8fe7f
  1. 5
      hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java

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()));
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());
}

Loading…
Cancel
Save