Commit 256925bc authored by tangwei's avatar tangwei

结决冲突

parents ea23097a 2a0751dd
...@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant; import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import com.yeejoin.amos.api.householdapi.constant.KSolarConstant; import com.yeejoin.amos.api.householdapi.constant.KSolarConstant;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jcajce.provider.symmetric.AES; import org.bouncycastle.jcajce.provider.symmetric.AES;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -20,7 +21,8 @@ import java.util.List; ...@@ -20,7 +21,8 @@ import java.util.List;
@Component @Component
public class KSolarRequestUtil { @Slf4j
public class KsolarRequestUtil {
/** /**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息 * @return HashMap<String, Object> 发送请求前的准备 准备header信息
...@@ -66,6 +68,7 @@ public class KSolarRequestUtil { ...@@ -66,6 +68,7 @@ public class KSolarRequestUtil {
String url = KSolarConstant.baseurl + apiurl; String url = KSolarConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap); respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone); jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
log.info("原始数据:{}", jsonArray);
if (!ObjectUtils.isEmpty(jsonArray)) { if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass); result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
} }
...@@ -82,24 +85,29 @@ public class KSolarRequestUtil { ...@@ -82,24 +85,29 @@ public class KSolarRequestUtil {
* @desc 根据解析规则解析请求返回数据 * @desc 根据解析规则解析请求返回数据
*/ */
public JSONArray handlerResponseByResultResolverule(String resultResovle, String response) { public JSONArray handlerResponseByResultResolverule(String resultResovle, String response) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
if (ObjectUtil.isNotEmpty(resultResovle)) {
String[] rules = resultResovle.split(","); if ("arr".equals(resultResovle)) {
if (rules.length > 0) { jsonArray = JSONArray.parseArray(response);
for (int i = 0; i < rules.length; i++) { } else {
try { JSONObject jsonObject = JSONObject.parseObject(response);
jsonObject = (JSONObject) jsonObject.get(rules[i]); if (ObjectUtil.isNotEmpty(resultResovle)) {
if (jsonObject == null) { String[] rules = resultResovle.split(",");
if (rules.length > 0) {
for (int i = 0; i < rules.length; i++) {
try {
jsonObject = (JSONObject) jsonObject.get(rules[i]);
if (jsonObject == null) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
} catch (Exception exception) {
jsonArray = (JSONArray) jsonObject.get(rules[i]); jsonArray = (JSONArray) jsonObject.get(rules[i]);
} }
} catch (Exception exception) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
} }
} }
} if (jsonArray.size() == 0) {
if (jsonArray.size() == 0) { jsonArray.add(jsonObject);
jsonArray.add(jsonObject); }
} }
} }
return jsonArray; return jsonArray;
......
package com.yeejoin.amos.api.householdapi.constant; package com.yeejoin.amos.api.householdapi.constant;
import java.util.HashMap;
public class KSolarConstant { public class KSolarConstant {
public static String baseurl ="http://111.230.136.62:8092"; public static String baseurl ="http://111.230.136.62:8092";
public static String account ="三一硅能"; public static String account ="三一硅能";
...@@ -11,6 +13,47 @@ public class KSolarConstant { ...@@ -11,6 +13,47 @@ public class KSolarConstant {
public static String requestPOST="POST"; public static String requestPOST="POST";
public static String requestGET="GET"; public static String requestGET="GET";
public static String stationListUrl="/station/list/info"; public static String stationListUrl="/station/list/info";
public static String stationInfoByIdUrl="/station/list/info/by/id";
public static String stationEarnUrl="/station/detail/earn";
public static String stationEarnChartUrl="/protocol/station/statistic/elec/chart";
public static String stationCollectListUrl="/station/detail/collect/list";
public static String stationCollectDataUrl="/station/detail/get/realdata/by/collectid";
public static String stationCollectAlarmUrl="/alarm/bi/list";
public static String resovle_rows="rows"; public static String resovle_rows="rows";
public static String resovle_data="data";
public static String resovle_arr="arr";
public static Double kwhToMwh = 0.0001;
public static final HashMap<String, String> stationStaus = new HashMap<String, String>() {
{
put("1", "在线");
put("0", "离线");
put("2", "报警");
}
};
public static final HashMap<String, String> collectStaus = new HashMap<String, String>() {
{
put("0", "在线");
put("1", "离线");
put("2", "报警");
}
};
public static final HashMap<String, String> alarmLevel = new HashMap<String, String>() {
{
put("1", "低级");
put("2", "中级");
put("3", "高级");
}
};
public static final HashMap<String, String> alarmstatus = new HashMap<String, String>() {
{
put("0", "未恢复");
put("1", "已恢复");
}
};
} }
package com.yeejoin.amos.api.householdapi.controller; package com.yeejoin.amos.api.householdapi.controller;
import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils; import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils;
import com.yeejoin.amos.api.householdapi.Utils.KSolarRequestUtil;
import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService;
import fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,7 +13,6 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -15,7 +13,6 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
/** /**
...@@ -111,9 +108,11 @@ public class HouseholdTestController { ...@@ -111,9 +108,11 @@ public class HouseholdTestController {
@PostMapping(value = "/ksolarnew") @PostMapping(value = "/ksolarnew")
@ApiOperation(httpMethod = "POST", value = "科士达", notes = "科士达") @ApiOperation(httpMethod = "POST", value = "科士达", notes = "科士达")
public void ksolarnew() throws IOException { public void ksolarnew() throws IOException {
// kSolarDataAcquisitionService.stationList();
kSolarDataAcquisitionService.stationDetail();
kSolarDataAcquisitionService.stationList(); kSolarDataAcquisitionService.stationList();
// goLangDataAcquisitionService.stationDetail(); kSolarDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.collectorList(); kSolarDataAcquisitionService.collectorDetail();
//// goLangDataAcquisitionService.inverterList(); //// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail(); // goLangDataAcquisitionService.collectorDetail();
// goLangDataAcquisitionService.inverterDetail(); // goLangDataAcquisitionService.inverterDetail();
......
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
/**
* @author DELL
*/
@Data
public class KsolarAlarmDto {
private String alarmId;
private String attribId;
private String collectName;
private String deviceId;
private String inverterId;
private String levels;
private String message;
private String removeTime;
private String saveTime;
private String solution;
private String stationId;
private String stationName;
private String status;
}
...@@ -54,7 +54,7 @@ public class JpInverter implements Serializable { ...@@ -54,7 +54,7 @@ public class JpInverter implements Serializable {
* 采集器id * 采集器id
*/ */
@TableField("collector_id") @TableField("collector_id")
private Long collectorId; private String collectorId;
/** /**
* 采集器sn编码 * 采集器sn编码
......
...@@ -43,7 +43,7 @@ public class JpInverterElectricity implements Serializable { ...@@ -43,7 +43,7 @@ public class JpInverterElectricity implements Serializable {
* 逆变器id * 逆变器id
*/ */
@TableField("inverter_id") @TableField("inverter_id")
private Long inverterId; private String inverterId;
/** /**
* sn编码 * sn编码
......
...@@ -16,7 +16,7 @@ public class HYGFJPInverterHistory implements Serializable { ...@@ -16,7 +16,7 @@ public class HYGFJPInverterHistory implements Serializable {
private Double powerGeneration; private Double powerGeneration;
private Double dailyReturn; private Double dailyReturn;
private Double generationHours; private Double generationHours;
private Long inverterId; private String inverterId;
private String thirdStationId; private String thirdStationId;
private String thirdCode; private String thirdCode;
} }
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
public class KsolarStationCollectData implements Serializable {
private Long createdTime;
private String inverterId;
private String status;
private String deviceModel;
private String version;
private Double powerApparent;
private Double dayGeneration;
private Double monthGeneration;
private Double yearGeneration;
private Double totalGeneration;
private Double currentPv1;
private Double currentPv2;
private Double currentPv3;
private Double currentPv4;
private Double currentPv5;
private Double currentPv6;
private Double currentPv7;
private Double currentPv8;
private Double currentPv9;
private Double currentPv10;
private Double currentPv11;
private Double currentPv12;
private Double currentR;
private Double currents;
private Double currentT;
private Double voltagePv1;
private Double voltagePv2;
private Double voltagePv3;
private Double voltagePv4;
private Double voltagePv5;
private Double voltagePv6;
private Double voltagePv7;
private Double voltagePv8;
private Double voltagePv9;
private Double voltagePv10;
private Double voltagePv11;
private Double voltagePv12;
private Double voltagePbus;
private Double voltagelbus;
private Double voltageRs;
private Double voltageSt;
private Double voltageTr;
private Double powerPv1;
private Double powerPv2;
private Double powerPv3;
private Double powerPv4;
private Double powerPv5;
private Double powerPv6;
private Double powerPv7;
private Double powerPv8;
private Double powerPv9;
private Double powerPv10;
private Double powerPv11;
private Double powerPv12;
private Double frequencyRs;
private Double frequencySt;
private Double frequencyTr;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "ksolar_collector_list" ,autoResultMap = true)
public class KsolarStationCollectList implements Serializable {
private Long createdTime;
private String address;
private String armVersion;
private String bstVersion;
private String collectId;
private String collectName;
private String collectVersion;
private String dayGeneration;
private String deviceModel;
private String dspVersion;
private String inverterId;
private String trafficType;
private Integer interfaceType;
private Integer modelId;
private Integer phaseStandard;
private String stationName;
private Integer phaseType;
private Double signal;
private String status;
private Double powerInter;
private Double totalGeneration;
private String thirdStationId;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "ksolar_station_detail" ,autoResultMap = true)
public class KsolarStationDetails implements Serializable {
private Long createdTime;
private String area;
private Double installCapacity;
private Double elecPrice;
private String city;
private String elecUnit;
private Integer stationType;
private String latitude;
private String timeZone;
private String countries;
private String userCode;
private String stationAddressDetail;
private String province;
private String stationName;
private String longitude;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "ksolar_station_earn" ,autoResultMap = true)
public class KsolarStationEarn implements Serializable {
private Long createdTime;
private Double co2;
private Double coal;
private Double dayEarn;
private Double dayGeneration;
private Double forest;
private Double monthGeneration;
private Double realPower;
private Double totalEarn;
private Double totalGeneration;
private Double totalPower;
private Double yearGeneration;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "ksolar_station_earn_chart" ,autoResultMap = true)
public class KsolarStationEarnChart {
private Long createdTime;
private String attribValue;
private String earnValue;
private String saveTime;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine; package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data @Data
public class KSolarStationList { @TableName(value = "ksolar_station_list" ,autoResultMap = true)
public class KsolarStationList implements Serializable {
private Long createdTime;
private String stationId; private String stationId;
private String stationName; private String stationName;
private Integer stationType; private Integer stationType;
......
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangCollectorList;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.KsolarStationCollectList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface KsolarStationCollectListMapper extends BaseMapper<KsolarStationCollectList> {
@Select("select collect_id from ksolar_collector_list group by collect_id")
List<String> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.KsolarStationDetails;
/**
* @author DELL
*/
public interface KsolarStationDetailsMapper extends BaseMapper<KsolarStationDetails> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.KsolarStationEarn;
/**
* @author DELL
*/
public interface KsolarStationEarnMapper extends BaseMapper<KsolarStationEarn> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.KsolarStationList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @author DELL
*/
public interface KsolarStationMapper extends BaseMapper<KsolarStationList> {
@Select("select station_id from ksolar_station_list group by station_id")
List<String> getStationIds();
}
...@@ -25,8 +25,5 @@ public interface KSolarDataAcquisitionService { ...@@ -25,8 +25,5 @@ public interface KSolarDataAcquisitionService {
* @descrption 逆变器详情数据入库 * @descrption 逆变器详情数据入库
*/ */
void inverterDetail(); void inverterDetail();
/**
* @descrption 采集器告警列表数据入库
*/
void inverAlramInfo();
} }
...@@ -364,7 +364,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -364,7 +364,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
} }
jpInverter.setSnCode(inverterDetailDto.getSn()); jpInverter.setSnCode(inverterDetailDto.getSn());
jpInverter.setState(GoLangConstant.stationStaus.get(inverterDetailDto.getCurrentState())); jpInverter.setState(GoLangConstant.stationStaus.get(inverterDetailDto.getCurrentState()));
jpInverter.setCollectorId(inverterDetailDto.getCollectorId()); jpInverter.setCollectorId(String.valueOf(inverterDetailDto.getCollectorId()));
jpInverter.setCollectorSnCode(inverterDetailDto.getCollectorsn()); jpInverter.setCollectorSnCode(inverterDetailDto.getCollectorsn());
jpInverter.setUpdateTime(new Date()); jpInverter.setUpdateTime(new Date());
jpInverter.setCurrentPower(inverterDetailDto.getPac()); jpInverter.setCurrentPower(inverterDetailDto.getPac());
...@@ -398,7 +398,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -398,7 +398,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
if (ObjectUtils.isEmpty(jpInverterElectricity)) { if (ObjectUtils.isEmpty(jpInverterElectricity)) {
jpInverterElectricity = new JpInverterElectricity(); jpInverterElectricity = new JpInverterElectricity();
} }
jpInverterElectricity.setInverterId(inverterDetailDto.getId()); jpInverterElectricity.setInverterId(String.valueOf(inverterDetailDto.getId()));
jpInverterElectricity.setSnCode(inverterDetailDto.getSn()); jpInverterElectricity.setSnCode(inverterDetailDto.getSn());
jpInverterElectricity.setThirdCode(PVProducerInfoEnum.JLY.getCode()); jpInverterElectricity.setThirdCode(PVProducerInfoEnum.JLY.getCode());
jpInverterElectricity.setThirdStationId(String.valueOf(inverterDetailDto.getStationId())); jpInverterElectricity.setThirdStationId(String.valueOf(inverterDetailDto.getStationId()));
...@@ -421,7 +421,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -421,7 +421,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
if (ObjectUtils.isEmpty(jpInverterElectricity)) { if (ObjectUtils.isEmpty(jpInverterElectricity)) {
jpInverterElectricity = new JpInverterElectricity(); jpInverterElectricity = new JpInverterElectricity();
} }
jpInverterElectricity.setInverterId(inverterDetailDto.getId()); jpInverterElectricity.setInverterId(String.valueOf(inverterDetailDto.getId()));
jpInverterElectricity.setSnCode(inverterDetailDto.getSn()); jpInverterElectricity.setSnCode(inverterDetailDto.getSn());
jpInverterElectricity.setThirdCode(PVProducerInfoEnum.JLY.getCode()); jpInverterElectricity.setThirdCode(PVProducerInfoEnum.JLY.getCode());
jpInverterElectricity.setThirdStationId(String.valueOf(inverterDetailDto.getStationId())); jpInverterElectricity.setThirdStationId(String.valueOf(inverterDetailDto.getStationId()));
...@@ -457,7 +457,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -457,7 +457,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
} }
hygfjpInverterHistory.setDate(today); hygfjpInverterHistory.setDate(today);
hygfjpInverterHistory.setThirdStationId(String.valueOf(inverterDetailDto.getStationId())); hygfjpInverterHistory.setThirdStationId(String.valueOf(inverterDetailDto.getStationId()));
hygfjpInverterHistory.setInverterId(inverterDetailDto.getId()); hygfjpInverterHistory.setInverterId(String.valueOf(inverterDetailDto.getId()));
hygfjpInverterHistory.setSnCode(inverterDetailDto.getSn()); hygfjpInverterHistory.setSnCode(inverterDetailDto.getSn());
hygfjpInverterHistory.setThirdCode(PVProducerInfoEnum.JLY.getCode()); hygfjpInverterHistory.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfjpInverterHistory.setGenerationHours(inverterDetailDto.getFullHour()); hygfjpInverterHistory.setGenerationHours(inverterDetailDto.getFullHour());
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import com.yeejoin.amos.api.householdapi.Utils.KSolarRequestUtil;
import com.yeejoin.amos.api.householdapi.constant.KSolarConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.KSolarStationList;
import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService;
import fastjson.JSON;
import jdk.nashorn.internal.ir.RuntimeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
@Service
public class KSolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionService {
@Autowired
KSolarRequestUtil kSolarRequestUtil;
@Override
public void stationList() {
HashMap<String, Object> requestInfo = new HashMap<>();
String requestParaminfo = JSON.toJSONString(requestInfo);
List<KSolarStationList> kSolarStationListList = kSolarRequestUtil.getResPonse(
KSolarConstant.stationListUrl,
KSolarConstant.requestGET,
requestParaminfo,
KSolarConstant.resovle_rows,
KSolarStationList.class);
for (int i = 0; i < kSolarStationListList.size(); i++) {
KSolarStationList kSolarStationList = kSolarStationListList.get(i);
kSolarStationList.getStationId();
}
}
@Override
public void stationDetail() {
}
@Override
public void collectorList() {
}
@Override
public void collectorDetail() {
}
@Override
public void inverterList() {
}
@Override
public void inverterDetail() {
}
@Override
public void inverAlramInfo() {
}
}
...@@ -2,53 +2,98 @@ ...@@ -2,53 +2,98 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IdxBizFanPointProcessVariableClassificationMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper">
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto">
SELECT b.*, SELECT
ibfpvcv.PROCESS_POINT1_ID as pointOneId, b.*,
ibfpvcv.PROCESS_POINT2_ID as pointTwoId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT3_ID as pointThreeId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.ANALYSIS_POINT_ID as pointId ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
FROM ( ibfpvcv.ANALYSIS_POINT_ID AS pointId
SELECT * FROM
FROM idx_biz_fan_point_process_variable_classification uxfv (
WHERE uxfv.SEQUENCE_NBR IN ( SELECT
SELECT PROCESS_POINT1_ID *
FROM `idx_biz_fan_point_var_central_value` FROM
WHERE ANALYSIS_POINT_ID IS NOT NULL idx_biz_fan_point_process_variable_classification uxfv
GROUP BY ANALYSIS_POINT_ID, WHERE
PROCESS_POINT1_ID, 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 )
PROCESS_POINT3_ID, ) AS b,
PROCESS_POINT2_ID idx_biz_fan_point_var_central_value ibfpvcv
UNION ALL WHERE
SELECT PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.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
UNION ALL
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
UNION ALL
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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY b.SEQUENCE_NBR 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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select> </select>
<select id="gateWayIdListFan" resultType="java.lang.String"> <select id="gateWayIdListFan" resultType="java.lang.String">
......
...@@ -6,52 +6,97 @@ ...@@ -6,52 +6,97 @@
</select> </select>
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT b.*, SELECT
ibfpvcv.PROCESS_POINT1_ID as pointOneId, b.*,
ibfpvcv.PROCESS_POINT2_ID as pointTwoId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT3_ID as pointThreeId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.ANALYSIS_POINT_ID as pointId ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
FROM ( ibfpvcv.ANALYSIS_POINT_ID AS pointId
SELECT * FROM
FROM idx_biz_pv_point_process_variable_classification uxfv (
WHERE uxfv.SEQUENCE_NBR IN ( SELECT
SELECT PROCESS_POINT1_ID *
FROM `idx_biz_pv_point_var_central_value` FROM
WHERE ANALYSIS_POINT_ID IS NOT NULL idx_biz_pv_point_process_variable_classification uxfv
GROUP BY ANALYSIS_POINT_ID, WHERE
PROCESS_POINT1_ID, 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 )
PROCESS_POINT3_ID, ) AS b,
PROCESS_POINT2_ID idx_biz_pv_point_var_central_value ibfpvcv
UNION ALL WHERE
SELECT PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.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
UNION ALL
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
UNION ALL
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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY b.SEQUENCE_NBR 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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select> </select>
</mapper> </mapper>
...@@ -44,8 +44,8 @@ public class TestController extends BaseController { ...@@ -44,8 +44,8 @@ public class TestController extends BaseController {
@GetMapping("/test2") @GetMapping("/test2")
public void test2 () { public void test2 () {
commonService.healthWarningMinuteByFJ(); // commonService.healthWarningMinuteByFJ();
commonService.healthWarningMinuteByFan();
} }
} }
...@@ -172,3 +172,5 @@ base.url.XGX=http://139.9.171.247:8052/intelligent-analysis/correlation ...@@ -172,3 +172,5 @@ base.url.XGX=http://139.9.171.247:8052/intelligent-analysis/correlation
base.url.GKHF=http://139.9.171.247:8052/intelligent-analysis/working-condition-division base.url.GKHF=http://139.9.171.247:8052/intelligent-analysis/working-condition-division
#相关性 算法调用 #相关性 算法调用
base.url.ZXZ=http://139.9.171.247:8052/intelligent-analysis/central-value base.url.ZXZ=http://139.9.171.247:8052/intelligent-analysis/central-value
#指数分析,算法调用
base.url.zsfx:http://139.9.171.247:8052/intelligent-analysis/index-analysis
\ No newline at end of file
...@@ -2,53 +2,98 @@ ...@@ -2,53 +2,98 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IdxBizFanPointProcessVariableClassificationMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper">
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto">
SELECT b.*, SELECT
ibfpvcv.PROCESS_POINT1_ID as pointOneId, b.*,
ibfpvcv.PROCESS_POINT2_ID as pointTwoId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT3_ID as pointThreeId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.ANALYSIS_POINT_ID as pointId ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
FROM ( ibfpvcv.ANALYSIS_POINT_ID AS pointId
SELECT * FROM
FROM idx_biz_fan_point_process_variable_classification uxfv (
WHERE uxfv.SEQUENCE_NBR IN ( SELECT
SELECT PROCESS_POINT1_ID *
FROM `idx_biz_fan_point_var_central_value` FROM
WHERE ANALYSIS_POINT_ID IS NOT NULL idx_biz_fan_point_process_variable_classification uxfv
GROUP BY ANALYSIS_POINT_ID, WHERE
PROCESS_POINT1_ID, 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 )
PROCESS_POINT3_ID, ) AS b,
PROCESS_POINT2_ID idx_biz_fan_point_var_central_value ibfpvcv
UNION ALL WHERE
SELECT PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.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
UNION ALL
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
UNION ALL
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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY b.SEQUENCE_NBR 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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select> </select>
<select id="gateWayIdListFan" resultType="java.lang.String"> <select id="gateWayIdListFan" resultType="java.lang.String">
......
...@@ -6,52 +6,97 @@ ...@@ -6,52 +6,97 @@
</select> </select>
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT b.*, SELECT
ibfpvcv.PROCESS_POINT1_ID as pointOneId, b.*,
ibfpvcv.PROCESS_POINT2_ID as pointTwoId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT3_ID as pointThreeId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.ANALYSIS_POINT_ID as pointId ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
FROM ( ibfpvcv.ANALYSIS_POINT_ID AS pointId
SELECT * FROM
FROM idx_biz_pv_point_process_variable_classification uxfv (
WHERE uxfv.SEQUENCE_NBR IN ( SELECT
SELECT PROCESS_POINT1_ID *
FROM `idx_biz_pv_point_var_central_value` FROM
WHERE ANALYSIS_POINT_ID IS NOT NULL idx_biz_pv_point_process_variable_classification uxfv
GROUP BY ANALYSIS_POINT_ID, WHERE
PROCESS_POINT1_ID, 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 )
PROCESS_POINT3_ID, ) AS b,
PROCESS_POINT2_ID idx_biz_pv_point_var_central_value ibfpvcv
UNION ALL WHERE
SELECT PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.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
UNION ALL
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
UNION ALL
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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY b.SEQUENCE_NBR 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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_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.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY
b.SEQUENCE_NBR
</select> </select>
</mapper> </mapper>
...@@ -214,7 +214,8 @@ ...@@ -214,7 +214,8 @@
ifnull(a.qrcode_color, '') AS qrCodeColor, ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(c.station_name, '') AS stationName, ifnull(c.station_name, '') AS stationName,
ifnull(a.rec_date, '') as recDate, ifnull(a.rec_date, '') as recDate,
a.sequence_nbr as objectId a.sequence_nbr as objectId,
b.project_name as unitName
FROM FROM
person_basic a person_basic a
LEFT JOIN person_account b ON a.sequence_nbr = b.person_id LEFT JOIN person_account b ON a.sequence_nbr = b.person_id
......
...@@ -488,16 +488,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -488,16 +488,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String, Object> otherInfo = new HashMap<>(); Map<String, Object> otherInfo = new HashMap<>();
List<IndicatorData> activePowerList = new ArrayList<>(); List<IndicatorData> activePowerList = new ArrayList<>();
List<IndicatorData> otherList = new ArrayList<>(); List<IndicatorData> otherList = new ArrayList<>();
String startTime = DateUtil.today() + " 00:00:00";
String endTime = DateUtil.today() + " 23:59:59";
Double installedCapacity = commonServiceImpl.getStationCapactityByStationWerks(stationBasic.getStationNumber()); Double installedCapacity = commonServiceImpl.getStationCapactityByStationWerks(stationBasic.getStationNumber());
if ("FDZ".equals(stationBasic.getStationType())) { if ("FDZ".equals(stationBasic.getStationType())) {
activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.xiazaoActivePowerPoint, startTime, endTime, stationBasic.getBoosterGatewayId()); activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.xiazaoActivePowerPoint, stationBasic.getBoosterGatewayId());
otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.xiazaoWindSpeedrPoint, startTime, endTime, stationBasic.getFanGatewayId()); otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.xiazaoWindSpeedrPoint, stationBasic.getFanGatewayId());
groupMap = otherList.stream().collect(Collectors.groupingBy(IndicatorData::getCreatedTime, Collectors.averagingDouble(IndicatorData::getValueF))); groupMap = otherList.stream().collect(Collectors.groupingBy(IndicatorData::getCreatedTime, Collectors.averagingDouble(IndicatorData::getValueF)));
} else { } else {
activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheActivePowerPoint, startTime, endTime, stationBasic.getBoosterGatewayId()); activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheActivePowerPoint, stationBasic.getBoosterGatewayId());
otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheIrradiationPonit, startTime, endTime, stationBasic.getBoosterGatewayId()); otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheIrradiationPonit, stationBasic.getBoosterGatewayId());
} }
for (int i = 0; i < activePowerList.size(); i++) { for (int i = 0; i < activePowerList.size(); i++) {
IndicatorData indicatorData = activePowerList.get(i); IndicatorData indicatorData = activePowerList.get(i);
...@@ -555,14 +553,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -555,14 +553,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public Map<String, Object> getDetailsWindSpeed(String gatewayId, String name) { public Map<String, Object> getDetailsWindSpeed(String gatewayId, String name) {
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> indicatorDataListWindSpeed = new ArrayList<>(); List<IndicatorData> indicatorDataListWindSpeed = new ArrayList<>();
List<IndicatorData> indicatorDataListActivePower = new ArrayList<>(); List<IndicatorData> indicatorDataListActivePower = new ArrayList<>();
indicatorDataListWindSpeed = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("瞬时风速", name, startTime, endTime, gatewayId); indicatorDataListWindSpeed = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("瞬时风速", name, gatewayId);
indicatorDataListActivePower = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("有功功率", name, startTime, endTime, gatewayId); indicatorDataListActivePower = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("有功功率", name, gatewayId);
List<String> windSpeeds = new ArrayList<>(); List<String> windSpeeds = new ArrayList<>();
List<String> activePowers = new ArrayList<>(); List<String> activePowers = new ArrayList<>();
List<String> axisData = new ArrayList<>(); List<String> axisData = new ArrayList<>();
...@@ -586,12 +581,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -586,12 +581,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public Map<String, Object> getDetailsWindSpeeds(String gatewayId, String name) { public Map<String, Object> getDetailsWindSpeeds(String gatewayId, String name) {
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> indicatorDataListActivePowers = new ArrayList<>(); List<IndicatorData> indicatorDataListActivePowers = new ArrayList<>();
indicatorDataListActivePowers = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("有功功率", name, startTime, endTime, gatewayId); indicatorDataListActivePowers = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumber("有功功率", name, gatewayId);
List<String> axisData = new ArrayList<>(); List<String> axisData = new ArrayList<>();
List<String> activePowers = new ArrayList<>(); List<String> activePowers = new ArrayList<>();
for (int i = 0; i < indicatorDataListActivePowers.size(); i++) { for (int i = 0; i < indicatorDataListActivePowers.size(); i++) {
...@@ -1372,11 +1363,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1372,11 +1363,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondition.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondition.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondition.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量")); queryCondition.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondition, null, ESEquipments.class); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondition, null, ESEquipments.class);
List<String> displayName = Arrays.asList("Ua","Ub","Uc");
// 10kVⅡ段母线数据 // 10kVⅡ段母线数据
List<ESEquipments> xianData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().contains("35kVⅠ母PT")).collect(Collectors.toList()); List<ESEquipments> xianData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().contains("35kVⅠ母PT")&&!displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString()))); xianData.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
List<ESEquipments> xianData1 = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().contains("南瑞光差保护_313")&&displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
xianData1.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
List<String> xyxDisplayNameList = Arrays.asList("Ia", "P", "Q"); List<String> xyxDisplayNameList = Arrays.asList("Ia", "P", "Q");
List<ESEquipments> xyxSqlData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().equals("35kV前万线") && xyxDisplayNameList.contains(esEquipments.getDisplayName())).collect(Collectors.toList()); List<ESEquipments> xyxSqlData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().equals("35kV前万线") && xyxDisplayNameList.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
xyxSqlData.forEach(item -> resultMap.put("35qwx" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString()))); xyxSqlData.forEach(item -> resultMap.put("35qwx" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
...@@ -1863,11 +1856,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1863,11 +1856,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public Map<String, Object> hlWindSpeeds(String gatewayId, String equipNum) { public Map<String, Object> hlWindSpeeds(String gatewayId, String equipNum) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date()); List<IndicatorData> originarPVs = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumberPv(equipNum, gatewayId);
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> originarPVs = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeAndEquipmentNumberPv(equipNum, startTime, endTime, gatewayId);
originarPVs.size(); originarPVs.size();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
Map<String, List<IndicatorData>> data = originarPVs.stream().collect(Collectors.groupingBy(IndicatorData::getEquipmentIndexName, TreeMap::new, Collectors.toList())); Map<String, List<IndicatorData>> data = originarPVs.stream().collect(Collectors.groupingBy(IndicatorData::getEquipmentIndexName, TreeMap::new, Collectors.toList()));
...@@ -1912,7 +1901,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1912,7 +1901,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
} }
List<Map<String, String>> maps = new ArrayList<>(); List<Map<String, String>> maps = new ArrayList<>();
List<String> nums = new ArrayList<>(); Set<String> nums = new HashSet<>();
//此处组装数据 每一个Map代表一个逆变器 //此处组装数据 每一个Map代表一个逆变器
for (ESEquipments esEquipments : listData1) { for (ESEquipments esEquipments : listData1) {
int num = Integer.parseInt(esEquipments.getEquipmentNumber().substring(0, 2)); int num = Integer.parseInt(esEquipments.getEquipmentNumber().substring(0, 2));
......
...@@ -706,7 +706,7 @@ public class MonitoringServiceImpl { ...@@ -706,7 +706,7 @@ public class MonitoringServiceImpl {
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0); AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量 //年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0); AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
stationCacheInfoDtoList.forEach( stationCacheInfoDto->{ stationCacheInfoDtoList.forEach(stationCacheInfoDto -> {
if ("FDZ".equals(stationCacheInfoDto.getStationType())) { if ("FDZ".equals(stationCacheInfoDto.getStationType())) {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
...@@ -824,13 +824,13 @@ public class MonitoringServiceImpl { ...@@ -824,13 +824,13 @@ public class MonitoringServiceImpl {
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total.set(commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator)); total.set(commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator));
} }
stationCacheInfoDto.setAddress(String.format(CommonConstans.Twodecimalplaces, (total.get())*100/getPlanGenByStationIdAndMonth(stationCacheInfoDto.getStationId()))); stationCacheInfoDto.setAddress(String.format(CommonConstans.Twodecimalplaces, (total.get()) * 100 / getPlanGenByStationIdAndMonth(stationCacheInfoDto.getStationId())));
}); });
List<StationCacheInfoDto> sorted = stationCacheInfoDtoList.stream().sorted(Comparator.comparing(StationCacheInfoDto::getAddress, Comparator.comparingDouble(Double::parseDouble)).reversed()).collect(Collectors.toList()); List<StationCacheInfoDto> sorted = stationCacheInfoDtoList.stream().sorted(Comparator.comparing(StationCacheInfoDto::getAddress, Comparator.comparingDouble(Double::parseDouble)).reversed()).collect(Collectors.toList());
sorted.forEach(stationBasic -> { sorted.forEach(stationBasic -> {
HashMap<String, String> hashMap1 = new HashMap<>(); HashMap<String, String> hashMap1 = new HashMap<>();
hashMap1.put("stationName", stationBasic.getStationName()); hashMap1.put("stationName", stationBasic.getStationName());
hashMap1.put("value", stationBasic.getAddress()+"%"); hashMap1.put("value", stationBasic.getAddress() + "%");
hashMap1.put("value1", stationBasic.getAddress()); hashMap1.put("value1", stationBasic.getAddress());
mapList.add(hashMap1); mapList.add(hashMap1);
}); });
...@@ -1051,19 +1051,19 @@ public class MonitoringServiceImpl { ...@@ -1051,19 +1051,19 @@ public class MonitoringServiceImpl {
page2.setRecords(list2); page2.setRecords(list2);
Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF); Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF);
HashMap<String, String> stringHashMap13 = new HashMap<>(); HashMap<String, String> stringHashMap13 = new HashMap<>();
stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide ))); stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide)));
stringHashMap13.put("title2", "二氧化碳减排量(t)"); stringHashMap13.put("title2", "二氧化碳减排量(t)");
list3.add(stringHashMap13); list3.add(stringHashMap13);
HashMap<String, String> stringHashMap14 = new HashMap<>(); HashMap<String, String> stringHashMap14 = new HashMap<>();
stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal ))); stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal)));
stringHashMap14.put("title2", "节约标准煤(t)"); stringHashMap14.put("title2", "节约标准煤(t)");
list3.add(stringHashMap14); list3.add(stringHashMap14);
HashMap<String, String> stringHashMap15 = new HashMap<>(); HashMap<String, String> stringHashMap15 = new HashMap<>();
stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner ))); stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner)));
stringHashMap15.put("title2", "碳粉尘减排量(t)"); stringHashMap15.put("title2", "碳粉尘减排量(t)");
list3.add(stringHashMap15); list3.add(stringHashMap15);
HashMap<String, String> stringHashMap16 = new HashMap<>(); HashMap<String, String> stringHashMap16 = new HashMap<>();
stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide ))); stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide)));
stringHashMap16.put("title2", "二氧化硫减排量(t)"); stringHashMap16.put("title2", "二氧化硫减排量(t)");
list3.add(stringHashMap16); list3.add(stringHashMap16);
page3.setRecords(list3); page3.setRecords(list3);
...@@ -1162,10 +1162,11 @@ public class MonitoringServiceImpl { ...@@ -1162,10 +1162,11 @@ public class MonitoringServiceImpl {
HashMap<String, Object> result = new HashMap<>(); HashMap<String, Object> result = new HashMap<>();
List<HashMap<String, Object>> hashMapList = new ArrayList<>(); List<HashMap<String, Object>> hashMapList = new ArrayList<>();
List<IndicatorData> indicatorDataList = new ArrayList<>(); List<IndicatorData> indicatorDataList = new ArrayList<>();
Long day = DateUtil.between(DateUtil.parse(date), new Date(), DateUnit.DAY);
if (stationBasic.getStationType().equals("FDZ")) { if (stationBasic.getStationType().equals("FDZ")) {
indicatorDataList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值", date + " 00:00:00", date + " 23:59:59", stationBasic.getBoosterGatewayId()); indicatorDataList = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeJp("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值", stationBasic.getBoosterGatewayId(), day);
} else { } else {
indicatorDataList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime("南瑞光差保护_313P", date + " 00:00:00", date + " 23:59:59", stationBasic.getBoosterGatewayId()); indicatorDataList = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeJp("南瑞光差保护_313P", stationBasic.getBoosterGatewayId(), day);
} }
//x轴数据 //x轴数据
List<String> xdata = new ArrayList<>(); List<String> xdata = new ArrayList<>();
...@@ -1314,7 +1315,7 @@ public class MonitoringServiceImpl { ...@@ -1314,7 +1315,7 @@ public class MonitoringServiceImpl {
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
total.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "南瑞光差保护_313P")*CommonConstans.kwToMv); total.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "南瑞光差保护_313P") * CommonConstans.kwToMv);
} }
}); });
//有功功率换算 //有功功率换算
...@@ -1325,8 +1326,9 @@ public class MonitoringServiceImpl { ...@@ -1325,8 +1326,9 @@ public class MonitoringServiceImpl {
public Double keepFourdecimalPlaces(Double param) { public Double keepFourdecimalPlaces(Double param) {
return Double.valueOf(String.format("%.4f", param)); return Double.valueOf(String.format("%.4f", param));
} }
public Double getPlanGenByStationIdAndMonth(String stationId){
String [] dates = DateUtil.today().split("-"); public Double getPlanGenByStationIdAndMonth(String stationId) {
return stationPlanMapper.getPlanGenByStationIdAndMonth(stationId,dates[0], String.valueOf(Integer.valueOf(dates[1]))); String[] dates = DateUtil.today().split("-");
return stationPlanMapper.getPlanGenByStationIdAndMonth(stationId, dates[0], String.valueOf(Integer.valueOf(dates[1])));
} }
} }
...@@ -11,17 +11,15 @@ import java.util.List; ...@@ -11,17 +11,15 @@ import java.util.List;
@Repository @Repository
public interface IndicatorDataMapper extends BaseMapper<IndicatorData> { public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and created_time >= #{startTime} and created_time <= #{endTime} and gateway_id =#{gatewayId}") @Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= TODAY()-8h and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("equipmentIndexName") String equipmentIndexName, @Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId); List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("equipmentIndexName") String equipmentIndexName, @Param("equipmentNumber") String equipmentNumber, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF, equipment_index_name from iot_data.indicator_data where equipment_index_name like '%路电流%' and equipment_number = #{equipmentNumber} and created_time >= #{startTime} and created_time <= #{endTime} and gateway_id =#{gatewayId}") @Select("select `value`, created_time, `value_f` as valueF, equipment_index_name from iot_data.indicator_data where equipment_index_name like '%路电流%' and equipment_number = #{equipmentNumber} and ts >= TODAY()-8h and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumberPv(@Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId); List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumberPv(@Param("equipmentNumber") String equipmentNumber, @Param("gatewayId") String gatewayId);
@Select("select last(`value_f`) as `value_f`,created_time from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and gateway_id=#{gatewayId} ") @Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >=TODAY()-8h")
IndicatorData selectLastDataOfPower(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId); List<IndicatorData> selectDataByequipmentIndexNameAndtime(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId);
@Select("select last(`value_f`) as `value_f`,created_time from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and gateway_id=#{gatewayId} and created_time <= #{endTime} ") @Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >=TODAY()-#{day}d-8h")
IndicatorData selectLastDataOfPower(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId,@Param("endTime") String endTime); List<IndicatorData> selectDataByequipmentIndexNameAndtimeJp(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId,@Param("day") Long day);
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and created_time >= #{startTime} and created_time <= #{endTime} and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtime(@Param("equipmentIndexName") String equipmentIndexName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
} }
...@@ -23,7 +23,7 @@ public class AlarmKafkaConsumer { ...@@ -23,7 +23,7 @@ public class AlarmKafkaConsumer {
AlarmEventServiceImpl alarmEventServiceImpl; AlarmEventServiceImpl alarmEventServiceImpl;
// 消费者来处理消息 // 消费者来处理消息
@KafkaListener(id="user1" , topics ={"${kafka.alarm.topic}"},groupId = "messageConsumerGroup") @KafkaListener(id="user1" , topics ={"${kafka.alarm.topic}"},groupId = "messageConsumerGroupWarn")
public void message1(List<ConsumerRecord<String, String>> consumerRecords, Acknowledgment ack){ public void message1(List<ConsumerRecord<String, String>> consumerRecords, Acknowledgment ack){
// 异步触发预警 // 异步触发预警
alarmEventServiceImpl.handleMessage(consumerRecords); alarmEventServiceImpl.handleMessage(consumerRecords);
......
...@@ -6,6 +6,7 @@ import java.util.Arrays; ...@@ -6,6 +6,7 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -69,8 +70,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent ...@@ -69,8 +70,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
for(Object o:arr) for(Object o:arr)
{ {
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(o)); JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(o));
if (json.containsKey(value)) { if (json.containsKey("key")&&value.equals(json.get("key"))) {
String warn = json.getString(value); String warn = json.getString("label");
if (warn.indexOf("备留") == -1) { if (warn.indexOf("备留") == -1) {
equipAlarmEvent.setEquipName(objName); equipAlarmEvent.setEquipName(objName);
equipAlarmEvent.setEventDesc(indexName); equipAlarmEvent.setEventDesc(indexName);
...@@ -80,7 +81,6 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent ...@@ -80,7 +81,6 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
} }
} }
} }
} else { } else {
// equipAlarmEvent.setEquipIndex(value); // equipAlarmEvent.setEquipIndex(value);
equipAlarmEvent.setEquipName(objName); equipAlarmEvent.setEquipName(objName);
...@@ -109,7 +109,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent ...@@ -109,7 +109,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
calendar.add(Calendar.DAY_OF_MONTH, -2); calendar.add(Calendar.DAY_OF_MONTH, -2);
List<AlarmEvent> alarmEventList = this.baseMapper.getEventList(gatewayId, calendar.getTime()); List<AlarmEvent> alarmEventList = this.baseMapper.getEventList(gatewayId, calendar.getTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar car = Calendar.getInstance();
alarmEventList.forEach(i -> { alarmEventList.forEach(i -> {
if ("true".equals(i.getValue())) { if ("true".equals(i.getValue())) {
i.setValue("合"); i.setValue("合");
...@@ -117,7 +118,10 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent ...@@ -117,7 +118,10 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
i.setValue("分"); i.setValue("分");
} }
i.setStationName("升压站"); i.setStationName("升压站");
i.setTime(sdf.format(new Date(i.getCreatedTime()))); long mills = i.getCreatedTime()/1000000;
car.setTimeInMillis(mills);
//System.out.println(sdf.format(car.getTime()));
i.setTime(sdf.format(car.getTime()));
}); });
PageInfo<EquipAlarmEvent> page = new PageInfo(alarmEventList); PageInfo<EquipAlarmEvent> page = new PageInfo(alarmEventList);
// 构建平台数据 // 构建平台数据
......
...@@ -5,6 +5,7 @@ import java.util.Arrays; ...@@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,7 +43,7 @@ public class EquipAlarmEventServiceImpl ...@@ -42,7 +43,7 @@ public class EquipAlarmEventServiceImpl
equipName = s[0] + "子阵/逆变器" + s[1]; equipName = s[0] + "子阵/逆变器" + s[1];
} else if ("汇流箱".equals(frontModule)) { } else if ("汇流箱".equals(frontModule)) {
String[] s = equipIndex.split("-"); String[] s = equipIndex.split("-");
if ("0".equals(s[2].indexOf(0))) { if (s[2].indexOf("0")==0) {
s[2] = s[2].substring(1); s[2] = s[2].substring(1);
} }
equipName = s[0] + "子阵/逆变器" + s[1] + "/#" + s[2] + "汇流箱"; equipName = s[0] + "子阵/逆变器" + s[1] + "/#" + s[2] + "汇流箱";
...@@ -55,14 +56,20 @@ public class EquipAlarmEventServiceImpl ...@@ -55,14 +56,20 @@ public class EquipAlarmEventServiceImpl
List<EquipAlarmEvent> alarmEventList = this.baseMapper.getEventList(gatewayId, equipName, null, List<EquipAlarmEvent> alarmEventList = this.baseMapper.getEventList(gatewayId, equipName, null,
calendar.getTime()); calendar.getTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar car = Calendar.getInstance();
alarmEventList.forEach(i -> { alarmEventList.forEach(i -> {
if ("true".equals(i.getValue())) { if ("true".equals(i.getValue())) {
i.setValue("合"); i.setValue("合");
} else if ("false".equals(i.getValue())) { } else if ("false".equals(i.getValue())) {
i.setValue("分"); i.setValue("分");
} }
i.setTime(sdf.format(new Date(i.getCreatedTime()))); long mills = i.getCreatedTime()/1000000;
car.setTimeInMillis(mills);
//System.out.println(sdf.format(car.getTime()));
i.setTime(sdf.format(car.getTime()));
//car.add(Calendar.HOUR, 12);
//System.out.println(sdf.format(car.getTime()));
}); });
PageInfo<EquipAlarmEvent> page = new PageInfo(alarmEventList); PageInfo<EquipAlarmEvent> page = new PageInfo(alarmEventList);
......
...@@ -93,7 +93,7 @@ spring.elasticsearch.rest.read-timeout=30000 ...@@ -93,7 +93,7 @@ spring.elasticsearch.rest.read-timeout=30000
#消费者所在组的名称 #消费者所在组的名称
#消费者 的broker地址 #消费者 的broker地址
spring.kafka.consumer.group-id=messageConsumerGroup spring.kafka.consumer.group-id=messageConsumerGroupWarn
spring.kafka.consumer.bootstrap-servers=139.9.173.44:9092 spring.kafka.consumer.bootstrap-servers=139.9.173.44:9092
spring.kafka.consumer.enable-auto-commit=false spring.kafka.consumer.enable-auto-commit=false
spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.auto-offset-reset=earliest
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
equip_alarm_event(created_time,staion_name,staion_id,gateway_id,equip_index,event_desc,equip_name,front_module,value) equip_alarm_event(created_time,staion_name,staion_id,gateway_id,equip_index,event_desc,equip_name,front_module,value)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(NOW(),#{item.stationName},#{item.stationId},#{item.gatewayId},#{item.equipIndex},'#{item.eventDesc}','#{item.equipName}',#{item.frontModule},#{item.value}) (NOW(),#{item.stationName},#{item.stationId},#{item.gatewayId},#{item.equipIndex},'#{item.eventDesc}','#{item.equipName}',#{item.frontModule},'#{item.value}')
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/jpush.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="org.mybatis" level="DEBUG" />
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="ERROR">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
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