Пример #1
0
  @PostConstruct
  public void init() {

    receivedStartedProjects = new ArrayList<>(projectSessionBean.getUncompletedStartedProjects());

    if (projectSessionBean.getUncompletedStartedProjects() != null) {
      for (Project p : projectSessionBean.getUncompletedProjects()) {
        ongoingProjectNos.put(p.getProjectNo(), p.getProjectNo());
      }
    }
  }
Пример #2
0
  public void onEditRow(RowEditEvent event) {
    WeldJob w = (WeldJob) event.getObject(); // gives me unedited value
    // w.setQuantityWelded(quantityWelded);
    projectSessionBean.conductWeldJobMerge(w);

    Project p = projectSessionBean.getProjectByProjectNo(w.getProjectNo()).get(0);
    double partialWeldJob = 0, totalWeldJob = 0;
    for (int i = 0; i < p.getWeldJobs().size(); i++) {
      partialWeldJob += w.getSurfaceArea() * w.getQuantityWelded();
      totalWeldJob += w.getSurfaceArea() * w.getTotalQuantity();
    }
    int percent = (int) ((partialWeldJob / totalWeldJob) * 100);
    p.setProjectProgress(percent);
    projectSessionBean.conductProjectMerge(p);
  }
Пример #3
0
 public void filterByProjectNo() {
   receivedProjectByProjectNo =
       new ArrayList<>(projectSessionBean.getProjectByProjectNo(selectedProjectNo));
   if (!receivedProjectByProjectNo.isEmpty()) {
     selectedProject = receivedProjectByProjectNo.get(0);
   }
 }