Search in sources :

Example 1 with MdcProductCategory

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;
}
Also used : MdcProductCategory(com.paascloud.provider.model.domain.MdcProductCategory)

Example 2 with MdcProductCategory

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);
    }
}
Also used : MdcBizException(com.paascloud.provider.exceptions.MdcBizException) MdcProductCategory(com.paascloud.provider.model.domain.MdcProductCategory)

Example 3 with MdcProductCategory

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;
}
Also used : MdcProductCategory(com.paascloud.provider.model.domain.MdcProductCategory)

Example 4 with MdcProductCategory

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;
}
Also used : MdcProductCategory(com.paascloud.provider.model.domain.MdcProductCategory)

Example 5 with MdcProductCategory

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;
}
Also used : MdcProductCategory(com.paascloud.provider.model.domain.MdcProductCategory)

Aggregations

MdcProductCategory (com.paascloud.provider.model.domain.MdcProductCategory)17 MdcBizException (com.paascloud.provider.exceptions.MdcBizException)3 ApiOperation (io.swagger.annotations.ApiOperation)2 PageInfo (com.github.pagehelper.PageInfo)1 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)1 LogAnnotation (com.paascloud.core.annotation.LogAnnotation)1 MdcProduct (com.paascloud.provider.model.domain.MdcProduct)1 ProductDto (com.paascloud.provider.model.dto.ProductDto)1 OptGetUrlRequest (com.paascloud.provider.model.dto.oss.OptGetUrlRequest)1 MdcCategoryVo (com.paascloud.provider.model.vo.MdcCategoryVo)1 ProductDetailVo (com.paascloud.provider.model.vo.ProductDetailVo)1 ModelMapper (org.modelmapper.ModelMapper)1