package main.java.com.zte.controller.system;

import java.util.ArrayList;
import java.util.List; import javax.annotation.Resource; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView; import main.java.com.zte.controller.base.BaseController;
import main.java.com.zte.entity.Page;
import main.java.com.zte.entity.charts.Option;
import main.java.com.zte.entity.charts.Series;
import main.java.com.zte.service.PmExceptionService;
import main.java.com.zte.util.Const;
import main.java.com.zte.util.PageData; @Controller
@RequestMapping(value = "/pmException")
public class PmExceptionController extends BaseController { @Resource(name = "pmExceptionService")
private PmExceptionService pmExceptionService; @RequestMapping(value = "/list")
public ModelAndView list(Page page,
@RequestParam(value = "taskId", required = false) String taskId)
throws Exception {
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
try {
pd = this.getPageData();
Subject currentUser = SecurityUtils.getSubject();
Session session = currentUser.getSession();
String userName = (String) session
.getAttribute(Const.SESSION_USERNAME); // 获取session中的用户名
pd.put(Const.SESSION_USERNAME, userName);
taskId = "1467859122980";
pd.put("taskId", taskId);
page.setPd(pd);
List<PageData> pmExceptions = pmExceptionService
.pmExceptionlistPage(page);
mv.addObject("pmExceptions", pmExceptions);
mv.addObject("pd", pd);
mv.setViewName("pm/exception_list");
} catch (Exception e) {
logger.error(e.toString(), e);
}
return mv;
} @RequestMapping(value = "/charts_month")
public ModelAndView chartsForMonth(Page page,
@RequestParam(value = "taskId", required = false) String taskId)
throws Exception {
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
try {
pd = this.getPageData();
Subject currentUser = SecurityUtils.getSubject();
Session session = currentUser.getSession();
String userName = (String) session
.getAttribute(Const.SESSION_USERNAME); // 获取session中的用户名
pd.put(Const.SESSION_USERNAME, userName);
pd.put("taskId", taskId);
page.setPd(pd);
List<PageData> chartsForMonthResult = pmExceptionService
.pmExceptionlistPage(page);
List<Series> seriesList = new ArrayList<Series>();
// 存放类别数据
List<String> categoryList = new ArrayList<String>();
// 存放所有
Option options = new Option(); if (!chartsForMonthResult.isEmpty()) {
for (PageData pmChart : chartsForMonthResult) {
Series series = new Series();
List<Double> datas = new ArrayList<Double>();
if (!seriesList.contains(pmChart.get("TAGS"))) {
series.setName(pmChart.get("TAGS").toString()); String pmDatas = pmChart.getString("EXCEPTION_COUNT")
.toString();
Double data = Double.valueOf(pmDatas.trim());
datas.add(data);
}
} } mv.addObject("chartsForMonthResult", chartsForMonthResult);
mv.addObject("pd", pd);
mv.setViewName("pm/exception_list");
} catch (Exception e) {
logger.error(e.toString(), e);
}
return mv;
} @RequestMapping(value = "/exception_detail")
public ModelAndView exceptionDetail(
Page page,
@RequestParam(value = "exception_id", required = false) String exception_id)
throws Exception {
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
try {
pd = this.getPageData();
pd.put("exception_id", exception_id);
page.setPd(pd);
List<PageData> pmExceptions = pmExceptionService
.pmExceptionlistPage(page);
mv.addObject("pmExceptions", pmExceptions);
mv.addObject("pd", pd);
mv.setViewName("pm/exception_list");
} catch (Exception e) {
logger.error(e.toString(), e);
}
return mv;
} }

PmExceptionController的更多相关文章

随机推荐

  1. KJHttp框架使用讲解

    摘要 本文原创,转载请注明地址:http://kymjs.com/code/2015/05/12/01写给那些在用.想用.还没有用过KJFrame的朋友. KJFrameForAndroid总共分为四 ...

  2. 解决kylin sync table报错:MetaException(message:java.lang.ClassNotFoundException Class org.apache.hive.hcatalog.data.JsonSerDe not found

    在kylin-gui中sync表default.customer_visit时报错: -- ::, ERROR [http-bio--exec-] controller.BasicController ...

  3. 完全理解Gson(1):简单入门

    GSON是Google开发的Java API,用于转换Java对象和Json对象.本文讨论并提供了使用API的简单代码示例.更多关于GSON的API可以访问:http://sites.google.c ...

  4. Git 学习(八)其他

    Git 学习(八)其他 通过以上七章Git的学习,基本操作已差不多了,本章介绍一点落网之鱼:  包括如何忽略文件.配置别名.以及使用GitHub等. 当然,Git的强大远不是七章内容可概括的,之后可结 ...

  5. nginx缓存和flask_cache

    1.使用flask_cache的缓存功能simple模式时,直接启用可以使用,但是如果中间使用nginx代理时,就没有效果了 2.那就直接使用nginx缓存机制 http://blog.csdn.ne ...

  6. 3D屏保:N皇后

    前几天园子里有人发表关于8皇后的算法.只有代码,没有能运行的DEMO多枯燥.于是我这两天抽时间写了个N皇后的屏保程序.程序启动后会从4皇后到14皇后显示其所有排列,每隔0.5秒自动切换一次.按下空格键 ...

  7. ListView 拖拽

    private void ListView1_MouseMove(object sender, MouseEventArgs e) { Patientappointment appointment = ...

  8. c语言中pthread的理解和使用

    在头文件中看到#typedef unsigned long int pthread_t这句话怎么理解,pthread_t是一个什么类型呢? 相当于pthread_t实际是个unsigned long  ...

  9. (转)Unity3D命令行Build

    转自:http://www.cnblogs.com/gameprogram/archive/2012/05/11/2496303.html 本来是没想用这个命令行Build方式,可惜电脑不知道怎么的就 ...

  10. dev -c++ 快捷键

    转自:http://blog.csdn.net/abcjennifer/article/details/7259222 F8:开始调试 F7:进一步执行当前行,并跳到下一行 F4:添加查看 ctrl ...