Search in sources :

Example 66 with Permission

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

the class TicketController method add.

/**
 * 新增小票
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Ticket ticket) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    ticket.setMerchantId(merchant.getId());
    ticketService.insert(ticket);
    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)

Example 67 with Permission

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

the class TicketController method ticketAdd.

/**
 * 跳转到添加小票
 */
@Permission
@RequestMapping("/ticket_add")
public String ticketAdd(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);
    model.addAttribute("specType", SpecType.values());
    return PREFIX + "ticket_add.html";
}
Also used : 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 68 with Permission

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

the class TicketController method checkStore.

/**
 * 验证店铺是否已经添加小票
 * @return Object
 */
@RequestMapping("/checkStore")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkStore(Long storeId, Long ticketId) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    /*List<Store> stores = storeService.selectStore(merchant.getId());
		if(stores!=null && !stores.isEmpty()){
			return "true";
		}else{
			return "flase";
		}*/
    return ticketService.checkTicket(ticketId, storeId, merchant.getId());
}
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)

Example 69 with Permission

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

the class CardController method checkName.

/**
 * 验证会员卡名称是否存在
 * @return
 */
@RequestMapping("/checkName")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkName(Long id, String cardName) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    return cardService.checkCardName(id, cardName, merchant.getId());
}
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)

Example 70 with Permission

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

the class CardController method checkLevel.

/**
 * 验证会员卡级别是否存在
 * @return
 */
@RequestMapping("/checkLevel")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkLevel(Long id, Integer cardLevel) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    return cardService.checkCardLevel(id, cardLevel, merchant.getId());
}
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