Package com.structis.fichesst.client.util

Examples of com.structis.fichesst.client.util.NameValuePair


      public void onExportSyntheseEcran(ExportSyntheseEcranEvent event) {

        List<NameValuePair> params = new ArrayList<NameValuePair>();
        // Information Chantier
        String chantier = chatierName.getValue();
        params.add(new NameValuePair("paramChantier", chantier));
        if( prorataTheorique.getValue() != null ) {
          Double prorata = prorataTheorique.getValue().doubleValue();
          params.add(new NameValuePair("paramProrata", prorata + ""));
        }
        // Synthese des fiches st
        // + Grid 1
        List<FicheStDto> fichestGrid1 = ficheStGrid1.getStore().getModels();
        List<String> lstKeyGrid1 = new ArrayList<String>();
        String keyGrid1 = "";
        for( int i = 0 ; i < fichestGrid1.size() ; i++ ) {
          if( fichestGrid1.get(i).getLotType() != null && !lstKeyGrid1.contains(fichestGrid1.get(i).getLotType().getName()) ) {
            lstKeyGrid1.add(fichestGrid1.get(i).getLotType().getName());
            keyGrid1 += fichestGrid1.get(i).getLotType().getName() + Constants.SEPRATE;
          }
        }
        if( keyGrid1 != null && keyGrid1.length() > 0 ) {
          keyGrid1 = keyGrid1.substring(0, keyGrid1.length() - Constants.SEPRATE.length());
          params.add(new NameValuePair("paramKeyGrid1", keyGrid1));
        }
        Map<String, String> mapGrid1 = new HashMap<String, String>();
        Map<String, String> mapTotalGroupGrid1 = new HashMap<String, String>();
        String totalSumGrid1 = createGridReport(fichestGrid1, lstKeyGrid1, mapGrid1, mapTotalGroupGrid1);
        params.add(new NameValuePair("paramMapGrid1", mapGrid1.toString()));
        params.add(new NameValuePair("paramMapTotalGroupGrid1", mapTotalGroupGrid1.toString()));
        params.add(new NameValuePair("paramTotalSumGrid1", totalSumGrid1));

        // +Grid 2
        List<FicheStDto> fichestGrid2 = ficheStGrid2.getStore().getModels();
        Map<String, String> mapGrid2 = new HashMap<String, String>();
        Map<String, String> mapTotalGroupGrid2 = new HashMap<String, String>();
        List<String> lstKeyGrid2 = new ArrayList<String>();
        String keyGrid2 = "";
        for( int i = 0 ; i < fichestGrid2.size() ; i++ ) {
          if( fichestGrid2.get(i).getLotType() != null && !lstKeyGrid2.contains(fichestGrid2.get(i).getLotType().getName()) ) {
            lstKeyGrid2.add(fichestGrid2.get(i).getLotType().getName());
            keyGrid2 += fichestGrid2.get(i).getLotType().getName() + Constants.SEPRATE;
          }
        }
        if( keyGrid2 != null && keyGrid2.length() > 0 ) {
          keyGrid2 = keyGrid2.substring(0, keyGrid2.length() - Constants.SEPRATE.length());
          params.add(new NameValuePair("paramKeyGrid2", keyGrid2));
        }
        String totalSumGrid2 = createGridReport(fichestGrid2, lstKeyGrid2, mapGrid2, mapTotalGroupGrid2);
        params.add(new NameValuePair("paramMapGrid2", mapGrid2.toString()));
        params.add(new NameValuePair("paramMapTotalGroupGrid2", mapTotalGroupGrid2.toString()));
        params.add(new NameValuePair("paramTotalSumGrid2", totalSumGrid2));

        // Synthese des transpert pp
        List<TransfertPpSummaryDto> listTransfertPpGrid = transfertPpGrid.getStore().getModels();
        TransfertPpSummaryDto transfertPpSummaryDto = null;
        String grid3 = "";
        double sumColumnObjectif = 0.0;
        double sumColumnObj = 0.0;
        double sumColumnTransfert = 0.0;
        double sumColumnRd = 0.0;
        double sumColumnTs = 0.0;
        double sumRow = 0.0;
        double sumSumRow = 0.0;
        NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
        for( int i = 0 ; i < listTransfertPpGrid.size() ; i++ ) {
          transfertPpSummaryDto = listTransfertPpGrid.get(i);
          sumColumnObjectif += transfertPpSummaryDto.getObjective();
          sumColumnObj += transfertPpSummaryDto.getObj();
          sumColumnTransfert += transfertPpSummaryDto.getDevers();
          sumColumnRd += transfertPpSummaryDto.getRd();
          sumColumnTs += transfertPpSummaryDto.getTs();
          sumRow = transfertPpSummaryDto.getObj() + transfertPpSummaryDto.getDevers() + transfertPpSummaryDto.getRd() + transfertPpSummaryDto.getTs();
          sumSumRow += sumRow;
          grid3 += createTotalSumReport(
              numberFormat, transfertPpSummaryDto.getLabel(), transfertPpSummaryDto.getObjective(),
              transfertPpSummaryDto.getObj(), transfertPpSummaryDto.getDevers(),
              transfertPpSummaryDto.getRd(), transfertPpSummaryDto.getTs(), sumRow);

        }
        params.add(new NameValuePair("paramGrid3", grid3));
        String totalSumGrid3 = createTotalSumReport(
            numberFormat, "Total PP", sumColumnObjectif, sumColumnObj, sumColumnTransfert, sumColumnRd,
            sumColumnTs, sumSumRow);
        params.add(new NameValuePair("paramTotalSumGrid3", totalSumGrid3));

        // ficheStSummaryGrid
        // +Grid 4
        List<FicheStDto> fichestGrid4 = ficheStSummaryGrid.getStore().getModels();
        String[] arr = createGridReportSummary(fichestGrid4);
        params.add(new NameValuePair("paramGrid4", arr[0]));
        params.add(new NameValuePair("paramTotalSumGrid4", arr[1]));

        String exportPdfUrl = GWT.getHostPageBaseURL() + "synthese.pdf";
        ReportUtil.showReport(exportPdfUrl, params.toArray(new NameValuePair[params.size()]));

      }
