Package lv.odylab.evemanage.domain.calculation

Examples of lv.odylab.evemanage.domain.calculation.Calculation


        String blueprintTypeName = securityManager.decodeUrlString(blueprintTypeNameFromUrl);
        calculationExpression.setBlueprintTypeName(blueprintTypeName);
        BlueprintDetailsDto blueprintDetailsDto = eveDbGateway.getBlueprintDetailsForTypeName(blueprintTypeName);
        BlueprintTypeDto blueprintTypeDto = blueprintDetailsDto.getBlueprintTypeDto();
        Long[] pathNodes = new Long[]{blueprintTypeDto.getProductTypeID()};
        Calculation calculation = getCalculation(pathNodes, blueprintDetailsDto, calculationExpression.getPriceSetItemTypeIdToPriceMap());
        calculation.setMaterialLevel(calculationExpression.getMeLevel());
        calculation.setProductivityLevel(calculationExpression.getPeLevel());
        return calculation;
    }
View Full Code Here


        calculation.setProductivityLevel(calculationExpression.getPeLevel());
        return calculation;
    }

    private Calculation getCalculation(Long[] pathNodes, BlueprintDetailsDto blueprintDetailsDto, Map<Long, String> priceSetItemTypeIdToPriceMap) {
        Calculation calculation = new Calculation();
        BlueprintTypeDto blueprintTypeDto = blueprintDetailsDto.getBlueprintTypeDto();
        calculation.setBlueprintTypeID(blueprintTypeDto.getBlueprintTypeID());
        calculation.setBlueprintTypeName(blueprintTypeDto.getBlueprintTypeName());
        calculation.setProductTypeID(blueprintTypeDto.getProductTypeID());
        calculation.setProductTypeCategoryID(blueprintTypeDto.getProductCategoryID());
        calculation.setProductTypeName(blueprintTypeDto.getProductTypeName());
        calculation.setProductGraphicIcon(blueprintTypeDto.getProductGraphicIcon());
        calculation.setMaterialLevel(0);
        calculation.setProductivityLevel(0);
        calculation.setWasteFactor(blueprintTypeDto.getWasteFactor());
        calculation.setPrice("0.00");

        List<TypeMaterialDto> materialDtos = blueprintDetailsDto.getMaterialDtos();
        List<TypeRequirementDto> requirementDtos = blueprintDetailsDto.getManufacturingRequirementDtos();
        List<CalculationItem> calculationItems = new ArrayList<CalculationItem>();

        for (TypeMaterialDto materialDto : materialDtos) {
            CalculationItem calculationItem = new CalculationItem();
            PathExpression pathExpression = new PathExpression(pathNodes, calculation.getMaterialLevel(), calculation.getProductivityLevel(), materialDto.getMaterialTypeID());
            calculationItem.setPath(pathExpression.getPath());
            calculationItem.setItemTypeID(materialDto.getMaterialTypeID());
            calculationItem.setItemCategoryID(materialDto.getMaterialTypeCategoryID());
            calculationItem.setItemTypeName(materialDto.getMaterialTypeName());
            calculationItem.setItemTypeIcon(materialDto.getMaterialTypeGraphicIcon());
            calculationItem.setQuantity(materialDto.getQuantity());
            calculationItem.setParentQuantity(1L);
            calculationItem.setPerfectQuantity(materialDto.getQuantity());
            calculationItem.setWasteFactor(blueprintTypeDto.getWasteFactor());
            calculationItem.setDamagePerJob("1.00");
            String price = priceSetItemTypeIdToPriceMap.get(materialDto.getMaterialTypeID());
            calculationItem.setPrice(price == null ? "0.00" : price);
            calculationItem.setTotalPrice("0.00");
            calculationItem.setTotalPriceForParent("0.00");
            calculationItems.add(calculationItem);
        }

        for (TypeRequirementDto requirementDto : requirementDtos) {
            if (requirementDto.getRequiredTypeCategoryID() == 16L) {
                continue;
            }
            CalculationItem calculationItem = new CalculationItem();
            PathExpression pathExpression = new PathExpression(pathNodes, requirementDto.getRequiredTypeID());
            calculationItem.setPath(pathExpression.getPath());
            calculationItem.setItemTypeID(requirementDto.getRequiredTypeID());
            calculationItem.setItemCategoryID(requirementDto.getRequiredTypeCategoryID());
            calculationItem.setItemTypeName(requirementDto.getRequiredTypeName());
            calculationItem.setItemTypeIcon(requirementDto.getRequiredTypeNameGraphicIcon());
            calculationItem.setQuantity(requirementDto.getQuantity());
            calculationItem.setParentQuantity(1L);
            calculationItem.setPerfectQuantity(requirementDto.getQuantity());
            calculationItem.setWasteFactor(blueprintTypeDto.getWasteFactor());
            calculationItem.setDamagePerJob(requirementDto.getDamagePerJob());
            String price = priceSetItemTypeIdToPriceMap.get(requirementDto.getRequiredTypeID());
            calculationItem.setPrice(price == null ? "0.00" : price);
            calculationItem.setTotalPrice("0.00");
            calculationItem.setTotalPriceForParent("0.00");
            calculationItems.add(calculationItem);
        }
        calculation.setItems(calculationItems);
        return calculation;
    }
View Full Code Here

        return itemTypeDtosForClient;
    }

    @Override
    public CalculationDto getQuickCalculation(String blueprintName) throws EveDbException, InvalidNameException {
        Calculation calculation = applicationFacade.getCalculation(blueprintName);
        return mapper.map(calculation, CalculationDto.class);
    }
View Full Code Here

        return mapper.map(calculation, CalculationDto.class);
    }

    @Override
    public CalculationDto getQuickCalculationForExpression(CalculationExpression calculationExpression) throws EveDbException, InvalidNameException {
        Calculation calculation = applicationFacade.getCalculationForExpression(calculationExpression);
        return mapper.map(calculation, CalculationDto.class);
    }
View Full Code Here

        return mapper.map(calculation, CalculationDto.class);
    }

    @Override
    public CalculationDto getQuickCalculation(Long[] pathNodes, String blueprintName) throws EveDbException, InvalidNameException {
        Calculation calculation = applicationFacade.getCalculation(pathNodes, blueprintName);
        return mapper.map(calculation, CalculationDto.class);
    }
View Full Code Here

        return mapper.map(calculation, CalculationDto.class);
    }

    @Override
    public CalculationDto getQuickCalculation(Long[] pathNodes, Long blueprintProductTypeID) throws EveDbException, InvalidNameException, InvalidItemTypeException {
        Calculation calculation = applicationFacade.getCalculation(pathNodes, blueprintProductTypeID);
        return mapper.map(calculation, CalculationDto.class);
    }
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.domain.calculation.Calculation

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.