d5379162 张雷

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

1 个父辈 62ce9588
...@@ -77,8 +77,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -77,8 +77,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
77 if(monitorMap.get(pybList.get(i).getMonitorId())==null){ 77 if(monitorMap.get(pybList.get(i).getMonitorId())==null){
78 textResult.setValue("--"); 78 textResult.setValue("--");
79 }else{ 79 }else{
80 if(monitorMap.get(pybList.get(i).getMonitorId())!=null){
80 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom())); 81 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
81 textResult.setValue(String.valueOf(pResult)); 82 textResult.setValue(String.valueOf(pResult));
83 }else{
84 textResult.setValue("--");
85 }
82 } 86 }
83 }else{ 87 }else{
84 textResult.setTitle("pressure"+(i+1)); 88 textResult.setTitle("pressure"+(i+1));
...@@ -537,10 +541,18 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -537,10 +541,18 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
537 for (WhatStructData whatStructData:list) { 541 for (WhatStructData whatStructData:list) {
538 if(whatStructData.getMonitorId()!=null){ 542 if(whatStructData.getMonitorId()!=null){
539 if("pressure".equals(whatStructData.getEquipType())){ 543 if("pressure".equals(whatStructData.getEquipType())){
544 if(monitorMap.get(whatStructData.getMonitorId())!=null){
540 double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())*Double.parseDouble(whatStructData.getMonitorZoom())); 545 double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())*Double.parseDouble(whatStructData.getMonitorZoom()));
541 map.put(whatStructData.getId(),String.valueOf(pResult)); 546 map.put(whatStructData.getId(),String.valueOf(pResult));
542 }else{ 547 }else{
548 map.put(whatStructData.getId(),"--");
549 }
550 }else{
551 if(monitorMap.get(whatStructData.getMonitorId())!=null){
543 map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId())); 552 map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId()));
553 }else{
554 map.put(whatStructData.getId(),"--");
555 }
544 } 556 }
545 }else{ 557 }else{
546 map.put(whatStructData.getId(),"--"); 558 map.put(whatStructData.getId(),"--");
...@@ -591,15 +603,19 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -591,15 +603,19 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
591 if(monitorList.size()==1){ 603 if(monitorList.size()==1){
592 monitorMap = monitorList.get(0); 604 monitorMap = monitorList.get(0);
593 if("feed".equals(sourceType)){//压力14流量8 605 if("feed".equals(sourceType)){//压力14流量8
594 for (int i = 0; i < 14; i++) { 606 for (int i = 0; i < 15; i++) {
595 TextResult textResult = new TextResult(); 607 TextResult textResult = new TextResult();
596 if(i<pybList.size()){ 608 if(i<pybList.size()){
597 textResult.setTitle(pybList.get(i).getId()); 609 textResult.setTitle(pybList.get(i).getId());
598 if(monitorMap.get(pybList.get(i).getMonitorId())==null){ 610 if(monitorMap.get(pybList.get(i).getMonitorId())==null){
599 textResult.setValue("--"); 611 textResult.setValue("--");
600 }else{ 612 }else{
613 if(monitorMap.get(pybList.get(i).getMonitorId())!=null){
601 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom())); 614 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())*Double.parseDouble(pybList.get(i).getMonitorZoom()));
602 textResult.setValue(String.valueOf(pResult)); 615 textResult.setValue(String.valueOf(pResult));
616 }else{
617 textResult.setValue("--");
618 }
603 } 619 }
604 }else{ 620 }else{
605 textResult.setTitle("pressure"+(i+1)); 621 textResult.setTitle("pressure"+(i+1));
...@@ -616,7 +632,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -616,7 +632,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
616 if(j<fybList.size()){ 632 if(j<fybList.size()){
617 flow.setTitle(fybList.get(j).getEquipType()); 633 flow.setTitle(fybList.get(j).getEquipType());
618 if(fybList.get(j).getMonitorId()!=null){ 634 if(fybList.get(j).getMonitorId()!=null){
635 if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
619 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString()); 636 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
637 }else{
638 flow.setValue("--");
639 }
620 flowList.add(flow); 640 flowList.add(flow);
621 String equipCode = fybList.get(j).getEquipCode(); 641 String equipCode = fybList.get(j).getEquipCode();
622 int fcount = 0; 642 int fcount = 0;
...@@ -625,12 +645,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -625,12 +645,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
625 if(equipCode.equals(whatStructData.getEquipCode())){ 645 if(equipCode.equals(whatStructData.getEquipCode())){
626 if("flow_ljll".equals(whatStructData.getEquipType())){ 646 if("flow_ljll".equals(whatStructData.getEquipType())){
627 fFlow.setTitle(whatStructData.getEquipType()); 647 fFlow.setTitle(whatStructData.getEquipType());
648 if(monitorMap.get(whatStructData.getMonitorId())!=null){
628 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 649 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
650 }else{
651 fFlow.setValue("--");
652 }
629 flowList.add(fFlow); 653 flowList.add(fFlow);
630 fcount++; 654 fcount++;
631 }else if("flow_rljll".equals(whatStructData.getEquipType())){ 655 }else if("flow_rljll".equals(whatStructData.getEquipType())){
632 rFlow.setTitle(whatStructData.getEquipType()); 656 rFlow.setTitle(whatStructData.getEquipType());
657 if(monitorMap.get(whatStructData.getMonitorId())!=null){
633 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 658 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
659 }else{
660 rFlow.setValue("--");
661 }
634 flowList.add(rFlow); 662 flowList.add(rFlow);
635 fcount++; 663 fcount++;
636 }else{} 664 }else{}
...@@ -692,7 +720,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -692,7 +720,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
692 if(j<fybList.size()){ 720 if(j<fybList.size()){
693 flow.setTitle(fybList.get(j).getEquipType()); 721 flow.setTitle(fybList.get(j).getEquipType());
694 if(fybList.get(j).getMonitorId()!=null){ 722 if(fybList.get(j).getMonitorId()!=null){
723 if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
695 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString()); 724 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
725 }else{
726 flow.setValue("--");
727 }
696 flowList.add(flow); 728 flowList.add(flow);
697 String equipCode = fybList.get(j).getEquipCode(); 729 String equipCode = fybList.get(j).getEquipCode();
698 int fcount = 0; 730 int fcount = 0;
...@@ -701,12 +733,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -701,12 +733,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
701 if(equipCode.equals(whatStructData.getEquipCode())){ 733 if(equipCode.equals(whatStructData.getEquipCode())){
702 if("flow_ljll".equals(whatStructData.getEquipType())){ 734 if("flow_ljll".equals(whatStructData.getEquipType())){
703 fFlow.setTitle(whatStructData.getEquipType()); 735 fFlow.setTitle(whatStructData.getEquipType());
736 if(monitorMap.get(whatStructData.getMonitorId())!=null){
704 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 737 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
738 }else{
739 fFlow.setValue("--");
740 }
705 flowList.add(fFlow); 741 flowList.add(fFlow);
706 fcount++; 742 fcount++;
707 }else if("flow_rljll".equals(whatStructData.getEquipType())){ 743 }else if("flow_rljll".equals(whatStructData.getEquipType())){
708 rFlow.setTitle(whatStructData.getEquipType()); 744 rFlow.setTitle(whatStructData.getEquipType());
745 if(monitorMap.get(whatStructData.getMonitorId())!=null){
709 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 746 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
747 }else{
748 rFlow.setValue("--");
749 }
710 flowList.add(rFlow); 750 flowList.add(rFlow);
711 fcount++; 751 fcount++;
712 }else{} 752 }else{}
...@@ -759,7 +799,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -759,7 +799,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
759 map.put("flow",fList); 799 map.put("flow",fList);
760 map.put("temperature",wList); 800 map.put("temperature",wList);
761 }else if("fire".equals(sourceType)){//压力9流量2. 801 }else if("fire".equals(sourceType)){//压力9流量2.
762 for (int i = 0; i < 9; i++) { 802 for (int i = 0; i < 10; i++) {
763 TextResult textResult = new TextResult(); 803 TextResult textResult = new TextResult();
764 if(i<pybList.size()){ 804 if(i<pybList.size()){
765 textResult.setTitle(pybList.get(i).getId()); 805 textResult.setTitle(pybList.get(i).getId());
...@@ -784,7 +824,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -784,7 +824,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
784 if(j<fybList.size()){ 824 if(j<fybList.size()){
785 flow.setTitle(fybList.get(j).getEquipType()); 825 flow.setTitle(fybList.get(j).getEquipType());
786 if(fybList.get(j).getMonitorId()!=null){ 826 if(fybList.get(j).getMonitorId()!=null){
827 if(monitorMap.get(fybList.get(j).getMonitorId())!=null){
787 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString()); 828 flow.setValue(monitorMap.get(fybList.get(j).getMonitorId()).toString());
829 }else{
830 flow.setValue("--");
831 }
788 flowList.add(flow); 832 flowList.add(flow);
789 String equipCode = fybList.get(j).getEquipCode(); 833 String equipCode = fybList.get(j).getEquipCode();
790 int fcount = 0; 834 int fcount = 0;
...@@ -793,12 +837,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -793,12 +837,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
793 if(equipCode.equals(whatStructData.getEquipCode())){ 837 if(equipCode.equals(whatStructData.getEquipCode())){
794 if("flow_ljll".equals(whatStructData.getEquipType())){ 838 if("flow_ljll".equals(whatStructData.getEquipType())){
795 fFlow.setTitle(whatStructData.getEquipType()); 839 fFlow.setTitle(whatStructData.getEquipType());
840 if(monitorMap.get(whatStructData.getMonitorId())!=null){
796 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 841 fFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
842 }else{
843 fFlow.setValue("--");
844 }
797 flowList.add(fFlow); 845 flowList.add(fFlow);
798 fcount++; 846 fcount++;
799 }else if("flow_rljll".equals(whatStructData.getEquipType())){ 847 }else if("flow_rljll".equals(whatStructData.getEquipType())){
800 rFlow.setTitle(whatStructData.getEquipType()); 848 rFlow.setTitle(whatStructData.getEquipType());
849 if(monitorMap.get(whatStructData.getMonitorId())!=null){
801 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString()); 850 rFlow.setValue(monitorMap.get(whatStructData.getMonitorId()).toString());
851 }else{
852 rFlow.setValue("--");
853 }
802 flowList.add(rFlow); 854 flowList.add(rFlow);
803 fcount++; 855 fcount++;
804 }else{} 856 }else{}
...@@ -835,7 +887,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -835,7 +887,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
835 map.put("pressure",pList); 887 map.put("pressure",pList);
836 map.put("flow",fList); 888 map.put("flow",fList);
837 }else{ 889 }else{
838 for (int i = 0; i < 33; i++) { 890 for (int i = 0; i < 35; i++) {
839 TextResult textResult = new TextResult(); 891 TextResult textResult = new TextResult();
840 textResult.setTitle("pressure"+(i+1)); 892 textResult.setTitle("pressure"+(i+1));
841 textResult.setValue("0.00"); 893 textResult.setValue("0.00");
...@@ -985,7 +1037,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -985,7 +1037,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
985 Map<String, Object> beanMap = new HashMap<>(); 1037 Map<String, Object> beanMap = new HashMap<>();
986 for (WhatStructData bean : list) { 1038 for (WhatStructData bean : list) {
987 if(bean.getId().startsWith(fId)){ 1039 if(bean.getId().startsWith(fId)){
1040 if(monitorMap.get(bean.getMonitorId())!=null){
988 beanMap.put(bean.getEquipType(),monitorMap.get(bean.getMonitorId())); 1041 beanMap.put(bean.getEquipType(),monitorMap.get(bean.getMonitorId()));
1042 }else{
1043 beanMap.put(bean.getEquipType(),"--");
1044 }
989 } 1045 }
990 } 1046 }
991 map.put(fId,beanMap); 1047 map.put(fId,beanMap);
...@@ -1210,7 +1266,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -1210,7 +1266,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
1210 List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField); 1266 List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
1211 if(monitorList.size()==1){ 1267 if(monitorList.size()==1){
1212 monitorMap = monitorList.get(0); 1268 monitorMap = monitorList.get(0);
1269 if(monitorMap.get(equipMap.get("runtime").toString())!=null){
1213 map.put("runtime", monitorMap.get(equipMap.get("runtime").toString())); 1270 map.put("runtime", monitorMap.get(equipMap.get("runtime").toString()));
1271 }else{
1272 map.put("runtime", "--");
1273 }
1214 String equipStatus = "停止"; 1274 String equipStatus = "停止";
1215 if("2".equals(equipMap.get("show_model"))){ 1275 if("2".equals(equipMap.get("show_model"))){
1216 equipStatus = getStatus2(monitorMap,statusList,pumpId); 1276 equipStatus = getStatus2(monitorMap,statusList,pumpId);
...@@ -1264,8 +1324,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -1264,8 +1324,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
1264 map.put("status", getStatus2(monitorMap,list1,equipCode)); 1324 map.put("status", getStatus2(monitorMap,list1,equipCode));
1265 map.put("signal","--"); 1325 map.put("signal","--");
1266 if(whatStructData.getMonitorId()!=null){ 1326 if(whatStructData.getMonitorId()!=null){
1327 if(monitorMap.get(whatStructData.getMonitorId())!=null){
1267 map.put("runtime",monitorMap.get(whatStructData.getMonitorId())); 1328 map.put("runtime",monitorMap.get(whatStructData.getMonitorId()));
1268 }else{ 1329 }else{
1330 map.put("runtime", "--");
1331 }
1332 }else{
1269 map.put("runtime","--"); 1333 map.put("runtime","--");
1270 } 1334 }
1271 list.add(map); 1335 list.add(map);
...@@ -1547,13 +1611,6 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -1547,13 +1611,6 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
1547 }else if("f".equals(type)){ 1611 }else if("f".equals(type)){
1548 for (WhatStructData whatStructData:wList) { 1612 for (WhatStructData whatStructData:wList) {
1549 EchartResult eResult = new EchartResult(); 1613 EchartResult eResult = new EchartResult();
1550 if("today".equals(timeType)){
1551 datatime = datatime.substring(11,16);
1552 }else if("week".equals(timeType)){
1553 datatime = datatime.substring(5,16);
1554 }else{
1555 datatime = datatime.substring(5,10);
1556 }
1557 eResult.setName(datatime); 1614 eResult.setName(datatime);
1558 if(whatStructData.getMonitorId()==null){ 1615 if(whatStructData.getMonitorId()==null){
1559 eResult.setValue(""); 1616 eResult.setValue("");
......
...@@ -68,7 +68,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService { ...@@ -68,7 +68,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
68 if(Long.parseLong(monitorList.get(m).get("time").toString()) > todayTimeStemp){ 68 if(Long.parseLong(monitorList.get(m).get("time").toString()) > todayTimeStemp){
69 map.put(monitorList.get(m).get("monitorId").toString(),monitorList.get(m).get("monitorValue")); 69 map.put(monitorList.get(m).get("monitorId").toString(),monitorList.get(m).get("monitorValue"));
70 }else{ 70 }else{
71 map.put(monitorList.get(m).get("monitorId").toString(),0.00); 71 map.put(monitorList.get(m).get("monitorId").toString(),null);
72 } 72 }
73 } 73 }
74 result.add(map); 74 result.add(map);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!