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";
}
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";
}
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";
}
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";
}
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";
}
Aggregations