Examples of SumAvvikV


Examples of no.ugland.utransprod.model.SumAvvikV

                .findByProductAreaYearAndMonthWithClosed(year,
                        month.getMonth(), productArea);

        Map<String, SumAvvikV> deviationMap = new Hashtable<String, SumAvvikV>();

        SumAvvikV currentDeviationOpen = null;
        SumAvvikV currentDeviationClosed = null;
        String jobFunctionName = "";
        int count = 0;
        if (deviations != null) {
            for (SumAvvikV deviation : deviations) {
                count++;
                if (!jobFunctionName.equalsIgnoreCase(deviation
                        .getJobFunctionName())
                        && count != 1) {
                    if (currentDeviationOpen != null
                            && currentDeviationClosed != null) {
                        currentDeviationOpen
                                .setClosedCount(currentDeviationClosed
                                        .getDeviationCount());
                        deviationMap.put(currentDeviationOpen
                                .getJobFunctionName(), currentDeviationOpen);
                    } else if (currentDeviationClosed != null) {
                        currentDeviationClosed
                                .setClosedCount(currentDeviationClosed
                                        .getDeviationCount());
                        currentDeviationClosed.setDeviationCount(0);
                        deviationMap.put(currentDeviationClosed
                                .getJobFunctionName(), currentDeviationClosed);
                    } else if (currentDeviationOpen != null) {
                        deviationMap.put(currentDeviationOpen
                                .getJobFunctionName(), currentDeviationOpen);
                    }
                    currentDeviationOpen = null;
                    currentDeviationClosed = null;
                }
                if (deviation.getClosed() == 0) {
                    currentDeviationOpen = deviation;
                } else {
                    currentDeviationClosed = deviation;
                }
                jobFunctionName = deviation.getJobFunctionName();

            }
        }
        // setter siste avvik
        if (currentDeviationOpen != null && currentDeviationClosed != null) {
            currentDeviationOpen.setClosedCount(currentDeviationClosed
                    .getDeviationCount());
            deviationMap.put(currentDeviationOpen.getJobFunctionName(),
                    currentDeviationOpen);
        } else if (currentDeviationClosed != null) {
            currentDeviationClosed.setClosedCount(currentDeviationClosed
                    .getDeviationCount());
            currentDeviationClosed.setDeviationCount(0);
            deviationMap.put(currentDeviationClosed.getJobFunctionName(),
                    currentDeviationClosed);
        } else if (currentDeviationOpen != null) {
            deviationMap.put(currentDeviationOpen.getJobFunctionName(),
                    currentDeviationOpen);
        }
View Full Code Here

Examples of no.ugland.utransprod.model.SumAvvikV

    row = sheet.createRow((short) currentRow++);
    createCell(row, cellStyle.getStyle10Bold(), (short) 0, countHeading);
    createCell(row, cellStyle.getStyle10(), (short) 1, String
        .valueOf(totalCount));

    SumAvvikV avvik;
    for (int i = 2; i <= column; i++) {
      avvik = columnMap.get(i);
      createCell(row, cellStyle.getStyle10(), (short) i, String
          .valueOf(avvik.getDeviationCount()));
    }

    row = sheet.createRow((short) currentRow++);
    createCell(row, cellStyle.getStyle10Bold(), (short) 0, sumHeading);
    createCell(row, cellStyle.getStyle10(), (short) 1, String
        .valueOf(totalCost.doubleValue()));

    for (int i = 2; i <= column; i++) {
      avvik = columnMap.get(i);
      createCell(row, cellStyle.getStyle10(), (short) i, String
          .valueOf(avvik.getInternalCost().doubleValue()));
    }
    return currentRow;

  }
View Full Code Here

