d5379162 张雷

奥体项目增加返回数据短数的情况判断

1 个父辈 62ce9588
......@@ -77,8 +77,12 @@ 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())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
textResult.setValue(String.valueOf(pResult));
if(monitorMap.get(pybList.get(i).getMonitorId())!=null){
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
textResult.setValue(String.valueOf(pResult));
}else{
textResult.setValue("--");
}
}
}else{
textResult.setTitle("pressure"+(i+1));
......@@ -537,10 +541,18 @@ 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())*Double.parseDouble(whatStructData.getMonitorZoom()));
map.put(whatStructData.getId(),String.valueOf(pResult));
if(monitorMap.get(whatStructData.getMonitorId())!=null){
double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())*Double.parseDouble(whatStructData.getMonitorZoom()));
map.put(whatStructData.getId(),String.valueOf(pResult));
}else{
map.put(whatStructData.getId(),"--");
}
}else{
map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId()));
if(monitorMap.get(whatStructData.getMonitorId())!=null){
map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId()));
}else{
map.put(whatStructData.getId(),"--");
}
}
}else{
map.put(whatStructData.getId(),"--");
......@@ -591,15 +603,19 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(monitorList.size()==1){
monitorMap = monitorList.get(0);
if("feed".equals(sourceType)){//压力14流量8
for (int i = 0; i < 14; i++) {
for (int i = 0; i < 15; i++) {
TextResult textResult = new TextResult();
if(i<pybList.size()){
textResult.setTitle(pybList.get(i).getId());
if(monitorMap.get(pybList.get(i).getMonitorId())==null){
textResult.setValue("--");
}else{
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
textResult.setValue(String.valueOf(pResult));
if(monitorMap.get(pybList.get(i).getMonitorId())!=null){
double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
textResult.setValue(String.valueOf(pResult));
}else{
textResult.setValue("--");
}
}
}else{
textResult.setTitle("pressure"+(i+1));
......@@ -616,7 +632,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(j<fybList.size()){
flow.setTitle(fybList.get(j).getEquipType());
if(fybList.get(j).getMonitorId()!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
}else{
flow.setValue("--");
}
flowList.add(flow);
String equipCode = fybList.get(j).getEquipCode();
int fcount = 0;
......@@ -625,12 +645,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(equipCode.equals(whatStructData.getEquipCode())){
if("flow_ljll".equals(whatStructData.getEquipType())){
fFlow.setTitle(whatStructData.getEquipType());
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
fFlow.setValue("--");
}
flowList.add(fFlow);
fcount++;
}else if("flow_rljll".equals(whatStructData.getEquipType())){
rFlow.setTitle(whatStructData.getEquipType());
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
rFlow.setValue("--");
}
flowList.add(rFlow);
fcount++;
}else{}
......@@ -692,7 +720,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(j<fybList.size()){
flow.setTitle(fybList.get(j).getEquipType());
if(fybList.get(j).getMonitorId()!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
}else{
flow.setValue("--");
}
flowList.add(flow);
String equipCode = fybList.get(j).getEquipCode();
int fcount = 0;
......@@ -701,12 +733,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(equipCode.equals(whatStructData.getEquipCode())){
if("flow_ljll".equals(whatStructData.getEquipType())){
fFlow.setTitle(whatStructData.getEquipType());
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
fFlow.setValue("--");
}
flowList.add(fFlow);
fcount++;
}else if("flow_rljll".equals(whatStructData.getEquipType())){
rFlow.setTitle(whatStructData.getEquipType());
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
rFlow.setValue("--");
}
flowList.add(rFlow);
fcount++;
}else{}
......@@ -759,7 +799,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
map.put("flow",fList);
map.put("temperature",wList);
}else if("fire".equals(sourceType)){//压力9流量2.
for (int i = 0; i < 9; i++) {
for (int i = 0; i < 10; i++) {
TextResult textResult = new TextResult();
if(i<pybList.size()){
textResult.setTitle(pybList.get(i).getId());
......@@ -784,7 +824,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(j<fybList.size()){
flow.setTitle(fybList.get(j).getEquipType());
if(fybList.get(j).getMonitorId()!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
}else{
flow.setValue("--");
}
flowList.add(flow);
String equipCode = fybList.get(j).getEquipCode();
int fcount = 0;
......@@ -793,12 +837,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
if(equipCode.equals(whatStructData.getEquipCode())){
if("flow_ljll".equals(whatStructData.getEquipType())){
fFlow.setTitle(whatStructData.getEquipType());
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
fFlow.setValue("--");
}
flowList.add(fFlow);
fcount++;
}else if("flow_rljll".equals(whatStructData.getEquipType())){
rFlow.setTitle(whatStructData.getEquipType());
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
if(monitorMap.get(whatStructData.getMonitorId())!=null){
rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
}else{
rFlow.setValue("--");
}
flowList.add(rFlow);
fcount++;
}else{}
......@@ -835,7 +887,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
map.put("pressure",pList);
map.put("flow",fList);
}else{
for (int i = 0; i < 33; i++) {
for (int i = 0; i < 35; i++) {
TextResult textResult = new TextResult();
textResult.setTitle("pressure"+(i+1));
textResult.setValue("0.00");
......@@ -985,7 +1037,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
Map<String, Object> beanMap = new HashMap<>();
for (WhatStructData bean : list) {
if(bean.getId().startsWith(fId)){
beanMap.put(bean.getEquipType(),monitorMap.get(bean.getMonitorId()));
if(monitorMap.get(bean.getMonitorId())!=null){
beanMap.put(bean.getEquipType(),monitorMap.get(bean.getMonitorId()));
}else{
beanMap.put(bean.getEquipType(),"--");
}
}
}
map.put(fId,beanMap);
......@@ -1210,7 +1266,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
if(monitorList.size()==1){
monitorMap = monitorList.get(0);
map.put("runtime", monitorMap.get(equipMap.get("runtime").toString()));
if(monitorMap.get(equipMap.get("runtime").toString())!=null){
map.put("runtime", monitorMap.get(equipMap.get("runtime").toString()));
}else{
map.put("runtime", "--");
}
String equipStatus = "停止";
if("2".equals(equipMap.get("show_model"))){
equipStatus = getStatus2(monitorMap,statusList,pumpId);
......@@ -1264,7 +1324,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
map.put("status", getStatus2(monitorMap,list1,equipCode));
map.put("signal","--");
if(whatStructData.getMonitorId()!=null){
map.put("runtime",monitorMap.get(whatStructData.getMonitorId()));
if(monitorMap.get(whatStructData.getMonitorId())!=null){
map.put("runtime",monitorMap.get(whatStructData.getMonitorId()));
}else{
map.put("runtime", "--");
}
}else{
map.put("runtime","--");
}
......@@ -1547,13 +1611,6 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}else if("f".equals(type)){
for (WhatStructData whatStructData:wList) {
EchartResult eResult = new EchartResult();
if("today".equals(timeType)){
datatime = datatime.substring(11,16);
}else if("week".equals(timeType)){
datatime = datatime.substring(5,16);
}else{
datatime = datatime.substring(5,10);
}
eResult.setName(datatime);
if(whatStructData.getMonitorId()==null){
eResult.setValue("");
......
......@@ -68,7 +68,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
if(Long.parseLong(monitorList.get(m).get("time").toString()) > todayTimeStemp){
map.put(monitorList.get(m).get("monitorId").toString(),monitorList.get(m).get("monitorValue"));
}else{
map.put(monitorList.get(m).get("monitorId").toString(),0.00);
map.put(monitorList.get(m).get("monitorId").toString(),null);
}
}
result.add(map);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!