posts - 41, comments - 15, trackbacks - 0, articles - 1
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          在jsp中使用jquery的ajax

          Posted on 2012-04-18 16:36 yuhaibo736 閱讀(2290) 評(píng)論(2)  編輯  收藏
          jQuery.ajax({
                 url: 'getAssessmentStaffEvaluation.html',
                 type: 'post',
                 data: 'userId=' + userid + '&startDate=' + startDate + '&endDate=' + endDate,
                 dataType:'json',
                 success: function(returnObj){
                  $("#countTd").text("服務(wù)客戶次數(shù):" + returnObj.customerService + "    閱讀報(bào)告篇數(shù):" + returnObj.reportReadLog +"    撰寫(xiě)產(chǎn)品篇數(shù):" + returnObj.htreport + "    完成任務(wù)情況:" + returnObj.task + "    工作申請(qǐng)情況:" + returnObj.applyTask);
                 }
                });

          public ModelAndView getAssessmentStaffEvaluationHandler(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException, ParseException {

            String userId = Utils.trim(request.getParameter("userId"));
            String startDate = Utils.trim(request.getParameter("startDate"));
            String endDate = Utils.trim(request.getParameter("endDate"));
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            Map param = new HashMap();
            param.put("inputid", userId);
            param.put("beginDate", sdf.parse(startDate));
            param.put("endDate", sdf.parse(endDate));
            Response response1 = customerServiceService.getCustomerServiceCount(param);
            Integer count1 = response1.getReturnInt();

            Calendar c = Calendar.getInstance();
            c.setTime(sdf.parse(endDate));
            c.add(Calendar.DATE, 1);
            Map param1 = new HashMap();
            param1.put("userid", userId);
            param1.put("beginDate", sdf.parse(startDate));
            param1.put("endDate", c.getTime());
            Response response2 = reportReadLogService.getReportReadLogCount(param1);
            Integer count2 = (Integer) response2.getReturnObject();

            Response response3 = htreportService.getHtreportCount(param1);
            Integer count3 = (Integer) response3.getReturnObject();

            Map param2 = new HashMap();
            param2.put("createId", userId);
            param2.put("flag", 1);
            param2.put("startTime", sdf.parse(startDate));
            param2.put("endTime", c.getTime());
            Response response4 = taskService.getTaskCount(param2);
            Integer count4 = (Integer) response4.getReturnObject();

            Map param3 = new HashMap();
            param3.put("createId", userId);
            param3.put("beginDate", sdf.parse(startDate));
            param3.put("endDate", c.getTime());
            Response response5 = applyTaskService.getApplyTaskCount(param3);
            Integer count5 = (Integer) response5.getReturnObject();

            response.setContentType("text/json");
            PrintWriter out = response.getWriter();
            out.println("{\"customerService\":\"" + count1 + "\", \"reportReadLog\":\"" + count2 + "\", \"htreport\":\""
                    + count3 + "\", \"task\":\"" + count4 + "\", \"applyTask\":\"" + count5 + "\"}");
            out.flush();
            out.close();

            return null;
           }


          評(píng)論

          # re: 在jsp中使用jquery的ajax  回復(fù)  更多評(píng)論   

          2014-10-28 14:45 by fdsa
          sadf

          # re: 在jsp中使用jquery的ajax[未登錄](méi)  回復(fù)  更多評(píng)論   

          2016-01-21 13:51 by oo
          的地方是否

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 黎城县| 阿克陶县| 宜丰县| 贵溪市| 廉江市| 伊春市| 达州市| 云和县| 榆林市| 海淀区| 建昌县| 商都县| 井冈山市| 常德市| 增城市| 当阳市| 遂平县| 伊金霍洛旗| 安西县| 绥德县| 南丹县| 贵溪市| 白水县| 平舆县| 三都| 浦县| 吴旗县| 五华县| 崇信县| 义马市| 三江| 松阳县| 靖西县| 搜索| 五寨县| 普陀区| 娄底市| 株洲市| 驻马店市| 盐池县| 北川|