Package com.structis.fichesst.shared.dto

Examples of com.structis.fichesst.shared.dto.ProgressDto


          listProcess = progressGrid.getStore().getModels();
        }
        else
          listProcess = event.getListProcess();
        if( listProcess != null && listProcess.size() > 0 ) {
          ProgressDto progressDto = null;
          for( int i = 0 ; i < listProcess.size() ; i++ ) {
            progressDto = listProcess.get(i);
            cumuleSum = progressDto.getCumule();
          }
        }

        if( totalTraite == 0 ) {
          etatAvancement = 0.0;
        }
        else {
          etatAvancement = (cumuleSum / totalTraite) * 100;
        }
        setProgressLabelText(etatAvancement);
      }
    });

    TableData td_htmlNewHtml = new TableData();
    td_htmlNewHtml.setHorizontalAlign(HorizontalAlignment.LEFT);
    layoutContainer_1.add(progressLabel, td_htmlNewHtml);

    saveButton = new HTML("<img src='./images/sauvegarder.png'/> " + messages.saveForm(), false);
    saveButton.setStyleName("actionHTML");
    saveButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        bus.fireEvent(new SaveFicheStEvent());
      }
    });
   
    TableData td_saveButton = new TableData();
    td_saveButton.setHorizontalAlign(HorizontalAlignment.RIGHT);
    layoutContainer_1.add(saveButton, td_saveButton);
   
    bus.addHandler(ExportAvancementPanelEvent.TYPE, new ExportAvancementPanelHandler() {
     
      @Override
      public void onExport(ExportAvancementPanelEvent event) {
        exportAvancementsPanel();
      }
    });
   
    HTML print2 = new HTML("<img src='./images/imprimer.png'/> " + messages.printPromotions(), false);
    print2.setStyleName("actionHTML");
    print2.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent arg0) {
        exportAvancementsPanel();
      }
    });
    TableData td_print2 = new TableData();
    td_print2.setWidth("250");
    td_print2.setHorizontalAlign(HorizontalAlignment.RIGHT);
    layoutContainer_1.add(print2, td_print2);

    avancementsFieldSet.add(layoutContainer_1);

    avancementsFieldSet.add(new HTML("<br>", true));
    avancementsFieldSet.setCollapsible(true);
    avancementsFieldSet.setHeading(messages.avancement());
    TableLayout avancementsTableLayout = new TableLayout(1);
    avancementsTableLayout.setWidth("100%");
    avancementsFieldSet.setLayout(avancementsTableLayout);

    FieldSet fldstNewFieldset_1 = new FieldSet();
    fldstNewFieldset_1.setCollapsible(true);
    fldstNewFieldset_1.setHeading(messages.deductionsDetails());

    createPenaltiesGrid();
    fldstNewFieldset_1.add(penaltyGrid);

    fldstNewFieldset_1.add(new HTML("<br>"));

    createGrid3();
    fldstNewFieldset_1.add(grid_3);

    FlexTable ft11 = new FlexTable();
    ft11.setWidget(0, 0, new HTML(SPACES_4));
    addRow = new HTML("<img src='./images/ajouter.png'/> " + messages.addRow(), false);
    addRow.setStyleName("actionHTML2");
    ft11.setWidget(0, 1, addRow);

    addRow.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        showAddDialog();
      }

      private void showAddDialog() {
        Dialog dialog = new Dialog();
        dialog.setHeading(messages.titlePopup());
        dialog.setLayout(new BorderLayout());
        dialog.setWidth(500);
        dialog.setHeight(220);
        dialog.setBodyBorder(false);
        dialog.setHideOnButtonClick(true);
        dialog.setButtons(Dialog.OKCANCEL);
        dialog.setButtonAlign(HorizontalAlignment.CENTER);
        dialog.setScrollMode(Scroll.AUTO);
        dialog.setModal(true);
        dialog.setBlinkModal(true);
        Button cancelButton = dialog.getButtonById(Dialog.CANCEL);
        cancelButton.setText(messages.cancel());
        Button okButton = dialog.getButtonById(Dialog.OK);
        okButton.setText(messages.ok());

        final AddAvancementForm addDataForm = new AddAvancementForm();
        dialog.add(addDataForm, new BorderLayoutData(LayoutRegion.CENTER));

        okButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
          public void componentSelected(ButtonEvent ce) {
            ProgressDto model = addDataForm.getDataModel();
            progressGrid.getStore().add(model);
            progressGrid.getView().refresh(true);
            //bus.fireEvent(new EtatAvancementEvent(listGestion,progressGrid.getStore().getModels()));
          }
        });

        dialog.show();
      }
    });

    LayoutContainer leftPanel = new LayoutContainer();
    leftPanel.setLayout(new TableLayout(1));

    leftPanel.add(new HTML("<br>"));

    createProgressGrid();
    leftPanel.add(progressGrid);

    leftPanel.add(ft11);

    leftPanel.add(new HTML("<br>"));
    leftPanel.add(fldstNewFieldset_1);
    TableData layoutData9 = new TableData();
    layoutData9.setWidth(COLUMNS_WIDTH_3[1]);
    setLayout(new RowLayout(Orientation.VERTICAL));
    add(avancementsFieldSet);

    setDefaultBackgroundColor(avancementsFieldSet);

    LayoutContainer layoutContainer_3 = new LayoutContainer();
    TableLayout tl3 = new TableLayout(3);
    tl3.setWidth("100%");
    layoutContainer_3.setLayout(tl3);
    avancementsFieldSet.add(layoutContainer_3);

    LayoutContainer rightPanel = new LayoutContainer();
    layoutContainer_3.add(leftPanel);

    TableData td2 = new TableData();
    td2.setWidth(COLUMNS_WIDTH_3[1]);
    layoutContainer_3.add(new HTML("&nbsp;"), td2);
    FormLayout fl_rightPanel = new FormLayout();
    fl_rightPanel.setLabelAlign(LabelAlign.TOP);
    rightPanel.setLayout(fl_rightPanel);

    TableData td_rightPanel = new TableData();
    td_rightPanel.setWidth(COLUMNS_WIDTH_3[2]);
    comment.setMaxLength(MAX_LENGTH_5);
    comment.setName(FicheStDto.AVCT_COMMENTAIRES);
    comment.setId("AVANCEMENTSPANEL_COMMENT");
    comment.setHeight("460px");
    comment.setFieldLabel(messages.comment2());
    formPanel.add(comment, new FormData("100%"));
    rightPanel.add(formPanel);
    layoutContainer_3.add(rightPanel, td_rightPanel);

    bus.addHandler(DeductionGridUpdateEvent.TYPE, new DeductionGridUpdateHandler() {
      @Override
      public void onSave(DeductionGridUpdateEvent event) {
        List<DeductionDto> deductionDtoList = event.getDeductionDtoList();
        int cantoQuantity = 0;
        int badgeQuantity = 0;
        int grueQuantity = 0;
        int liftQuantity = 0;
        int benneQuantity = 0;
        int nettoyageQuantity = 0;
        double autres = 0.0;
        for( DeductionDto deductionDto : deductionDtoList ) {
          cantoQuantity += deductionDto.getCanto();
          badgeQuantity += deductionDto.getBadge();
          grueQuantity += deductionDto.getGrue();
          liftQuantity += deductionDto.getLift();
          benneQuantity += deductionDto.getBenne();
          nettoyageQuantity += deductionDto.getNettoyage();
          autres += deductionDto.getAutres();
        }
        grid_3.getStore().removeAll();

        List<AnonymousDto> models = new ArrayList<AnonymousDto>();
        AnonymousDto model = null;

        String[] column1s = { messages.nombre(), messages.amount() }
       
        NumberField canto = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_CANTO_ID");
        NumberField badge = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_BADGE_ID");       
        NumberField grue = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_GRUE_ID");
        NumberField lift = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_LIFT_ID");
        NumberField benne = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_BENNE_ID");     
        NumberField netoyage = (NumberField)ComponentManager.get().get("INFORMATIONAL_PANEL_NETOYAGE_ID");
       
        double cantoValue = 0.0;
        double badgeValue = 0.0;
        double grueValue = 0.0;
        double liftValue = 0.0;
        double benneValue = 0.0;
        double netoyageValue = 0.0;
        if(canto!=null && canto.getValue()!=null)
          cantoValue = canto.getValue().doubleValue();
        if(badge!=null && badge.getValue()!=null)
          badgeValue = badge.getValue().doubleValue();
        if(grue!=null && grue.getValue()!=null)
          grueValue = grue.getValue().doubleValue();
        if(lift!=null && lift.getValue()!=null)
          liftValue = lift.getValue().doubleValue();
        if(benne!=null && benne.getValue()!=null)
          benneValue = benne.getValue().doubleValue();
        if(netoyage!=null && netoyage.getValue()!=null)
          netoyageValue = netoyage.getValue().doubleValue();
        double[] column2s = { cantoQuantity, (cantoQuantity * cantoValue) };
        double[] column3s = { badgeQuantity, (badgeQuantity * badgeValue) };
        double[] column4s = { grueQuantity, (grueQuantity * grueValue) };
        double[] column5s = { liftQuantity, (liftQuantity * liftValue) };
        double[] column6s = { benneQuantity, (benneQuantity * benneValue) };
        double[] column7s = { nettoyageQuantity,(nettoyageQuantity * netoyageValue) };
        double[] column8s = { 0, autres };
        grid_3_report = "";
        for( int i = 0 ; i < 2 ; i++ ) {
          model = new AnonymousDto();
          model.set(AnonymousDto.COLUMN_1, column1s[i]);
          model.set(AnonymousDto.COLUMN_2, column2s[i]);
          model.set(AnonymousDto.COLUMN_3, column3s[i]);
          model.set(AnonymousDto.COLUMN_4, column4s[i]);
          model.set(AnonymousDto.COLUMN_5, column5s[i]);
          model.set(AnonymousDto.COLUMN_6, column6s[i]);
          model.set(AnonymousDto.COLUMN_7, column7s[i]);
          model.set(AnonymousDto.COLUMN_8, column8s[i]);
          //For report
          grid_3_report +=  column2s[i] + Constants.SEPRATE + column3s[i] + Constants.SEPRATE + column4s[i] +
          Constants.SEPRATE + column5s[i] + Constants.SEPRATE + column6s[i] + Constants.SEPRATE + column7s[i] + Constants.SEPRATE + column8s[i] + Constants.SEPRATE;
          models.add(model);
        }
View Full Code Here


                progressGrid.getStore().getModels().get(rowIndex).setMois(result);
              else
                progressGrid.getStore().getModels().get(rowIndex).setMois2(result);
            }
            else {
              ProgressDto previousModel = grid.getStore().getAt(rowIndex - 1);
              if( ProgressDto.MOIS.equalsIgnoreCase(columnId) ) {
                result = model.getCumule() - previousModel.getCumule();
              }
              else {
                result = model.getCumule2() - previousModel.getCumule2();
              }
              if(ProgressDto.MOIS.equalsIgnoreCase(columnId))
                progressGrid.getStore().getModels().get(rowIndex).setMois(result);
              else
                progressGrid.getStore().getModels().get(rowIndex).setMois2(result);
            }
            return result;
          }     
        });
        //Total summary columns
        totalSummary.setSummaryFormat(columnId, NumberFormat.getCurrencyFormat());
        totalSummary.setSummaryType(columnId, new SummaryType<Double>() {
          @Override
          public Double render(Object v, ModelData m, String field, Map<String, Object> data) {
            double sumMois = 0.0;
            double sumMois2 = 0.0;
            double sumCumule = 0.0;
            double sumCumule2 = 0.0;
            ProgressDto progressDto = null;
            for(int i = 0 ; i < progressGrid.getStore().getModels().size() ; i++){
              progressDto = progressGrid.getStore().getModels().get(i);
              sumMois += progressDto.getMois();
              sumMois2 += progressDto.getMois2();
              sumCumule = progressDto.getCumule();
              sumCumule2 = progressDto.getCumule2();
              cumule = progressDto.getCumule() + Constants.SEPRATE + progressDto.getCumule2();
             
            }
            //For Report
            mois = sumMois + Constants.SEPRATE + sumMois2;
            txt_advancement_mois.setValue(mois);
View Full Code Here

    cumule2.setName(ProgressDto.CUMULE2);
    formPanel.add(cumule2, new FormData(ANCHOR_SPEC));
   
    add(formPanel);
   
    ProgressDto dataModel = new ProgressDto();
    bindModel(formPanel, dataModel);
   
    setDefaultBackgroundColor();
  }
View Full Code Here

    NumberField montant = (NumberField)ComponentManager.get().get("INFORMATION_PANEL_MONTANT_ID");
   
    List<NameValuePair> params = new ArrayList<NameValuePair>()
    List<ProgressDto> list = progressGrid.getStore().getModels();   
   
    ProgressDto progressDto = null;
    String process = "";
    String totalsituation = "";
    //Grid 1
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
    NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
    String process_date = "";
    //String [] arrMois = mois.split(Constants.SEPRATE);
    for (int j = 0; j < list.size(); j++) {   
      progressDto = list.get(j);
      process_date = progressDto.getDate() != null ? dateTimeFormat.format(progressDto.getDate()) : "";
      process += (j+1) + Constants.SEPRATE + progressDto.getLabel() + Constants.SEPRATE +
      process_date + Constants.SEPRATE + numberFormat.format(progressDto.getCumule()) + Constants.SEPRATE + numberFormat.format(progressDto.getMois()) +
      Constants.SEPRATE + numberFormat.format(progressDto.getCumule2()) + Constants.SEPRATE + numberFormat.format(progressDto.getMois2()) + Constants.SEPRATE;
    }

    String generaleInformation = chainter + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE +
    societte.getValue() + Constants.SEPRATE + lotType.getValue().getName() + Constants.SEPRATE + montant.getValue();
    params.add(new NameValuePair("generaleInformation", generaleInformation));
View Full Code Here

 
  @SuppressWarnings("unchecked")
  private void addProcessReport(List<ProgressDto> listProcess, List<NameValuePair> values) {
   
    List<ProgressDto> list = listProcess;
    ProgressDto progressDto = null;
    String process = "";
    String totalsituation = "";
    // Grid 1
    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(Constants.DATE_FORMAT);
    NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
    String process_date = "";
   
    for (int j = 0; j < list.size(); j++) {
      progressDto = list.get(j);
      process_date = progressDto.getDate() != null ? dateTimeFormat.format(progressDto.getDate()) : "";
      process += (j + 1) + Constants.SEPRATE + progressDto.getLabel() + Constants.SEPRATE + process_date + Constants.SEPRATE + numberFormat.format(progressDto.getCumule()) + Constants.SEPRATE
          + numberFormat.format(progressDto.getMois()) + Constants.SEPRATE + numberFormat.format(progressDto.getCumule2()) + Constants.SEPRATE + numberFormat.format(progressDto.getMois2())
          + Constants.SEPRATE;
    }
    if (process != null && process.length() > 0) {
      process = process.substring(0, process.length() - Constants.SEPRATE.length());
      values.add(new NameValuePair(ConstantClient.PROCESSDTO_ID_STR, process));
View Full Code Here

    }
    return listPenaltySaved;
  }
 
  private List<ProgressDto> getProgressSaved() {
    ProgressDto progressDto = null;
    List<ProgressDto> listProgressSaved = new ArrayList<ProgressDto>();
    for (int i = 0; i < centerPanel.getProgressDtoList().size(); i++) {
      progressDto = centerPanel.getProgressDtoList().get(i);
      if (progressDto.getLabel() != null || progressDto.getDate() != null || progressDto.getCumule() != 0 || progressDto.getCumule2() != 0) {
        listProgressSaved.add(progressDto);
      }
    }
    return listProgressSaved;
  }
View Full Code Here

TOP

Related Classes of com.structis.fichesst.shared.dto.ProgressDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.