Commit 01f84570 authored by caotao's avatar caotao

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

parents de882b4b a561afaa
......@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -72,5 +74,11 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "电站地址")
private String addr;
@ApiModelProperty(value = "采集器列表")
private List<JpInverter> jpInverters;
private List<String> stationIds;
@ApiModelProperty(value = "采集器名称")
private String name;
}
......@@ -117,5 +117,10 @@ public class JpCollector extends BaseEntity {
*/
@TableField("addr")
private String addr;
/**
* 采集器名称
*/
@TableField("name")
private String name;
}
......@@ -29,7 +29,7 @@
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
and hygf_jp_collector.`state` is not null and hygf_jp_collector.`state` in ("在线","警","离线")
and hygf_jp_collector.`state` is not null and hygf_jp_collector.`state` in ("在线","警","离线")
</where>
......
......@@ -28,7 +28,7 @@
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
and hygf_jp_inverter.`state` is not null and hygf_jp_inverter.`state` in ("在线","警","离线")
and hygf_jp_inverter.`state` is not null and hygf_jp_inverter.`state` in ("在线","警","离线")
</where>
GROUP BY hygf_jp_inverter.`state`
</select>
......
......@@ -9,7 +9,7 @@
<if test="dto!=null">
third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
#{item.thirdStationId}
</foreach>
</if>
and `state` in ('未处理','已处理','已恢复')
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -42,6 +46,9 @@ public class JpCollectorController extends BaseController {
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Autowired
JpInverterServiceImpl jpInverterServiceImpl;
/**
* 新增户用光伏监盘采集器表
*
......@@ -92,9 +99,16 @@ public class JpCollectorController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryBySeq(sequenceNbr));
JpCollectorDto jpCollectorDto = jpCollectorServiceImpl.queryBySeq(sequenceNbr);
LambdaQueryWrapper<JpInverter> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JpInverter::getCollectorSnCode, jpCollectorDto.getSnCode());
List<JpInverter> list = jpInverterServiceImpl.list(queryWrapper);
jpCollectorDto.setJpInverters(list);
return ResponseHelper.buildResponse(jpCollectorDto);
}
/**
......
......@@ -203,7 +203,7 @@ public class JpStationController extends BaseController {
collector.put("zx",map.get("num"));
}else if("离线".equals(map.get("state").toString())){
collector.put("lx",map.get("num"));
}else if("警".equals(map.get("state").toString())){
}else if("警".equals(map.get("state").toString())){
collector.put("gj",map.get("num"));
}
}
......@@ -214,7 +214,7 @@ public class JpStationController extends BaseController {
inverter.put("zx",map.get("num"));
}else if("离线".equals(map.get("state").toString())){
inverter.put("lx",map.get("num"));
}else if("警".equals(map.get("state").toString())){
}else if("警".equals(map.get("state").toString())){
inverter.put("gj",map.get("num"));
}
}
......
......@@ -213,39 +213,4 @@ public class TdHygfJpInverterWarnController extends BaseController {
}
return ResponseHelper.buildResponse(collector);
}
// /**
// * 获取告警统计
// **/
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
// @GetMapping(value = "/selectcount")
// public ResponseModel<List<Map<String, Object>>> selectcount(JpStationDto reviewDto) {
// LambdaQueryWrapper<JpStation> qugda = new LambdaQueryWrapper<>();
// // 获取当前人管理场站
// if (reviewDto.getThirdStationId() == null) {
// // 获取当前人管理场站
// LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
// qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
// List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
// List ids = null;
// if (pPersonStation != null && !pPersonStation.isEmpty()) {
// ids = new ArrayList();
// for (JpPersonStation jpPersonStation : pPersonStation) {
// ids.add(jpPersonStation.getStationId());
// }
// qugda.in(ids != null, JpStation::getThirdStationId, ids);
// }
// } else {
// qugda.eq(JpStation::getThirdStationId, reviewDto.getThirdStationId());
// }
// qugda.like(reviewDto.getUserName() != null, JpStation::getUserName, reviewDto.getUserName());
// qugda.like(reviewDto.getArea() != null, JpStation::getArea, reviewDto.getArea());
// List<JpStation> pPersonStation = jpStationMapper.selectList(qugda);
// List<Map<String, Object>> datalist = tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation);
// return ResponseHelper.buildResponse(datalist);
// }
}
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
......@@ -14,12 +16,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.ESEquipmentsDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointProcessVariableClassification;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -55,6 +60,9 @@ public class BigScreenAnalyseController extends BaseController {
@Autowired
IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper;
@Autowired
IndicatorDataMapper indicatorDataMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo")
......@@ -553,4 +561,39 @@ public class BigScreenAnalyseController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风站/光伏 右下实时趋势")
@GetMapping("/getTrendInfoByAddress")
public ResponseModel<Map<String, Object>> getTrendInfoByAddress(@RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN);
List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
HashMap<String, Object> resultMap = new HashMap<>();
List<String> time = new ArrayList<>();
List<Object> valueList = new ArrayList<>();
indicatorData.forEach(item -> {
String date = DateUtils.convertDateToString(item.getCreatedTime(), "HH:mm:ss");
time.add(date);
String value = StrUtil.isEmpty(item.getValue()) ? "0.0" : item.getValue();
double v = Double.parseDouble(value);
valueList.add(v);
});
List<Map<String, Object>> arrayList = new ArrayList<>();
HashMap<String, Object> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("data", valueList);
arrayList.add(stringStringHashMap);
resultMap.put("axisData", time);
resultMap.put("seriesData", arrayList);
return ResponseHelper.buildResponse(resultMap);
}
}
......@@ -11,7 +11,7 @@ import java.util.List;
@Repository
public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select `value` from iot_data.indicator_data where address=#{address} and createdtime >= #{startTime} and createdtime <= #{endTime} and gateway_id =#{gatewayId}")
@Select("select `value`, createdTime, `value_f` as valueF from iot_data.indicator_data where address=#{address} and createdtime >= #{startTime} and createdtime <= #{endTime} and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByAddressAndtime(@Param("address")String address,@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("gatewayId")String gatewayId);
}
......@@ -328,7 +328,8 @@
<select id="getFanInfoByPage" resultType="java.util.Map">
SELECT
EQUIPMENT_NAME as equipmentName
EQUIPMENT_NAME as equipmentName,
INDEX_ADDRESS as indexAddress
FROM
idx_biz_fan_point_process_variable_classification
<where>
......@@ -364,12 +365,17 @@
<select id="getSumSystemListByEquipment" resultType="java.util.Map">
SELECT
SUB_SYSTEM as subSystem
SUB_SYSTEM as subSystem,
INDEX_ADDRESS as indexAddress
FROM
idx_biz_fan_point_process_variable_classification
<where>
EQUIPMENT_NAME = #{equipmentName}
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where>
GROUP BY
SUB_SYSTEM
......@@ -377,12 +383,17 @@
<select id="getPointNameListBySumSystem" resultType="java.util.Map">
SELECT
POINT_NAME as pointName
POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress
FROM
idx_biz_fan_point_process_variable_classification
<where>
SUB_SYSTEM = #{subSystem}
<if test="subSystem != null and subSystem != ''">
AND SUB_SYSTEM = #{subSystem}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where>
GROUP BY
POINT_NAME
......@@ -491,8 +502,12 @@
FROM
idx_biz_pv_point_process_variable_classification
<where>
SUBARRAY = #{subarray}
<if test="subarray != null and subarray != ''">
AND SUBARRAY = #{subarray}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where>
GROUP BY
EQUIPMENT_NAME
......@@ -536,8 +551,12 @@
FROM
idx_biz_pv_point_process_variable_classification
<where>
EQUIPMENT_NAME = #{equipmentName}
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where>
GROUP BY
POINT_NAME
......
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