View Full Code Here


        Image exportButton = createPrintButton();
        exportButton.addClickHandler(new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new NameValuePair("fichestIds", model.getId() + Constants.SEPRATE));
            params.add(new NameValuePair("isHasGestion", "true"));

            String action = GWT.getHostPageBaseURL() + "custom_fichest.pdf";
            ReportUtil.showReport(action, params.toArray(new NameValuePair[params.size()]));
          }
        });
View Full Code Here

      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));
   
    params.add(new NameValuePair(ConstantClient.PROCESSDTO_ID_STR, process));
   
    if((cumule != null && cumule.length() > 0) && (mois !=null && mois.length() > 0)){
      String [] arrCumule = cumule.split(Constants.SEPRATE);
      String [] arrMois = mois.split(Constants.SEPRATE);
      totalsituation = numberFormat.format(new Double(arrCumule[0])) + Constants.SEPRATE + numberFormat.format(new Double(arrMois[0])) + Constants.SEPRATE +
              numberFormat.format(new Double(arrCumule[1])) + Constants.SEPRATE + numberFormat.format(new Double(arrMois[1]));
      params.add(new NameValuePair("totalsituation",totalsituation));
    }
    //Grid 2
    params.add(new NameValuePair("detail_des_retenues_appliques",detail_des_retenues_appliques));
   
    //Grid 3
    params.add(new NameValuePair("grid_3_report",grid_3_report));
    params.add(new NameValuePair("etatAvancement",numberFormat.format(etatAvancement)));
    String srcComment = comment.getValue();
    params.add(new NameValuePair("commentaire",srcComment));
    String exportPdfUrl = GWT.getHostPageBaseURL() + "list_processdto.pdf"
    ReportUtil.showReport(exportPdfUrl, params.toArray(new NameValuePair[params.size()]));   
  }
View Full Code Here

        public void onClick(ClickEvent event) {
      // TODO Auto-generated method stub
      // syn
      List<NameValuePair> params = new ArrayList<NameValuePair>();
      String exportPdfUrl = GWT.getHostPageBaseURL() + "acceuil.pdf";
      params.add(new NameValuePair("chantierId", model.getId() + ""));
      ReportUtil.showReport(exportPdfUrl, params.toArray(new NameValuePair[params.size()]));

        }
    });
    Image img2 = new Image("./images/voir.png");
