Search in sources :

Example 6 with Card

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

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

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

Example 9 with Card

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

the class MemberController method memberUpdate.

/**
 * 跳转到修改会员
 */
@Permission
@RequestMapping("/member_update/{memberId}")
public String memberUpdate(@PathVariable Long memberId, Model model) {
    Member member = memberService.selectById(memberId);
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    MemberCard memberCard = new MemberCard();
    memberCard.setMemberId(member.getId());
    memberCard.setIsDefault(true);
    memberCard = memberCardMapper.selectOne(memberCard);
    model.addAttribute("memberCard", memberCard);
    // 会员卡
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    condition.put("inGrantType", new Object[] { CardGrantType.NO_RULE.getCode(), CardGrantType.SUB_WX.getCode() });
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    model.addAttribute("member", member);
    return PREFIX + "member_edit.html";
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Member(com.ikoori.vip.common.persistence.model.Member) 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 10 with Card

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

the class MemberCardController 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());
    model.addAttribute("grantType", CardGrantType.values());
    model.addAttribute("state", MemCardState.values());
    // 查询会员卡
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    return PREFIX + "memberCard.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

Card (com.ikoori.vip.common.persistence.model.Card)16 Merchant (com.ikoori.vip.common.persistence.model.Merchant)11 Permission (com.ikoori.vip.common.annotion.Permission)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)9 HashMap (java.util.HashMap)9 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)9 Member (com.ikoori.vip.common.persistence.model.Member)5 Transactional (org.springframework.transaction.annotation.Transactional)5 BussinessException (com.ikoori.vip.common.exception.BussinessException)4 Coupon (com.ikoori.vip.common.persistence.model.Coupon)4 Store (com.ikoori.vip.common.persistence.model.Store)3 Point (com.ikoori.vip.common.persistence.model.Point)2 Date (java.util.Date)2 JSONObject (com.alibaba.fastjson.JSONObject)1 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)1 CouponPayDo (com.ikoori.vip.common.dto.CouponPayDo)1 OrderItemPayDo (com.ikoori.vip.common.dto.OrderItemPayDo)1 CardRight (com.ikoori.vip.common.persistence.model.CardRight)1 CouponFetch (com.ikoori.vip.common.persistence.model.CouponFetch)1 CouponTrade (com.ikoori.vip.common.persistence.model.CouponTrade)1