Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bill of materials more then one item #605

Closed
litzvi opened this issue Oct 1, 2021 · 52 comments
Closed

Bill of materials more then one item #605

litzvi opened this issue Oct 1, 2021 · 52 comments
Labels
enhancement New feature or request

Comments

@litzvi
Copy link
Owner

litzvi commented Oct 1, 2021

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 litzvi self-assigned this Oct 1, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 2, 2021

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 litzvi assigned mei309 and unassigned litzvi Oct 2, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 3, 2021

I built it with dtos both ways this time.

@mei309
Copy link
Collaborator

mei309 commented Oct 3, 2021

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

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 3, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 3, 2021

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.

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 3, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 3, 2021

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

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 3, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 4, 2021

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

  • a place for them to add/edit data of bom.
  • show the default items in production (it's only for reducing mistakes , they can still fill everything.)

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 4, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 5, 2021

ok

@mei309
Copy link
Collaborator

mei309 commented Oct 5, 2021

a function to get all would be helpful

@mei309
Copy link
Collaborator

mei309 commented Oct 5, 2021

once you do the function upload and let me know.

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 5, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 6, 2021

and also restrict to one bom per product

@mei309
Copy link
Collaborator

mei309 commented Oct 6, 2021

otherwise its working

@litzvi
Copy link
Owner Author

litzvi commented Oct 6, 2021

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
Copy link
Owner Author

litzvi commented Oct 6, 2021

and also restrict to one bom per product

it is

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 6, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 6, 2021

getAllBillOfMaterials

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

@mei309
Copy link
Collaborator

mei309 commented Oct 12, 2021

@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

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 12, 2021
@mei309 mei309 removed the bug Something isn't working label Oct 12, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 12, 2021

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.

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 12, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 12, 2021

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

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 12, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 13, 2021

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.

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 13, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 13, 2021

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
Copy link
Owner Author

litzvi commented Oct 13, 2021

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
Copy link
Owner Author

litzvi commented Oct 13, 2021

that's exactly what I'm doing by me

@mei309
Copy link
Collaborator

mei309 commented Oct 13, 2021

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

@litzvi
Copy link
Owner Author

litzvi commented Oct 13, 2021 via email

@litzvi
Copy link
Owner Author

litzvi commented Oct 13, 2021

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
Copy link
Collaborator

mei309 commented Oct 13, 2021

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};

@mei309 mei309 assigned litzvi and unassigned mei309 Oct 13, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 14, 2021

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

@litzvi litzvi assigned mei309 and unassigned litzvi Oct 14, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 14, 2021

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

i didnt ignore. i put a try catch

@mei309 mei309 removed their assignment Oct 14, 2021
@mei309
Copy link
Collaborator

mei309 commented Oct 14, 2021

done

@mei309 mei309 closed this as completed Oct 14, 2021
@litzvi
Copy link
Owner Author

litzvi commented Oct 14, 2021

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

i didnt ignore. i put a try catch

yes, that's what i meant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants