Search in sources :

Example 1 with Role

use of com.ikoori.vip.common.persistence.model.Role in project vip by guangdada.

the class RoleController method roleEdit.

/**
 * 跳转到修改角色
 */
@Permission
@RequestMapping(value = "/role_edit/{roleId}")
public String roleEdit(@PathVariable Integer roleId, Model model) {
    if (ToolUtil.isEmpty(roleId)) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    Role role = this.roleMapper.selectById(roleId);
    model.addAttribute(role);
    model.addAttribute("pName", ConstantFactory.me().getSingleRoleName(role.getPid()));
    model.addAttribute("deptName", ConstantFactory.me().getDeptName(role.getDeptid()));
    LogObjectHolder.me().set(role);
    return PREFIX + "/role_edit.html";
}
Also used : Role(com.ikoori.vip.common.persistence.model.Role) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with Role

use of com.ikoori.vip.common.persistence.model.Role in project vip by guangdada.

the class StoreEmployeeController method storeEmployeeUpdate.

/**
 * 跳转到修改员工管理
 */
@Permission
@RequestMapping("/storeEmployee_update/{storeEmployeeId}")
public String storeEmployeeUpdate(@PathVariable Long storeEmployeeId, Model model) {
    StoreEmployee storeEmployee = storeEmployeeService.selectById(storeEmployeeId);
    // 当前登录账号
    Long createUserId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(createUserId);
    Role role = roleService.selectById(storeEmployee.getRoleId());
    User user = userMapper.selectById(storeEmployee.getUserId());
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    List<Store> stores = storeService.selectByCondition(condition);
    // 查询店铺
    model.addAttribute("stores", stores);
    model.addAttribute("roles", RoleType.values());
    model.addAttribute(user);
    model.addAttribute(role);
    model.addAttribute(storeEmployee);
    model.addAttribute(merchant);
    return PREFIX + "storeEmployee_edit.html";
}
Also used : Role(com.ikoori.vip.common.persistence.model.Role) User(com.ikoori.vip.common.persistence.model.User) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) StoreEmployee(com.ikoori.vip.common.persistence.model.StoreEmployee) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with Role

use of com.ikoori.vip.common.persistence.model.Role in project vip by guangdada.

the class ConstantFactory method getRoleName.

/**
 * 通过角色ids获取角色名称
 */
@Override
public String getRoleName(String roleIds) {
    Integer[] roles = Convert.toIntArray(roleIds);
    StringBuilder sb = new StringBuilder();
    for (int role : roles) {
        Role roleObj = roleMapper.selectById(role);
        if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) {
            sb.append(roleObj.getName()).append(",");
        }
    }
    return StrKit.removeSuffix(sb.toString(), ",");
}
Also used : Role(com.ikoori.vip.common.persistence.model.Role)

Aggregations

Role (com.ikoori.vip.common.persistence.model.Role)3 Permission (com.ikoori.vip.common.annotion.Permission)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 BussinessException (com.ikoori.vip.common.exception.BussinessException)1 Merchant (com.ikoori.vip.common.persistence.model.Merchant)1 Store (com.ikoori.vip.common.persistence.model.Store)1 StoreEmployee (com.ikoori.vip.common.persistence.model.StoreEmployee)1 User (com.ikoori.vip.common.persistence.model.User)1 HashMap (java.util.HashMap)1