Hello, I have a problem and I believe it is logical, but I can not find it. I have 4 listings and I have to group the markets of a region, then I have a list with all the products linked to the market and I have my list which are the lists of the products chosen. I want the market name and the sum of the values of if I were to make a purchase in it but no market can be compared if I do not have all the products.
Listas l=Listas.getInstance();
int i =1; //Regiaoo.getIdReg();
List<prodmerc> tempPM = new ArrayList();
List<prodmerc> tempPM1 = new ArrayList();
List<FiltraMercados> fm=new ArrayList();
FiltraMercados ff=new FiltraMercados();
for (int ii=0;ii<l.getM().size();ii++){
for (int j=0;j<l.getMl().size();j++){
for (int jj=0;jj<l.getPm().size();jj++){
if(l.getPm().get(jj).getMercID()==l.getM().get(ii).getMercID() && l.getPm().get(jj).getProdID()==l.getMl().get(j).getP().getProdID() && l.getM().get(ii).getRegID()==i){
FiltraMercados f=new FiltraMercados(l.getM().get(ii),l.getMl().get(j).getP().getProdID(),(l.getPm().get(jj).getPmPreco()*l.getMl().get(j).getQtda()));
fm.add(f);
}
}
}
}