Commit ac80a9d2 authored by zhangsen's avatar zhangsen

健康指数页面保留一位小数

parent 38e813af
...@@ -33,6 +33,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -33,6 +33,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -64,6 +65,7 @@ public class TdInfoQueryController { ...@@ -64,6 +65,7 @@ public class TdInfoQueryController {
@Autowired @Autowired
IdxBizFanHealthIndexMapper idxBizFanHealthIndexMapper; IdxBizFanHealthIndexMapper idxBizFanHealthIndexMapper;
public final DecimalFormat df = new DecimalFormat("#.0");
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
...@@ -110,6 +112,7 @@ public class TdInfoQueryController { ...@@ -110,6 +112,7 @@ public class TdInfoQueryController {
} }
List<FanHealthIndex> fanHealthIndexIPage = fanHealthIndexMapper.getInfoByPage(dto); List<FanHealthIndex> fanHealthIndexIPage = fanHealthIndexMapper.getInfoByPage(dto);
fanHealthIndexIPage.forEach(item -> item.setHealthIndex(Double.valueOf(df.format(item.getHealthIndex()))));
Integer infoByPageTotal = fanHealthIndexMapper.getInfoByPageTotal(dto); Integer infoByPageTotal = fanHealthIndexMapper.getInfoByPageTotal(dto);
resultPage.setRecords(fanHealthIndexIPage); resultPage.setRecords(fanHealthIndexIPage);
resultPage.setTotal(infoByPageTotal); resultPage.setTotal(infoByPageTotal);
...@@ -172,6 +175,7 @@ public class TdInfoQueryController { ...@@ -172,6 +175,7 @@ public class TdInfoQueryController {
String join = String.join(",", orderByList); String join = String.join(",", orderByList);
dto.setOrderColumns(join); dto.setOrderColumns(join);
List<PvHealthIndex> pvHealthIndexIPage = pvHealthIndexMapper.getInfoByPage(dto); List<PvHealthIndex> pvHealthIndexIPage = pvHealthIndexMapper.getInfoByPage(dto);
pvHealthIndexIPage.forEach(item -> item.setHealthIndex(Double.valueOf(df.format(item.getHealthIndex()))));
Integer infoByPageTotal = pvHealthIndexMapper.getInfoByPageTotal(dto); Integer infoByPageTotal = pvHealthIndexMapper.getInfoByPageTotal(dto);
resultPage.setRecords(pvHealthIndexIPage); resultPage.setRecords(pvHealthIndexIPage);
resultPage.setTotal(infoByPageTotal); resultPage.setTotal(infoByPageTotal);
......
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