use of com.ikoori.vip.common.persistence.model.Merchant 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.persistence.model.Merchant 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.persistence.model.Merchant in project vip by guangdada.
the class CouponCodeController method add.
/**
* 批量生成券号
*/
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Integer num) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
String batchNo = couponCodeService.genarateCode(merchant.getId(), num);
if (batchNo == null) {
throw new BussinessException(500, "生成券号失败");
}
return batchNo;
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class CouponCodeController method list.
/**
* 获取券码管理列表
*/
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String batchNo, String verifyCode, String verifyNo, Long couponId, Integer useStatus, Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
List<Map<String, Object>> result = couponCodeService.getCouponCodeList(page, batchNo, verifyCode, verifyNo, useStatus, couponId, merchant.getId(), page.getOrderByField(), page.isAsc());
page.setRecords((List<Map<String, Object>>) new CouponCodeWarpper(result).warp());
return super.packForBT(page);
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class CouponFetchController method list.
/**
* 获取领取记录列表
*/
@RequestMapping(value = "/list")
@ResponseBody
@Permission
public Object list(String couponName, Integer isUsed, Integer type, String mobile, 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 = couponFetchService.selectByCondition(verifyCode, nickname, type, mobile, isUsed, page, couponName, page.getOrderByField(), page.isAsc(), merchant.getId());
page.setRecords((List<Object>) new CouponFetchWarpper(result).warp());
return super.packForBT(page);
}
Aggregations