litzvi / avc-beta

trying to build first demo for avc
0 stars 0 forks source link

Bill of materials more then one item #605

Closed litzvi closed 2 years ago

litzvi commented 2 years ago

I started to prepare bom - the materials needed to create a product. So you will be able to choose the appropriate items in a process, as requested by David. And then we will use it for production plan too.

@mei309 Just started, it's not ready, but if you want you can look in BillOfMaterials, BomLine classes (in entities.item package) and in BillOfMaterialService and see if you have some insight.

litzvi commented 2 years ago

added com.avc.mis.beta.service.ValueTablesReader.getProductBillOfMaterials(Integer, ItemGroup, ProductionUse) to use in production form. I'm not sure how you will use it, so please tell me what you need. perhaps you only need the item ids etc.

litzvi commented 2 years ago

I built it with dtos both ways this time.

mei309 commented 2 years ago

it looks ok but the defaults will be a big problem in the production form because of convesion

litzvi commented 2 years ago

it looks ok but the defaults will be a big problem in the production form because of convesion

I don't think you need to play with the defaults. Probably should be done by the backend.

mei309 commented 2 years ago

it looks ok but the defaults will be a big problem in the production form because of convesion

I don't think you need to play with the defaults. Probably should be done by the backend.

its always the same amounts or they can change it? if its always the same so i can remove the material used from the form and only show that they would be used without changing option

litzvi commented 2 years ago

THEY CAN EDIT. Amounts is to calculate the needed inventory for the plan, that's later. For now you need

mei309 commented 2 years ago

ok

mei309 commented 2 years ago

a function to get all would be helpful

mei309 commented 2 years ago

once you do the function upload and let me know.

mei309 commented 2 years ago

and also restrict to one bom per product

mei309 commented 2 years ago

otherwise its working

litzvi commented 2 years ago

a function to get all would be helpful

of course. not sure what data to add. is this ok? com.avc.mis.beta.service.ValueTablesReader.getAllBillOfMaterials()

litzvi commented 2 years ago

and also restrict to one bom per product

it is

mei309 commented 2 years ago

getAllBillOfMaterials

yup. just to show a table of it so we can edit

mei309 commented 2 years ago

its done.

mei309 commented 2 years ago

a function to get all would be helpful

of course. not sure what data to add. is this ok? com.avc.mis.beta.service.ValueTablesReader.getAllBillOfMaterials()

now you only showing the product and the default mu why not the materials?

litzvi commented 2 years ago

a function to get all would be helpful

of course. not sure what data to add. is this ok? com.avc.mis.beta.service.ValueTablesReader.getAllBillOfMaterials()

now you only showing the product and the default mu why not the materials?

you want to show all materials in the table? and if so the amounts too? I thought you will only show the product and they click and get full details.

mei309 commented 2 years ago

possible . but i also can show it like used items

litzvi commented 2 years ago

OK I'll fix it

On Thu, Oct 7, 2021, 16:56 mei309 @.***> wrote:

possible . but i also can show it like used items

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/litzvi/avc-beta/issues/605#issuecomment-937638124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMZHF3EGWIWXKAI47UROFCLUFVVDVANCNFSM5FE4LP7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mei309 commented 2 years ago

i forgot the important thing in this. therefor what i need is a function like this input: cashew item output: a List of ProcessItemInventory of the items in the bom list of the cashew item

litzvi commented 2 years ago

a function to get all would be helpful

of course. not sure what data to add. is this ok? com.avc.mis.beta.service.ValueTablesReader.getAllBillOfMaterials()

now you only showing the product and the default mu why not the materials?

ok use this one. com.avc.mis.beta.service.BillOfMaterialService.getAllBillOfMaterials()

litzvi commented 2 years ago

i forgot the important thing in this. therefor what i need is a function like this input: cashew item output: a List of ProcessItemInventory of the items in the bom list of the cashew item

I guess you need this one for plan production right? i'll do it later.

mei309 commented 2 years ago

i forgot the important thing in this. therefor what i need is a function like this input: cashew item output: a List of ProcessItemInventory of the items in the bom list of the cashew item

I guess you need this one for plan production right? i'll do it later.

no. i need it for production

mei309 commented 2 years ago

so i dont call to get the items and then call to get their storages. its better if i just get it together

litzvi commented 2 years ago

com.avc.mis.beta.service.BillOfMaterialService.getProductBomInventory(Integer productId, ItemGroup, ProductionUse[], ProductionFunctionality[], PackageType, Integer[], Integer)

mei309 commented 2 years ago

com.avc.mis.beta.service.BillOfMaterialService.getProductBomInventory(Integer productId, ItemGroup, ProductionUse[], ProductionFunctionality[], PackageType, Integer[], Integer)

