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