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; ...@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -71,6 +73,12 @@ public class JpCollectorDto extends BaseDto { ...@@ -71,6 +73,12 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "电站地址") @ApiModelProperty(value = "电站地址")
private String addr; private String addr;
@ApiModelProperty(value = "采集器列表")
private List<JpInverter> jpInverters;
private List<String> stationIds; private List<String> stationIds;
@ApiModelProperty(value = "采集器名称")
private String name;
} }
...@@ -117,5 +117,10 @@ public class JpCollector extends BaseEntity { ...@@ -117,5 +117,10 @@ public class JpCollector extends BaseEntity {
*/ */
@TableField("addr") @TableField("addr")
private String addr; private String addr;
/**
* 采集器名称
*/
@TableField("name")
private String name;
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </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> </where>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<if test="dto.thirdStationId!=null"> <if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </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> </where>
GROUP BY hygf_jp_inverter.`state` GROUP BY hygf_jp_inverter.`state`
</select> </select>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<if test="dto!=null"> <if test="dto!=null">
third_station_id in third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item.stationId} #{item.thirdStationId}
</foreach> </foreach>
</if> </if>
and `state` in ('未处理','已处理','已恢复') and `state` in ('未处理','已处理','已恢复')
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; 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 org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -42,12 +46,15 @@ public class JpCollectorController extends BaseController { ...@@ -42,12 +46,15 @@ public class JpCollectorController extends BaseController {
@Autowired @Autowired
JpPersonStationMapper pPersonStationMapper; JpPersonStationMapper pPersonStationMapper;
/** @Autowired
* 新增户用光伏监盘采集器表 JpInverterServiceImpl jpInverterServiceImpl;
*
* @return /**
*/ * 新增户用光伏监盘采集器表
@TycloudOperation(ApiLevel = UserType.AGENCY) *
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘采集器表", notes = "新增户用光伏监盘采集器表") @ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘采集器表", notes = "新增户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> save(@RequestBody JpCollectorDto model) { public ResponseModel<JpCollectorDto> save(@RequestBody JpCollectorDto model) {
...@@ -92,9 +99,16 @@ public class JpCollectorController extends BaseController { ...@@ -92,9 +99,16 @@ public class JpCollectorController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long 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 { ...@@ -203,7 +203,7 @@ public class JpStationController extends BaseController {
collector.put("zx",map.get("num")); collector.put("zx",map.get("num"));
}else if("离线".equals(map.get("state").toString())){ }else if("离线".equals(map.get("state").toString())){
collector.put("lx",map.get("num")); 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")); collector.put("gj",map.get("num"));
} }
} }
...@@ -214,7 +214,7 @@ public class JpStationController extends BaseController { ...@@ -214,7 +214,7 @@ public class JpStationController extends BaseController {
inverter.put("zx",map.get("num")); inverter.put("zx",map.get("num"));
}else if("离线".equals(map.get("state").toString())){ }else if("离线".equals(map.get("state").toString())){
inverter.put("lx",map.get("num")); 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")); inverter.put("gj",map.get("num"));
} }
} }
......
...@@ -213,39 +213,4 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -213,39 +213,4 @@ public class TdHygfJpInverterWarnController extends BaseController {
} }
return ResponseHelper.buildResponse(collector); 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; 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.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
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.module.jxiop.api.entity.StationBasic; 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.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments; import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
...@@ -14,12 +16,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.ESEquipmentsDTO; ...@@ -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.IdxBizFanHealthLevel;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointProcessVariableClassification; 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.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.IdxBizFanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper; 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.mapper2.IdxBizFanWarningRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -55,6 +60,9 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -55,6 +60,9 @@ public class BigScreenAnalyseController extends BaseController {
@Autowired @Autowired
IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper; IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper;
@Autowired
IndicatorDataMapper indicatorDataMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo") @GetMapping(value = "/getHealthScoreInfo")
...@@ -553,4 +561,39 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -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; ...@@ -11,7 +11,7 @@ import java.util.List;
@Repository @Repository
public interface IndicatorDataMapper extends BaseMapper<IndicatorData> { 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); List<IndicatorData> selectDataByAddressAndtime(@Param("address")String address,@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("gatewayId")String gatewayId);
} }
...@@ -328,7 +328,8 @@ ...@@ -328,7 +328,8 @@
<select id="getFanInfoByPage" resultType="java.util.Map"> <select id="getFanInfoByPage" resultType="java.util.Map">
SELECT SELECT
EQUIPMENT_NAME as equipmentName EQUIPMENT_NAME as equipmentName,
INDEX_ADDRESS as indexAddress
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
...@@ -364,12 +365,17 @@ ...@@ -364,12 +365,17 @@
<select id="getSumSystemListByEquipment" resultType="java.util.Map"> <select id="getSumSystemListByEquipment" resultType="java.util.Map">
SELECT SELECT
SUB_SYSTEM as subSystem SUB_SYSTEM as subSystem,
INDEX_ADDRESS as indexAddress
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
EQUIPMENT_NAME = #{equipmentName} <if test="equipmentName != null and equipmentName != ''">
AND GATEWAY_ID = #{gatewayId} AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where> </where>
GROUP BY GROUP BY
SUB_SYSTEM SUB_SYSTEM
...@@ -377,12 +383,17 @@ ...@@ -377,12 +383,17 @@
<select id="getPointNameListBySumSystem" resultType="java.util.Map"> <select id="getPointNameListBySumSystem" resultType="java.util.Map">
SELECT SELECT
POINT_NAME as pointName POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
SUB_SYSTEM = #{subSystem} <if test="subSystem != null and subSystem != ''">
AND GATEWAY_ID = #{gatewayId} AND SUB_SYSTEM = #{subSystem}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where> </where>
GROUP BY GROUP BY
POINT_NAME POINT_NAME
...@@ -491,8 +502,12 @@ ...@@ -491,8 +502,12 @@
FROM FROM
idx_biz_pv_point_process_variable_classification idx_biz_pv_point_process_variable_classification
<where> <where>
SUBARRAY = #{subarray} <if test="subarray != null and subarray != ''">
AND GATEWAY_ID = #{gatewayId} AND SUBARRAY = #{subarray}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where> </where>
GROUP BY GROUP BY
EQUIPMENT_NAME EQUIPMENT_NAME
...@@ -536,8 +551,12 @@ ...@@ -536,8 +551,12 @@
FROM FROM
idx_biz_pv_point_process_variable_classification idx_biz_pv_point_process_variable_classification
<where> <where>
EQUIPMENT_NAME = #{equipmentName} <if test="equipmentName != null and equipmentName != ''">
AND GATEWAY_ID = #{gatewayId} AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
</if>
</where> </where>
GROUP BY GROUP BY
POINT_NAME 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