Commit f0a91a2d by 张建升

搜索 代码同步

parent 41b3a4c6
......@@ -438,15 +438,18 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
map.put("pageIndex", 0);
LogUtil.e(" zjs getFoodsBySupplier foodCategoryTrees.getId()= "+foodCategoryTrees.getId() +
" name="+name +" position="+position);
if (!TextUtils.isEmpty(name)) {
final boolean hasName=!TextUtils.isEmpty(name);
if (hasName) {
map.put("name", name);
}else {
if (foodCategoryTrees != null) {
map.put("supplierId", foodCategoryTrees.getId());
}
}
AppConstant.addBrandId(map);
AppConstant.addRestaurantId(map);
if (foodCategoryTrees != null) {
map.put("supplierId", foodCategoryTrees.getId());
}
mModel.getFoodBySupplierId(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> {
......@@ -465,9 +468,14 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
if (info.isSuccess() && info.getData() != null) {
List<PurchaseFoodBean> purchaseFoodListVOS = JsonUtils.parseArray(info.getData(), PurchaseFoodBean.class);
BuyIngredientsBean buyIngredientsBean = conversionSupplierToShowInfo(foodCategoryTrees, purchaseFoodListVOS);
supplierFoods.set(position, buyIngredientsBean);
showFoods.add(addToHead ? 0 : showFoods.size(), buyIngredientsBean);
loadFood(buyIngredientsBean, addToHead, isReset);
if (hasName) {
loadFood(buyIngredientsBean, addToHead, isReset);
}else {
supplierFoods.set(position, buyIngredientsBean);
showFoods.add(addToHead ? 0 : showFoods.size(), buyIngredientsBean);
loadFood(buyIngredientsBean, addToHead, isReset);
}
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment