Commit 0513130d authored by zhangsen's avatar zhangsen

小数位保留、飞书文档bug修改

parent 1c51f231
...@@ -68,6 +68,8 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -68,6 +68,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
@Autowired @Autowired
FanWaringRecordMapper fanWarningRecord; FanWaringRecordMapper fanWarningRecord;
public final DecimalFormat df = new DecimalFormat("#.0"); public final DecimalFormat df = new DecimalFormat("#.0");
public final DecimalFormat dfSS = new DecimalFormat("#.00");
/** /**
* 新增 * 新增
* *
...@@ -763,7 +765,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -763,7 +765,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -784,7 +786,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -784,7 +786,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -806,7 +808,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -806,7 +808,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
......
...@@ -57,6 +57,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -57,6 +57,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper; IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper;
public final DecimalFormat df = new DecimalFormat("0.0"); public final DecimalFormat df = new DecimalFormat("0.0");
public final DecimalFormat dfSS = new DecimalFormat("0.00");
/** /**
* 新增 * 新增
* *
...@@ -430,7 +432,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -430,7 +432,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -451,7 +453,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -451,7 +453,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -476,7 +478,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -476,7 +478,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
Date format = null; Date format = null;
try { try {
......
...@@ -23,6 +23,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -23,6 +23,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.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -155,6 +156,7 @@ public class KafkaAnalyseController { ...@@ -155,6 +156,7 @@ public class KafkaAnalyseController {
return ResponseHelper.buildResponse(indicatorData); return ResponseHelper.buildResponse(indicatorData);
} }
public final DecimalFormat df = new DecimalFormat("0.0");
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "全景诊断回溯") @ApiOperation(value = "全景诊断回溯")
...@@ -192,7 +194,7 @@ public class KafkaAnalyseController { ...@@ -192,7 +194,7 @@ public class KafkaAnalyseController {
int subSystemInt = 1; int subSystemInt = 1;
Double healthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(null, null, analysisType).doubleValue(); Double healthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(null, null, analysisType).doubleValue();
healthScoreInfo = Double.parseDouble(df.format(healthScoreInfo));
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.isNull(IdxBizFanHealthLevel::getStatus); query.isNull(IdxBizFanHealthLevel::getStatus);
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域"); query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域");
...@@ -216,7 +218,7 @@ public class KafkaAnalyseController { ...@@ -216,7 +218,7 @@ public class KafkaAnalyseController {
Double areaHighScore = null; Double areaHighScore = null;
Double areaHealthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(areaMap.getKey(), null, analysisType).doubleValue(); Double areaHealthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(areaMap.getKey(), null, analysisType).doubleValue();
areaHealthScoreInfo = Double.parseDouble(df.format(areaHealthScoreInfo));
LambdaQueryWrapper<IdxBizFanHealthLevel> areaQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> areaQuery = new LambdaQueryWrapper<>();
areaQuery.isNull(IdxBizFanHealthLevel::getStatus); areaQuery.isNull(IdxBizFanHealthLevel::getStatus);
areaQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区"); areaQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区");
......
...@@ -161,7 +161,7 @@ public class CommonServiceImpl { ...@@ -161,7 +161,7 @@ public class CommonServiceImpl {
@Autowired @Autowired
private TdengineTimeServiceImpl tdengineTimeService; private TdengineTimeServiceImpl tdengineTimeService;
public final DecimalFormat df = new DecimalFormat("#.0"); public final DecimalFormat df = new DecimalFormat("#.00");
/** /**
* @return * @return
......
...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; ...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -69,7 +71,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -69,7 +71,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
} }
public final DecimalFormat dfSS = new DecimalFormat("0.00");
public Object getqyt(String type,String address,String statioName,String equipmentName, String arae,String startTime,String endTime){ public Object getqyt(String type,String address,String statioName,String equipmentName, String arae,String startTime,String endTime){
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -120,7 +122,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -120,7 +122,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
List<String> axisData = new ArrayList<>(); List<String> axisData = new ArrayList<>();
List<String> activePowers = new ArrayList<>(); List<String> activePowers = new ArrayList<>();
for (int i = 0; i < indicatorDataListActivePowers.size(); i++) { for (int i = 0; i < indicatorDataListActivePowers.size(); i++) {
activePowers.add(indicatorDataListActivePowers.get(i).getValue()); activePowers.add(dfSS.format(indicatorDataListActivePowers.get(i).getValue()));
axisData.add(DateUtil.format(indicatorDataListActivePowers.get(i).getCreatedTime(), "yyyy-MM-dd HH:mm:ss")); axisData.add(DateUtil.format(indicatorDataListActivePowers.get(i).getCreatedTime(), "yyyy-MM-dd HH:mm:ss"));
} }
// List<Map<String, Object>> seriesData = new ArrayList<>(); // List<Map<String, Object>> seriesData = new ArrayList<>();
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</select> </select>
<select id="getHealthScoreInfoByParam" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfoByParam" resultType="java.math.BigDecimal">
SELECT SELECT
CEILING(avg( a.avgHealthIndex )) AS healthIndex avg( a.avgHealthIndex ) AS healthIndex
FROM FROM
( (
SELECT SELECT
...@@ -1302,7 +1302,7 @@ ...@@ -1302,7 +1302,7 @@
</select> </select>
<select id="getStationIndexInfoByParam" resultType="java.util.Map"> <select id="getStationIndexInfoByParam" resultType="java.util.Map">
SELECT a.STATION AS station, SELECT a.STATION AS station,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex ROUND(avg(a.avgHealthIndex), 1) AS healthIndex
FROM ( FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex, SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
STATION AS STATION STATION AS STATION
...@@ -1350,7 +1350,7 @@ ...@@ -1350,7 +1350,7 @@
</select> </select>
<select id="getEquipmentIndexInfoByParam" resultType="java.util.Map"> <select id="getEquipmentIndexInfoByParam" resultType="java.util.Map">
SELECT a.equipmentName AS equipmentName, SELECT a.equipmentName AS equipmentName,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex ROUND(avg(a.avgHealthIndex), 1) AS healthIndex
FROM ( FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex, SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
EQUIPMENT_NAME AS equipmentName EQUIPMENT_NAME AS equipmentName
...@@ -1401,7 +1401,7 @@ ...@@ -1401,7 +1401,7 @@
</select> </select>
<select id="getSubSystemIndexInfoByParam" resultType="java.util.Map"> <select id="getSubSystemIndexInfoByParam" resultType="java.util.Map">
SELECT a.subSystem AS subSystem, SELECT a.subSystem AS subSystem,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex ROUND(avg(a.avgHealthIndex), 1) AS healthIndex
FROM ( FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex, SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SUB_SYSTEM AS subSystem SUB_SYSTEM AS subSystem
...@@ -1451,7 +1451,8 @@ ...@@ -1451,7 +1451,8 @@
a.subSystem a.subSystem
</select> </select>
<select id="getPointNameIndexInfoByParam" resultType="java.util.Map"> <select id="getPointNameIndexInfoByParam" resultType="java.util.Map">
SELECT IFNULL(HEALTH_INDEX, 100) AS healthIndex, SELECT
ROUND(IFNULL(HEALTH_INDEX, 100), 1) AS healthIndex,
concat(STATION, '_', INDEX_ADDRESS) as gatewayIndexAddress concat(STATION, '_', INDEX_ADDRESS) as gatewayIndexAddress
FROM fan_health_index_latest_data FROM fan_health_index_latest_data
<where> <where>
......
...@@ -217,7 +217,10 @@ ...@@ -217,7 +217,10 @@
ifnull(c.station_name, '') AS stationName, ifnull(c.station_name, '') AS stationName,
ifnull(a.rec_date, '') as recDate, ifnull(a.rec_date, '') as recDate,
a.sequence_nbr as objectId, a.sequence_nbr as objectId,
b.project_name as unitName b.project_name as unitName,
case when a.qrcode_color = 'red' then 1
when a.qrcode_color = 'yellow' then 2
else 3 end as sort
FROM FROM
person_basic a person_basic a
INNER JOIN station_basic c ON a.project_org_code = c.project_org_code INNER JOIN station_basic c ON a.project_org_code = c.project_org_code
...@@ -237,7 +240,7 @@ ...@@ -237,7 +240,7 @@
AND a.qrcode_color != #{ne} AND a.qrcode_color != #{ne}
</if> </if>
</where> </where>
ORDER BY a.rec_date DESC ORDER BY sort asc,a.rec_date DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
...@@ -102,7 +102,10 @@ ...@@ -102,7 +102,10 @@
ifnull(a.QRCODE_COLOR, '') AS qrCodeColor, ifnull(a.QRCODE_COLOR, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName, ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.UPDATE_STAMP, '') as recDate, ifnull(a.UPDATE_STAMP, '') as recDate,
a.SBBM as objectId a.SBBM as objectId,
(case when a.QRCODE_COLOR = 'red' then 1
when a.QRCODE_COLOR = 'yellow' then 2
else 3 end) as sort
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
...@@ -120,7 +123,7 @@ ...@@ -120,7 +123,7 @@
AND a.QRCODE_COLOR != #{ne} AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.UPDATE_STAMP DESC ORDER BY sort asc, a.UPDATE_STAMP DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
...@@ -153,7 +156,10 @@ ...@@ -153,7 +156,10 @@
ifnull(b.COMPANY_NAME, '') AS stationName, ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.CREATE_TIME, '') as recDate, ifnull(a.CREATE_TIME, '') as recDate,
a.DBID AS objectId, a.DBID AS objectId,
c.SBBM as jobId c.SBBM as jobId,
case when a.QRCODE_COLOR = 'red' then 1
when a.QRCODE_COLOR = 'yellow' then 2
else 3 end as sort
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
...@@ -172,7 +178,7 @@ ...@@ -172,7 +178,7 @@
AND a.QRCODE_COLOR != #{ne} AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY sort asc, a.CREATE_TIME DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
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