View Full Code Here

        List<FicheStDto> listAllFis = new ArrayList<FicheStDto>();
        listAllFis.addAll(listFis1);
        listAllFis.addAll(listFis2);
        String ids = convertToStringId(listAllFis);
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new NameValuePair("fichestIds", ids));
        params.add(new NameValuePair("isHasGestion", isHasGestion + ""));
        String action = GWT.getHostPageBaseURL() + "custom_fichest.pdf";
        if (ids != null && ids.length() > 0)
          ReportUtil.showReport(action, params.toArray(new NameValuePair[params.size()]));
      };
    });
View Full Code Here

    grue = grue * ratioList[2];
    lift = lift * ratioList[3];
    benne = benne * ratioList[4];
    nettoyage = nettoyage * ratioList[5];
    prorata = prorata * ratioList[6];
    values.add(new NameValuePair(ConstantClient.DEDUCTIONDTO_ID_STR, deductions));
    String paramPrestation = append(ratioList[0], ratioList[1], ratioList[2], ratioList[3], ratioList[4], ratioList[5], ratioList[6]);
    values.add(new NameValuePair("paramPrestation", paramPrestation));
    canto += deductionDto.getCanto();
    badge += deductionDto.getBadge();
    grue += deductionDto.getGrue();
    lift += deductionDto.getLift();
    benne += deductionDto.getBenne();
    nettoyage += deductionDto.getNettoyage();
    autres += deductionDto.getAutres();
    prorata += deductionDto.getProrata();

    information += chantier + Constants.SEPRATE + responsables + Constants.SEPRATE + societe;
    values.add(new NameValuePair("information", information));

    String generaleInformation = chantier + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE
        + societte.getValue() + Constants.SEPRATE + lotType.getValue().getName() + Constants.SEPRATE + montant.getValue();
    values.add(new NameValuePair("generaleInformation", generaleInformation));
    /*
     * if(totaldeduction != "") totaldeduction = totaldeduction.substring(0, totaldeduction.length() - Constants.SEPRATE.length());
     */
    totaldeduction = append(canto, badge, grue, lift, benne, nettoyage, autres, prorata, refacturations);
    values.add(new NameValuePair("totaldeduction", totaldeduction));

    List<PenaltyDto> listPenalty = penaltyGrid.getStore().getModels();
    PenaltyDto penaltyDto = null;
    String penaltys = "";
    String penaltyDate = "";
    // Grid 1
    for (int j = 0; j < listPenalty.size(); j++) {
      penaltyDto = listPenalty.get(j);
      penaltyDate = penaltyDto.getDate() != null ? DateTimeFormat.getFormat(Constants.DATE_FORMAT).format(penaltyDto.getDate()) : "";
      penaltys += penaltyDate + Constants.SEPRATE + numberFormat.format(penaltyDto.getAmount()) + Constants.SEPRATE + penaltyDto.getComment()
          + Constants.SEPRATE;
      amount += penaltyDto.getAmount();
    }
    if (penaltys != null && penaltys.length() > 0)
      penaltys = penaltys.substring(0, penaltys.length() - Constants.SEPRATE.length());
    values.add(new NameValuePair(ConstantClient.PENALTYDTO_ID_STR, penaltys));

    values.add(new NameValuePair("amount", amount + ""));
    values.add(new NameValuePair("commentaire", comment.getValue()));
    values.add(new NameValuePair("internalCommentaire", internalComment.getValue()));
    String exportPdfUrl = GWT.getHostPageBaseURL() + "list_accomptesdto.pdf";
    ReportUtil.showReport(exportPdfUrl, values.toArray(new NameValuePair[values.size()]));
  }
View Full Code Here

      listtotalgestion.put(lstKeys.get(i), totalgestion);
  }
  if (keys.length() > 0) {
      keys = keys.substring(0, keys.length() - (Constants.SEPRATE.length()));
  }
  params.add(new NameValuePair(ConstantClient.GESTIONDTO_ID_STR, listgestion.toString()));
  alltotalgestion += append(allamount, allavenants, allarrete, allnonarrete, allprovision, alldevisrefuse, alltotalfdc, allreelactivitive, allamount2, allTotalecart);
  params.add(new NameValuePair("alltotalgestion", alltotalgestion));
  String generaleInformation = append(chainter, lot.getValue(), sitravaux.getValue(), societte.getValue(), lotType.getValue().getName(), montant.getValue());
  params.add(new NameValuePair("generaleInformation", generaleInformation));
  params.add(new NameValuePair("totalgestion", listtotalgestion.toString()));
  summary += append(totalObj, totalTF, totalTS, totalRD);
  params.add(new NameValuePair("summary", summary));
  budget += append(budgetInitial, dernierPoint, dernier);
  params.add(new NameValuePair("budget", budget));
  DateField dernier = (DateField) ComponentManager.get().get("GESTION_PANEL_DATEDERNIER_ID");
  params.add(new NameValuePair("dernier", dernier + ""));
  params.add(new NameValuePair("keys", keys));
  String exportPdfUrl = GWT.getHostPageBaseURL() + "list_gestiondto.pdf";
  ReportUtil.showReport(exportPdfUrl, params.toArray(new NameValuePair[params.size()]));
    }
