Пример #1
0
 public ActionForward execute(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   ActionMessages messages = new ActionMessages();
   try {
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     ILoanerlogoutBS loanerlogoutBS =
         (ILoanerlogoutBS)
             BSUtils.getBusinessService("loanerlogoutBS", this, mapping.getModuleConfig());
     String contractId = (String) request.getParameter("contractId");
     if (contractId != null && !"".equals(contractId.trim())) {
       contractId = (String) request.getParameter("contractId");
     }
     loanerlogoutBS.findLoanerlogouAvailable(contractId);
     loanerlogoutBS.saveLoanerlogouTa(contractId, securityInfo);
     request.setAttribute("save", "save");
   } catch (BusinessException be) {
     messages.add(
         ActionMessages.GLOBAL_MESSAGE, new ActionMessage(be.getLocalizedMessage(), false));
     saveErrors(request, messages);
     return mapping.findForward("loanerlogout_show");
   } catch (Exception e) {
     e.printStackTrace();
   }
   return mapping.findForward("loanerlogout_show");
 }
Пример #2
0
 public ActionForward execute(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   ActionMessages messages = null;
   try {
     messages = new ActionMessages();
     TraninAddAF traninAddAF = (TraninAddAF) form;
     TranInTail tranInTail = traninAddAF.getTranInTail();
     String traninTailsex = traninAddAF.getTraninTailsex();
     tranInTail.setSex(new Integer(traninTailsex));
     String empName = tranInTail.getName();
     String cardNum = tranInTail.getCardNum();
     String noteNum = traninAddAF.getNoteNum();
     String tranInHeadById = traninAddAF.getTranInHeadId();
     String inOrgId = traninAddAF.getInOrgId();
     ITraninBS traninBS =
         (ITraninBS) BSUtils.getBusinessService("traninBS", this, mapping.getModuleConfig());
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     String info = traninBS.addTranInTail_sy(inOrgId, noteNum, tranInTail, securityInfo);
     if (info.equals("showTraninListAC")) {
       messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("操作成功!", false));
       saveErrors(request, messages);
       return mapping.findForward("showTraninListAC");
     }
     if (info.equals("employeeMaintainAC")) {
       List list = traninBS.queryEmp_sy(empName, cardNum);
       traninAddAF.setNoteNum(noteNum);
       traninAddAF.setInOrgId(inOrgId);
       traninAddAF.setTranInTail(tranInTail);
       traninAddAF.setList(list);
       request.setAttribute("traninAddAF", traninAddAF);
       return mapping.findForward("showemppop");
     }
     if (info.equals("sameEmployeeMaintainAC")) {
       List list = traninBS.querySameCompanyEmp_sy(inOrgId, empName, cardNum);
       traninAddAF.setNoteNum(noteNum);
       traninAddAF.setInOrgId(inOrgId);
       traninAddAF.setTranInTail(tranInTail);
       traninAddAF.setList(list);
       request.setAttribute("traninAddAF", traninAddAF);
       request.getSession().setAttribute("Magssage", "sameorg");
       return mapping.findForward("showemppop");
     }
   } catch (BusinessException bex) {
     messages = new ActionMessages();
     messages.add(
         ActionMessages.GLOBAL_MESSAGE,
         new ActionMessage(bex.getLocalizedMessage().toString(), false));
     saveErrors(request, messages);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return mapping.findForward("showTraninListAC");
 }