Search in sources :

Example 1 with CmsCategoryRoleVO

use of com.bc.pmpheep.back.vo.CmsCategoryRoleVO in project pmph by BCSquad.

the class CmsCategoryServiceImpl method getCmsCategoryDetail.

@Override
public Map<String, Object> getCmsCategoryDetail(Long id) throws CheckedServiceException {
    if (ObjectUtil.isNull(id)) {
        throw new CheckedServiceException(CheckedExceptionBusiness.CMS, CheckedExceptionResult.NULL_PARAM, "参数为空");
    }
    Map<String, Object> resultMap = new HashMap<String, Object>();
    CmsCategory cmsCategory = this.getCmsCategoryById(id);
    resultMap.put("cmsCategory", cmsCategory);
    // 按Category查询对应权限
    List<CmsCategoryRoleVO> cmsCategoryRoles = this.getCmsCategoryRoleByCategoryId(id);
    for (CmsCategoryRoleVO cmsCategoryRole : cmsCategoryRoles) {
        if (Const.CMS_CATEGORY_PERMISSSION_1 == cmsCategoryRole.getPermissionType()) {
            resultMap.put("permissionId", cmsCategoryRole.getRoleId());
        } else {
            resultMap.put("authRoleId", cmsCategoryRole.getRoleId());
        }
    }
    return resultMap;
}
Also used : HashMap(java.util.HashMap) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) CmsCategory(com.bc.pmpheep.back.po.CmsCategory) CmsCategoryRoleVO(com.bc.pmpheep.back.vo.CmsCategoryRoleVO)

Aggregations

CmsCategory (com.bc.pmpheep.back.po.CmsCategory)1 CmsCategoryRoleVO (com.bc.pmpheep.back.vo.CmsCategoryRoleVO)1 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)1 HashMap (java.util.HashMap)1