View Full Code Here

       
        // Add General Information
        String lotype = lotType.getValue() != null ? lotType.getValue().getName() : "";
        String generaleInformation = chainter + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE + societte.getValue() + Constants.SEPRATE
            + lotype + Constants.SEPRATE + montant.getValue();
        values.add(new NameValuePair("generaleInformation", generaleInformation));
       
        // Add Conditions Particilifers
        String dgdpresentedate_ = dgdpresentedate.getValue() != null ? dateTimeFormat.format(dgdpresentedate.getValue()) : "null";
        String conditionsparticulieres = simpleDto.getValue().getLabel() + Constants.SEPRATE + rg.getValue() + Constants.SEPRATE + decennalenecessaire.getValue().getLabel()
            + Constants.SEPRATE + demandedagrement.getValue().getLabel() + Constants.SEPRATE + dgdpresente.getValue().getLabel() + Constants.SEPRATE + dgdpresentedate_;
       
        values.add(new NameValuePair("conditionsparticulieres", conditionsparticulieres));
        // Add Prestations
        String prestations = pilotage.getValue() + Constants.SEPRATE + assurances.getValue() + Constants.SEPRATE + prorata.getValue() + Constants.SEPRATE + canto.getValue()
            + Constants.SEPRATE + badge.getValue() + Constants.SEPRATE + grue.getValue() + Constants.SEPRATE + lift.getValue() + Constants.SEPRATE + benne.getValue() + Constants.SEPRATE
            + netoyage.getValue();
        values.add(new NameValuePair("prestations", prestations));
       
        // Add Informationa Complementaires
        String date_of_market = "null";
        if (dateOfMarket.getValue() != null) {
          date_of_market = dateTimeFormat.format(dateOfMarket.getValue());
        }
        String informationscomplementaires = conducteur.getValue() + Constants.SEPRATE + date_of_market;
        values.add(new NameValuePair("informationscomplementaires", informationscomplementaires));
       
        List<CautionFournieDto> listCautionFournieDto = centerPanel.getCautionFournieDtoList();
        String cautionFournies = "";
        String caution_date = "";
        for (CautionFournieDto cautionFournieDto : listCautionFournieDto) {
          caution_date = cautionFournieDto.getDate() != null ? dateTimeFormat.format(cautionFournieDto.getDate()) : "";
          cautionFournies += caution_date + Constants.SEPRATE + numberFormat.format(cautionFournieDto.getAmount()) + Constants.SEPRATE;
        }
        values.add(new NameValuePair("cautionFournies", cautionFournies));
       
        // Add Gestion
        List<GestionDto> listGestion = centerPanel.getGestionDtoList();
        addGestionReport(listGestion, values);
        List<ProgressDto> listProcess = centerPanel.getProgressDtoList();
