Commit 966888c5 authored by zhangsen's avatar zhangsen

bug修改

parent b7fe98dd
......@@ -69,6 +69,11 @@
<artifactId>tablesaw-json</artifactId>
<version>0.43.1</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
......@@ -8,6 +8,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.AgencyuserFeign;
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.dto.FullViewRecallDataDTO;
......@@ -23,6 +24,9 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
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 com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
......@@ -77,7 +81,7 @@ public class BigScreenAnalyseController extends BaseController {
if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getStationName();
stationCode = stationBasic.getFanGatewayId();
}
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode));
......@@ -92,7 +96,7 @@ public class BigScreenAnalyseController extends BaseController {
if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getStationName();
stationCode = stationBasic.getFanGatewayId();
}
HashMap<String, Object> resultMap = new HashMap<>();
......@@ -111,12 +115,13 @@ public class BigScreenAnalyseController extends BaseController {
resultMap.put("seriesData", arrayList);
return ResponseHelper.buildResponse(resultMap);
}
@Autowired
AgencyuserFeign agencyuserFeign;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各片区设备预警情况(条) ", notes = "全域各片区设备预警情况(条) ")
@GetMapping(value = "/getAllEquipAlarmInfo")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfo(@RequestParam(required = false) String tableName) {
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfo(@RequestParam(required = false) String tableName) throws Exception {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfo(tableName);
HashMap<String, Integer> wxMap = new HashMap<>();
......@@ -135,10 +140,26 @@ public class BigScreenAnalyseController extends BaseController {
List<Integer> zyList = new ArrayList<>();
List<Integer> jgList = new ArrayList<>();
List<String> list = new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("area");
Collection<CompanyModel> companyModels = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
companyModels = listFeignClientResult.getResult();
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
List<String> collect = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
if ("idx_biz_fan_warning_record".equals(tableName)) {
list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
list = collect;
// list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
} else {
list = Arrays.asList("华北片区", "东北片区", "华东片区", "华南片区", "西南片区", "西北片区", "华中片区");
Collections.reverse(list);
// list = Arrays.asList("华北片区", "东北片区", "华东片区", "华南片区", "西南片区", "西北片区", "华中片区");
}
list.forEach(item -> {
wxList.add(wxMap.getOrDefault(item, 0));
......@@ -166,11 +187,26 @@ public class BigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各片区设备健康状态指数 ", notes = "全域各片区设备健康状态指数 ")
@GetMapping(value = "/getHealthInfoByArea")
public ResponseModel<Map<String, Object>> getHealthInfoByArea() {
public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
Map<String, BigDecimal> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> new BigDecimal(t.get("healthIndex").toString())));
List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List<String> list = new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("AREA");
Collection<CompanyModel> companyModels = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
companyModels = listFeignClientResult.getResult();
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
list = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>();
list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100"))));
resultMap.put("axisData", list);
......@@ -282,7 +318,7 @@ public class BigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> assessIndexRadarMap(@RequestParam(required = false, value = "stationCode") String stationCode) {
if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getBoosterGatewayId();
stationCode = stationBasic.getFanGatewayId();
}
List<Map<String, Object>> list = idxBizFanHealthIndexMapper.equipWarningRadarMap(stationCode);
Map<String, Integer> warningNumMap = list.stream().collect(Collectors.toMap(t -> t.get("warningName").toString(), t -> Integer.parseInt(t.get("num").toString())));
......@@ -404,7 +440,7 @@ public class BigScreenAnalyseController extends BaseController {
String replace = CharSequenceUtil.replace(equipmentName, "集电Ⅲ线#", "");
String replace1 = CharSequenceUtil.replace(replace, "集电Ⅱ线#", "");
String replace2 = CharSequenceUtil.replace(replace1, "集电Ⅰ线#", "");
String replace3 = CharSequenceUtil.replace(replace2, "风机系统", "");
String replace3 = CharSequenceUtil.replace(replace2, "风机", "");
item.put("equipmentNameSimple", replace3);
});
......@@ -464,7 +500,7 @@ public class BigScreenAnalyseController extends BaseController {
} else {
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备");
query.eq(IdxBizFanHealthLevel::getStatus, stationBasic.getStationName());
query.eq(IdxBizFanHealthLevel::getStatus, item.get("station"));
query.le(IdxBizFanHealthLevel::getGroupLowerLimit, equipmentHealthScore);
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit, equipmentHealthScore);
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
......
......@@ -19,7 +19,7 @@
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
......@@ -42,7 +42,7 @@
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
......@@ -81,7 +81,7 @@
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
......@@ -102,7 +102,7 @@
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
......@@ -320,12 +320,11 @@
FROM
idx_biz_fan_health_index
<where>
STATION IS NOT NULL
AND STATION != ''
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统')
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
......@@ -337,7 +336,8 @@
<select id="getFanInfoByPage" resultType="java.util.Map">
SELECT
EQUIPMENT_NAME as equipmentName,
INDEX_ADDRESS as indexAddress
INDEX_ADDRESS as indexAddress,
STATION as station
FROM
idx_biz_fan_point_process_variable_classification
<where>
......@@ -359,8 +359,7 @@
FROM
idx_biz_fan_health_index
<where>
STATION IS NOT NULL
AND STATION != ''
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="gatewayId != null and gatewayId != ''">
......@@ -378,8 +377,9 @@
FROM
idx_biz_fan_point_process_variable_classification
<where>
SUB_SYSTEM IS NOT NULL AND SUB_SYSTEM != ''
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统')
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
......@@ -392,7 +392,8 @@
<select id="getPointNameListBySumSystem" resultType="java.util.Map">
SELECT
POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress
INDEX_ADDRESS as indexAddress,
STATION AS station
FROM
idx_biz_fan_point_process_variable_classification
<where>
......@@ -414,8 +415,7 @@
FROM
idx_biz_fan_health_index
<where>
STATION IS NOT NULL
AND STATION != ''
ANALYSIS_OBJ_TYPE= '测点'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
AND POINT_NAME IS NOT NULL
......
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