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