Commit 5e8bb0dd authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/amos-boot-biz into developer

parents 019ac91c 55fd3d3d
......@@ -3,6 +3,7 @@ package com.yeejoin.amos;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.listener.SyncDasSuccessMqttListener;
import com.yeejoin.amos.boot.module.jxiop.biz.listener.SyncESDataToTdengineMqttListener;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
......@@ -62,6 +63,8 @@ public class AmosJxiopAnalyseApplication {
Boolean openHealth;
@Autowired
private SyncESDataToTdengineMqttListener syncESDataToTdengineMqttListener;
@Autowired
private SyncDasSuccessMqttListener syncDasSuccessMqttListener;
private static final Logger logger = LoggerFactory.getLogger(AmosJxiopAnalyseApplication.class);
......@@ -82,6 +85,8 @@ public class AmosJxiopAnalyseApplication {
if (openHealth) {
//订阅固化周期性数据成功的消息
emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1, syncESDataToTdengineMqttListener);
//订阅业务固化同步数据成功消息
emqKeeper.subscript("sync_iotdata_to_tdengine_notice", 1, syncDasSuccessMqttListener);
}
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanPointVarCorrelationServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -15,6 +19,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
*
......@@ -112,4 +117,32 @@ public class IdxBizFanPointVarCorrelationController extends BaseController {
public ResponseModel<List<IdxBizFanPointVarCorrelationDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizFanPointVarCorrelationServiceImpl.queryForIdxBizFanPointVarCorrelationList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@GetMapping(value = "/getCurrentChoosePoint")
public ResponseModel<Map<String,Object>> getCurrentChoosePoint(String gatewayId,String analysePointId) {
return ResponseHelper.buildResponse(idxBizFanPointVarCorrelationServiceImpl.getCurrentChoosePoint(gatewayId,analysePointId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@PostMapping(value = "/updatePointChoose")
public ResponseModel updatePointChoose(@RequestBody IdxBizFanPointVarCorrelationDto dto) {
idxBizFanPointVarCorrelationServiceImpl.updatePointChoose(dto.getAnalysisGatewayId(),dto.getAnalysisPointId(),dto.getProcessPointIds());
return CommonResponseUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位的工况变量", notes = "查询当前点位的工况变量")
@GetMapping(value = "/getPointProcess")
public ResponseModel<Map<String,Object>> getPointProcess(String gatewayId, String analysePointId) {
return ResponseHelper.buildResponse(idxBizFanPointVarCorrelationServiceImpl.getPointProcess(gatewayId,analysePointId));
}
}
......@@ -2,7 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvPointVarCorrelationServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -15,6 +19,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
*
......@@ -112,4 +117,32 @@ public class IdxBizPvPointVarCorrelationController extends BaseController {
public ResponseModel<List<IdxBizPvPointVarCorrelationDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizPvPointVarCorrelationServiceImpl.queryForIdxBizPvPointVarCorrelationList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@GetMapping(value = "/getCurrentChoosePoint")
public ResponseModel<Map<String,Object>> getCurrentChoosePoint(String gatewayId, String analysePointId) {
return ResponseHelper.buildResponse(idxBizPvPointVarCorrelationServiceImpl.getCurrentChoosePoint(gatewayId,analysePointId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@PostMapping(value = "/updatePointChoose")
public ResponseModel updatePointChoose(@RequestBody IdxBizFanPointVarCorrelationDto dto) {
idxBizPvPointVarCorrelationServiceImpl.updatePointChoose(dto.getAnalysisGatewayId(),dto.getAnalysisPointId(),dto.getProcessPointIds());
return CommonResponseUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前点位的工况变量", notes = "查询当前点位的工况变量")
@GetMapping(value = "/getPointProcess")
public ResponseModel<Map<String,Object>> getPointProcess(String gatewayId, String analysePointId) {
return ResponseHelper.buildResponse(idxBizPvPointVarCorrelationServiceImpl.getPointProcess(gatewayId,analysePointId));
}
}
......@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -86,4 +87,6 @@ public class IdxBizFanPointVarCorrelationDto {
@TableField("EQUIPMENT_NAME")
private String equipmentName;
@TableField(exist = false)
private List<String> processPointIds;
}
......@@ -149,4 +149,9 @@ public class IdxBizFanPointVarCorrelation{
*/
@TableField("PROCESS_POINT_NAME")
private String processPointName;
/**
* 匹配工况变量
*/
@TableField("MATCH_PROCESS_PONIT")
private String matchProcessPoint;
}
......@@ -12,8 +12,6 @@ import java.time.LocalDateTime;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2023-08-15
*/
......@@ -21,107 +19,109 @@ import java.util.Date;
@Accessors(chain = true)
@TableName("idx_biz_fan_warning_rule_set")
public class IdxBizFanWarningRuleSet{
public class IdxBizFanWarningRuleSet {
private static final long serialVersionUID = 1L;
/**
*
*
*/
@TableId("SEQUENCE_NBR")
@TableId("SEQUENCE_NBR")
private String sequenceNbr;
/**
*
*
*/
@TableField("RECORD")
@TableField("RECORD")
private String record;
/**
*
*
*/
@TableField("REC_DATE")
@TableField("REC_DATE")
private Date recDate;
/**
*
*
*/
@TableField("REC_USER_ID")
@TableField("REC_USER_ID")
private String recUserId;
/**
*
*
*/
@TableField("INSTANCE_ID")
@TableField("INSTANCE_ID")
private String instanceId;
/**
*
*
*/
@TableField("STATUS")
@TableField("STATUS")
private String status;
/**
* 预警判断条件
*/
@TableField("WARNING_IF")
@TableField("WARNING_IF")
private String warningIf;
/**
* 预警判断连续周期
*/
@TableField("WARNING_CYCLE")
@TableField("WARNING_CYCLE")
private String warningCycle;
/**
* 预警名称(危险、警告、注意)
*/
@TableField("WARNING_NAME")
@TableField("WARNING_NAME")
private String warningName;
/**
*
*
*/
@TableField("ANALYSIS_POINT_ID")
@TableField("ANALYSIS_POINT_ID")
private String analysisPointId;
/**
* 分析周期((按天、10min、小时)
*/
@TableField("ANALYSIS_TYPE")
@TableField("ANALYSIS_TYPE")
private String analysisType;
/**
* 片区
*/
@TableField("ARAE")
@TableField("ARAE")
private String arae;
/**
* 场站
*/
@TableField("STATION")
@TableField("STATION")
private String station;
/**
* 子系统
*/
@TableField("SUB_SYSTEM")
@TableField("SUB_SYSTEM")
private String subSystem;
/**
* 型号
*/
@TableField("NUMBER")
@TableField("NUMBER")
private String number;
/**
* 设备名称
*/
@TableField("EQUIPMENT_NAME")
@TableField("EQUIPMENT_NAME")
private String equipmentName;
@TableField("POINT_NAME")
@TableField("POINT_NAME")
private String pointName;
@TableField("GATEWAY_ID")
private String gatewayId;
}
......@@ -151,4 +151,7 @@ public class IdxBizPvPointVarCorrelation{
*/
@TableField("PROCESS_POINT_NAME")
private String processPointName;
@TableField("MATCH_PROCESS_POINT")
private String matchProcessPoint;
}
......@@ -133,4 +133,11 @@ public class IdxBizPvWarningRuleSet{
*/
@TableField("POINT_NAME")
private String pointName;
/**
* 分析变量
*/
@TableField("GATEWAY_ID")
private String gatewayId;
}
package com.yeejoin.amos.boot.module.jxiop.biz.listener;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
/**
* @author Administrator
*/
@Component
@Slf4j
public class SyncDasSuccessMqttListener extends EmqxListener {
@Autowired
CommonServiceImpl commonServiceImpl;
@Override
public void processMessage(String topic, MqttMessage mqttMessage) {
log.info(topic + "收到数据同步成功,开始计算健康指数!");
byte[] payload = mqttMessage.getPayload();
String str = new String(payload);
String msg = JSON.parse(str).toString();
JSONObject jsonObject = JSONObject.parseObject(msg);
String flag = jsonObject.get("sync_flag").toString();
String gatewayId = jsonObject.get("gatewayId").toString();
if ("success".equals(flag)&&jsonObject.containsKey("gatewayId")){
//开始异步计算光伏的健康指数算法
new Thread(()->{
//调用光伏的健康指数算法
commonServiceImpl.healthWarningMinuteByPv(gatewayId);
}).start();
//开始异步计算风机的健康指数算法
new Thread(()->{
//调用风机的健康指数算法
commonServiceImpl.healthWarningMinuteByFan(gatewayId);
}).start();
}
}
}
......@@ -16,6 +16,7 @@ import java.util.Map;
*/
public interface IdxBizFanPointProcessVariableClassificationMapper extends BaseMapper<IdxBizFanPointProcessVariableClassification> {
List<IdxBizFanPointProcessVariableClassificationDto> getInfluxDBData();
List<IdxBizFanPointProcessVariableClassificationDto> getInfluxDBDataByGatewayId(String gatewayId);
List<Map<String,Object>> selectParams(String tableName,String column,String isFx);
......
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation;
import java.util.List;
/**
* Mapper 接口
*
......@@ -10,5 +12,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelatio
* @date 2023-08-15
*/
public interface IdxBizFanPointVarCorrelationMapper extends BaseMapper<IdxBizFanPointVarCorrelation> {
void updatePointChoose(String gatewayId, Long analysePointId, List<String> processPointIds);
}
......@@ -21,6 +21,9 @@ public interface IdxBizFanWarningRuleSetMapper extends BaseMapper<IdxBizFanWarni
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_fan_warning_rule_set WHERE ANALYSIS_TYPE = '按10分钟'")
Integer getMaxWaringCycleOfMinutes();
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_fan_warning_rule_set WHERE ANALYSIS_TYPE = '按10分钟' and GATEWAY_ID = #{gatewayId}")
Integer getMaxWaringCycleOfMinutesByGatewayId(String gatewayId);
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_fan_warning_rule_set WHERE ANALYSIS_TYPE = '按小时'")
Integer getMaxWaringCycleOfHour();
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_fan_warning_rule_set WHERE ANALYSIS_TYPE = '按天'")
......
......@@ -17,5 +17,6 @@ public interface IdxBizPvPointProcessVariableClassificationMapper extends BaseMa
List<String> gateWayIdListPv();
List<IdxBizPvPointProcessVariableClassificationDto> getInfluxDBData();
List<IdxBizPvPointProcessVariableClassificationDto> getInfluxDBDataByGatewayId(String gatewayId);
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointVarCorrelation;
import java.util.List;
/**
* Mapper 接口
*
......@@ -11,4 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointVarCorrelation
*/
public interface IdxBizPvPointVarCorrelationMapper extends BaseMapper<IdxBizPvPointVarCorrelation> {
void updatePointChoose(String gatewayId, Long analysePointId, List<String> processPointIds);
}
......@@ -16,6 +16,8 @@ public interface IdxBizPvWarningRuleSetMapper extends BaseMapper<IdxBizPvWarning
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_pv_warning_rule_set WHERE ANALYSIS_TYPE = '按10分钟'")
Integer getMaxWaringCycleOfMinutes();
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_pv_warning_rule_set WHERE ANALYSIS_TYPE = '按10分钟' and GATEWAY_ID = #{gateWayId}")
Integer getMaxWaringCycleOfMinutesByGatewayId(String gateWayId);
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_pv_warning_rule_set WHERE ANALYSIS_TYPE = '按小时'")
Integer getMaxWaringCycleOfHour();
@Select("SELECT MAX(WARNING_CYCLE) FROM idx_biz_pv_warning_rule_set WHERE ANALYSIS_TYPE = '按天'")
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointVarCorrelationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizFanPointVarCorrelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 服务实现类
......@@ -18,6 +25,9 @@ import java.util.List;
*/
@Service
public class IdxBizFanPointVarCorrelationServiceImpl extends BaseService<IdxBizFanPointVarCorrelationDto, IdxBizFanPointVarCorrelation, IdxBizFanPointVarCorrelationMapper> implements IIdxBizFanPointVarCorrelationService {
@Autowired
private IdxBizFanPointVarCorrelationMapper idxBizFanPointVarCorrelationMapper;
/**
* 分页查询
*/
......@@ -31,4 +41,47 @@ public class IdxBizFanPointVarCorrelationServiceImpl extends BaseService<IdxBizF
public List<IdxBizFanPointVarCorrelationDto> queryForIdxBizFanPointVarCorrelationList() {
return this.queryForList("" , false);
}
public Map<String,Object> getCurrentChoosePoint(String gatewayId, String analysePointId) {
List<IdxBizFanPointVarCorrelation> gongkuangList;
gongkuangList = idxBizFanPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizFanPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId)
.eq("MATCH_PROCESS_PONIT","匹配"));
if (CollectionUtil.isEmpty(gongkuangList) || gongkuangList.size() !=3 ){
gongkuangList = idxBizFanPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizFanPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId)
.orderByDesc("CORRELATION_COEFFICIENT").last("limit 0,3"));
}
List<Long> collect = gongkuangList.stream().map(IdxBizFanPointVarCorrelation::getProcessPointId).collect(Collectors.toList());
return MapBuilder.<String,Object>create().put("processPointIds",collect).build();
}
public void updatePointChoose(String gatewayId, Long analysePointId, List<String> processPointIds) {
this.getBaseMapper().updatePointChoose(gatewayId,analysePointId,null);
this.getBaseMapper().updatePointChoose(gatewayId,analysePointId,processPointIds);
}
public Map<String,Object> getPointProcess(String gatewayId, String analysePointId) {
List<IdxBizFanPointVarCorrelation> gongkuangList = idxBizFanPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizFanPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId));
return MapBuilder.<String,Object>create().put("processPointIds",gongkuangList).build();
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointVarCorrelationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizPvPointVarCorrelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 服务实现类
......@@ -18,6 +26,8 @@ import java.util.List;
*/
@Service
public class IdxBizPvPointVarCorrelationServiceImpl extends BaseService<IdxBizPvPointVarCorrelationDto,IdxBizPvPointVarCorrelation,IdxBizPvPointVarCorrelationMapper> implements IIdxBizPvPointVarCorrelationService {
@Autowired
private IdxBizPvPointVarCorrelationMapper idxBizPvPointVarCorrelationMapper;
/**
* 分页查询
*/
......@@ -31,4 +41,49 @@ public class IdxBizPvPointVarCorrelationServiceImpl extends BaseService<IdxBizPv
public List<IdxBizPvPointVarCorrelationDto> queryForIdxBizPvPointVarCorrelationList() {
return this.queryForList("" , false);
}
public Map<String,Object> getCurrentChoosePoint(String gatewayId, String analysePointId) {
List<IdxBizPvPointVarCorrelation> gongkuangList;
gongkuangList = idxBizPvPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizPvPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId)
.eq("MATCH_PROCESS_POINT","匹配"));
if (CollectionUtil.isEmpty(gongkuangList) || gongkuangList.size() !=3 ){
gongkuangList = idxBizPvPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizPvPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId)
.orderByDesc("CORRELATION_COEFFICIENT").last("limit 0,3"));
}
List<String> collect = gongkuangList.stream().map(IdxBizPvPointVarCorrelation::getProcessPointId).collect(Collectors.toList());
return MapBuilder.<String,Object>create().put("processPointIds",collect).build();
}
public void updatePointChoose(String gatewayId, Long analysePointId, List<String> processPointIds) {
this.getBaseMapper().updatePointChoose(gatewayId,analysePointId,null);
this.getBaseMapper().updatePointChoose(gatewayId,analysePointId,processPointIds);
}
public Map<String,Object> getPointProcess(String gatewayId, String analysePointId) {
List<IdxBizPvPointVarCorrelation> gongkuangList = idxBizPvPointVarCorrelationMapper
.selectList(new QueryWrapper<IdxBizPvPointVarCorrelation>()
.eq("ANALYSIS_GATEWAY_ID",
gatewayId)
.eq("ANALYSIS_POINT_ID",
analysePointId));
return MapBuilder.<String,Object>create().put("processPointIds",gongkuangList).build();
}
}
\ No newline at end of file
......@@ -53,6 +53,8 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}")
List<IndicatorData> selectDataByGatewayIdAndAddress(@Param("gatewayId") String gatewayId);
@Select("select `value`,`value_f`, address, gateway_id from analysis_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId} and point_type = 'SENSOR'")
List<IndicatorData> selectDataByGatewayId(@Param("gatewayId") String gatewayId);
@Select("select created_time,`value`,`value_f`, address, gateway_id from iot_data.indicator_data where gateway_id = #{gatewayId} and `address` in ( ${addresses} ) and ts >= #{startTime} and ts <= #{endTime}")
List<IndicatorData> selectDataByGatewayIdAndAddressForAlarmInfoDetail(@Param("gatewayId") String gatewayId,@Param("addresses") String addresses,@Param("startTime") String startTime, @Param("endTime") String endTime);
......
......@@ -83,7 +83,89 @@
GROUP BY
b.SEQUENCE_NBR
</select>
<select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto">
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_fan_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT1_ID FROM `idx_biz_fan_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_fan_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT2_ID FROM `idx_biz_fan_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_fan_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT3_ID FROM `idx_biz_fan_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_fan_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT ANALYSIS_POINT_ID FROM `idx_biz_fan_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_fan_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
and b.GATEWAY_ID = #{gatewayId}
GROUP BY
b.SEQUENCE_NBR
</select>
<select id="gateWayIdListFan" resultType="java.lang.String">
select GATEWAY_ID from idx_biz_fan_point_process_variable_classification group by GATEWAY_ID;
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointVarCorrelationMapper">
<update id="updatePointChoose">
update idx_biz_fan_point_var_correlation
<set>
<if test="processPointIds == null || processPointIds.size() == 0">
MATCH_PROCESS_PONIT = null
</if>
<if test="processPointIds != null and processPointIds.size() > 0">
MATCH_PROCESS_PONIT = '匹配'
</if>
</set>
WHERE ANALYSIS_GATEWAY_ID = #{gatewayId}
and ANALYSIS_POINT_ID = #{analysePointId}
<if test="processPointIds != null and processPointIds.size() > 0">
and PROCESS_POINT_ID in
<foreach collection="processPointIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</update>
</mapper>
......@@ -88,4 +88,89 @@
GROUP BY
b.SEQUENCE_NBR
</select>
<select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_pv_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT1_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_pv_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT2_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_pv_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT3_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY
b.SEQUENCE_NBR UNION ALL
SELECT
b.*,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID AS pointId
FROM
(
SELECT
*
FROM
idx_biz_pv_point_process_variable_classification uxfv
WHERE
uxfv.SEQUENCE_NBR IN ( SELECT ANALYSIS_POINT_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
and b.GATEWAY_ID = #{gatewayId}
GROUP BY
b.SEQUENCE_NBR
</select>
</mapper>
......@@ -2,4 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointVarCorrelationMapper">
<update id="updatePointChoose">
update idx_biz_pv_point_var_correlation
<set>
<if test="processPointIds == null || processPointIds.size() == 0">
MATCH_PROCESS_PONIT = null
</if>
<if test="processPointIds != null and processPointIds.size() > 0">
MATCH_PROCESS_PONIT = '匹配'
</if>
</set>
WHERE ANALYSIS_GATEWAY_ID = #{gatewayId}
and ANALYSIS_POINT_ID = #{analysePointId}
<if test="processPointIds != null and processPointIds.size() > 0">
and PROCESS_POINT_ID in
<foreach collection="processPointIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</update>
</mapper>
......@@ -4,11 +4,13 @@ import lombok.Data;
@Data
public class BuDunGenDto {
private Double day;
private Double month;
private Double year;
private Double month_complete;
private Double year_complete;
private Double year_hour_number;
private Double cumulative;
private String station_name;
private Double actual_installed_capacity;
private Double day;
private Double month;
private Double year;
private Double month_complete;
private Double year_complete;
private Double year_hour_number;
private Double cumulative;
}
......@@ -246,10 +246,11 @@ public class MonitorServiceImpl implements MonitorService {
@Override
public Map<String, Object> gettimedateqyyfd(String areaName) {
String requestUrl = Constants.BASE_URL + "?" + Constants.get_generated_quota_trend + "&areaName=" + areaName;
String requestUrl = Constants.BASE_URL + "?" + Constants.get_generated_quota_trend ;
MapRegion mapRegion = mapRegionMapper.selectOne(new QueryWrapper<MapRegion>().eq("name", areaName));
if (!areaName.contains(Constants.areaChinese)) {
areaName = Constants.areaChinese;
areaName =areaName+ Constants.areaChinese;
requestUrl =requestUrl+ "&areaName=" + areaName;
}
List<BundunCompleteDto> bundunCompleteDtoList = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BundunCompleteDto.class);
......
......@@ -39,7 +39,7 @@ public class CoreCommonServiceImpl implements CoreCommonService {
});
}catch (Exception e){
e.printStackTrace();
return result;
return new ArrayList<>();
}
return result;
}
......
......@@ -361,14 +361,14 @@ public class MonitorServiceImpl implements MonitorService {
AtomicReference<Double> fdzannualPower = new AtomicReference<>(0.0);
AtomicReference<Double> gfzannualPower = new AtomicReference<>(0.0);
List<CoreValuesDto> coreValuesDtos = coreCommonService.getValuesByStationNamesAndPointsNames(null, null);
String requestUrl = Constants.BASE_URL + "?" + Constants.get_province_station_item + "&provinceName" + provinceName;
String requestUrl = Constants.BASE_URL + "?" + Constants.get_province_station_item + "&provinceName=" + provinceName;
List<BuDunStationDetailInfo> buDunStationDetailInfos = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunStationDetailInfo.class);
if (buDunStationDetailInfos.size() > 0) {
buDunStationDetailInfos.forEach(buDunStationDetailInfo -> {
CompletionOfPowerIndicatorsDto completionOfPowerIndicatorsDto = new CompletionOfPowerIndicatorsDto();
completionOfPowerIndicatorsDto.setStationName(buDunStationDetailInfo.getStation_name());
completionOfPowerIndicatorsDto.setInstallCapactity(String.valueOf(buDunStationDetailInfo.getActual_installed_capacity()));
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, buDunStationDetailInfo.getWind_as_irradiance()));
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(!ObjectUtils.isEmpty(buDunStationDetailInfo.getWind_as_irradiance())?String.format(CommonConstans.Twodecimalplaces, buDunStationDetailInfo.getWind_as_irradiance()):"--");
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, buDunStationDetailInfo.getDay()));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, buDunStationDetailInfo.getMonth()));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, buDunStationDetailInfo.getYear()));
......@@ -487,7 +487,7 @@ public class MonitorServiceImpl implements MonitorService {
String requestUrl = Constants.BASE_URL + "?" + Constants.get_area_item_url;
if (!ObjectUtils.isEmpty(areaName)) {
if (!areaName.contains(Constants.areaChinese)) {
areaName = Constants.areaChinese;
areaName =areaName+ Constants.areaChinese;
}
requestUrl = requestUrl + "&areaName=" + areaName;
}
......@@ -579,7 +579,7 @@ public class MonitorServiceImpl implements MonitorService {
List<HashMap<String, String>> mapList = new ArrayList<>();
String requestUrl = Constants.BASE_URL + "?" + Constants.get_month_top_url + "&topValue=5";
if (!ObjectUtils.isEmpty(areaName)) {
if (areaName.contains(Constants.areaChinese)) {
if (!areaName.contains(Constants.areaChinese)) {
areaName = areaName + Constants.areaChinese;
}
requestUrl = requestUrl + "&areaName=" + areaName;
......@@ -646,7 +646,7 @@ public class MonitorServiceImpl implements MonitorService {
List<StationBasic> gfdzlist = new ArrayList<>();
String requestUrl = Constants.BASE_URL + "?" + Constants.get_hours_num_top + "&topValue=3&tabValue=" + tabValue;
if (!ObjectUtils.isEmpty(areaName)) {
if (areaName.contains(Constants.areaChinese)) {
if (!areaName.contains(Constants.areaChinese)) {
areaName = areaName + Constants.areaChinese;
}
requestUrl = requestUrl + "&areaName=" + areaName;
......
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