예제 #1
0
  public ActionForward update_step1(
      ActionMapping mapping,
      ActionForm form, // 修改步骤一
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    log.debug("update_step1");
    String vacationId = request.getParameter("vacationid");
    Vacation vacation = vacationService.get(vacationId);
    String startDate = vacation.getStartdate();
    String endDate = vacation.getEnddate();

    Department department = departmentService.getDepartment(vacation.getDepartid());

    request.setAttribute("vacation", vacation);
    request.setAttribute("start_month", startDate.substring(0, 2));
    request.setAttribute("end_month", endDate.substring(0, 2));
    request.setAttribute("start_day", endDate.substring(0, 2));
    request.setAttribute("end_day", endDate.substring(2));
    request.setAttribute("depart_name", department.getName());

    return mapping.findForward("update");
  }
예제 #2
0
  public ActionForward addConfirm(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    log.debug("addConfirm");
    Map filterMap = WebUtils.getParametersStartingWith(request, "new_");

    Department department = departmentService.getDepartment((String) filterMap.get("departId"));
    /*
     * 得到当前部门的公休假日
     */
    List vacationList = vacationService.getVacationsByDeptId((String) filterMap.get("departId"));
    String va = "";
    if (!vacationList.isEmpty()) {
      Iterator vaIte = vacationList.iterator();
      while (vaIte.hasNext()) {
        Vacation vacation = (Vacation) vaIte.next();
        va += vacation.getStartdate() + "---" + vacation.getEnddate() + " ";
      }
    }
    /*
     * 得到上一级部门公休假日
     */
    String parantVa = "";
    Department parantDept = department.getParent();
    if (parantDept != null) {
      vacationList = vacationService.getVacationsByDeptId(parantDept.getId());
      if (!vacationList.isEmpty()) {
        Iterator vaIte = vacationList.iterator();
        while (vaIte.hasNext()) {
          Vacation vacation = (Vacation) vaIte.next();
          parantVa += vacation.getStartdate() + "---" + vacation.getEnddate() + " ";
        }
      }
    }
    /*
     * 得到全局公休假日
     */
    vacationList = vacationService.getGlobeVacation();
    String globeVa = "";
    if (vacationList != null && !vacationList.isEmpty()) {
      Iterator vaIte = vacationList.iterator();
      while (vaIte.hasNext()) {
        Vacation vacation = (Vacation) vaIte.next();
        globeVa += vacation.getStartdate() + "---" + vacation.getEnddate() + " ";
      }
    }
    request.setAttribute("new_startMonth", (String) filterMap.get("startMonth"));
    request.setAttribute("new_startDay", (String) filterMap.get("startDay"));
    request.setAttribute("new_confname", (String) filterMap.get("confName"));
    request.setAttribute("new_endMonth", (String) filterMap.get("endMonth"));
    request.setAttribute("new_endDay", (String) filterMap.get("endDay"));
    request.setAttribute("parantVa", parantVa);
    request.setAttribute("va", va);
    request.setAttribute("globeVa", globeVa);
    request.setAttribute("dptName", department.getName());
    request.setAttribute("new_departId", (String) filterMap.get("departId"));

    return mapping.findForward("addConfirm");
  }