---
title: "window.print() 打印学时证明"
author: "lengzl"
date: "2016-12-08T15:51:52Z"
tags: []
categories: ["Web前端"]
slug: "window-print"
draft: false
lastmod: "2015-09-14T17:46:44Z"
id: 2242439
url: "https://timeil.iteye.com/blog/2242439"
---

\[size=medium] 主要按照MVC的顺序,+mapper.xml文件. 参考前台打印. // 主要技能点: 1.复选框的多选. 2.window.print(); \[img]http://dl2.iteye.com/upload/attachment/0111/6996/1fe96e4d-b3b8-3301-9d3c-2be037f53016.png\[/img] \[img]http://dl2.iteye.com/upload/attachment/0111/6998/640a6abd-5a0d-3786-b7b3-df75cec5544d.jpg\[/img] deptViewPersonList.jsp 培训组织者的学员查询页面. 含有打印按钮和复选框的批量打印. \[/size] \[code="html"] &lt;%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%&gt; &lt;%@ taglib prefix="s" uri="/struts-tags"%&gt; &lt;%@ include file="/common/common.jsp"%&gt; 学员查询 &lt;%--北京方面制定的样式 添加. --%&gt; &lt;%--分页用CSS --%&gt; &lt;%--时间控件部分 放在上面--%&gt; &lt;%--学员信息列表查询 --%&gt;

&lt;%--整体盒子分 三大部分.头部 搜索提示 --%&gt;

&lt;%--头部的css --%&gt; &lt;%--如果没有agent\_id,就是从组织者学员查询来的;有则是从代理明细/学员查询过来的. --%&gt;

&lt;%--border="2px black solid;" --%&gt;

身份证号： 姓名： 组织机构： 全部 &lt;%--和数据统计的 对比. ★ --%&gt; selected&gt;${t.name } 类别体系:

&lt;%--value="${qc.conditionsStr.licenseType}" 对应7--%&gt;

时间段: " onfocus="WdatePicker({maxDate:'#F{$dp.$D(\\'endtime\\')}'})" /&gt; 至 " onfocus="WdatePicker({minDate:'#F{$dp.$D(\\'begintime\\')}'})"/&gt; &lt;%--style="height:28px;" 1.B原,精确到s onfocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" 2.B 缺陷:onfocus 关键控制显示的值.否则,onclick变为1900年的. --%&gt; 学习状态: 全部 selected&gt;未开通 selected&gt;未支付 selected&gt;支付中 selected&gt;学习中 selected&gt;已完成 selected&gt;已取消

注:打印功能仅限完成学习的学员

&lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- --%&gt; &lt;%-- String的显示方式 s:date format="yyyy-MM-dd" datetime 数据类型 只显示时分秒--%&gt;

