Commit 114f26b5 authored by caotao's avatar caotao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents c50da944 6ae54dac
......@@ -9,7 +9,7 @@
</parent>
<artifactId>amos-boot-module-hygf-biz</artifactId>
<version>1.0.0</version>
<name>amos-boot-module-jxiop-hygf</name>
<name>amos-boot-module-hygf-biz</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
......@@ -22,6 +23,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......@@ -63,6 +65,9 @@ public class BigScreenAnalyseController extends BaseController {
@Autowired
IndicatorDataMapper indicatorDataMapper;
@Autowired
RiskWarningFeign riskWarningFeign;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo")
......@@ -610,5 +615,26 @@ public class BigScreenAnalyseController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风站/光伏 右下诊断分析")
@GetMapping("/getRiskHandleByVarDesc")
public ResponseModel<Map<String, String>> getRiskHandleByVarDesc(@RequestParam(value = "varDesc", required = false) String varDesc) {
FeignClientResult<List<String>> sevenEntityMcb = null;
try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
} catch (Exception e) {
e.printStackTrace();
}
StringBuilder resultString = new StringBuilder();
List<String> result = sevenEntityMcb.getResult();
for (String s : result) {
resultString.append(s);
}
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("content", resultString.toString());
return ResponseHelper.buildResponse(stringStringHashMap);
}
}
......@@ -8,7 +8,7 @@
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex
FROM
idx_biz_fan_health_index
<where>ANALYSIS_TYPE = '按天'
......@@ -27,7 +27,7 @@
UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex
FROM
idx_biz_pv_health_index
<where>
......@@ -49,7 +49,7 @@
<select id="getHealthListInfo" resultType="java.util.Map">
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
a.date
FROM
(
......@@ -123,7 +123,7 @@
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_fan_health_index
......@@ -135,7 +135,7 @@
ARAE UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
......@@ -180,7 +180,7 @@
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
STATION
FROM
idx_biz_fan_health_index
......@@ -197,7 +197,7 @@
STATION UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
STATION
FROM
idx_biz_pv_health_index
......@@ -307,7 +307,7 @@
<select id="getSubSystemInfo" resultType="java.util.Map">
SELECT
IFNULL( HEALTH_INDEX, 0 ) AS healthIndex,
IFNULL( HEALTH_INDEX, 100 ) AS healthIndex,
SUB_SYSTEM AS subSystem
FROM
idx_biz_fan_health_index
......@@ -317,7 +317,7 @@
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME = #{equipmentName}
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统')
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
......@@ -346,7 +346,7 @@
<select id="getFanHealthInfoList" resultType="java.util.Map">
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
EQUIPMENT_NAME as equipmentName
FROM
idx_biz_fan_health_index
......@@ -371,7 +371,7 @@
idx_biz_fan_point_process_variable_classification
<where>
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME = #{equipmentName}
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统')
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
......@@ -401,7 +401,7 @@
<select id="getHealthInfoBySubSystem" resultType="java.util.Map">
SELECT
IFNULL( avg( HEALTH_INDEX ), 0 ) AS healthIndex,
IFNULL( avg( HEALTH_INDEX ), 100 ) AS healthIndex,
POINT_NAME AS pointName
FROM
idx_biz_fan_health_index
......@@ -547,7 +547,8 @@
<select id="getPvPointNameListBySumSystem" resultType="java.util.Map">
SELECT
POINT_NAME as pointName
POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress
FROM
idx_biz_pv_point_process_variable_classification
<where>
......
package com.yeejoin.amos.boot.module.jxiop.api.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@FeignClient(name = "${mcb.warning.name:MCB-SERVER}", path = "risk", configuration = {FeignConfiguration.class})
public interface RiskWarningFeign {
/**
* 根据风险来源查询人员红黄绿吗信息
*/
@GetMapping("/model-risk-handle/getRiskHandleByVarDesc")
FeignClientResult<List<String>> getRiskHandleByVarDesc(@RequestParam(required = false, value = "varDesc") String varDesc);
}
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