c2f21995 张雷

奥体项目实时数据增加累计流量

1 个父辈 49d66248
......@@ -12,5 +12,7 @@ public interface WhatStructDataMapper {
List<WhatStructData> getList();
List<WhatStructData> getListForUE();
WhatStructData getOneById(@Param("id") String id);
}
......
......@@ -6,6 +6,10 @@
select * from what_struct_data
</select>
<select id="getListForUE" resultType="com.skua.modules.business.entity.WhatStructData">
select * from what_struct_data where equip_type in ('flow','pressure','temperature')
</select>
<select id="getOneById" resultType="com.skua.modules.business.entity.WhatStructData">
select * from what_struct_data where id = #{id} limit 1
</select>
......
......@@ -39,6 +39,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
Map<String, Object> monitorMap = new HashMap<>();
List<WhatStructData> pybList = new ArrayList<>();
List<WhatStructData> fybList = new ArrayList<>();
List<WhatStructData> ljbList = new ArrayList<>();
List<WhatStructData> wybList = new ArrayList<>();
List<TextResult> pList = new ArrayList<>();
List<TextResult> fList = new ArrayList<>();
......@@ -55,6 +56,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
pybList.add(whatStructData);
}else if("flow".equals(whatStructData.getEquipType())){
fybList.add(whatStructData);
}else if("flow_ljll".equals(whatStructData.getEquipType())){
ljbList.add(whatStructData);
}else if("temperature".equals(whatStructData.getEquipType())){
wybList.add(whatStructData);
}else{ }
......@@ -73,7 +76,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(monitorMap.get(pybList.get(i).getMonitorId())==null){
textResult.setValue("--");
}else{
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000);
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
textResult.setValue(String.valueOf(pResult));
}
}else{
......@@ -97,6 +100,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
fList.add(j,textResult);
}
for (int k = 0; k < 8; k++) {
TextResult textResult = new TextResult();
if(k<ljbList.size()){
textResult.setTitle(ljbList.get(k).getId());
if(monitorMap.get(ljbList.get(k).getMonitorId())==null){
textResult.setValue("--");
}else{
textResult.setValue(monitorMap.get(ljbList.get(k).getMonitorId()).toString());
}
}else{
textResult.setTitle("flow_ljll"+(k+1));
textResult.setValue("--");
}
fList.add(textResult);
}
map.put("pressure",pList);
map.put("flow",fList);
}else if("hot".equals(sourceType)){//压力10流量4温度4;
......@@ -107,7 +125,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(monitorMap.get(pybList.get(i).getMonitorId())==null){
textResult.setValue("--");
}else{
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000);
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
textResult.setValue(String.valueOf(pResult));
}
}else{
......@@ -131,6 +149,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
fList.add(j,textResult);
}
for (int h = 0; h < 4; h++) {
TextResult textResult = new TextResult();
if(h<ljbList.size()){
textResult.setTitle(ljbList.get(h).getId());
if(monitorMap.get(ljbList.get(h).getMonitorId())==null){
textResult.setValue("--");
}else{
textResult.setValue(monitorMap.get(ljbList.get(h).getMonitorId()).toString());
}
}else{
textResult.setTitle("flow_ljll"+(h+1));
textResult.setValue("--");
}
fList.add(textResult);
}
for (int k = 0; k < 4; k++) {
TextResult textResult = new TextResult();
if(k<wybList.size()){
......@@ -157,7 +190,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(monitorMap.get(pybList.get(i).getMonitorId())==null){
textResult.setValue("--");
}else{
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000);
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
textResult.setValue(String.valueOf(pResult));
}
}else{
......@@ -181,6 +214,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
fList.add(j,textResult);
}
for (int k = 0; k < 2; k++) {
TextResult textResult = new TextResult();
if(k<ljbList.size()){
textResult.setTitle(ljbList.get(k).getId());
if(monitorMap.get(ljbList.get(k).getMonitorId())==null){
textResult.setValue("--");
}else{
textResult.setValue(monitorMap.get(ljbList.get(k).getMonitorId()).toString());
}
}else{
textResult.setTitle("flow_ljll"+(k+1));
textResult.setValue("--");
}
fList.add(textResult);
}
map.put("pressure",pList);
map.put("flow",fList);
}else{
......@@ -196,6 +244,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
textResult.setValue("0.00");
fList.add(j,textResult);
}
for (int h = 0; h < 14; h++) {
TextResult textResult = new TextResult();
textResult.setTitle("flow_ljll"+(h+1));
textResult.setValue("0.00");
fList.add(h,textResult);
}
for (int k = 0; k < 4; k++) {
TextResult textResult = new TextResult();
textResult.setTitle("temperature"+(k+1));
......@@ -333,7 +387,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
EchartResult echartResult = new EchartResult();
echartResult.setName(map.get("time").toString());
if("p".equals(type)){
double pResult = formatDouble(Double.parseDouble(map.get(whatStructData.getMonitorId()).toString())/1000);
double pResult = formatDouble(Double.parseDouble(map.get(whatStructData.getMonitorId()).toString())/100);
echartResult.setValue(String.valueOf(pResult));
echartResult.setSeries("压力表");
}else if("f".equals(type)){
......@@ -463,7 +517,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
@Override
public Map<String, Object> getRealTimeDataToUE() {
List<WhatStructData> list = whatStructDataMapper.getList();
List<WhatStructData> list = whatStructDataMapper.getListForUE();
Map<String, Object> map = new HashMap<>();
Map<String, Object> monitorMap = new HashMap<>();
String pgField = "";
......@@ -476,7 +530,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for (WhatStructData whatStructData:list) {
if(whatStructData.getMonitorId()!=null){
if("pressure".equals(whatStructData.getEquipType())){
double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())/1000);
double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())/100);
map.put(whatStructData.getId(),String.valueOf(pResult));
}else{
map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId()));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!