Commit 59eec70b authored by zhangsen's avatar zhangsen

bug修改

parent 594c8984
...@@ -2,13 +2,13 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,13 +2,13 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; 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.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.feign.RiskWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO; import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
...@@ -78,12 +78,13 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -78,12 +78,13 @@ public class BigScreenAnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo") @GetMapping(value = "/getHealthScoreInfo")
public ResponseModel<Map<String, BigDecimal>> getHealthScoreInfo(@RequestParam(required = false) String areaCode, @RequestParam(required = false) String stationCode) { public ResponseModel<Map<String, BigDecimal>> getHealthScoreInfo(@RequestParam(required = false) String areaCode, @RequestParam(required = false) String stationCode) {
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
if (StrUtil.isNotEmpty(stationCode)) { if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfoByStation(areaCode, stationCode));
return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode)); stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
...@@ -115,8 +116,6 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -115,8 +116,6 @@ public class BigScreenAnalyseController extends BaseController {
resultMap.put("seriesData", arrayList); resultMap.put("seriesData", arrayList);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@Autowired
AgencyuserFeign agencyuserFeign;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各片区设备预警情况(条) ", notes = "全域各片区设备预警情况(条) ") @ApiOperation(httpMethod = "GET", value = "全域各片区设备预警情况(条) ", notes = "全域各片区设备预警情况(条) ")
...@@ -141,7 +140,9 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -141,7 +140,9 @@ public class BigScreenAnalyseController extends BaseController {
List<Integer> jgList = new ArrayList<>(); List<Integer> jgList = new ArrayList<>();
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("area");
FeignClientResult<Collection<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("AREA");
Collection<CompanyModel> companyModels = new ArrayList<>(); Collection<CompanyModel> companyModels = new ArrayList<>();
...@@ -152,8 +153,8 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -152,8 +153,8 @@ public class BigScreenAnalyseController extends BaseController {
throw new RuntimeException(listFeignClientResult.getMessage()); throw new RuntimeException(listFeignClientResult.getMessage());
} }
} }
List<String> collect = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
List<String> collect = companyModels.stream().map(t -> t.getCompanyName()).collect(Collectors.toList());
if ("idx_biz_fan_warning_record".equals(tableName)) { if ("idx_biz_fan_warning_record".equals(tableName)) {
list = collect; list = collect;
// list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区"); // list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
...@@ -436,12 +437,18 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -436,12 +437,18 @@ public class BigScreenAnalyseController extends BaseController {
item.put("warningName", idxBizFanHealthLevel.getHealthLevel()); item.put("warningName", idxBizFanHealthLevel.getHealthLevel());
} }
item.put("healthIndex", equipmentHealthScore); item.put("healthIndex", equipmentHealthScore);
String equipmentName = CharSequenceUtil.replace(item.get("equipmentName").toString(), "集电Ⅳ线#", ""); // String equipmentName = CharSequenceUtil.replace(item.get("equipmentName").toString(), "集电Ⅳ线#", "");
String replace = CharSequenceUtil.replace(equipmentName, "集电Ⅲ线#", ""); // String replace = CharSequenceUtil.replace(equipmentName, "集电Ⅲ线#", "");
String replace1 = CharSequenceUtil.replace(replace, "集电Ⅱ线#", ""); // String replace1 = CharSequenceUtil.replace(replace, "集电Ⅱ线#", "");
String replace2 = CharSequenceUtil.replace(replace1, "集电Ⅰ线#", ""); // String replace2 = CharSequenceUtil.replace(replace1, "集电Ⅰ线#", "");
String replace3 = CharSequenceUtil.replace(replace2, "风机", ""); // String replace3 = CharSequenceUtil.replace(replace2, "风机", "");
item.put("equipmentNameSimple", replace3);
String equipmentName = item.get("equipmentName").toString();
String str1 = equipmentName.substring(0, equipmentName.indexOf("#"));
String str2 = equipmentName.substring(str1.length()+1, equipmentName.length());
String str3 = CharSequenceUtil.replace(str2, "风机", "");
item.put("equipmentNameSimple", str3);
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
......
...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
BigDecimal getHealthScoreInfoByStation(@Param("stationCode") String stationCode, @Param("tableName") String tableName);
List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName); List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName);
......
...@@ -53,6 +53,25 @@ ...@@ -53,6 +53,25 @@
) a ) a
</select> </select>
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT
IFNULL( HEALTH_INDEX , 100 ) AS healthIndex
FROM
${tableName}
<where>
ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="stationCode != null and stationCode != ''">
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
</where>
limit 1
</select>
<select id="getHealthListInfo" resultType="java.util.Map"> <select id="getHealthListInfo" resultType="java.util.Map">
SELECT SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex, IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
......
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