b7211e3ee02a5561ff0487aed027dc5ef0ce72ee.svn-base 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. package com.sinosoft.cm.chart.util;
  2. import java.util.List;
  3. import org.apache.log4j.Logger;
  4. import org.directwebremoting.ServerContextFactory;
  5. import com.sinosoft.cm.chart.vo.ChartType;
  6. import com.system.push.MessagePush;
  7. import flex.messaging.io.ArrayList;
  8. public class DwrToSysChartFactory {
  9. private static DwrToSysChartFactory dcf = new DwrToSysChartFactory();
  10. private final Logger log = Logger.getLogger(getClass());
  11. private static final int SUCCESS = 0;
  12. private static final int FAILURE = 1;
  13. private DwrToSysChartFactory() {
  14. }
  15. public static DwrToSysChartFactory getDwrChartFactoryInstance() {
  16. if (dcf == null) {
  17. dcf = new DwrToSysChartFactory();
  18. }
  19. return dcf;
  20. }
  21. public static int dwrToPage(int pageType, String number) {
  22. dcf = getDwrChartFactoryInstance();
  23. return dcf.dwrToPageType(pageType, number);
  24. }
  25. public int dwrToPageType(int pageType, String number) {
  26. try {
  27. switch (pageType) {
  28. case ChartType.XLTZ:
  29. dwrXLTZ(number);
  30. break;
  31. case ChartType.BDZTY:
  32. dwrBDZTY(number);
  33. break;
  34. case ChartType.SBSS:
  35. dwrSBSS(number);
  36. break;
  37. case ChartType.YHTD:
  38. dwrYHTD(number);
  39. break;
  40. case ChartType.YJZY:
  41. dwrYJZY(number);
  42. break;
  43. case ChartType.GIS:
  44. dwrGIS();
  45. default:
  46. break;
  47. }
  48. log.info("页面推送成功");
  49. return DwrToSysChartFactory.SUCCESS;
  50. } catch (Exception e) {
  51. log.error("推送失败");
  52. return DwrToSysChartFactory.FAILURE;
  53. }
  54. }
  55. private int dwrGIS() {
  56. try {
  57. MessagePush.showMsg("/page/cockpit/webgis/webgis.html", 0, "", "",
  58. "refreshEwer");
  59. return DwrToSysChartFactory.SUCCESS;
  60. } catch (Exception e) {
  61. return DwrToSysChartFactory.FAILURE;
  62. }
  63. }
  64. private int dwrXLTZ(String number) {
  65. @SuppressWarnings("unchecked")
  66. List<String> list = new ArrayList();
  67. // String path=ServerContextFactory.get().getContextPath();
  68. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_fenzu_chart.html");
  69. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_mainNest_strend.html");
  70. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_helpNest_strend.html");
  71. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_gauge.html");
  72. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_byLevel_gauge.html");
  73. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_sum_strend.html");
  74. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_btdy_chart.html");
  75. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_child_chart.html");
  76. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_child_chart.html");
  77. list.add("/page/cockpit/echart_maticView/line_trip/line_trip_sum_chart.html");
  78. try {
  79. for (int index = 0, len = list.size(); index < len; index++) {
  80. MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
  81. }
  82. return DwrToSysChartFactory.SUCCESS;
  83. } catch (Exception e) {
  84. return DwrToSysChartFactory.FAILURE;
  85. }
  86. }
  87. private int dwrBDZTY(String number) {
  88. @SuppressWarnings("unchecked")
  89. List<String> list = new ArrayList();
  90. // String path=ServerContextFactory.get().getContextPath();
  91. list.add("/page/cockpit/echart_maticView/substation_stoppage/substation_stop_child_chart.html");
  92. list.add("/page/cockpit/echart_maticView/substation_stoppage/substation_stop_sum_voltage.html");
  93. try {
  94. for (int index = 0, len = list.size(); index < len; index++) {
  95. MessagePush.showMsg(list.get(index), 0, "", number ,
  96. "dwrSysData");
  97. }
  98. return DwrToSysChartFactory.SUCCESS;
  99. } catch (Exception e) {
  100. return DwrToSysChartFactory.FAILURE;
  101. }
  102. }
  103. private int dwrSBSS(String number) {
  104. @SuppressWarnings("unchecked")
  105. List<String> list = new ArrayList();
  106. // String path=ServerContextFactory.get().getContextPath();
  107. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_cover_strend.html");
  108. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_sum_strend.html");
  109. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_group_pie_chart.html");
  110. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_gauge.html");
  111. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_equipment_type_pie_chart.html");
  112. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_child_chart.html");
  113. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_child_stackLevel_chart.html");
  114. list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_type_chart_pie_chart.html");
  115. try {
  116. for (int index = 0, len = list.size(); index < len; index++) {
  117. MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
  118. }
  119. return DwrToSysChartFactory.SUCCESS;
  120. } catch (Exception e) {
  121. return DwrToSysChartFactory.FAILURE;
  122. }
  123. }
  124. private int dwrYHTD(String number) {
  125. @SuppressWarnings("unchecked")
  126. List<String> list = new ArrayList();
  127. // String path=ServerContextFactory.get().getContextPath();
  128. list.add("/page/cockpit/echart_maticView/important_user_outage/user_outage_gauge.html");
  129. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_strend.html");
  130. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_uncover_chart.html");
  131. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_importantAndnormal_chart.html");
  132. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_chart.html");
  133. list.add("/page/cockpit/echart_maticView/important_user_outage/important_user_outage_gauge.html");
  134. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_each_strend.html");
  135. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_each_pie.html");
  136. list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_uncover_each_pie.html");
  137. list.add("/page/cockpit/echart_maticView/power_loss/power_loss_child_chart.html");
  138. list.add("/page/cockpit/echart_maticView/important_user_outage/user_outage_and_important_user_outage_gauge.html");
  139. try {
  140. for (int index = 0, len = list.size(); index < len; index++) {
  141. MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
  142. }
  143. return DwrToSysChartFactory.SUCCESS;
  144. } catch (Exception e) {
  145. return DwrToSysChartFactory.FAILURE;
  146. }
  147. }
  148. private int dwrYJZY(String number) {
  149. @SuppressWarnings("unchecked")
  150. List<String> list = new ArrayList();
  151. // //String path=ServerContextFactory.get().getContextPath();
  152. list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_pie.html");
  153. list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_person_into_child_chart.html");
  154. list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_child_chart.html");
  155. try {
  156. for (int index = 0, len = list.size(); index < len; index++) {
  157. MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
  158. }
  159. return DwrToSysChartFactory.SUCCESS;
  160. } catch (Exception e) {
  161. return DwrToSysChartFactory.FAILURE;
  162. }
  163. }
  164. }