public void onClick$passAll() { if (qklwListbox.getSelectedItems() == null || qklwListbox.getSelectedItems().size() <= 0) { try { Messagebox.show("请选择要审核的期刊论文!", "提示", Messagebox.OK, Messagebox.INFORMATION); } catch (InterruptedException e) { e.printStackTrace(); } return; } Iterator<Listitem> items = qklwListbox.getSelectedItems().iterator(); List<JXKH_QKLW> meetingList = new ArrayList<JXKH_QKLW>(); JXKH_QKLW meeting = new JXKH_QKLW(); while (items.hasNext()) { meeting = (JXKH_QKLW) items.next().getValue(); int rank = 0, index = 0; List<JXKH_QKLWDept> meetingDepList = meeting.getLwDep(); for (int t = 0; t < meetingDepList.size(); t++) { JXKH_QKLWDept dep = meetingDepList.get(t); if (dep.getDepId().equals(user.getDept().getKdNumber())) { rank = dep.getRank(); index = t; } } if ((rank == 1 || meeting.getLwState() == JXKH_MEETING.First_Dept_Pass) && meeting.getTempState().charAt(index) == '0') { meetingList.add(meeting); } } BatchAuditWindow win = (BatchAuditWindow) Executions.createComponents( "/admin/jxkh/audit/article/journal/batchAudit.zul", null, null); try { win.setMeetingList(meetingList); win.doModal(); } catch (SuspendNotAllowedException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } initWindow(); }
// 导出 public void onClick$exportExcel() { if (qklwListbox.getSelectedCount() == 0) { try { Messagebox.show("请选择要导出的数据", "提示", Messagebox.OK, Messagebox.EXCLAMATION); } catch (InterruptedException e) { e.printStackTrace(); } return; } else { int i = 0; ArrayList<JXKH_QKLW> expertlist = new ArrayList<JXKH_QKLW>(); @SuppressWarnings("unchecked") Set<Listitem> sel = qklwListbox.getSelectedItems(); Iterator<Listitem> it = sel.iterator(); while (it.hasNext()) { Listitem item = (Listitem) it.next(); JXKH_QKLW p = (JXKH_QKLW) item.getValue(); expertlist.add(i, p); i++; } Date now = new Date(); String fileName = ConvertUtil.convertDateString(now) + "QiKanLunWenXinXi" + ".xls"; String Title = "期刊论文"; List<String> titlelist = new ArrayList<String>(); titlelist.add("序号"); titlelist.add("期刊论文名称"); titlelist.add("全部作者"); titlelist.add("院内部门"); titlelist.add("合作单位"); titlelist.add("期刊级别"); // titlelist.add("收录类别"); titlelist.add("论文级别"); // titlelist.add("收录时间"); titlelist.add("发表时间"); titlelist.add("发表刊物名称"); titlelist.add("发表刊物期次"); titlelist.add("起止页"); titlelist.add("通讯作者"); titlelist.add("信息填写人"); String c[][] = new String[expertlist.size()][titlelist.size()]; // 从SQL中读数据 for (int j = 0; j < expertlist.size(); j++) { JXKH_QKLW meeting = (JXKH_QKLW) expertlist.get(j); c[j][0] = j + 1 + ""; c[j][1] = meeting.getLwName(); // 全部作者 String memberName = ""; List<JXKH_QKLWMember> qklwMemberList = jxkhQklwService.findAwardMemberByAwardId(meeting); for (int t = 0; t < qklwMemberList.size(); t++) { JXKH_QKLWMember mem = (JXKH_QKLWMember) qklwMemberList.get(t); memberName += mem.getName() + "、"; } if (memberName != "" && memberName != null) memberName = memberName.substring(0, memberName.length() - 1); c[j][2] = memberName; // 部门 String d = ""; List<JXKH_QKLWDept> meetDeptList = jxkhQklwService.findMeetingDeptByMeetingId(meeting); for (int k = 0; k < meetDeptList.size(); k++) { JXKH_QKLWDept dept = (JXKH_QKLWDept) meetDeptList.get(k); d += dept.getName() + "、"; } if (d != "" && d != null) d = d.substring(0, d.length() - 1); c[j][3] = d; c[j][4] = meeting.getLwCoDep(); if (meeting.getQkGrade() == null) { c[j][5] = ""; } else { c[j][5] = meeting.getQkGrade().getKbName(); } // if (meeting.getLwType() == null) { // c[j][6] = ""; // } else { // c[j][6] = meeting.getLwType().getKbName(); // } c[j][6] = meeting.getLwRank(); // c[j][8] = meeting.getLwTime(); c[j][7] = meeting.getLwDate(); c[j][8] = meeting.getKwName(); c[j][9] = meeting.getLwQC(); c[j][10] = meeting.getLwPages(); c[j][11] = meeting.getLwAuthor(); c[j][12] = meeting.getLwWriter(); } ExportExcel ee = new ExportExcel(); try { ee.exportExcel(fileName, Title, titlelist, expertlist.size(), c); } catch (WriteException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }