Commit 1086dccc authored by KeYong's avatar KeYong

修改返回值四舍五入

parent 6832f04c
...@@ -53,6 +53,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -53,6 +53,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -1943,7 +1944,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1943,7 +1944,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
iotIndexInfoVo.setNumber(deviceName); iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) { if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName()); BigDecimal val = new BigDecimal(String.valueOf(entry.getValue()));
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + (val.setScale(2, BigDecimal.ROUND_HALF_UP)) + equipmentSpecificIndex.getIndexUnitName());
} else { } else {
if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) { if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) {
iotIndexInfoVo.setContent(TrueOrFalseEnum.real.value.equals(entry.getValue()) ? equipmentSpecificIndex.getEquipmentIndexName() : PressurePumpRelateEnum.STOP.getDesc()); iotIndexInfoVo.setContent(TrueOrFalseEnum.real.value.equals(entry.getValue()) ? equipmentSpecificIndex.getEquipmentIndexName() : PressurePumpRelateEnum.STOP.getDesc());
......
...@@ -1869,7 +1869,7 @@ ...@@ -1869,7 +1869,7 @@
WHEN 'false' THEN WHEN 'false' THEN
'关' '关'
ELSE ELSE
si.`value` IF(si.`value` IS NOT NULL AND si.`value` != '', ROUND(si.`value`, 2), '')
END END
) )
ELSE ELSE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment