c8036cd1 张雷

奥体项目设备实时数据,模拟量实时数据接口开发

1 个父辈 aee46f9c
......@@ -32,7 +32,6 @@
<orderEntry type="library" name="Maven: cn.jpush.api:jpush-client:3.4.8" level="project" />
<orderEntry type="library" name="Maven: cn.jpush.api:jiguang-common:1.1.10" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.33.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.5" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.60" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.60" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.3.RELEASE" level="project" />
......@@ -96,6 +95,40 @@
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" />
<orderEntry type="library" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.binarywang:weixin-java-miniapp:3.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.binarywang:weixin-java-common:3.3.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.7" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.0.0" level="project" />
<orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
<orderEntry type="library" name="Maven: com.github.binarywang:java-emoji-converter:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.vdurmont:emoji-java:5.1.1" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.12" level="project" />
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
<orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.jodd:jodd-http:5.1.4" level="project" />
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.1.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.10.1" level="project" />
<orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java:0.2.7" level="project" />
<orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.7" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.squareup.okhttp3:okhttp:4.10.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.squareup.okio:okio-jvm:3.0.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.2.71" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.5" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.1.3.RELEASE" level="project" />
......@@ -115,11 +148,10 @@
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.17" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.17" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:2.5.4" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.56" level="project" />
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.47" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.16" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-quartz:2.1.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.0" level="project" />
......@@ -146,7 +178,6 @@
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
......@@ -184,7 +215,6 @@
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:3.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.5.11" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-dysmsapi:1.0.0" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.2.3" level="project" />
......
......@@ -315,4 +315,28 @@ public class OlympicCenterController {
result.setSuccess(true);
return result;
}
@ApiOperation(value="获取新锅炉房设备实时数据", notes="获取新锅炉房设备实时数据")
@GetMapping(value = "/getNewBoilerEquipRealTimeReport")
public Result<List<Map<String,Object>>> getNewBoilerRealTimeReport(String sourceType){
Result<List<Map<String,Object>>> result = new Result<List<Map<String,Object>>>();
List<Map<String,Object>> list = new ArrayList<>();
list = olympicCenterService.getNewBoilerRealTimeReport(sourceType);
result.setResult(list);
result.setSuccess(true);
return result;
}
@ApiOperation(value="获取新锅炉房模拟量实时数据", notes="获取新锅炉房模拟量实时数据")
@GetMapping(value = "/getNewBoilerRealDataReport")
public Result<List<TableResult>> getNewBoilerRealDataReport(InputQueryParams inputQueryParams){
Result<List<TableResult>> result = new Result<List<TableResult>>();
List<TableResult> list = new ArrayList<>();
if(inputQueryParams.getSourceType()!=null&&inputQueryParams.getPipeDn()!=null){
list = olympicCenterService.getNewBoilerRealDataReport(inputQueryParams.getSourceType(),inputQueryParams.getPipeDn());
}
result.setResult(list);
result.setSuccess(true);
return result;
}
}
......
......@@ -30,8 +30,11 @@ public class WhatStructData {
@ApiModelProperty(value = "设备编码")
private String equipCode;
/**设备类型*/
@ApiModelProperty(value = "设备类型")
@ApiModelProperty(value = "设备类型")
private String equipType;
/**设备管径*/
@ApiModelProperty(value = "设备管径")
private String equipDiameter;
/**所属系统*/
@ApiModelProperty(value = "所属系统")
private String systemCode;
......@@ -44,6 +47,9 @@ public class WhatStructData {
/**点类型*/
@ApiModelProperty(value = "点类型")
private String monitorType;
/**点实单位*/
@ApiModelProperty(value = "点实单位")
private String monitorUnit;
/**点实时值*/
@ApiModelProperty(value = "点实时值")
private String monitorValue;
......
......@@ -33,4 +33,8 @@ public interface WhatStructDataMapper {
List<WhatStructData> getEquipDataListBySource(@Param("sourceType") String sourceType);
List<WhatStructData> getSumEquipListBySource(@Param("sourceType") String sourceType);
List<WhatStructData> getEquipDataListOfNewBoiler(@Param("sourceType") String sourceType);
List<WhatStructData> getRealTimeDataOfNewBoiler(@Param("sourceType") String sourceType, @Param("pipeDn") String pipeDn);
}
......
......@@ -74,4 +74,26 @@
AND is_sum = 1
</select>
<select id="getEquipDataListOfNewBoiler" resultType="com.skua.modules.business.entity.WhatStructData">
SELECT
*
FROM
what_struct_data_xglf
WHERE
pump_code = #{sourceType}
AND equip_type = 'equip_status'
OR equip_type = 'equip_time'
</select>
<select id="getRealTimeDataOfNewBoiler" resultType="com.skua.modules.business.entity.WhatStructData">
SELECT
*
FROM
what_struct_data_xglf
WHERE
pump_code = #{sourceType}
AND equip_diameter = #{pipeDn}
AND equip_type = 'other'
</select>
</mapper>
\ No newline at end of file
......
......@@ -60,4 +60,8 @@ public interface IOlympicCenterService {
Map<String, Object> getYearSumFlowGroup(SumFlowParams sumFlowParams);
WhatStructData getFieldNameById(String equipId);
List<Map<String,Object>> getNewBoilerRealTimeReport(String sourceType);
List<TableResult> getNewBoilerRealDataReport(String sourceType,String pipeDn);
}
......
......@@ -1939,6 +1939,33 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return status;
}
private String getStatusNew2(Map<String, Object> map, List<Map<String, Object>> list, String pumpId) {
String status = "停止";
String gzName = pumpId+"_FLT";
String yxName = pumpId+"_RUN";
boolean gzFlag = false;
for (Map<String, Object> bean : list) {
if(gzName.equals(bean.get("id"))){
if("1".equals(map.get(bean.get("monitorid").toString()))){
status = "故障";
gzFlag = true;
}
}
if(!gzFlag){
if(yxName.equals(bean.get("id"))){
if("1".equals(map.get(bean.get("monitorid").toString()))){
status = "运行";
}else{
status = "停止";
}
}else{
status = "停止";
}
}
}
return status;
}
private List<Map<String, Object>> getMnData(){
List<Map<String, Object>> list = new ArrayList<>();
Map<String, Object> flowMap = new HashMap<>();
......@@ -2853,6 +2880,94 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return whatStructData;
}
@Override
public List<Map<String,Object>> getNewBoilerRealTimeReport(String sourceType) {
List<Map<String, Object>> list = new ArrayList<>();
List<WhatStructData> timeList = new ArrayList<>();
List<WhatStructData> equipList = new ArrayList<>();
String pgField = "";
equipList = whatStructDataMapper.getEquipDataListOfNewBoiler(sourceType);
if(equipList.size()==0){
return null;
}
for (WhatStructData whatStructData : equipList) {
pgField = pgField + "," + whatStructData.getMonitorId();
if("equip_time".equals(whatStructData.getEquipType())){
timeList.add(whatStructData);
}
}
Map<String, Object> monitorMap = new HashMap<>();
List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
if(monitorList.size()==1){
monitorMap = monitorList.get(0);
}
for (WhatStructData whatStructData:timeList) {
List<Map<String, Object>> list1 = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
map.put("id",whatStructData.getEquipCode());
map.put("name",whatStructData.getMonitorName());
String equipCode = whatStructData.getEquipCode();
for (WhatStructData whatStructData1 : equipList) {
if(equipCode.equals(whatStructData1.getEquipCode())){
Map<String, Object> statusMap = new HashMap<>();
statusMap.put("id",whatStructData1.getId());
statusMap.put("name",whatStructData1.getMonitorName());
if(whatStructData1.getMonitorId()!=null){
statusMap.put("monitorid",whatStructData1.getMonitorId());
}else{
statusMap.put("monitorid","");
}
list1.add(statusMap);
}
}
map.put("status", getStatusNew2(monitorMap,list1,equipCode));
map.put("signal","--");
if(whatStructData.getMonitorId()!=null){
if(monitorMap.get(whatStructData.getMonitorId())!=null){
map.put("runtime",monitorMap.get(whatStructData.getMonitorId()));
}else{
map.put("runtime", "--");
}
}else{
map.put("runtime","--");
}
list.add(map);
}
return list;
}
@Override
public List<TableResult> getNewBoilerRealDataReport(String sourceType,String pipeDn) {
List<TableResult> list = new LinkedList<>();
List<WhatStructData> dataList = new LinkedList<>();
String pgField = "";
dataList = whatStructDataMapper.getRealTimeDataOfNewBoiler(sourceType, pipeDn);
if(dataList.size()==0){
return null;
}
for (WhatStructData whatStructData : dataList) {
pgField = pgField + "," + whatStructData.getMonitorId();
}
Map<String, Object> monitorMap = new HashMap<>();
List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
if(monitorList.size()==1){
monitorMap = monitorList.get(0);
}
for (WhatStructData whatStructData : dataList) {
TableResult tableResult = new TableResult();
tableResult.setId(whatStructData.getId());
tableResult.setName(whatStructData.getMonitorName());
tableResult.setUnit(whatStructData.getMonitorUnit());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
tableResult.setCount(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
tableResult.setCount("--");
}
list.add(tableResult);
}
return list;
}
//遍历两个年份之间的年份
private static String[] getYearsArray(String startYear, String endYear) {
int length = Integer.parseInt(endYear) - Integer.parseInt(startYear) + 1;
......
......@@ -20,4 +20,6 @@ public class InputQueryParams {
private String start;
/**结束时间 yyyy-MM-DD*/
private String end;
/**设备管径 DN350,DN250*/
private String pipeDn;
}
......
package com.skua.modules.business.vo;
import lombok.Data;
@Data
public class ReportParamsVO {
//数据类型
private String dataType;
//功能位置
private String loction;
//日期
private String dataDate;
}
......@@ -14,5 +14,7 @@ public class TableResult {
private String name;
/**数值*/
private String count;
/**单位*/
private String unit;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!