great

mei309 commented 2 years ago

done for first item not if more are added so leave it open

mei309 commented 2 years ago

done

litzvi commented 2 years ago

look on the cloud. the ring is turning, now that it's empty

litzvi commented 2 years ago

in a new production, you are giving a message that there isn't a bill of materials.

litzvi commented 2 years ago

column header 'payable units'?

litzvi commented 2 years ago

in the details change 'weight' to 'amount' it's not weight half of the time.

litzvi commented 2 years ago

@David added a bill of materials and it doesn't show all items in the production (only one of them) It's because the others are not in inventory. do you think we should show it in some way?

mei309 commented 2 years ago

look on the cloud. the ring is turning, now that it's empty

you giving back null vs everywhere else you giving empty array. if you change it let me know

mei309 commented 2 years ago

@david added a bill of materials and it doesn't show all items in the production (only one of them) It's because the others are not in inventory. do you think we should show it in some way?

we should give a massage on top. i will do it

litzvi commented 2 years ago

look on the cloud. the ring is turning, now that it's empty

you giving back null vs everywhere else you giving empty array. if you change it let me know

not true. many places it's null

mei309 commented 2 years ago

look on the cloud. the ring is turning, now that it's empty

you giving back null vs everywhere else you giving empty array. if you change it let me know

not true. many places it's null

i fixed it here but if you right so it should happen in a lot of places but it doesn't seem so (i checked a lot of them)

mei309 commented 2 years ago

@david added a bill of materials and it doesn't show all items in the production (only one of them) It's because the others are not in inventory. do you think we should show it in some way?

we should give a massage on top. i will do it

actually i cannot do it because I dont have the bom of the item i just calling with the item. maybe you should give back both the List of ProcessItemInventory and List Items Not Available

litzvi commented 2 years ago

So how do we solve it? Can I return it in a map<Item, List> for every item in bom? if the there is no list you know it's missing.

mei309 commented 2 years ago

why not one map with 2 lists? if you give the storages list separately and the unfulfilled list it will be easier then starting to connect and etc... but if you think this is better its ok with me

litzvi commented 2 years ago

why not one map with 2 lists? if you give the storages list separately and the unfulfilled list it will be easier then starting to connect and etc... but if you think this is better its ok with me

okay. but then a map has no meaning. I'll just give u an array or list of lists.

mei309 commented 2 years ago

why not one map with 2 lists? if you give the storages list separately and the unfulfilled list it will be easier then starting to connect and etc... but if you think this is better its ok with me

okay. but then a map has no meaning. I'll just give u an array or list of lists.

no problem. let me know when up

litzvi commented 2 years ago

I can but it's pretty ugly, not clear what the method is doing/giving from name.

I suggest you - as the user - do what I'm doing. BillOfMaterialsDTO billOfMaterials = getBillOfMaterialsByProduct(productId); //call for bill of materials

//get item ids and call for inventory for given items Integer[] itemIds = billOfMaterials.getBomList().stream().map(i -> i.getMaterial().getId()).toArray(Integer[]::new);
List inventory = warehouseManagement.getAvailableInventory(group, productionUses, functionalities, itemIds, packageType, poCodeIds, excludeProcessId);

//find the items that have no inventory Arrays.asList(itemIds).removeAll(inventory.stream().map(i -> i.getItem().getId()).collect(Collectors.toList()))

litzvi commented 2 years ago

that's exactly what I'm doing by me

mei309 commented 2 years ago

i dont see a difference who dose it but ok no problem

litzvi commented 2 years ago

You are the user. I'm the service

On Wed, Oct 13, 2021, 15:50 mei309 @.***> wrote:

i dont see a difference who dose it but ok no problem

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/litzvi/avc-beta/issues/605#issuecomment-942076447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMZHF3AALBEOFZJW3WCDG43UGVB6JANCNFSM5FE4LP7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

litzvi commented 2 years ago

but you can use this if you want (better copy the content) com.avc.mis.beta.service.BillOfMaterialService.getProductBomInventoryAndMissingItems(Integer, ItemGroup, ProductionUse[], ProductionFunctionality[], PackageType, Integer[], Integer)

mei309 commented 2 years ago

did by me but just so you know this is the way to do it

ArrayList itemsList = new ArrayList(Arrays.asList(itemIds)); if not we cannot remove from it itemsList.removeAll(inventory.stream().map(i -> i.getItem().getId()).collect(Collectors.toList())); returns boolean return new Object[]{inventory, itemsList};

litzvi commented 2 years ago

you are ignoring the case that bill of materials wasn't defined. It's good - correct.

mei309 commented 2 years ago

you are ignoring the case that bill of materials wasn't defined. It's good - correct.

i didnt ignore. i put a try catch