序号 身份证号 姓名性别联系电话学员状态最后登录时间 计划名称计划状态注册时间有效期开始 有效期结束当前学时/目标学时 最后学习时间 操作 无相关记录 &lt;%--disabled="disabled" --%&gt; disabled="true"/&gt; &lt;%-- --%&gt; &lt;%-- ppId为:${viewList.ppId } --%&gt; ${viewList.pIdCard} ${viewList.pRealName} 男 女 未知 ${viewList.pTel} 注册 已付费 付费中 学习中 完成 ${viewList.pLastLogin} ${viewList.planName} 测试学员 普通学员 注册 导入 ${viewList.pAddTime }&lt;%--datetime的显示方式 --%&gt; ${viewList.ppSumStudyTime}/${viewList.ppTargetStudyTime} [学习记录]($%7BpageContext.request.contextPath%7D/adminx/personRecordAction.do?personId=%24%7BviewList.ppPersonId%7D&personPlanId=%24%7BviewList.ppId%7D) [考试记录]($%7BpageContext.request.contextPath%7D/adminx/personExamAction.do?personPlanId=%24%7BviewList.ppId%7D) [照片审核]($%7BpageContext.request.contextPath%7D/adminx/personPhotoCheckAction.do?personPlanId=%24%7BviewList.ppId%7D) &lt;%-- ppStartDate, pp\_end\_date AS ppEndDate, ${viewList.ppRegisterFaceImage }--%&gt; [','','${viewList.ppTargetStudyTime }','${viewList.planName }','${viewList.pRealName }','${viewList.pIdCard}','${viewList.certificationNum }','${viewList.ppRegisterFaceImage }','${viewList.pId }');return false;" &gt;打印学时证明](#)

&lt;%--中部 end --%&gt;

&lt;%--ui\_content end --%&gt;

&lt;%-- 提交打印的表单 --%&gt;

\[/code] PersonAction.java 主要方法printAc(); 打印; printAcBatch(); 批量打印 \[code="java"] package com.myland.jp.adminx.person.action; import java.io.File; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.google.gson.Gson; import com.myland.framework.annotation.Token; import com.myland.framework.base.AjaxHead; import com.myland.framework.base.BaseAction; import com.myland.framework.init.BaseConf; import com.myland.framework.mybatis.query.Condition; import com.myland.framework.mybatis.query.CxxString; import com.myland.framework.mybatis.query.QueryCriterion; import com.myland.framework.mybatis.query.QueryRulesCreator; import com.myland.framework.util.ExceptionPrintUtil; import com.myland.framework.util.LogUtil; import com.myland.framework.util.collections.ListUtil; import com.myland.framework.util.collections.MapUtil; import com.myland.framework.util.time.DateFormatUtil; import com.myland.jp.common.CommonMessage; import com.myland.jp.common.service.AgentService; import com.myland.jp.common.service.PersonFaceImageService; import com.myland.jp.common.service.PersonPlanService; import com.myland.jp.common.service.PersonService; import com.myland.jp.common.service.PlanService; import com.myland.jp.common.service.ViewPersonPersonPlanService; import com.myland.pojo.Person; import com.myland.pojo.PersonFaceImage; import com.myland.pojo.Plan; import com.myland.pojo.User; /\*\*学员管理 * * @create 2015年1月12日 \*/ public class PersonAction extends BaseAction { /\** * 序列号 \*/ private static final long serialVersionUID = 1759551448629970681L; /\** * 日志工具类 \*/ private static final Logger log = LogManager.getLogger(PersonAction.class); /\** * 学员业务逻辑操作 \*/ private PersonService personService; /\** * 学习计划业务逻辑操作 \*/ private PlanService planService; /\** * 学员学习计划业务逻辑操作 \*/ private PersonPlanService personPlanService; /\** * 代理商业务逻辑处理类 \*/ private AgentService agentService; /\** * 学员权限Map \*/ private Map resDatasMap; /\** * 学员对应的权限 \*/ private String resDatas\_dept; /\** * 代理商对应的权限 \*/ private String resDatas\_agent; /\** * 学习计划ids \*/ private String planIds; /\** * 学员id \*/ private String id; private String personPlanStatus; /\** * 学员实体 \*/ private Person person; /\** * 学员身份证（登录账号） \*/ private String loginId; /\** * 学员姓名 \*/ private String realName; /\** * 代理商Id \*/ private String agentId; /\** * 代理商列表 \*/ private List agentList; /\** * 学员列表 \*/ private List personList; private List impPersonList = new ArrayList(); private String newFileName; //新生成的文件名 private String errFlag ; /\** * 学习计划集合列表 \*/ private List planList; /\** * 标准查询 \*/ private QueryCriterion qc; /\** * 学员列表页脚 \*/ private String bar; /\** * 权限不足跳转的页面 \*/ final String loginPage = BaseConf.get().getString(BaseConf.\_ADMINX\_NAMED\_RESOURCES\_LOGIN); /\** * 上传文件 \*/ private File impPerson; /\** * 上传文件名 \*/ private String impPersonFileName ; /\*startDate").attr("value",startDate); $("#endDate").attr("value",endDate); $("#targetTime").attr("value",targetTime); $("#courseName \*/ //打印相关 开始时间etc. private String startDate; private String endDate; private String targetTime; private String courseName; private String idCard; /\** * id数组 \*/ private String ids\[]; /\** * ,拼接的ids \*/ private String idsString; /\** * 学员信息列表 \*/ private List&gt; viewList; private List&gt; ppInfoAndImage = new ArrayList&gt;(); /\** * json返回信息 \*/ private AjaxHead bm = new AjaxHead("00", null); /\** * 当前时间 \*/ private String currentDate; /\** * 是否是批量打印. print\_all为批量打印. \*/ private String act; /\** * 从业资格证件号 \*/ private String certificationNum; /\** * 获取人脸识别的照片 \*/ private PersonFaceImageService personFaceImageService; /\** * 注册人脸照片 \*/ private String registerFaceImage; /\** * 学员的最后四张照片. \*/ private List personFaceImages = new ArrayList(); /\** * 判断浏览器是否是IE \*/ private String isIE; @Override public String execute() throws Exception { int ret = this.initPerson(); if(ret != 0) { getRequest().setAttribute("err","权限不足！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } return SUCCESS; } /\** * 学员列表初始化 * @author wangdaiwei * @create 2015年1月12日 下午7:00:12 \*/ public int initPerson(){ //从session中获取数据权限Map并找到部门信息访问权限，进行控制 resDatasMap = (Map) getSession().getAttribute("resDatas"); if (MapUtil.isNotEmpty(resDatasMap)) { resDatas\_dept = resDatasMap.get("ORGANIZER\_DATA"); resDatas\_agent = resDatasMap.get("AGENT\_DATA"); } if(StringUtils.isBlank(resDatas\_dept)){ return -1; } // 查询数据权限范围内的代理商 agentList = agentService.getAgentByIds(resDatas\_agent); StringBuffer sbf = new StringBuffer(); for(String deptId : resDatas\_dept.split(",")){ sbf.append("'").append(deptId).append("',"); } final String deptIds = sbf.toString(); qc = this.getQueryCriterion(new QueryRulesCreator(){ @Override public Map createConditions() { // TODO Auto-generated method stub Map conditions = new HashMap(); conditions.put("deptId",new CxxString(deptIds.substring(0,deptIds.length()-1))); if (!"".equals(loginId) && loginId != null) { conditions.put("pLoginId", new CxxString(loginId)); } if (!"".equals(realName) && realName != null) { conditions.put("pRealName", new CxxString(realName)); } if (!"all".equals(agentId) && agentId != null) { conditions.put("agentId", new CxxString(agentId)); } return conditions; } @Override public String createKeyFlds() { // TODO Auto-generated method stub return null; } }); //分页样式 qc.getPagination().setShowType("002"); //根据标准查询获得银行信息分页列表 personList = personService.queryPersonForPage(qc); // 获取分页页脚 bar = qc.getPagination().toBar(); return 0; } /\** * 添加学员及学员的学习计划 * @author wangdaiwei * @create 2015年1月13日 下午7:48:39 * @return \*/ public String addPerson(){ //从session中获取数据权限Map并找到部门信息访问权限，进行控制 resDatasMap = (Map) getSession().getAttribute("resDatas"); if (MapUtil.isNotEmpty(resDatasMap)) { resDatas\_dept = resDatasMap.get("ORGANIZER\_DATA"); } if(StringUtils.isBlank(resDatas\_dept)){ getRequest().setAttribute("err","权限不足！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } StringBuffer sbf = new StringBuffer(); for(String deptId : resDatas\_dept.split(",")){ sbf.append("'").append(deptId).append("',"); } final String deptIds = sbf.toString().substring(0,sbf.toString().length()-1); planList = planService.getPlanListByDeptIds(deptIds); return "addPerson"; } /\** * 修改学员及学员的学习计划 * @author wangdaiwei * @create 2015年1月15日 上午9:32:08 * @return \*/ public String modifyPerson(){ //从session中获取数据权限Map并找到部门信息访问权限，进行控制 resDatasMap = (Map) getSession().getAttribute("resDatas"); if (MapUtil.isNotEmpty(resDatasMap)) { resDatas\_dept = resDatasMap.get("ORGANIZER\_DATA"); } if(StringUtils.isBlank(resDatas\_dept)){ getRequest().setAttribute("err","权限不足！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } person = personService.getPersonById(Long.valueOf(id)); if(person != null) { // 查询取消的计划学员是否已重新绑定计划 int cnt = personPlanService.getPersonPlanCountForNotCancel(person.getId()); if(cnt &gt; 0) { personPlanStatus = "0"; } } planIds = personPlanService.getPlanIdsByPersonId(person.getId().toString()); StringBuffer sbf = new StringBuffer(); for(String deptId : resDatas\_dept.split(",")){ sbf.append("'").append(deptId).append("',"); } final String deptIds = sbf.toString().substring(0,sbf.toString().length()-1); planList = planService.getPlanListByDeptIds(deptIds); return "modifyPerson"; } /\** * 删除学员 * @author wangdaiwei * @create 2015年1月15日 下午5:21:29 * @return \*/ public String deletePerson(){ User curuser = (User) getRequest().getSession().getAttribute("curuser"); if (null == curuser) { getRequest().setAttribute("err", "session信息丢失!"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } if(StringUtils.isBlank(id)){ getRequest().setAttribute("err","参数不正确！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } try{ Person ps = new Person(); ps.setId(Long.valueOf(id)); ps.setPStatus("9"); personService.updatePerson(ps); LogUtil.Log("13", curuser.getId(), curuser.getName(), "删除学员" ,"Person",Long.valueOf(id),"3"); }catch(Exception e){ ExceptionPrintUtil.PrintErrorMessage(e, log); getRequest().setAttribute("err",e.getMessage()); getRequest().setAttribute("rtnurl",loginPage); return ERROR; } this.initPerson(); return SUCCESS; } /\** * 根据学员身份证号（登录账号）检查是否有该学员，有 把相关信息查出来 * @author wangdaiwei * @create 2015年1月14日 下午8:38:46 \*/ public void checkPersonByloginId(){ Gson gson = new Gson(); Map paraMap = new HashMap(); paraMap.put("loginId", loginId); List personList = personService.queryPersonByLoginId(paraMap); if(ListUtil.isEmpty(personList)){ CommonMessage cm = new CommonMessage(false, null); String rsMsg = gson.toJson(cm); printAjaxMessage(rsMsg); } else { CommonMessage cm = new CommonMessage(true, personList.get(0)); String rsMsg = gson.toJson(cm); printAjaxMessage(rsMsg); } } /\** * 添加保存学员及学员的学习计划 * @author wangdaiwei * @create 2015年1月14日 下午1:53:39 * @return \*/ @Token public String savePerson(){ User curuser = (User) getRequest().getSession().getAttribute("curuser"); if (null == curuser) { getRequest().setAttribute("err", "session信息丢失!"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } if(null == person || StringUtils.isBlank(planIds)){ getRequest().setAttribute("err","参数不正确!"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } try{ personService.addPersonAndPersonPlan(person, planIds); LogUtil.Log("13", curuser.getId(), curuser.getName(), "新增学员" ,"Person",person.getId(),"1"); }catch(Exception e){ ExceptionPrintUtil.PrintErrorMessage(e, log); getRequest().setAttribute("err",e.getMessage()); getRequest().setAttribute("rtnurl",loginPage); return ERROR; } this.initPerson(); return SUCCESS; } /\** * 修改保存学员及学员的学习计划 * @author wangdaiwei * @create 2015年1月15日 下午4:05:28 * @return \*/ @Token public String updatePerson(){ User curuser = (User) getRequest().getSession().getAttribute("curuser"); if (null == curuser) { getRequest().setAttribute("err", "session信息丢失!"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } if(null == person){ getRequest().setAttribute("err","参数不正确！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } try{ Person oldPerson = personService.getPersonById(person.getId()); String oldPlanIds = personPlanService.getPlanIdsByPersonId(person.getId().toString()); personService.updatePersonAndPersonPlan(person, planIds); //记录日志 Map fieldsMap = new HashMap(); fieldsMap.put("姓名", "realName"); fieldsMap.put("性别", "sex"); fieldsMap.put("手机号", "tel"); fieldsMap.put("电子邮件", "email"); fieldsMap.put("地址", "address"); String logContStr = LogUtil.getObjectChangeLogInfo(oldPerson,person,fieldsMap); StringBuffer contStrbuf = new StringBuffer(); contStrbuf.append(logContStr); if(StringUtils.isNotBlank(planIds)){ contStrbuf.append("学习计划:").append(oldPlanIds).append("--&gt;").append(oldPlanIds); contStrbuf.append(",").append(planIds); } LogUtil.Log("13", curuser.getId(), curuser.getName(), contStrbuf.toString() ,"Person",person.getId(),"2"); }catch(Exception e){ ExceptionPrintUtil.PrintErrorMessage(e, log); getRequest().setAttribute("err",e.getMessage()); getRequest().setAttribute("rtnurl",loginPage); return ERROR; } this.initPerson(); return SUCCESS; } /\** * 打开导入学员信息页面 * @return \*/ public String impPerson(){ return "impPerson"; } /\** * 加载excel文件中学员信息 * @return \*/ @SuppressWarnings("unchecked") public String readExcelPerson(){ User curuser = (User) getRequest().getSession().getAttribute("curuser"); //从session中获取数据权限Map并找到部门信息访问权限，进行控制 resDatasMap = (Map) getSession().getAttribute("resDatas"); if (MapUtil.isNotEmpty(resDatasMap)) { resDatas\_dept = resDatasMap.get("ORGANIZER\_DATA"); } if(StringUtils.isBlank(resDatas\_dept)){ getRequest().setAttribute("err","权限不足！"); getRequest().setAttribute("rtnurl", loginPage); return ERROR; } //文件大小不能大于1M if(impPerson != null && impPerson.length() &gt; 1048576) { // 2097152 =2M 1048576大于1M 1M= 1\*1024\*1024 getRequest().setAttribute("err","导入文件不能大于1M！"); getRequest().setAttribute("rtnurl", ""); return ERROR; } StringBuffer sbf = new StringBuffer(); for(String deptId : resDatas\_dept.split(",")){ sbf.append("'").append(deptId).append("',"); } final String deptIds = sbf.toString().substring(0,sbf.toString().length()-1); planList = planService.getPlanListByDeptIds(deptIds); //加载文件 读取excel 并验证 Map flagMap = new HashMap(); Map fileNameMap = new HashMap(); impPersonList = personService.impAndCheckFile(impPerson, impPersonFileName, curuser, flagMap, fileNameMap); if(impPersonList == null || impPersonList.size() ==0) { getRequest().setAttribute("err","导入文件为空或格式不正确！"); getRequest().setAttribute("rtnurl", ""); return ERROR; } if(flagMap != null && flagMap.size() &gt; 0) { errFlag = "1"; //有错 } if(fileNameMap != null && fileNameMap.size() &gt; 0) { newFileName = fileNameMap.get("newFileName"); } return "loadExcel"; } /\** * 保存学员，绑定学习计划 * @return \*/ @Token public String saveImpPerson(){ impPersonList = personService.loadImpFile(newFileName); personService.impPersonAndPersonPlan(impPersonList, planIds); return "saveImpPerson"; } /\** * 进入打印页预览 * @author lengzl * @create 2015年8月12日 下午8:32:35 * @return \*/ public String enterPrintAc(){ User curuser = (User)getSession().getAttribute("curuser"); if(null==curuser){ if (curuser == null) { getRequest().setAttribute("err", "session信息丢失!"); getRequest().setAttribute("rtnurl", BaseConf.get().getString(BaseConf.\_ADMINX\_NAMED\_RESOURCES\_LOGIN)); return ERROR; } } try { startDate = java.net.URLDecoder.decode(startDate,"utf-8"); endDate = java.net.URLDecoder.decode(endDate,"utf-8"); targetTime = java.net.URLDecoder.decode(targetTime,"utf-8"); courseName = java.net.URLDecoder.decode(courseName,"utf-8"); realName = java.net.URLDecoder.decode(realName,"utf-8"); idCard = java.net.URLDecoder.decode(idCard,"utf-8"); certificationNum = java.net.URLDecoder.decode(certificationNum,"utf-8"); // registerFaceImage = java.net.URLDecoder.decode(registerFaceImage,"utf-8"); // /* * 最后的四张照片. Map map = new HashMap(); map.put("personId", id); personFaceImages = personFaceImageService.getPersonFaceImageListByPid(map); \*/ currentDate = DateFormatUtil.formatCnYyyyMMdd(new Date()); } catch(UnsupportedEncodingException e) { log.error("转码出现异常!"); ExceptionPrintUtil.PrintErrorMessage(e, log); } //getRequest().setAttribute("currentDate",currentDate); return "printOne"; } /\** * 批量打印学时证明,5s循环弹出窗口.废弃.C * @author lengzl * @create 2015年8月14日 下午1:40:18 \*/ public void batchPrint(){ try { String str = ""; //Cau:如果有且只有一个disabled的被选中,那么传到后台为null. if (ids != null&&ids.length &gt; 0) { for (int i = 0, m = ids.length; i &lt; m; i++) { str = str + ids\[i]; if (i &lt; (m - 1)) { str = str + ","; } } } viewList = personService.getPersonLearnTimeCertificate(str); JSONArray jsonArray = new JSONArray(); for (int i = 0; i &lt; viewList.size(); i++) { JSONObject jsonObject = new JSONObject(); /* 需要的人名,身份证号,开始,结束时间,目标学时,当前时间.id="+jsonarray\[data\_count].pId; \*/ jsonObject.put("realName", viewList.get(i).get("pRealName")); jsonObject.put("idCard", viewList.get(i).get("pIdCard")); jsonObject.put("startDate", viewList.get(i).get("ppStartDate").toString()); jsonObject.put("endDate", viewList.get(i).get("ppEndDate").toString()); jsonObject.put("courseName", viewList.get(i).get("planName")); jsonObject.put("certificationNum", viewList.get(i).get("certificationNum")); //jsonObject.put("registerFaceImage", viewList.get(i).get("ppRegisterFaceImage")); jsonObject.put("targetTime", viewList.get(i).get("ppTargetStudyTime")); jsonObject.put("pId", viewList.get(i).get("pId")); //person 的id. /\*不用传递,每次打开调用就行. String currentDate = DateFormatUtil.formatCnYyyyMMdd(new Date()); jsonObject.put("currentDate", currentDate);\*/ jsonArray.add(jsonObject); jsonObject = null; } bm.setCode("00"); bm.setMessage(jsonArray.toString()); System.out.println(jsonArray.toString()+"←===============================================\*\*\*\*"); printAjaxMessage(JSONObject.fromObject(bm).toString()); } catch(Exception e) { log.error("批量打印异常!"); ExceptionPrintUtil.PrintErrorMessage(e, log); } } /\** * 通过一个页面的分页 实现批量打印学时证明 * @author lengzl * @create 2015年8月14日 下午1:40:18 \*/ public String batchPrintByOnePage(){ String str = ""; str = idsString.substring(0,idsString.length()-1); viewList = personService.getPersonLearnTimeCertificate(str); //遍历,找到id,查一下,放到Map中科. for (int i = 0; i &lt; viewList.size(); i++) { //Long ppId = (Long) viewList.get(i).get("ppPersonId"); //放置单个学员信息 Map personPlanCyMap = new HashMap(); /* * 最后的四张照片 \*/ /\*Map map = new HashMap(); map.put("personId", ppId); personFaceImages = personFaceImageService.getPersonFaceImageListByPid(map);\*/ personPlanCyMap.put("ppInfo", viewList.get(i)); //personPlanCyMap.put("ppFaceImage", personFaceImages); ppInfoAndImage.add(personPlanCyMap); } currentDate = DateFormatUtil.formatCnYyyyMMdd(new Date()); return "printAll"; /* JSONArray jsonArray = new JSONArray(); for (int i = 0; i &lt; viewList.size(); i++) { JSONObject jsonObject = new JSONObject(); 需要的人名,身份证号,开始,结束时间,目标学时,当前时间.id="+jsonarray\[data\_count].pId; //System.out.println("真实姓名:"+viewList.get(i).get("pRealName")+viewList.get(i).get("pIdCard")+viewList.get(i).get("ppStartDate")); jsonObject.put("realName", viewList.get(i).get("pRealName")); jsonObject.put("idCard", viewList.get(i).get("pIdCard")); jsonObject.put("startDate", viewList.get(i).get("ppStartDate").toString()); jsonObject.put("endDate", viewList.get(i).get("ppEndDate").toString()); jsonObject.put("courseName", viewList.get(i).get("planName")); jsonObject.put("certificationNum", viewList.get(i).get("certificationNum")); jsonObject.put("registerFaceImage", viewList.get(i).get("ppRegisterFaceImage")); jsonObject.put("targetTime", viewList.get(i).get("ppTargetStudyTime")); jsonObject.put("pId", viewList.get(i).get("pId")); //person 的id. 不用传递,每次打开调用就行. String currentDate = DateFormatUtil.formatCnYyyyMMdd(new Date()); jsonObject.put("currentDate", currentDate); jsonArray.add(jsonObject); jsonObject = null; } bm.setCode("00"); bm.setMessage(jsonArray.toString()); System.out.println(jsonArray.toString()+"←===============================================\*\*\*\*"); printAjaxMessage(JSONObject.fromObject(bm).toString()); } catch(Exception e) { log.error("批量打印异常!"); ExceptionPrintUtil.PrintErrorMessage(e, log); } \*/ } /\** * @return the personService \*/ public PersonService getPersonService() { return personService; } /\** * @param personService the personService to set \*/ public void setPersonService(PersonService personService) { this.personService = personService; } /\** * @return the person \*/ public Person getPerson() { return person; } /\** * @param person the person to set \*/ public void setPerson(Person person) { this.person = person; } /\** * @return the loginId \*/ public String getLoginId() { return loginId; } /\** * @param loginId the loginId to set \*/ public void setLoginId(String loginId) { this.loginId = loginId; } /\** * @return the realName \*/ public String getRealName() { return realName; } /\** * @param realName the realName to set \*/ public void setRealName(String realName) { this.realName = realName; } /\** * @return the personList \*/ public List getPersonList() { return personList; } /\** * @param personList the personList to set \*/ public void setPersonList(List personList) { this.personList = personList; } /\** * @return the qc \*/ public QueryCriterion getQc() { return qc; } /\** * @param qc the qc to set \*/ public void setQc(QueryCriterion qc) { this.qc = qc; } /\** * @return the bar \*/ public String getBar() { return bar; } /\** * @param bar the bar to set \*/ public void setBar(String bar) { this.bar = bar; } /\** * @return the planService \*/ public PlanService getPlanService() { return planService; } /\** * @param planService the planService to set \*/ public void setPlanService(PlanService planService) { this.planService = planService; } /\** * @return the planList \*/ public List getPlanList() { return planList; } /\** * @param planList the planList to set \*/ public void setPlanList(List planList) { this.planList = planList; } /\** * @return the planIds \*/ public String getPlanIds() { return planIds; } /\** * @param planIds the planIds to set \*/ public void setPlanIds(String planIds) { this.planIds = planIds; } /\** * @return the id \*/ public String getId() { return id; } /\** * @param id the id to set \*/ public void setId(String id) { this.id = id; } /\** * @return the personPlanService \*/ public PersonPlanService getPersonPlanService() { return personPlanService; } /\** * @param personPlanService the personPlanService to set \*/ public void setPersonPlanService(PersonPlanService personPlanService) { this.personPlanService = personPlanService; } /\** * @return the agentList \*/ public List getAgentList() { return agentList; } /\** * @param agentList the agentList to set \*/ public void setAgentList(List agentList) { this.agentList = agentList; } /\** * @return the agentService \*/ public AgentService getAgentService() { return agentService; } /\** * @param agentService the agentService to set \*/ public void setAgentService(AgentService agentService) { this.agentService = agentService; } /\** * @return the agentId \*/ public String getAgentId() { return agentId; } /\** * @param agentId the agentId to set \*/ public void setAgentId(String agentId) { this.agentId = agentId; } public File getImpPerson() { return impPerson; } public void setImpPerson(File impPerson) { this.impPerson = impPerson; } public String getImpPersonFileName() { return impPersonFileName; } public void setImpPersonFileName(String impPersonFileName) { this.impPersonFileName = impPersonFileName; } public String getErrFlag() { return errFlag; } public void setErrFlag(String errFlag) { this.errFlag = errFlag; } public List getImpPersonList() { return impPersonList; } public void setImpPersonList(List impPersonList) { this.impPersonList = impPersonList; } public String getNewFileName() { return newFileName; } public void setNewFileName(String newFileName) { this.newFileName = newFileName; } public String getPersonPlanStatus() { return personPlanStatus; } public void setPersonPlanStatus(String personPlanStatus) { this.personPlanStatus = personPlanStatus; } public String getResDatas\_agent() { return resDatas\_agent; } public void setResDatas\_agent(String resDatas\_agent) { this.resDatas\_agent = resDatas\_agent; } public String getStartDate() { return startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { return endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public String getTargetTime() { return targetTime; } public void setTargetTime(String targetTime) { this.targetTime = targetTime; } public String getCourseName() { return courseName; } public void setCourseName(String courseName) { this.courseName = courseName; } public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } public String\[] getIds() { return ids; } public void setIds(String\[] ids) { this.ids = ids; } public List&gt; getViewList() { return viewList; } public void setViewList(List&gt; viewList) { this.viewList = viewList; } public AjaxHead getBm() { return bm; } public void setBm(AjaxHead bm) { this.bm = bm; } public String getCurrentDate() { return currentDate; } public void setCurrentDate(String currentDate) { this.currentDate = currentDate; } public String getAct() { return act; } public void setAct(String act) { this.act = act; } public String getCertificationNum() { return certificationNum; } public void setCertificationNum(String certificationNum) { this.certificationNum = certificationNum; } public String getRegisterFaceImage() { return registerFaceImage; } public void setRegisterFaceImage(String registerFaceImage) { this.registerFaceImage = registerFaceImage; } public PersonFaceImageService getPersonFaceImageService() { return personFaceImageService; } public void setPersonFaceImageService(PersonFaceImageService personFaceImageService) { this.personFaceImageService = personFaceImageService; } public List getPersonFaceImages() { return personFaceImages; } public void setPersonFaceImages(List personFaceImages) { this.personFaceImages = personFaceImages; } public String getIdsString() { return idsString; } public void setIdsString(String idsString) { this.idsString = idsString; } public List&gt; getPpInfoAndImage() { return ppInfoAndImage; } public void setPpInfoAndImage(List&gt; ppInfoAndImage) { this.ppInfoAndImage = ppInfoAndImage; } public String getIsIE() { return isIE; } public void setIsIE(String isIE) { this.isIE = isIE; } } \[/code] struts-adminx.xml \[code="xml"] /adminx/login/adminLogin.jsp /adminx/home/home.jsp /adminx/exam/examList.jsp /adminx/exam/examAdd.jsp /adminx/exam/examUpdate.jsp /adminx/exam/examBatchAdd.jsp /adminx/exam/examCheckList.jsp /adminx/exam/examView.jsp /adminx/common/examContentShow.jsp /adminx/exam/examQueryList.jsp /adminx/exam/examCheckQueryList.jsp /adminx/testpaper/testPaperList.jsp /adminx/testpaper/testPaperAdd.jsp /adminx/testpaper/testPaperUpdate.jsp /adminx/testpaper/testPaperQueryList.jsp /adminx/plan/planList.jsp /adminx/plan/planList.jsp /adminx/plan/planList.jsp /adminx/plan/planAdd.jsp /adminx/plan/planModify.jsp /adminx/plan/planDetail.jsp /adminx/plan/showImg.jsp /adminx/plan/planNodeList.jsp /adminx/plan.do /adminx/plan/planNodeAdd.jsp /adminx/plan/interfaceList.jsp /adminx/plan/jsPlanNode.jsp /adminx/plan/orderPlanNode.jsp /adminx/plan/courseList.jsp /adminx/plan/examList.jsp /adminx/agent/agentList.jsp /adminx/agent/agentAdd.jsp /adminx/agent/agentModify.jsp /adminx/agent/agentDetail.jsp /adminx/agent/bindedPlanAgent.jsp /adminx/agent/bindAgent.jsp /adminx/agent/bindedPlanAgent.jsp /adminx/cont/contList.jsp /adminx/cont/contAdd.jsp /adminx/cont/contModify.jsp /adminx/cont/contDetail.jsp /adminx/cont/contView.jsp /adminx/cont/personDataSuccess.jsp /adminx/cont/viewDetailInfo.jsp /adminx/cont/showImage.jsp?fileName=${fileName} /adminx/payAccnt/payAccntList.jsp /adminx/payAccnt/payAccntAdd.jsp /adminx/payAccnt/payAccntModify.jsp /adminx/payAccnt/payAccntFlowList.jsp /adminx/payAccnt/payAccntFlowSum.jsp /adminx/payAccnt/courseSaledSum.jsp /adminx/payAccnt/showPieChartCourseSaledSum.jsp /adminx/payAccnt/showColumnChartCourseSaledSum.jsp /adminx/payAccnt/showLineChartCourseSaledSum.jsp /adminx/payAccnt/payAccntAdd.jsp /adminx/payAccnt/agentList.jsp /adminx/payAccnt/contList.jsp /adminx/payAccnt/payAccntByDeptIdList.jsp /adminx/viewPerson/agentViewPersonList.jsp /adminx/viewPerson/deptViewPersonList.jsp /adminx/viewPerson/deptViewPersonList\_sum.jsp /adminx/viewPerson/deptViewPersonList\_cs.jsp /adminx/deptViewPerson\_cs.do /adminx/viewPerson/deptViewPersonList\_cs.jsp /adminx/viewPerson/personPlanRecord.jsp /adminx/agentRefund/agentRefundApplyPage.jsp /adminx/agentRefund/agentRefundAuditPage.jsp /adminx/agentRefund/agentRefundAuditDetail.jsp /adminx/agentRefundAuditPage.do /adminx/agentRefund/agentAccntRefundPage.jsp /adminx/viewPerson/personPlanExam.jsp /adminx/viewPerson/personPlanRecord.jsp /adminx/viewPerson/personPlanExam.jsp /adminx/viewPerson/personPlanRecord.jsp /adminx/viewPerson/personPlanExam.jsp /adminx/viewPerson/personPhotoView.jsp /adminx/deptViewPerson.do /adminx/statisticalSummary/deptViewSummary.jsp /common/error.jsp /adminx/statisticalSummary/deptViewSummary\_list.jsp /adminx/statisticalSummary/deptViewSummary\_list.jsp /adminx/statisticalSummary/agentViewSummary\_list.jsp /adminx/statisticalSummary/deptViewSummary.jsp /adminx/statisticalSummary/deptViewSummary\_list.jsp /adminx/statisticalSummary/highcharts.jsp /adminx/payAccnt/payAccntFlowList.jsp /adminx/statisticalSummary/deptViewSummary.jsp /adminx/statisticalSummary/highcharts\_column.jsp /adminx/statisticalSummary/deptColumnChart.jsp /adminx/statisticalSummary/agentViewSummary.jsp /adminx/payBank/payBankList.jsp /adminx/payBank/payBankAdd.jsp /adminx/payBank/payBankModify.jsp /adminx/payBank/payBankDetailed.jsp /adminx/agentChange/agentList.jsp /adminx/agentChange/agentModify.jsp /adminx/agentChange/agentChangeList.jsp /adminx/agentChange/agentChangeModify.jsp /adminx/agentChange/agentChangeModifyP.jsp /adminx/agentChange/agentInvoiceModify.jsp /adminx/agentChange/agentInvoiceView.jsp /adminx/agentChangeConfirmAction.do /adminx/agentChange/agentChangePage.jsp /adminx/agentChange/payAccntListSelect.jsp /adminx/agentChange/viewAgentChangeDetail.jsp /adminx/agentChange/agentChangeList.jsp /adminx/agentChange/viewAgentChangeDetail.jsp /adminx/agentChange/agentChangeAdd.jsp /adminx/agentChange/payAccntList.jsp /adminx/agentChange/payBankListSelect.jsp /adminx/agentChange/agentChangeConfirm.jsp /adminx/dept/deptList.jsp /adminx/dept/deptUpdate.jsp?hotId=${hotId}&hotPid=${hotPid} /adminx/deptAction.do?hotId=${hotId}&hotPid=${hotPid} /adminx/deptAction.do?hotId=${hotPid}&hotPid=${hotPid}&delFlag=1 /adminx/deptAction.do?hotId=${hotPid} /adminx/role/roleList.jsp /adminx/roleAction.do?conditions=keep /adminx/role/roleUpdate.jsp /adminx/roleAction.do?conditions=keep /adminx/roleAction.do?conditions=keep /adminx/role/roleDetail.jsp /adminx/role/menuAllocate.jsp /adminx/role/funcAllocate.jsp /adminx/getUsersInfo.do?conditions=keep /adminx/user/userView.jsp /adminx/user/userUpdate.jsp /adminx/getUsersInfo.do?conditions=keep /adminx/getUsersInfo.do?conditions=keep /adminx/user/myInfoUpdate.jsp /adminx/user/tools.jsp /adminx/user/myInfoUpdate.jsp /adminx/user/myPassUpdate.jsp /adminx/user/userList.jsp /adminx/user/userAdd.jsp /adminx/resdata/resdataDetail.jsp /adminx/resdata/resdataDetail.jsp /adminx/resdata/simpleHelp.jsp /adminx/resdata/resDataList.jsp /adminx/pay/payOrderListAdminx.jsp /adminx/pay/payOrdersListAdminx.jsp /web/pay/alipayapi.jsp /web/pay/alipayapi.jsp /adminx/pay/orderDetail.jsp /adminx/pay/orderDetailInfo.jsp /adminx/pay/payOrdersListAdminx.jsp /adminx/exam/appExamVersion.jsp /adminx/pay/orderRefundApplyPage.jsp /adminx/pay/orderRefundApplyDetailPage.jsp /adminx/pay/orderRefundAuditPage.jsp /adminx/orderRefundAuditPage.do /adminx/catType/catTypeList.jsp /adminx/catType/catTypeAdd.jsp /adminx/catType/catTypeUpdate.jsp /adminx/chapter/chapterParentList.jsp /adminx/chapter/chapterParentAdd.jsp /adminx/chapter/chapterParentUpdate.jsp /adminx/chapter/works.jsp /adminx/chapter/chapterTopList.jsp /adminx/chapter/chapterTree.jsp /adminx/chapter/chapterList.jsp /adminx/chapter/chapterAdd.jsp /adminx/chapter/chapterUpdate.jsp /adminx/chapterAction!getChapterList.do?id=${pid} /adminx/chapter/uploadCCWareList.jsp /adminx/chapter/uploadCCWareList\_list.jsp /adminx/chapter/importExcel.jsp /adminx/chapter/chapterQueryList.jsp /adminx/chapter/examHelp.jsp /adminx/chapter/chapterExamList.jsp /adminx/chapter/chapterExamAdd.jsp /adminx/chapter/chapterExamUpdate.jsp /adminx/chapterExamAction!getChapterExamList.do?id=${id} /adminx/chapter/examList.jsp /adminx/chapter/chapterWareList.jsp /adminx/chapter/chapterWareAdd.jsp /adminx/chapter/chapterWareUpdate.jsp /adminx/chapter/wareAdd.jsp /adminx/chapter/chapterWareView.jsp /adminx/chapterWareAction!getChapterWareList.do?chapterId=${chapterId} /adminx/course/courseList.jsp /adminx/course/courseAdd.jsp /adminx/course/courseUpdate.jsp /adminx/course/courseCheckList.jsp /adminx/course/works.jsp /adminx/course/courseTree.jsp /adminx/course/chaptersList.jsp /adminx/course/chapterWareList.jsp /adminx/course/chapterExamList.jsp /adminx/course/uploadCCWareList.jsp /adminx/course/uploadCCWareList\_list.jsp /adminx/course/courseView.jsp /adminx/course/courseQueryList.jsp /adminx/course/courseCheckQueryList.jsp /adminx/course/coursePower.jsp /adminx/course/chapterSelectList.jsp /adminx/chapterSelListAction.do?id=${id} /adminx/chapterSelListAction.do?id=${id} /adminx/course/chapterList.jsp /adminx/course/chapterSelectList.jsp /adminx/course/chapterSelectList.jsp /adminx/pay/payInvoiceListAdminx.jsp queryInvoice payInvoiceAdmin /adminx queryInvoice\_agent payInvoiceAdmin\_agent /adminx /adminx/pay/payInvoiceListAdminx.jsp queryInvoice payInvoiceAdmin /adminx queryInvoice\_agent payInvoiceAdmin\_agent /adminx /adminx/pay/payInvoiceListAdminx.jsp /adminx/pay/payInvoiceListAdminx\_agent.jsp /adminx/pay/payInvoiceListAdminx\_agent.jsp /adminx/dic/dicMain.jsp /adminx/dic/dicList.jsp /adminx/person/personList.jsp /adminx/person/personAdd.jsp /adminx/person/personModify.jsp /adminx/person/impPerson.jsp /adminx/person/loadImpPerson.jsp /adminx/personAction.do /adminx/viewPerson/printAc.jsp /adminx/viewPerson/printAcBatch.jsp /adminx/pay/logOrderList.jsp /adminx/menu/menuInfo.jsp /adminx/menu/menuTopAdd.jsp /adminx/menu/menuSubAdd.jsp /adminx/menu/menuTopUpdate.jsp /adminx/menu/menuSubUpdate.jsp /adminx/menuListAction.do?pid=${pid} /adminx/menu/menuTree.jsp /adminx/menu/menuTopList.jsp /adminx/menu/menuSubList.jsp /adminx/funcInfoListAction.do?pid=${pid} /adminx/funcUrlsListAction.do?funcId=${funcId} /adminx/menu/funcInfoAdd.jsp /adminx/menu/funcInfoUpdate.jsp /adminx/menu/funcUrlsAdd.jsp /adminx/menu/funcUrlsUpdate.jsp /adminx/menu/funcInfoList.jsp /adminx/menu/funcUrlsList.jsp /adminx/examPoint/examPointList.jsp /adminx/examPoint/examPointAdd.jsp /adminx/examPoint/examPointUpdate.jsp /adminx/examPoint/examPointQueryList.jsp /adminx/survey/surveyList.jsp /adminx/survey/questionAdd.jsp /adminx/surveyAction.do /adminx/survey/questionModify.jsp /adminx/applyReply/applyReplyList.jsp /adminx/interFace/interFaceList.jsp /adminx/interFace/interFaceAdd.jsp /adminx/interFace/interFaceEdit.jsp /adminx/interFace/interFaceView.jsp /adminx/cache/refreshCache.jsp /adminx/log/LogList.jsp /adminx/log/LogQueryList.jsp /adminx/log/WebLogQueryList.jsp /adminx/summary/summaryMonthList.jsp /adminx/summary/summaryNumList.jsp /adminx/summary/summaryDayList.jsp /adminx/summary/detailDayList.jsp /adminx/message/messageCheckList.jsp /adminx/message/messageQueryList.jsp /adminx/message/messageContentShow.jsp /adminx/message/messageDetailList.jsp /adminx/message/messageDetailContentShow.jsp /adminx/message/messageDetailQueryList.jsp /adminx/payOrderFlowTotal/orderTotalList.jsp \[/code]