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";
}
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";
}
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(), ",");
}
Aggregations