use of build.dream.catering.beans.ZTreeNode in project erp-catering by liuyandong33.
the class GoodsService method listCategories.
@Transactional(readOnly = true)
public ApiRest listCategories(ListCategoriesModel listCategoriesModel) {
SearchModel searchModel = new SearchModel(true);
searchModel.addSearchCondition("tenant_id", Constants.SQL_OPERATION_SYMBOL_EQUALS, listCategoriesModel.getTenantId());
searchModel.addSearchCondition("branch_id", Constants.SQL_OPERATION_SYMBOL_EQUALS, listCategoriesModel.getBranchId());
List<GoodsCategory> goodsCategories = goodsCategoryMapper.findAll(searchModel);
List<ZTreeNode> zTreeNodes = new ArrayList<ZTreeNode>();
for (GoodsCategory goodsCategory : goodsCategories) {
zTreeNodes.add(new ZTreeNode(goodsCategory.getId().toString(), goodsCategory.getName(), goodsCategory.getParentId().toString()));
}
return new ApiRest(zTreeNodes, "查询菜品分类成功!");
}
Aggregations