Search in sources :

Example 71 with Permission

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;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 72 with Permission

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";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) Card(com.ikoori.vip.common.persistence.model.Card) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 73 with Permission

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";
}
Also used : StoreCoupon(com.ikoori.vip.common.persistence.model.StoreCoupon) Coupon(com.ikoori.vip.common.persistence.model.Coupon) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 74 with Permission

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";
}
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 75 with Permission

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";
}
Also used : Order(com.ikoori.vip.common.persistence.model.Order) OrderItem(com.ikoori.vip.common.persistence.model.OrderItem) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Permission (com.ikoori.vip.common.annotion.Permission)93 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)92 Merchant (com.ikoori.vip.common.persistence.model.Merchant)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)47 HashMap (java.util.HashMap)31 Map (java.util.Map)23 BussinessException (com.ikoori.vip.common.exception.BussinessException)18 Store (com.ikoori.vip.common.persistence.model.Store)12 Coupon (com.ikoori.vip.common.persistence.model.Coupon)11 Card (com.ikoori.vip.common.persistence.model.Card)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)6 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)6 User (com.ikoori.vip.common.persistence.model.User)6 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)4 LinkedHashMap (java.util.LinkedHashMap)4 BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)3 OperationLog (com.ikoori.vip.common.persistence.model.OperationLog)3 WxConfig (com.ikoori.vip.common.persistence.model.WxConfig)3 LogWarpper (com.ikoori.vip.server.modular.system.warpper.LogWarpper)3 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)2