Package lv.odylab.evedb.domain

Examples of lv.odylab.evedb.domain.InvTypeMaterial


        InvBlueprintType invBlueprintType = new InvBlueprintType();
        invBlueprintType.setBlueprintTypeID(1L);
        invBlueprintType.setProductTypeID(2L);
        List<InvTypeMaterial> invTypeMaterials = new ArrayList<InvTypeMaterial>();
        InvTypeMaterial invTypeMaterial1 = new InvTypeMaterial();
        invTypeMaterial1.setMaterialTypeID(3L);
        invTypeMaterial1.setQuantity(10L);
        InvTypeMaterial invTypeMaterial2 = new InvTypeMaterial();
        invTypeMaterial2.setMaterialTypeID(4L);
        invTypeMaterial2.setQuantity(20L);
        InvTypeMaterial invTypeMaterial3 = new InvTypeMaterial();
        invTypeMaterial3.setMaterialTypeID(5L);
        invTypeMaterial3.setQuantity(30L);
        invTypeMaterials.add(invTypeMaterial1);
        invTypeMaterials.add(invTypeMaterial2);
        invTypeMaterials.add(invTypeMaterial3);
        List<RamTypeRequirement> ramTypeRequirements = new ArrayList<RamTypeRequirement>();
        RamTypeRequirement ramTypeRequirement1 = new RamTypeRequirement();
        ramTypeRequirement1.setRequiredTypeID(6L);
        ramTypeRequirement1.setQuantity(2L);
        ramTypeRequirement1.setActivityName("Manufacturing");
        ramTypeRequirement1.setRecycle(Boolean.TRUE);
        RamTypeRequirement ramTypeRequirement2 = new RamTypeRequirement();
        ramTypeRequirement2.setRequiredTypeID(7L);
        ramTypeRequirement2.setQuantity(1L);
        ramTypeRequirement2.setActivityName("Manufacturing");
        ramTypeRequirement2.setRecycle(Boolean.FALSE);
        RamTypeRequirement ramTypeRequirement3 = new RamTypeRequirement();
        ramTypeRequirement3.setRequiredTypeID(8L);
        ramTypeRequirement3.setQuantity(1L);
        ramTypeRequirement3.setActivityName("Researching Time Productivity");
        ramTypeRequirement3.setRecycle(Boolean.FALSE);
        RamTypeRequirement ramTypeRequirement4 = new RamTypeRequirement();
        ramTypeRequirement4.setRequiredTypeID(9L);
        ramTypeRequirement4.setQuantity(1L);
        ramTypeRequirement4.setActivityName("Researching Material Productivity");
        ramTypeRequirement4.setRecycle(Boolean.FALSE);
        RamTypeRequirement ramTypeRequirement5 = new RamTypeRequirement();
        ramTypeRequirement5.setRequiredTypeID(10L);
        ramTypeRequirement5.setQuantity(1L);
        ramTypeRequirement5.setActivityName("Copying");
        ramTypeRequirement5.setRecycle(Boolean.FALSE);
        RamTypeRequirement ramTypeRequirement6 = new RamTypeRequirement();
        ramTypeRequirement6.setRequiredTypeID(11L);
        ramTypeRequirement6.setQuantity(1L);
        ramTypeRequirement6.setActivityName("Reverse Engineering");
        ramTypeRequirement6.setRecycle(Boolean.FALSE);
        RamTypeRequirement ramTypeRequirement7 = new RamTypeRequirement();
        ramTypeRequirement7.setRequiredTypeID(12L);
        ramTypeRequirement7.setQuantity(1L);
        ramTypeRequirement7.setActivityName("Invention");
        ramTypeRequirement7.setRecycle(Boolean.FALSE);
        ramTypeRequirements.add(ramTypeRequirement1);
        ramTypeRequirements.add(ramTypeRequirement2);
        ramTypeRequirements.add(ramTypeRequirement3);
        ramTypeRequirements.add(ramTypeRequirement4);
        ramTypeRequirements.add(ramTypeRequirement5);
        ramTypeRequirements.add(ramTypeRequirement6);
        ramTypeRequirements.add(ramTypeRequirement7);

        List<InvTypeMaterial> invTypeMaterialsForRequirement = new ArrayList<InvTypeMaterial>();
        InvTypeMaterial invTypeMaterialForRequirement1 = new InvTypeMaterial();
        invTypeMaterialForRequirement1.setMaterialTypeID(3L);
        invTypeMaterialForRequirement1.setQuantity(2L);
        InvTypeMaterial invTypeMaterialForRequirement2 = new InvTypeMaterial();
        invTypeMaterialForRequirement2.setMaterialTypeID(4L);
        invTypeMaterialForRequirement2.setQuantity(15L);
        invTypeMaterialsForRequirement.add(invTypeMaterialForRequirement1);
        invTypeMaterialsForRequirement.add(invTypeMaterialForRequirement2);

        when(invBlueprintTypeDao.getByTypeID(1L)).thenReturn(invBlueprintType);
        when(invBlueprintTypeDao.getByTypeName("typeName")).thenReturn(invBlueprintType);
View Full Code Here


        }

        for (RamTypeRequirement ramTypeRequirement : recyclableRequirements) {
            List<InvTypeMaterial> invTypeMaterials = invTypeMaterialDao.getForTypeIdWithoutCheck(ramTypeRequirement.getRequiredTypeID());
            for (InvTypeMaterial invTypeMaterial : invTypeMaterials) {
                InvTypeMaterial existingInvTypeMaterial = typeIdToInvTypeMaterialMap.get(invTypeMaterial.getMaterialTypeID());
                if (existingInvTypeMaterial != null) {
                    Long existingQuantity = existingInvTypeMaterial.getQuantity();
                    Long quantity = invTypeMaterial.getQuantity() * ramTypeRequirement.getQuantity();
                    if (existingQuantity - quantity > 0) {
                        existingInvTypeMaterial.setQuantity(existingQuantity - quantity);
                    } else {
                        typeIdToInvTypeMaterialMap.remove(invTypeMaterial.getMaterialTypeID());
                        materials.remove(existingInvTypeMaterial);
                    }
                }
View Full Code Here

TOP

Related Classes of lv.odylab.evedb.domain.InvTypeMaterial

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.