Search in sources :

Example 6 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant 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 7 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant 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 8 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant 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 9 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant 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 10 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant 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

Merchant (com.ikoori.vip.common.persistence.model.Merchant)66 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)59 Permission (com.ikoori.vip.common.annotion.Permission)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)35 HashMap (java.util.HashMap)29 Map (java.util.Map)20 Store (com.ikoori.vip.common.persistence.model.Store)12 Card (com.ikoori.vip.common.persistence.model.Card)11 BussinessException (com.ikoori.vip.common.exception.BussinessException)8 Coupon (com.ikoori.vip.common.persistence.model.Coupon)7 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)7 LinkedHashMap (java.util.LinkedHashMap)4 JSONObject (com.alibaba.fastjson.JSONObject)3 Ticket (com.ikoori.vip.common.persistence.model.Ticket)3 User (com.ikoori.vip.common.persistence.model.User)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Member (com.ikoori.vip.common.persistence.model.Member)2 Picture (com.ikoori.vip.common.persistence.model.Picture)2 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)2 CouponCodeWarpper (com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper)2