示例#1
0
 public List<WkTUser> findNameByTeacher(List<Teacher> telist) {
   StringBuffer queryString = new StringBuffer("from WkTUser as u where u.kuId in (");
   for (int i = 0; i < telist.size(); i++) {
     Teacher tea = (Teacher) telist.get(i);
     queryString.append(tea.getKuId());
     if (i < telist.size() - 1) {
       queryString.append(",");
     }
   }
   queryString.append(") order by u.kuName ");
   return getHibernateTemplate().find(queryString.toString());
 }
示例#2
0
  public void onClick$addTeacher() {
    if (yearlist.getSelectedItem() == null) {
      try {
        Messagebox.show("请选择有效的年份!", "提示", Messagebox.OK, Messagebox.EXCLAMATION);
      } catch (InterruptedException e) {
        System.out.println("年份");
      }
      return;
    }
    Map arg = new HashMap();
    final Integer year = Integer.parseInt(yearlist.getSelectedItem().getLabel());
    arg.put("year", year);
    arg.put("xyuserrole", getXyUserRole());
    //		System.out.println(Teacher.getRoleId( getSchoolDept().getKdId())+"---");
    arg.put(
        "role",
        (WkTRole)
            xyUserRoleService.get(WkTRole.class, Teacher.getRoleId(getSchoolDept().getKdId())));
    final AddTeacherWindow win =
        (AddTeacherWindow)
            Executions.createComponents("/admin/kyjf/gljs/addteacher.zul", null, arg);
    win.setTitle("管理指标分解人员");
    win.doHighlighted();
    win.initWindow();
    win.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {

          public void onEvent(Event arg0) throws Exception {
            List slist = win.getSelectUser();
            for (int i = 0; i < slist.size(); i++) {
              Teacher t = (Teacher) slist.get(i);
              Zbteacher Zt = new Zbteacher();
              Zt.setKuId(t.getKuId());
              Zt.setKdId(getXyUserRole().getKdId());
              Zt.setZtYear(year);
              zbteacherService.save(Zt);
            }
            win.detach();
            onClick$query();
          }
        });
  }