Search in sources :

Example 6 with Store

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

use of com.ikoori.vip.common.persistence.model.Store 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";
}
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 8 with Store

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

the class StoreController method list.

/**
 * 获取门店列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String condition) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Store> page = new PageFactory<Store>().defaultPage();
    List<Map<String, Object>> result = storeService.getStoreList(page, condition, page.getOrderByField(), page.isAsc(), merchant.getId());
    page.setRecords((List<Store>) new StoreWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) StoreWarpper(com.ikoori.vip.server.modular.biz.warpper.StoreWarpper) Store(com.ikoori.vip.common.persistence.model.Store) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 9 with Store

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

the class StoreController method storeUpdate.

/**
 * 跳转到修改门店
 */
@Permission
@RequestMapping("/store_update/{storeId}")
public String storeUpdate(@PathVariable Long storeId, Model model) {
    Store store = storeService.selectById(storeId);
    String latitude = StringUtils.isNotBlank(store.getLatitude()) ? store.getLatitude() : "";
    String longitude = StringUtils.isNotBlank(store.getLongitude()) ? store.getLongitude() : "";
    String coordinate = longitude + "," + latitude;
    model.addAttribute("coordinate", coordinate);
    model.addAttribute(store);
    model.addAttribute("storePhotos", storePhotoService.selectStorePhoto(storeId));
    model.addAttribute("storeTypes", StoreType.values());
    return PREFIX + "store_edit.html";
}
Also used : Store(com.ikoori.vip.common.persistence.model.Store) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with Store

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

the class StoreEmployeeController 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("roles", RoleType.values());
    return PREFIX + "storeEmployee.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)

Aggregations

Store (com.ikoori.vip.common.persistence.model.Store)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)14 Permission (com.ikoori.vip.common.annotion.Permission)12 Merchant (com.ikoori.vip.common.persistence.model.Merchant)12 HashMap (java.util.HashMap)12 JSONObject (com.alibaba.fastjson.JSONObject)3 Card (com.ikoori.vip.common.persistence.model.Card)3 Ticket (com.ikoori.vip.common.persistence.model.Ticket)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 Coupon (com.ikoori.vip.common.persistence.model.Coupon)2 ApiOperation (io.swagger.annotations.ApiOperation)2 CouponPayDo (com.ikoori.vip.common.dto.CouponPayDo)1 OrderItemPayDo (com.ikoori.vip.common.dto.OrderItemPayDo)1 BussinessException (com.ikoori.vip.common.exception.BussinessException)1 CouponFetch (com.ikoori.vip.common.persistence.model.CouponFetch)1 CouponTrade (com.ikoori.vip.common.persistence.model.CouponTrade)1 Member (com.ikoori.vip.common.persistence.model.Member)1 Order (com.ikoori.vip.common.persistence.model.Order)1 OrderItem (com.ikoori.vip.common.persistence.model.OrderItem)1 Picture (com.ikoori.vip.common.persistence.model.Picture)1