Commit 0513130d authored by zhangsen's avatar zhangsen

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

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