123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- package com.sinosoft.cm.chart.util;
- import java.util.List;
- import org.apache.log4j.Logger;
- import org.directwebremoting.ServerContextFactory;
- import com.sinosoft.cm.chart.vo.ChartType;
- import com.system.push.MessagePush;
- import flex.messaging.io.ArrayList;
- public class DwrToSysChartFactory {
- private static DwrToSysChartFactory dcf = new DwrToSysChartFactory();
- private final Logger log = Logger.getLogger(getClass());
- private static final int SUCCESS = 0;
- private static final int FAILURE = 1;
- private DwrToSysChartFactory() {
- }
- public static DwrToSysChartFactory getDwrChartFactoryInstance() {
- if (dcf == null) {
- dcf = new DwrToSysChartFactory();
- }
- return dcf;
- }
- public static int dwrToPage(int pageType, String number) {
- dcf = getDwrChartFactoryInstance();
- return dcf.dwrToPageType(pageType, number);
- }
- public int dwrToPageType(int pageType, String number) {
- try {
- switch (pageType) {
- case ChartType.XLTZ:
- dwrXLTZ(number);
- break;
- case ChartType.BDZTY:
- dwrBDZTY(number);
- break;
- case ChartType.SBSS:
- dwrSBSS(number);
- break;
- case ChartType.YHTD:
- dwrYHTD(number);
- break;
- case ChartType.YJZY:
- dwrYJZY(number);
- break;
- case ChartType.GIS:
- dwrGIS();
- default:
- break;
- }
- log.info("页面推送成功");
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- log.error("推送失败");
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrGIS() {
- try {
- MessagePush.showMsg("/page/cockpit/webgis/webgis.html", 0, "", "",
- "refreshEwer");
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrXLTZ(String number) {
- @SuppressWarnings("unchecked")
- List<String> list = new ArrayList();
- // String path=ServerContextFactory.get().getContextPath();
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_fenzu_chart.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_mainNest_strend.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_helpNest_strend.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_gauge.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_byLevel_gauge.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_sum_strend.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_btdy_chart.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_child_chart.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_child_chart.html");
- list.add("/page/cockpit/echart_maticView/line_trip/line_trip_sum_chart.html");
-
- try {
- for (int index = 0, len = list.size(); index < len; index++) {
- MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
- }
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrBDZTY(String number) {
- @SuppressWarnings("unchecked")
- List<String> list = new ArrayList();
- // String path=ServerContextFactory.get().getContextPath();
- list.add("/page/cockpit/echart_maticView/substation_stoppage/substation_stop_child_chart.html");
- list.add("/page/cockpit/echart_maticView/substation_stoppage/substation_stop_sum_voltage.html");
-
- try {
- for (int index = 0, len = list.size(); index < len; index++) {
- MessagePush.showMsg(list.get(index), 0, "", number ,
- "dwrSysData");
- }
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrSBSS(String number) {
- @SuppressWarnings("unchecked")
- List<String> list = new ArrayList();
- // String path=ServerContextFactory.get().getContextPath();
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_cover_strend.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_sum_strend.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_group_pie_chart.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_gauge.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_equipment_type_pie_chart.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_child_chart.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_child_stackLevel_chart.html");
- list.add("/page/cockpit/echart_maticView/equipment_loss/equipment_loss_type_chart_pie_chart.html");
- try {
- for (int index = 0, len = list.size(); index < len; index++) {
- MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
- }
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrYHTD(String number) {
- @SuppressWarnings("unchecked")
- List<String> list = new ArrayList();
- // String path=ServerContextFactory.get().getContextPath();
- list.add("/page/cockpit/echart_maticView/important_user_outage/user_outage_gauge.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_strend.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_uncover_chart.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_importantAndnormal_chart.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_child_chart.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/important_user_outage_gauge.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_each_strend.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_each_pie.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/importent_user_outage_uncover_each_pie.html");
- list.add("/page/cockpit/echart_maticView/power_loss/power_loss_child_chart.html");
- list.add("/page/cockpit/echart_maticView/important_user_outage/user_outage_and_important_user_outage_gauge.html");
- try {
- for (int index = 0, len = list.size(); index < len; index++) {
- MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
- }
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- private int dwrYJZY(String number) {
- @SuppressWarnings("unchecked")
- List<String> list = new ArrayList();
- // //String path=ServerContextFactory.get().getContextPath();
- list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_pie.html");
- list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_person_into_child_chart.html");
- list.add("/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_child_chart.html");
- try {
- for (int index = 0, len = list.size(); index < len; index++) {
- MessagePush.showMsg(list.get(index), 0, "", number, "dwrSysData");
- }
- return DwrToSysChartFactory.SUCCESS;
- } catch (Exception e) {
- return DwrToSysChartFactory.FAILURE;
- }
- }
- }
|