Examples of no.ugland.utransprod.model.SumAvvikV

    List<MonthEnum> months = MonthEnum.getMonthList();
    Map<String, SumAvvikV> monthDeviations;
    Set<Integer> columns;
    // Antall nye avvik for gjeldende m�ned
    SumAvvikV newDeviations = null;
    SumAvvikV totalDeviations = new SumAvvikV();

    // Total for alle fiunksjoner
    Map<String, SumAvvikV> totalDeviationMap = new Hashtable<String, SumAvvikV>();

    // G�r gjennom alle m�neder og skriver ut antall avvik, �pne og lukkede
    for (MonthEnum month : months) {
      row = sheet.createRow((short) currentRow++);
      createCell(row, cellStyle.getStyle10BoldWithBorders(), (short) 0,
          month.getMonthString());

      // Henter ut avvik for gjeldende m�ned
      monthDeviations = deviationList.get(month);
      if (monthDeviations != null) {
        columns = jobFunctionNameColumns.keySet();
        newDeviations = new SumAvvikV();

        createDeviationCellForFunction(cellStyle, row,
            jobFunctionNameColumns, monthDeviations, columns,
            newDeviations, totalDeviations, totalDeviationMap);
        createCell(row, cellStyle.getStyle10BoldWithBorders(),
            (short) 1, newDeviations.getDeviationCount() + " ("
                + newDeviations.getClosedCount() + ")");
        newDeviations = null;
        if (totalDeviations != null) {
          createCell(row, cellStyle.getStyle10BoldWithBorders(),
              (short) 2, totalDeviations.getDeviationCount()
                  + " (" + totalDeviations.getClosedCount()
                  + ")");
        }
      }

    }
View Full Code Here

Examples of no.ugland.utransprod.model.SumAvvikV

      final Map<Integer, String> jobFunctionNameColumns,
      final Map<String, SumAvvikV> monthDeviations,
      final SumAvvikV newDeviations, final SumAvvikV totalDeviations,
      final Map<String, SumAvvikV> totalDeviationMap,
      final Integer nameColumn) {
    SumAvvikV deviation;
    deviation = monthDeviations.get(jobFunctionNameColumns.get(nameColumn));

    // Dersom m�ned har avvik for gjeldende funskjon skrives
    // denne ut
    if (deviation != null) {

      // Legger til nye avvik for m�ned
      newDeviations.addDeviationCount(deviation.getDeviationCount());
      newDeviations.addClosedCount(deviation.getClosedCount());

      createCellForDeviation(cellStyle, row, jobFunctionNameColumns,
          totalDeviations, totalDeviationMap, nameColumn, deviation);

    }
View Full Code Here

Examples of no.ugland.utransprod.model.SumAvvikV

      final HSSFRow row,
      final Map<Integer, String> jobFunctionNameColumns,
      final SumAvvikV totalDeviations,
      final Map<String, SumAvvikV> totalDeviationMap,
      final Integer nameColumn, final SumAvvikV deviation) {
    SumAvvikV totalDeviation;
    if (totalDeviations != null) {
      // Legger til total
      totalDeviations.addDeviationCount(deviation.getDeviationCount());
      totalDeviations.addClosedCount(deviation.getClosedCount());

      totalDeviation = totalDeviationMap.get(jobFunctionNameColumns
          .get(nameColumn));
      totalDeviation = getTotalDeviation(jobFunctionNameColumns,
          totalDeviationMap, nameColumn, deviation, totalDeviation);
      createCell(row, cellStyle.getStyle10BoldWithBorders(), nameColumn
          .shortValue(), totalDeviation.getDeviationCount() + " ("
          + totalDeviation.getClosedCount() + ")");
    }
  }
View Full Code Here

Examples of no.ugland.utransprod.model.SumAvvikV

  private SumAvvikV getTotalDeviation(
      final Map<Integer, String> jobFunctionNameColumns,
      final Map<String, SumAvvikV> totalDeviationMap,
      final Integer nameColumn, final SumAvvikV deviation,
      final SumAvvikV currentTotalDeviation) {
    SumAvvikV totalDeviation = currentTotalDeviation;
    if (totalDeviation != null) {
      totalDeviation.addDeviationCount(deviation.getDeviationCount());
      totalDeviation.addClosedCount(deviation.getClosedCount());
    } else {
      totalDeviation = new SumAvvikV();
      totalDeviation.setSumAvvikVPK(new SumAvvikVPK(deviation
          .getProductArea(), deviation.getJobFunctionName(), null,
          null, null));
      totalDeviation.setDeviationCount(deviation.getDeviationCount());
      totalDeviation.setClosedCount(deviation.getClosedCount());
      totalDeviationMap.put(jobFunctionNameColumns.get(nameColumn),
          totalDeviation);
    }
    return totalDeviation;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.