Search in sources :

Example 16 with Merchant

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

the class CouponController method couponUpdate.

/**
 * 跳转到修改优惠券
 */
@Permission
@RequestMapping("/coupon_update/{couponId}")
public String couponUpdate(@PathVariable Long couponId, 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<StoreCoupon> storeCoupons = storeCouponService.getByCouponId(couponId);
    model.addAttribute("storeCoupons", storeCoupons);
    // 查询店铺
    List<Store> stores = storeService.selectByCondition(condition);
    model.addAttribute("stores", stores);
    // 查询会员卡
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    Coupon coupon = couponService.selectById(couponId);
    model.addAttribute(coupon);
    return PREFIX + "coupon_edit.html";
}
Also used : StoreCoupon(com.ikoori.vip.common.persistence.model.StoreCoupon) Coupon(com.ikoori.vip.common.persistence.model.Coupon) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) Card(com.ikoori.vip.common.persistence.model.Card) Merchant(com.ikoori.vip.common.persistence.model.Merchant) StoreCoupon(com.ikoori.vip.common.persistence.model.StoreCoupon) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 17 with Merchant

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

the class CouponController method index.

/**
 * 跳转到优惠券首页
 */
@Permission
@RequestMapping("")
public String index(Model model) {
    model.addAttribute("couponType", CouponType.values());
    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);
    return PREFIX + "coupon.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 18 with Merchant

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

the class CouponTradeController method list.

/**
 * 获取使用记录列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String couponName, String mobile, Integer type, String nickname, String verifyCode) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Object> page = new PageFactory<Object>().defaultPage();
    List<Map<String, Object>> result = couponTradeService.selectByCondition(verifyCode, nickname, type, mobile, page, couponName, page.getOrderByField(), page.isAsc(), merchant.getId());
    page.setRecords((List<Object>) new CouponTradeWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) CouponTradeWarpper(com.ikoori.vip.server.modular.biz.warpper.CouponTradeWarpper) 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 Merchant

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

the class MemberController method index.

/**
 * 跳转到会员首页
 */
@Permission
@RequestMapping("")
public String index(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<Card> cards = cardService.findByCondition(condition);
    model.addAttribute("cards", cards);
    return PREFIX + "member.html";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Card(com.ikoori.vip.common.persistence.model.Card) MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 20 with Merchant

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

the class MemberController method memberAdd.

/**
 * 跳转到添加会员
 */
@Permission
@RequestMapping("/member_add")
public String memberAdd(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<Card> cards = cardService.selectByCondition(condition);
    // 会员卡
    model.addAttribute("cards", cards);
    return PREFIX + "member_add.html";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Card(com.ikoori.vip.common.persistence.model.Card) MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

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