Search in sources :

Example 16 with Permission

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

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

the class StoreEmployeeController method add.

/**
 * 新增员工管理
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(StoreEmployee storeEmployee, String password, String sex) {
    // 当前登录账号
    Long createUserId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(createUserId);
    // 添加用户, 判断账号是否重复
    User theUser = managerDao.getByAccount(storeEmployee.getMobile());
    if (theUser != null) {
        throw new BussinessException(BizExceptionEnum.USER_ALREADY_REG);
    }
    storeEmployee.setMerchantId(merchant.getId());
    storeEmployee.setCreateUserId(createUserId);
    storeEmployeeService.saveEmployee(storeEmployee, password, sex);
    return super.SUCCESS_TIP;
}
Also used : User(com.ikoori.vip.common.persistence.model.User) Merchant(com.ikoori.vip.common.persistence.model.Merchant) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 18 with Permission

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

the class TicketController method list.

/**
 * 获取小票列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String ticketName, Long storeId, Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Ticket> page = new PageFactory<Ticket>().defaultPage();
    List<Map<String, Object>> result = ticketService.getTicketList(page, ticketName, storeId, merchant.getId(), page.getOrderByField(), page.isAsc());
    page.setRecords((List<Ticket>) new TicketWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Ticket(com.ikoori.vip.common.persistence.model.Ticket) Merchant(com.ikoori.vip.common.persistence.model.Merchant) TicketWarpper(com.ikoori.vip.server.modular.biz.warpper.TicketWarpper) HashMap(java.util.HashMap) 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 19 with Permission

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

the class TicketController method ticketUpdate.

/**
 * 跳转到修改小票
 */
@Permission
@RequestMapping("/ticket_update/{ticketId}")
public String ticketUpdate(@PathVariable Long ticketId, Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    List<Store> stores = storeService.selectByCondition(condition);
    // 查询店铺
    model.addAttribute("stores", stores);
    Ticket ticket = ticketService.selectById(ticketId);
    model.addAttribute(ticket);
    model.addAttribute("specType", SpecType.values());
    return PREFIX + "ticket_edit.html";
}
Also used : Ticket(com.ikoori.vip.common.persistence.model.Ticket) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 20 with Permission

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

the class CardController method add.

/**
 * 新增会员卡
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Card card, String rights) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    card.setMerchantId(merchant.getId());
    cardService.saveCard(card, rights);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

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