Commit ac80a9d2 authored by zhangsen's avatar zhangsen

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

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