use of com.paascloud.provider.model.domain.MdcProductCategory in project paascloud-master by paascloud.
the class MdcProductCategoryServiceImpl method selectCategoryAndChildrenById.
@Override
public List<Long> selectCategoryAndChildrenById(Long categoryId) {
Set<MdcProductCategory> categorySet = Sets.newHashSet();
findChildCategory(categorySet, categoryId);
List<Long> categoryIdList = Lists.newArrayList();
if (categoryId != null) {
for (MdcProductCategory categoryItem : categorySet) {
categoryIdList.add(categoryItem.getId());
}
}
return categoryIdList;
}
use of com.paascloud.provider.model.domain.MdcProductCategory in project paascloud-master by paascloud.
the class MdcProductCategoryServiceImpl method saveMdcCategory.
@Override
public void saveMdcCategory(final MdcProductCategory mdcCategory, final LoginAuthDto loginAuthDto) {
Long pid = mdcCategory.getPid();
mdcCategory.setUpdateInfo(loginAuthDto);
MdcProductCategory parentMenu = mapper.selectByPrimaryKey(pid);
if (PublicUtil.isEmpty(parentMenu)) {
throw new MdcBizException(ErrorCodeEnum.MDC10023002, pid);
}
if (mdcCategory.isNew()) {
MdcProductCategory updateMenu = new MdcProductCategory();
updateMenu.setId(pid);
Long categoryId = super.generateId();
mdcCategory.setId(categoryId);
mapper.insertSelective(mdcCategory);
} else {
mapper.updateByPrimaryKeySelective(mdcCategory);
}
}
use of com.paascloud.provider.model.domain.MdcProductCategory in project paascloud-master by paascloud.
the class MdcProductCategoryServiceImpl method buildNode.
/**
* 递归获取菜单的子节点
*/
private List<MdcProductCategory> buildNode(List<MdcProductCategory> mdcCategoryList, MdcProductCategory uacMenu, int categoryStatus) {
List<MdcProductCategory> uacMenuQueryList = mapper.select(uacMenu);
MdcProductCategory uacMenuQuery;
for (MdcProductCategory category : uacMenuQueryList) {
if (categoryStatus == category.getStatus()) {
mdcCategoryList.add(category);
}
uacMenuQuery = new MdcProductCategory();
uacMenuQuery.setPid(category.getId());
buildNode(mdcCategoryList, uacMenuQuery, categoryStatus);
}
return mdcCategoryList;
}
use of com.paascloud.provider.model.domain.MdcProductCategory in project paascloud-master by paascloud.
the class MdcProductCategoryServiceImpl method getAllParentCategoryFolderByMenuId.
private List<MdcProductCategory> getAllParentCategoryFolderByMenuId(Long categoryId) {
MdcProductCategory mdcCategoryQuery = new MdcProductCategory();
mdcCategoryQuery.setId(categoryId);
mdcCategoryQuery = mapper.selectOne(mdcCategoryQuery);
List<MdcProductCategory> mdcCategoryList = Lists.newArrayList();
mdcCategoryList = buildParentNote(mdcCategoryList, mdcCategoryQuery);
return mdcCategoryList;
}
use of com.paascloud.provider.model.domain.MdcProductCategory in project paascloud-master by paascloud.
the class MdcProductCategoryServiceImpl method getAllCategoryFolder.
private List<MdcProductCategory> getAllCategoryFolder(Long id, int categoryStatus) {
MdcProductCategory mdcCategory = new MdcProductCategory();
mdcCategory.setId(id);
mdcCategory = mapper.selectOne(mdcCategory);
List<MdcProductCategory> mdcCategoryList = Lists.newArrayList();
mdcCategoryList = buildNode(mdcCategoryList, mdcCategory, categoryStatus);
return mdcCategoryList;
}
Aggregations