View Full Code Here

          + Constants.SEPRATE + numberFormat.format(deductionDto.getNettoyage()) + Constants.SEPRATE + numberFormat.format(deductionDto.getAutres()) + Constants.SEPRATE
          + numberFormat.format(deductionDto.getProrata()) + Constants.SEPRATE + numberFormat.format(deductionDto.getRefacturations()) + Constants.SEPRATE;
    }
    if (deductions != null && deductions.length() > 0)
      deductions = deductions.substring(0, deductions.length() - 1);
    values.add(new NameValuePair(ConstantClient.DEDUCTIONDTO_ID_STR, deductions.toString()));
   
    TextField<String> txtTotalDeduction = (TextField<String>) ComponentManager.get().get("ACCOMPTES_PANEL_TOTALDEDUCTION_ID");
    String totaldeduction = "";
    if (txtTotalDeduction.getValue() != null && txtTotalDeduction.getValue().length() > 0)
      totaldeduction = txtTotalDeduction.getValue().substring(0, txtTotalDeduction.getValue().length() - 1);
    values.add(new NameValuePair("totaldeduction", totaldeduction));
   
    List<PenaltyDto> listPenalty = centerPanel.getPenaltyDtoList();
    PenaltyDto penaltyDto = null;
    String penaltys = "";
    // Grid 1
    for (int j = 0; j < listPenalty.size(); j++) {
      penaltyDto = listPenalty.get(j);
      /*
       * penaltys += DateTimeFormat.getFormat(Constants.DATE_FORMAT).format(penaltyDto.getDate()) + Constants.SEPRATE + numberFormat.format(penaltyDto.getAmount()) + Constants.SEPRATE +
       * penaltyDto.getComment() + Constants.SEPRATE;
       */
      penaltys += append(penaltyDto.getDate(), penaltyDto.getAmount(), penaltyDto.getComment());
      amount += penaltyDto.getAmount();
    }
    if (penaltys != null && penaltys.length() > 0)
      penaltys = penaltys.substring(0, penaltys.length() - 1);
    values.add(new NameValuePair(ConstantClient.PENALTYDTO_ID_STR, penaltys));
   
    values.add(new NameValuePair("amount", amount + ""));
    TextArea txtAccomptesPanelComment = (TextArea) ComponentManager.get().get("ACCOMPTESPANEL_COMMENT");
    TextArea txtAccomptesPanelInternalComment = (TextArea) ComponentManager.get().get("ACCOMPTESPANEL_INTERNAL_COMMENT");
    values.add(new NameValuePair("deductionComment1", txtAccomptesPanelComment.getValue() == null ? "" : txtAccomptesPanelComment.getValue()));
    values.add(new NameValuePair("deductionComment2", txtAccomptesPanelInternalComment.getValue() == null ? "" : txtAccomptesPanelInternalComment.getValue()));
  }
View Full Code Here

     * numberFormat.format(allnonarrete) + Constants.SEPRATE + numberFormat.format(allprovision) + Constants.SEPRATE + numberFormat.format(alldevisrefuse) + Constants.SEPRATE +
     * numberFormat.format(alltotalfdc) + Constants.SEPRATE + numberFormat.format(allreelactivitive) + Constants.SEPRATE + numberFormat.format(allamount2) + Constants.SEPRATE +
     * numberFormat.format(alltotalecart) + Constants.SEPRATE;
     */
    alltotalgestion += append(allamount, allavenants, allarrete, allnonarrete, allprovision, alldevisrefuse, alltotalfdc, allreelactivitive, allamount2, alltotalecart);
    values.add(new NameValuePair(ConstantClient.GESTIONDTO_ID_STR, listgestion.toString()));
    values.add(new NameValuePair("totalgestion", listtotalgestion.toString()));
    values.add(new NameValuePair("alltotalgestion", alltotalgestion));
    double totalObj = 0.0;
    double totalTF = 0.0;
    double totalTS = 0.0;
    double totalRD = 0.0;
    for (GestionDto gestion : listGestion) {
      Integer typeId = gestion.getType().getId();
      double value = gestion.getAmount2();
      switch (typeId) {
        case 1:
          totalObj += value;
          break;
        case 2:
          totalTF += value;
          break;
        case 3:
          totalTS += value;
          break;
        case 4:
          totalRD += value;
          break;
        default:
          break;
      }
    }
   
    /* summary += totalObj + Constants.SEPRATE + totalTF + Constants.SEPRATE + totalTS + Constants.SEPRATE + totalRD; */
    summary += append(totalObj, totalTF, totalTS, totalRD);
    values.add(new NameValuePair("summary", summary));
   
    NumberField budgetInitial = (NumberField) ComponentManager.get().get("GESTIONAL_PANEL_BUDGET_ID");
    NumberField dernierPoint = (NumberField) ComponentManager.get().get("GESTIONAL_PANEL_ECARDDERNIER_ID");
    DateField dernier = (DateField) ComponentManager.get().get("GESTION_PANEL_DATEDERNIER_ID");
    /* budget += budgetInitial.getValue() + Constants.SEPRATE + dernierPoint.getValue() + Constants.SEPRATE + dernier.getValue(); */
    budget += append(budgetInitial.getValue(), dernierPoint.getValue(), dernier.getValue());
    values.add(new NameValuePair("budget", budget));
    values.add(new NameValuePair("key_gestion", keys));
  }
View Full Code Here

TOP

Related Classes of com.structis.fichesst.client.util.NameValuePair

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.