/**
   * hanjiwei modify it 20060920
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return
   * @throws Exception
   */
  public ActionForward preUpdate(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    String leaveInfoId = request.getParameter("pre_leaveinfoId");

    Tleaveinfo leaveinfo = new Tleaveinfo();

    if (leaveInfoId != null) leaveinfo = leaveInfoService.getLeaveInfoById(leaveInfoId);
    List typeList = sysService.getLeaveList();

    request.setAttribute("leaveType", typeList);
    request.setAttribute("leaveinfo", leaveinfo);
    request.setAttribute("custId", leaveinfo.getCustId());
    request.setAttribute(
        "clerkName", sysService.getCustomerNameByCustomerId(leaveinfo.getCustId()));
    request.setAttribute("new_leaveInfoId", leaveInfoId);
    request.setAttribute("leaveInfoName", sysService.getLeaveTypeName(leaveinfo.getLeaveTypeid()));
    request.setAttribute("new_description", leaveinfo.getLeaveInfo());
    request.setAttribute("new_type", leaveinfo.getLeaveTypeid());
    request.setAttribute("new_startDate", DateUtilExtend.formatDate3(leaveinfo.getStartdate()));
    request.setAttribute("new_endDate", DateUtilExtend.formatDate3(leaveinfo.getEnddate()));
    request.setAttribute("new_startHour", leaveinfo.getStarttime().substring(0, 2));
    request.setAttribute("new_startMin", leaveinfo.getStarttime().substring(2, 4));
    request.setAttribute("new_endHour", leaveinfo.getEndtime().substring(0, 2));
    request.setAttribute("new_endMin", leaveinfo.getEndtime().substring(2, 4));

    return mapping.findForward("preupdate");
  }
  public ActionForward goStatic(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    List departmentTree = departmentService.getDepartmentTree(0, null);
    request.setAttribute("departmentTree", departmentTree);

    request.setAttribute("leave_startDate", DateUtilExtend.getNowDate());
    request.setAttribute("leave_endDate", DateUtilExtend.getNowDate());
    return mapping.findForward("leaveInfoQuery");
  }
  /**
   * hanjiwei modify it 20060920
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return
   * @throws Exception
   */
  public ActionForward update(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    ActionMessages messages = new ActionMessages();
    List departmentTree = departmentService.getDepartmentTree(0, null);
    request.setAttribute("departmentTree", departmentTree);

    Map filterMap = WebUtils.getParametersStartingWith(request, "new_");

    Integer custId = Integer.valueOf((String) filterMap.get("custId"));
    String custName = (String) filterMap.get("clerkName");
    String startTime =
        DateUtilExtend.formatDate2((String) filterMap.get("startDate"))
            + (String) filterMap.get("startHour")
            + (String) filterMap.get("startMin")
            + "00";
    String endTime =
        DateUtilExtend.formatDate2((String) filterMap.get("endDate"))
            + (String) filterMap.get("endHour")
            + (String) filterMap.get("endMin")
            + "00";

    String msg = leaveInfoService.checkIsLeaveByClerkId(custId, startTime, endTime);
    if (!"".equals(msg)) {
      String tipMsg = custName + "请假信息设置有重复,请重新设置!";
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("fail.modify", tipMsg));
      saveMessages(request, messages);
      return mapping.findForward("operOk");
    }
    HttpSession session = request.getSession();
    filterMap.put("operatorid", (String) session.getAttribute("account"));

    leaveInfoService.updateLeaveInfo(filterMap);

    // request.setAttribute("msg", "修改成功");
    String tipMsg = custName + "请假修改成功!";
    messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("success.modify", tipMsg));
    saveMessages(request, messages);
    return mapping.findForward("operOk");
  }