Search in sources :

Example 46 with Merchant

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

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

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

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

Example 50 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class CouponController method add.

/**
 * 新增优惠券
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Coupon coupon, String storeIds) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    coupon.setMerchantId(merchant.getId());
    coupon.setCreateUserId(userId);
    coupon.setStock(coupon.getTotal());
    couponService.saveCoupon(coupon, storeIds);
    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