use of cn.exrick.common.pojo.ZTreeNode in project xmall by Exrick.
the class ItemCatServiceImpl method getItemCatList.
@Override
public List<ZTreeNode> getItemCatList(int parentId) {
TbItemCatExample example = new TbItemCatExample();
TbItemCatExample.Criteria criteria = example.createCriteria();
// 排序
example.setOrderByClause("sort_order");
// 条件查询
criteria.andParentIdEqualTo(new Long(parentId));
List<TbItemCat> list = tbItemCatMapper.selectByExample(example);
// 转换成ZtreeNode
List<ZTreeNode> resultList = new ArrayList<>();
for (TbItemCat tbItemCat : list) {
ZTreeNode node = DtoUtil.TbItemCat2ZTreeNode(tbItemCat);
resultList.add(node);
}
return resultList;
}
use of cn.exrick.common.pojo.ZTreeNode in project xmall by Exrick.
the class PanelServiceImpl method getPanelList.
@Override
public List<ZTreeNode> getPanelList(int position, boolean showAll) {
TbPanelExample example = new TbPanelExample();
TbPanelExample.Criteria criteria = example.createCriteria();
if (position == 0 && !showAll) {
// 除去非轮播
criteria.andTypeNotEqualTo(0);
} else if (position == -1) {
// 仅含轮播
position = 0;
criteria.andTypeEqualTo(0);
}
// 首页板块
criteria.andPositionEqualTo(position);
example.setOrderByClause("sort_order");
List<TbPanel> panelList = tbPanelMapper.selectByExample(example);
List<ZTreeNode> list = new ArrayList<>();
for (TbPanel tbPanel : panelList) {
ZTreeNode zTreeNode = DtoUtil.TbPanel2ZTreeNode(tbPanel);
list.add(zTreeNode);
}
return list;
}
use of cn.exrick.common.pojo.ZTreeNode in project xmall by Exrick.
the class DtoUtil method TbContentCategory2ZTreeNode.
public static ZTreeNode TbContentCategory2ZTreeNode(TbContentCategory tbContentCategory) {
ZTreeNode zTreeNode = new ZTreeNode();
zTreeNode.setId(Math.toIntExact(tbContentCategory.getId()));
zTreeNode.setIsParent(tbContentCategory.getIsParent());
zTreeNode.setpId(Math.toIntExact(tbContentCategory.getParentId()));
zTreeNode.setName(tbContentCategory.getName());
zTreeNode.setIcon(tbContentCategory.getIcon());
zTreeNode.setSortOrder(tbContentCategory.getSortOrder());
zTreeNode.setStatus(tbContentCategory.getStatus());
zTreeNode.setRemark(tbContentCategory.getRemark());
zTreeNode.setNum(tbContentCategory.getNum());
return zTreeNode;
}
use of cn.exrick.common.pojo.ZTreeNode in project xmall by Exrick.
the class ContentCatServiceImpl method getContentCatList.
@Override
public List<ZTreeNode> getContentCatList(Long parentId) {
TbContentCategoryExample example = new TbContentCategoryExample();
TbContentCategoryExample.Criteria criteria = example.createCriteria();
criteria.andParentIdEqualTo(parentId);
example.setOrderByClause("sort_order");
List<TbContentCategory> catList = tbContentCategoryMapper.selectByExample(example);
List<ZTreeNode> list = new ArrayList<>();
for (int i = 0; i < catList.size(); i++) {
ZTreeNode zTreeNode = DtoUtil.TbContentCategory2ZTreeNode(catList.get(i));
list.add(zTreeNode);
}
return list;
}
use of cn.exrick.common.pojo.ZTreeNode in project xmall by Exrick.
the class DtoUtil method TbPanel2ZTreeNode.
public static ZTreeNode TbPanel2ZTreeNode(TbPanel tbPanel) {
ZTreeNode zTreeNode = new ZTreeNode();
zTreeNode.setId(tbPanel.getId());
zTreeNode.setIsParent(false);
zTreeNode.setpId(0);
zTreeNode.setName(tbPanel.getName());
zTreeNode.setSortOrder(tbPanel.getSortOrder());
zTreeNode.setStatus(tbPanel.getStatus());
zTreeNode.setRemark(tbPanel.getRemark());
zTreeNode.setLimitNum(tbPanel.getLimitNum());
zTreeNode.setType(tbPanel.getType());
return zTreeNode;
}
Aggregations