Exemple #1
0
  public String doDelete() {
    ActionContext ctx = ActionContext.getContext();
    HttpServletRequest req = Struts2Util.getRequest();
    String[] invoiceIds = req.getParameter("invoiceIds").split(",");
    // System.out.println("SessionUtil.getUserId():"+SessionUtil.getUserId());
    // System.out.println("statusUpReason:"+req.getParameter("statusUpReason"));

    List<ApInvoice> list = new ArrayList();
    for (int i = 0; i < invoiceIds.length; i++) {
      ApInvoice entity =
          (ApInvoice)
              apInvoiceDao
                  .getSession()
                  .get(
                      ApInvoice.class,
                      new Integer(invoiceIds[i])); // apInvoiceDao.get(new Integer(invoiceIds[i]));
      entity.setOldStatus(entity.getStatus()); // 原始状态
      entity.setStatus(Constant.STATUS_VOID); // 修改后的状态
      entity.setModifiedBy(SessionUtil.getUserId());
      entity.setModifyDate(new Date());
      entity.setStatusUpdReason(req.getParameter("statusUpReason"));
      list.add(entity);
    }

    boolean bres = apInvoiceService.delete(list);
    Struts2Util.getRequest().setAttribute("operate_result", bres);

    return "delete_invoice_page";
    //				return input();
  }