<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    guanxf

    我的博客:http://blog.sina.com.cn/17learning

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      71 隨筆 :: 1 文章 :: 41 評(píng)論 :: 0 Trackbacks
    1、主要方法:
                   String startDate = req.getParameter("startDate"); 
    String endDate = req.getParameter("endDate");
    UserVO users = (UserVO) req.getSession().getAttribute("users");
    List<ReportBaseVO> titleList = MessageCountService.titleList();  //表列
    List<ReportBaseVO> mentList=MessageCountService.findMentList(users,messType); //表行
                    List<ReportDataVO> dataList=MessageCountService.findData(users,messType,startDate,endDate); //數(shù)據(jù)集
    Map<String,String> dataMap = ReportService.getReport(dataList); //裝入Map
    2、方法實(shí)現(xiàn):
    //0:滿意 1:非常滿意2:不滿意 
    public static List<ReportBaseVO> titleList(){
    List<ReportBaseVO> list = new ArrayList<ReportBaseVO>();
    ReportBaseVO vo1 = new ReportBaseVO();
    vo1.setCode("0");
    vo1.setName("滿意");
    list.add(vo1);
    ReportBaseVO vo2 = new ReportBaseVO();
    vo2.setCode("1");
    vo2.setName("基本滿意");
    list.add(vo2);
    ReportBaseVO vo3 = new ReportBaseVO();
    vo3.setCode("2");
    vo3.setName("不滿意");
    list.add(vo3);
    return list;
    }

    public static List<ReportBaseVO> findMentList(UserVO users,String type){
    List<ReportBaseVO> list = new ArrayList<ReportBaseVO>();
             
    if((users.isHave("0") && ("1".equals(type)||type==null||"".equals(type)))||users.isHave("1") && ("1".equals(type)||type==null||"".equals(type))){
    ReportBaseVO vo1 = new ReportBaseVO();
    vo1.setCode("1");
    vo1.setName("局長(zhǎng)信箱");
    list.add(vo1);
    }
    }

    public static List<ReportDataVO> findData(UserVO users, String messType,String startDate,String endDate){
                   List<ReportDataVO> list = new ArrayList<ReportDataVO>();
    String sql="select APPRAISAL as titleId,MESS_TYPE as mentId,count(ID) as count from act_message where DELETE_FLAG='0' and APPRAISAL<>'' and MESS_TYPE='1' group by MESS_TYPE,APPRAISAL";
    List<ReportDataVO> reportDataList = DBBeanUtil.execute(conn, new ReportDataVO(),sql);
    list.addAll(reportDataList);
    return list;
    }

    public static Map<String,String> getReport(List<ReportDataVO> paraList){
    Map<String, String> reportMap = new HashMap<String, String>();
    for(int i=0;i<paraList.size();i++){
    ReportDataVO p = paraList.get(i);
    reportMap.put(p.getMentId()+"_"+p.getTitleId(), String.valueOf(p.getCount()));
    }
    return reportMap;
    }

    3、遍歷數(shù)據(jù):
    Map<String,String> dataMap = ReportService.getReport(dataList);
    String[][] data = new String[mentList.size()][titleList.size()];
    for (int i = 0; i < mentList.size(); i++) {
    mentList.get(i).getName();  
    int typeAll=0;
    for (int j = 0; j < titleList.size(); j++) {
    String dateMa=mentList.get(i).getCode()+ "_" + titleList.get(j).getCode();
    //             out.print("titleList.get(j).getCode():"+titleList.get(j).getCode());
    String content = dataMap.get(dateMa);//IsTurn0
    if (content == null || "".equals(content)) {
    content = "0";
    }
    data[i][j] = content;
    typeAll=Integer.parseInt(content)+typeAll;
    }
    BigDecimal point = new BigDecimal(0);
    BigDecimal mcount=new BigDecimal(data[i][0]).add(new BigDecimal(data[i][1]));//滿意發(fā)布件數(shù)
    BigDecimal atotal=mcount.add(new BigDecimal(data[i][2]));//共發(fā)布件數(shù)
    if(atotal.compareTo(new BigDecimal(0))!=0){
    point = new BigDecimal(100).multiply(mcount.divide(atotal,2, RoundingMode.HALF_UP));
    }
    }
    posted on 2012-09-12 23:57 管先飛 閱讀(343) 評(píng)論(0)  編輯  收藏 所屬分類: Java技術(shù)Struts2
    主站蜘蛛池模板: 99亚洲精品高清一二区| 亚洲国产精品一区二区久久hs | 久久精品国产免费| 亚洲情a成黄在线观看| 亚洲国产免费综合| 亚洲日韩在线观看免费视频| 皇色在线免费视频| 久久精品夜色国产亚洲av| 国产一精品一AV一免费| 亚洲第一精品在线视频| 3d成人免费动漫在线观看| 亚洲高清中文字幕| 免费看韩国黄a片在线观看| 亚洲AV无码无限在线观看不卡| 免费高清资源黄网站在线观看| 亚洲av无码一区二区三区四区| 亚洲 自拍 另类小说综合图区| 人碰人碰人成人免费视频| 亚洲中文字幕无码中文字在线| 最近免费mv在线观看动漫 | 四虎永久在线精品免费网址 | 亚洲av无码专区在线观看下载| www.亚洲精品.com| 久艹视频在线免费观看| 亚洲一级毛片免费看| 日韩免费三级电影| 香蕉免费看一区二区三区| 亚洲天堂一区二区三区四区| 日本特黄特色aa大片免费| 国产精品永久免费| 亚洲色图.com| 亚洲国产激情一区二区三区| 在线播放免费人成毛片乱码| 亚洲资源最新版在线观看| 亚洲日韩国产精品乱| 无码区日韩特区永久免费系列| 日韩毛片在线免费观看| 亚洲美女视频网址| 免费a级毛片网站| 999久久久免费精品播放| 在线播放亚洲精品|