Commit 65d9171f authored by zhangsen's avatar zhangsen

bug修改

parent 34cdfd81
......@@ -35,6 +35,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -66,6 +67,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
FanHealthIndexMomentMapper fanHealthIndexMomentMapper;
@Autowired
FanWaringRecordMapper fanWarningRecord;
public final DecimalFormat df = new DecimalFormat("#.0");
/**
* 新增
*
......@@ -381,6 +383,12 @@ public class IdxBizFanHealthIndexController extends BaseController {
startTimeTop = formatter.format(startDate);
}
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
fanHealthIndexDays.forEach(item -> {
double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex()));
item.setHealthIndex(roundedNumber);
});
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setRecords(fanHealthIndexDays);
page.setTotal(total);
......@@ -423,7 +431,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null);
Map<String,Object> map = new HashMap<>();
map.put("value",fanHealthIndexDays.get(0).getValue());
map.put("value",Double.parseDouble(df.format(fanHealthIndexDays.get(0).getValue())));
return ResponseHelper.buildResponse(map);
}
......@@ -708,7 +716,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
for (FanHealthIndexDay obj : fanHealthIndexDays) {
if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue());
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else {
seriesData.add(obj.getAnomaly());
}
......@@ -729,7 +737,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getAnalysisTime)).collect(Collectors.toList());
for (FanHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue());
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else {
seriesData.add(obj.getAnomaly());
}
......@@ -751,7 +759,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList());
for (FanHealthIndexMoment obj : fanHealthIndexMoments) {
if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue());
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else {
seriesData.add(obj.getAnomaly());
}
......
......@@ -140,8 +140,13 @@
<select id="selectWarningPointTotal" resultType="int">
SELECT
count(1)
select count(1) from (SELECT
a.station,
a.warning_name,
a.content,
a.equipment_name,
a.point_name,
a.rec_date
from
analysis_data.fan_warning_record a
where
......@@ -158,7 +163,7 @@
point_name,
rec_date ,
content,
warning_name
warning_name) b
</select>
<select id="selectEquipWarningTotal" resultType="map">
......
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