Search in sources :

Example 1 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class LogController method list.

/**
 * 查询操作日志列表
 */
@RequestMapping("/list")
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Object list(@RequestParam(required = false) String beginTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String logName, @RequestParam(required = false) Integer logType) {
    Page<OperationLog> page = new PageFactory<OperationLog>().defaultPage();
    List<Map<String, Object>> result = logDao.getOperationLogs(page, beginTime, endTime, logName, BizLogType.valueOf(logType), page.getOrderByField(), page.isAsc());
    page.setRecords((List<OperationLog>) new LogWarpper(result).warp());
    return super.packForBT(page);
}
Also used : LogWarpper(com.ikoori.vip.server.modular.system.warpper.LogWarpper) OperationLog(com.ikoori.vip.common.persistence.model.OperationLog) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class LoginLogController method list.

/**
 * 查询登录日志列表
 */
@RequestMapping("/list")
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Object list(@RequestParam(required = false) String beginTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String logName) {
    Page<OperationLog> page = new PageFactory<OperationLog>().defaultPage();
    List<Map<String, Object>> result = logDao.getLoginLogs(page, beginTime, endTime, logName, page.getOrderByField(), page.isAsc());
    page.setRecords((List<OperationLog>) new LogWarpper(result).warp());
    return super.packForBT(page);
}
Also used : LogWarpper(com.ikoori.vip.server.modular.system.warpper.LogWarpper) OperationLog(com.ikoori.vip.common.persistence.model.OperationLog) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class MenuController method menuEdit.

/**
 * 跳转到菜单详情列表页面
 */
@Permission(Const.ADMIN_NAME)
@RequestMapping(value = "/menu_edit/{menuId}")
public String menuEdit(@PathVariable Integer menuId, Model model) {
    if (ToolUtil.isEmpty(menuId)) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    Menu menu = this.menuMapper.selectById(menuId);
    // 获取父级菜单的id
    Menu temp = new Menu();
    temp.setCode(menu.getPcode());
    Menu pMenu = this.menuMapper.selectOne(temp);
    // 如果父级是顶级菜单
    if (pMenu == null) {
        menu.setPcode("0");
    } else {
        // 设置父级菜单的code为父级菜单的id
        menu.setPcode(String.valueOf(pMenu.getId()));
    }
    Map<String, Object> menuMap = BeanKit.beanToMap(menu);
    menuMap.put("pcodeName", ConstantFactory.me().getMenuNameByCode(temp.getCode()));
    model.addAttribute("menu", menuMap);
    LogObjectHolder.me().set(menu);
    return PREFIX + "menu_edit.html";
}
Also used : Menu(com.ikoori.vip.common.persistence.model.Menu) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with Permission

use of com.ikoori.vip.common.annotion.Permission 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 5 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class UserMgrController method roleAssign.

/**
 * 跳转到角色分配页面
 */
@Permission
@RequestMapping("/role_assign/{userId}")
public String roleAssign(@PathVariable Integer userId, Model model) {
    if (ToolUtil.isEmpty(userId)) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    User user = (User) Db.create(UserMapper.class).selectOneByCon("id", userId);
    model.addAttribute("userId", userId);
    model.addAttribute("userAccount", user.getAccount());
    return PREFIX + "user_roleassign.html";
}
Also used : ShiroUser(com.ikoori.vip.server.core.shiro.ShiroUser) User(com.ikoori.vip.common.persistence.model.User) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Permission (com.ikoori.vip.common.annotion.Permission)93 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)92 Merchant (com.ikoori.vip.common.persistence.model.Merchant)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)47 HashMap (java.util.HashMap)31 Map (java.util.Map)23 BussinessException (com.ikoori.vip.common.exception.BussinessException)18 Store (com.ikoori.vip.common.persistence.model.Store)12 Coupon (com.ikoori.vip.common.persistence.model.Coupon)11 Card (com.ikoori.vip.common.persistence.model.Card)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)6 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)6 User (com.ikoori.vip.common.persistence.model.User)6 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)4 LinkedHashMap (java.util.LinkedHashMap)4 BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)3 OperationLog (com.ikoori.vip.common.persistence.model.OperationLog)3 WxConfig (com.ikoori.vip.common.persistence.model.WxConfig)3 LogWarpper (com.ikoori.vip.server.modular.system.warpper.LogWarpper)3 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)2