Ejemplo n.º 1
0
 protected void processSelectModel(
     String actionCode, String actionObject, HttpServletRequest request) throws SQLException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   String serial = actionCode.split("-")[2];
   if (actionObject.equals("Employee")) {
     Employee employee =
         (Employee)
             Utility.getObject(
                 workCenterMgr.getFindMeta(workCenterMgr.getFoundMode()).getFindList(), serial);
     if (workCenterMgr.getEntryMode().equals(Constant.WORKER_GROUP)) {
       workCenterMgr.getCurrentWorkerGroup().setLeader(employee);
     } else if (workCenterMgr.getEntryMode().equals(Constant.CREATE_WORKER)) {
       workCenterMgr.getCurrentWorker().setEmployee(employee);
       workCenterMgr.getCurrentWorkerGroupMeta().refreshDepartment(employee.getEmployeeId());
     }
   } else if (actionObject.equals("WorkerGroup")) {
     WorkerGroup workerGroup =
         (WorkerGroup)
             Utility.getObject(
                 workCenterMgr.getFindMeta(workCenterMgr.getFoundMode()).getFindList(), serial);
     workCenterMgr.getCurrentWorker().setWorkerGroup(workerGroup);
   } else if (actionObject.equals("Worker")) {
     Worker worker =
         (Worker)
             Utility.getObject(
                 workCenterMgr.getFindMeta(workCenterMgr.getFoundMode()).getFindList(), serial);
     workCenterMgr.getCurrentWorking().setWorker(worker);
     workCenterMgr.getCurrentWorking().getWorkingDetailList().clear();
   } else if (actionObject.equals("Assignment")) {
     WorkingAssignment workingAssignment =
         (WorkingAssignment)
             Utility.getObject(
                 workCenterMgr.getFindMeta(workCenterMgr.getFoundMode()).getFindList(), serial);
     if (workingAssignment != null && !workCenterMgr.getCurrentWorking().isSelected(serial)) {
       WorkingDetail workingDetail = new WorkingDetail();
       workingDetail.setWorkingAssignment(workingAssignment);
       workingDetail.setSheetQty(workingAssignment.getAssignmentQty());
       workCenterMgr.getCurrentWorking().getWorkingDetailList().add(workingDetail);
       workCenterMgr.getCurrentWorking().setDetailListRowNo();
     }
   } else if (actionObject.equals("Working")) {
     Working working =
         (Working)
             Utility.getObject(
                 workCenterMgr.getFindMeta(workCenterMgr.getFoundMode()).getFindList(), serial);
     workCenterMgr.setCurrentWorking(working);
     workCenterMgr.getCurrentWorking().populateWorkingDetailList();
     WorkingDetail workingDetail =
         (WorkingDetail)
             ((LinkedList) workCenterMgr.getCurrentWorking().getWorkingDetailList()).getFirst();
     workCenterMgr
         .getCurrentWorking()
         .populateWorker(workCenterMgr, workingDetail.getWorkingAssignment().getWorkerId());
   }
 }
Ejemplo n.º 2
0
 protected void forwardView(
     String actionEvent,
     String actionObject,
     HttpServletRequest request,
     HttpServletResponse response)
     throws ServletException, IOException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   String actionCode = actionEvent + actionObject;
   if (actionEvent.equals("find")) {
     if (workCenterMgr.getFoundMode().equals(Constant.FIND_EMPLOYEE)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/findEmployee.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getFoundMode().equals(Constant.FIND_WORKER_GROUP)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/findWorkerGroup.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getFoundMode().equals(Constant.FIND_WORKER)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/findWorker.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getFoundMode().equals(Constant.FIND_ASSIGNMENT)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/findWorkAssignment.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getFoundMode().equals(Constant.FIND_WORKING)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/findWorking.jsp")
           .forward(request, response);
     }
   } else {
     if (workCenterMgr.getEntryMode().equals(Constant.WORKCENTER)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/workCenter.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getEntryMode().equals(Constant.WORKER_GROUP)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/workerGroup.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getEntryMode().equals(Constant.CREATE_WORKER)) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/worker.jsp")
           .forward(request, response);
     } else if (workCenterMgr.getEntryMode().indexOf(Constant.WORKING) >= 0) {
       getServletContext()
           .getRequestDispatcher("/jsp/mfg/wo/working.jsp")
           .forward(request, response);
       //            } else if
       // (workCenterMgr.getEntryMode().equals(Constant.PAYMENT_WORKING_REPORT)) {
       //
       // getServletContext().getRequestDispatcher("/jsp/mfg/wo/workingReport.jsp").forward(request, response);
     }
   }
 }
Ejemplo n.º 3
0
 protected void processRefreshModel(
     String actionCode, String actionObject, HttpServletRequest request) throws SQLException {
   WorkCenterMgr workCenterMgr = (WorkCenterMgr) this.getManagerFromSession(request);
   if (workCenterMgr.getEntryMode().equals(Constant.WORKER_GROUP)) {
     this.setHttpParameterWorkerGroup(request, workCenterMgr);
   } else if (workCenterMgr.getEntryMode().equals(Constant.CREATE_WORKER)) {
     this.setHttpParameterWorker(request, workCenterMgr);
   } else if (workCenterMgr.getEntryMode().indexOf(Constant.WORKING) >= 0) {
     this.setHttpParameterWorking(request, workCenterMgr);
   }
 }