use of com.ikoori.vip.common.annotion.Permission 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;
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class CouponController method couponAdd.
/**
* 跳转到添加优惠券
*/
@Permission
@RequestMapping("/coupon_add")
public String couponAdd(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);
// 查询会员卡
List<Card> cards = cardService.selectByCondition(condition);
model.addAttribute("cards", cards);
model.addAttribute("merchantName", merchant.getName());
return PREFIX + "coupon_add.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class CouponController method couponPublish.
/**
* 跳转到发行优惠券
*/
@Permission
@RequestMapping("/coupon_publish/{couponId}")
public String couponPublish(@PathVariable Long couponId, Model model) {
Coupon coupon = couponService.selectById(couponId);
Integer count = couponService.getPublishCount(couponId, coupon.getMerchantId());
Integer leftnum = coupon.getTotal() - count;
model.addAttribute("leftnum", leftnum);
model.addAttribute(coupon);
return PREFIX + "coupon_publish.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class OrderController 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<Store> stores = storeService.selectByCondition(condition);
// 查询店铺
model.addAttribute("stores", stores);
model.addAttribute("orderSources", OrderSource.values());
return PREFIX + "order.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class OrderController method orderUpdate.
/**
* 跳转到修改订单
*/
@Permission
@RequestMapping("/order_update/{orderId}")
public String orderUpdate(@PathVariable Long orderId, Model model) {
Order order = orderService.selectById(orderId);
List<OrderItem> orderItems = orderItemService.selectByOrderId(order.getId());
model.addAttribute("orderItems", orderItems);
model.addAttribute("order", order);
return PREFIX + "order_edit.html";
}
Aggregations